Eosc explore: latest changes/ corrections before review

This commit is contained in:
argirok 2022-08-08 12:47:14 +03:00
parent 1bbb064a01
commit 1e3c9d7cba
2 changed files with 14 additions and 11 deletions

View File

@ -9,10 +9,10 @@ import {StringUtils} from "../../utils/string-utils.class";
})
export class ParsingFunctions {
public eoscSubjects = [
{label: 'EOSC::Jupyter Notebook', link: 'https://' + (properties.environment == 'beta'?'beta.':'') + 'marketplace.eosc-portal.eu/services?tag=EOSC%3A%3AJupyter+Notebook', value: 'Jupyter Notebook'},
{label: 'EOSC::RO-crate', link: 'https://' + (properties.environment == 'beta'?'beta.':'') + 'marketplace.eosc-portal.eu/services?tag=EOSC%3A%3ARO-crate', value: 'RO-crate'},
{label: 'EOSC::Galaxy Workflow', link: 'https://' + (properties.environment == 'beta'?'beta.':'') + 'marketplace.eosc-portal.eu/services?tag=EOSC%3A%3AGalaxy+Workflow', value: 'Galaxy Workflow'},
{label: 'EOSC::Twitter Data', link: 'https://' + (properties.environment == 'beta'?'beta.':'') + 'marketplace.eosc-portal.eu/services?tag=EOSC%3A%3ATwitter+Data', value: 'Twitter Data'}
{label: 'EOSC::Jupyter Notebook', link: 'https://' + (properties.environment != 'production'?'beta.':'') + 'marketplace.eosc-portal.eu/services?tag=EOSC%3A%3AJupyter+Notebook', value: 'Jupyter Notebook'},
{label: 'EOSC::RO-crate', link: 'https://' + (properties.environment != 'production'?'beta.':'') + 'marketplace.eosc-portal.eu/services?tag=EOSC%3A%3ARO-crate', value: 'RO-crate'},
{label: 'EOSC::Galaxy Workflow', link: 'https://' + (properties.environment != 'production'?'beta.':'') + 'marketplace.eosc-portal.eu/services?tag=EOSC%3A%3AGalaxy+Workflow', value: 'Galaxy Workflow'},
{label: 'EOSC::Twitter Data', link: 'https://' + (properties.environment != 'production'?'beta.':'') + 'marketplace.eosc-portal.eu/services?tag=EOSC%3A%3ATwitter+Data', value: 'Twitter Data'}
]
public notebookInSubjects: boolean = false;

View File

@ -60,7 +60,7 @@ declare var UIkit;
[validators]="validators" class="uk-margin-top"></div>
<button (click)="transfer()"
class="uk-button uk-button-primary uk-margin-top"
[class.uk-disabled]="destinationPath.length == 0 || status == 'success' ||status == 'loading' || !validatePath() ">
[class.uk-disabled]="destinationPath.length == 0 || status == 'success' ||status == 'loading' || !validatePath() || (!this.downloadElements || this.downloadElements.length == 0)">
>> Transfer
</button>
</div>
@ -97,7 +97,7 @@ export class EGIDataTransferComponent {
sourceUrls = []
selectedSourceUrl = null;
destinationPath = "";
destinationOptions = [{label: "EGI dCache (dcache-demo.desy.de)", value: { url: "https://dcache-demo.desy.de:2443", id: "dcache" , webpage:"https://dcache-demo.desy.de"} }];
destinationOptions = [{label: "EGI dCache (dcache-demo.desy.de)", value: {label: "EGI dCache (dcache-demo.desy.de)", url: "https://dcache-demo.desy.de:2443", id: "dcache" , webpage:"https://dcache-demo.desy.de"} }];
selectedDestination = null;
downloadElements = null;
@ -180,7 +180,7 @@ export class EGIDataTransferComponent {
this.status = "loading";
this.message = null;
this.downloadElements = [];
this.subscriptions.push(this.http.get(this.APIURL + "/parser/zenodo?doi=" + encodeURIComponent(this.selectedSourceUrl)).subscribe(
this.subscriptions.push(this.http.get(this.APIURL + "/parser?doi=" + encodeURIComponent(this.selectedSourceUrl)).subscribe(
res => {
this.downloadElements= res['elements']
// console.log(this.downloadElements)
@ -229,7 +229,7 @@ export class EGIDataTransferComponent {
}
let headers = new HttpHeaders({'Authorization': 'Bearer '+this.accessToken});
this.subscriptions.push(this.http.post(this.APIURL + "/transfer" ,body, {headers: headers}).subscribe(
this.subscriptions.push(this.http.post(this.APIURL + "/transfers" ,body, {headers: headers}).subscribe(
res => {
// console.log(res)
UIkit.notification('Data transfer has began! ', {
@ -240,9 +240,9 @@ export class EGIDataTransferComponent {
this.status = "success"
this.message = `
<div class="uk-text-large uk-margin-bottom">Data transfer has began!</div>
<div>Transfering ` + this.downloadElements.length + ` files to <a href="`+ this.selectedDestination.webpage + `" target=_blank> EGI Storage</a>:
<div class=" uk-overflow-auto uk-height-xsmall" >
<!--div class="uk-text-large uk-margin-bottom">Data transfer has began!</div-->
<div>Transfer of ` + this.downloadElements.length + ` files to <a href="`+ this.selectedDestination.webpage + `" target=_blank>`+this.selectedDestination.label+`</a> has began.`;
/*this.message += ` <div class=" uk-overflow-auto uk-height-xsmall" >
<ul>
`;
// TODO LATER we can call status for each file and see if the transfer has been complete
@ -254,6 +254,9 @@ export class EGIDataTransferComponent {
this.message += `
</ul>
</div>
</div>`*/
this.message += `
</div>`
}, error => {