Skip to content

Commit

Permalink
Enable landing page form for URLs retrieve
Browse files Browse the repository at this point in the history
  • Loading branch information
minottic authored Mar 21, 2023
1 parent af8f0d0 commit f690fc7
Show file tree
Hide file tree
Showing 8 changed files with 51 additions and 8 deletions.
2 changes: 1 addition & 1 deletion backend
3 changes: 2 additions & 1 deletion dev/config/backend/config.local.js
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,8 @@ module.exports = {
from: "[email protected]",
to: undefined,
subject: "[SciCat " + process.env.NODE_ENV + "]",
text: undefined, // can also set html key and this will override this
text: undefined, // can also set html key and this will override this,
publicRetrieve: true,
},
logbook: {
enabled: false
Expand Down
3 changes: 2 additions & 1 deletion helm/configs/backend/config.local.js
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,8 @@ module.exports = {
from: "[email protected]",
replyTo: "[email protected]",
subject: "[SciCat " + process.env.ENV + "]",
scicatHref: process.env.ENV === "production"? "https://discovery.psi.ch": `https://discovery-${process.env.ENV}.psi.ch`
scicatHref: process.env.ENV === "production"? "https://discovery.psi.ch": `https://discovery-${process.env.ENV}.psi.ch`,
publicRetrieve: true,
},
queue: "rabbitmq",
logbook: {
Expand Down
27 changes: 26 additions & 1 deletion helm/configs/backend/job-template.html
Original file line number Diff line number Diff line change
Expand Up @@ -92,28 +92,41 @@ <h2>{{subject}}</h2>
<!-- Template for job submission comfirmation -->
{{#with jobSubmissionNotification}}
<div>
{{#if (or (eq jobType "retrieve") (eq jobType "archive"))}}
Your <a href="{{@root.config.scicatHref}}/user/jobs?id={{urlEncode jobId}}">{{jobType}}</a> job has been submitted and will be processed as soon as possible.<br>
{{else}}
Your {{jobType}} job has been submitted and will be processed as soon as possible.<br>
Job id: {{jobId}}.<br>
{{/if}}
You will be notified by email as soon as the job is completed.<br>
</div>
{{#if jobData}}
<p><b>Job will be perfomed on the following dataset(s):</b></p>
<table>
<tr style="background-color:lightblue">
<td>PID</td>
{{#unless (eq jobType "public")}}
<td>Ownergroup</td>
{{/unless}}
<td>Sourcefolder</td>
<td>Size</td>
{{#unless (eq jobType "public")}}
<td>Archivable</td>
<td>Retrievable</td>
{{/unless}}
</tr>
{{#each jobData}}
<tr>
<td><a href="{{@root.config.scicatHref}}/datasets/{{urlEncode pid}}">{{pid}}</a></td>
{{#unless (eq ../jobType "public")}}
<td>{{ownerGroup}}</td>
{{/unless}}
<td>{{sourceFolder}}</td>
<td>{{formatBytes size}}</td>
{{#unless (eq ../jobType "public")}}
<td>{{archivable}}</td>
<td>{{retrievable}}</td>
{{/unless}}
</tr>
{{/each}}
</table>
Expand All @@ -124,7 +137,11 @@ <h2>{{subject}}</h2>
<!-- Template for finished job Notification -->
{{#with jobFinishedNotification}}
<div>
{{#if (or (eq jobType "retrieve") (eq jobType "archive"))}}
Your <a href="{{@root.config.scicatHref}}/user/jobs?id={{urlEncode jobId}}">{{jobType}}</a> job is now finished.<br>
{{else}}
Your {{jobType}} job is now finished. Job id: {{jobId}}<br>
{{/if}}
{{#if jobStatusMessage}}
The returned job status is: <b>{{jobStatusMessage}}</b>
{{/if}}
Expand All @@ -139,15 +156,19 @@ <h2>{{subject}}</h2>
<tr style="background-color:lightblue">
<td>PID</td>
<td>Name</td>
{{#unless (eq ../jobType "public")}}
<td>Ownergroup</td>
{{/unless}}
<td>Sourcefolder</td>
<td>Size</td>
</tr>
{{#each bad}}
<tr>
<td><a href="{{@root.config.scicatHref}}/datasets/{{urlEncode pid}}">{{pid}}</a></td>
<td>{{name}}</td>
{{#unless (eq ../../jobType "public")}}
<td>{{ownerGroup}}</td>
{{/unless}}
<td>{{sourceFolder}}</td>
<td>{{formatBytes size}}</td>
</tr>
Expand All @@ -160,7 +181,9 @@ <h2>{{subject}}</h2>
<tr style="background-color:lightblue">
<td>PID</td>
<td>Name</td>
{{#unless (eq ../jobType "public")}}
<td>Ownergroup</td>
{{/unless}}
{{#if (eq ../jobParams.option "URLs")}}
<td>Sourcefolder</td>
<td>Download parts (size)</td>
Expand All @@ -176,7 +199,9 @@ <h2>{{subject}}</h2>
<tr>
<td><a href="{{@root.config.scicatHref}}/datasets/{{urlEncode pid}}">{{pid}}</a></td>
<td>{{name}}</td>
{{#unless (eq ../../jobType "public")}}
<td>{{ownerGroup}}</td>
{{/unless}}
{{#if (eq ../../jobParams.option "URLs")}}
<td>{{sourceFolder}}</td>
<td>
Expand Down Expand Up @@ -204,7 +229,7 @@ <h2>{{subject}}</h2>
<p>You can now download the data by clicking on the download icon in the <b>Download parts</b> column of the
table. The data is potentially spread over several tar files which you then must untar on your destination system.
The data will be available for download for the next 30 days. <br>
<b>Anyone with these URLs will be able to download the data. Do not forward them to people who should not see the data.</b>
<b>Anyone with these URLs will be able to download the data.{{#unless (eq jobType "public")}} Do not forward them to people who should not see the data.{{/unless}}</b>
</p>
{{else if (eq jobParams.option "PSI")}}
<p>You can now use the command 'datasetRetriever' to move the retrieved datasets to their final destination.
Expand Down
8 changes: 7 additions & 1 deletion helm/configs/landing-page-server/development/environment.ts
Original file line number Diff line number Diff line change
Expand Up @@ -10,5 +10,11 @@ export const environment = {
oaiProviderRoute: null,
production: true,
scicatBaseUrl: "https://discovery-development.psi.ch",
showLogoBanner: false
showLogoBanner: false,
retrieveToEmail: {
option: "URLs",
username: "lp_service",
title: "Please enter your email address where you will receive the download procedure",
confirmMessage: "Are you sure you want to continue?"
},
};
7 changes: 6 additions & 1 deletion helm/configs/landing-page-server/production/environment.ts
Original file line number Diff line number Diff line change
Expand Up @@ -10,5 +10,10 @@ export const environment = {
oaiProviderRoute: null,
production: true,
scicatBaseUrl: "https://discovery.psi.ch",
showLogoBanner: false
showLogoBanner: false,
retrieveToEmail: {
option: "URLs",
username: "lp_service",
title: "Please enter your email address where you will receive the download procedure"
},
};
7 changes: 6 additions & 1 deletion helm/configs/landing-page-server/qa/environment.ts
Original file line number Diff line number Diff line change
Expand Up @@ -10,5 +10,10 @@ export const environment = {
oaiProviderRoute: null,
production: true,
scicatBaseUrl: "https://discovery-qa.psi.ch",
showLogoBanner: false
showLogoBanner: false,
retrieveToEmail: {
option: "URLs",
username: "lp_service",
title: "Please enter your email address where you will receive the download procedure"
},
};
2 changes: 1 addition & 1 deletion landing-page-server

0 comments on commit f690fc7

Please sign in to comment.