data-transfer-v2 #6
|
@ -54,7 +54,7 @@
|
|||
<p class="uk-text-meta uk-text-xsmall uk-margin-remove-bottom uk-margin-top">Please select the
|
||||
Destination Storage technology:</p>
|
||||
<div input type="select" [(value)]="selectedDestination" placeholder="Destination Storage" hint="Select..."
|
||||
[options]="destinationOptions" (valueChange)="folders = {}"></div>
|
||||
[options]="destinationOptions" (valueChange)="folders = {}; sourceUrlValidators()"></div>
|
||||
|
||||
<p class="uk-text-meta uk-text-xsmall uk-margin-remove-bottom uk-margin-top">Provide the
|
||||
corresponding storage destination url:</p>
|
||||
|
|
|
@ -110,6 +110,7 @@ export class EGIDataTransferComponent {
|
|||
(res: Array<any>) => {
|
||||
this.destinationOptions = res.map(dest => {return {"label": dest.destination, "value": dest}});
|
||||
this.selectedDestination = res[0];
|
||||
this.sourceUrlValidators();
|
||||
}
|
||||
));
|
||||
|
||||
|
@ -468,6 +469,18 @@ export class EGIDataTransferComponent {
|
|||
}
|
||||
|
||||
validateDestinationUrl():boolean {
|
||||
if(this.selectedDestination.destination == "s3") {
|
||||
return (this.destinationUrl.length > 0 && new RegExp('s3:\/\/[a-zA-Z0-9]+').test(this.destinationUrl));
|
||||
}
|
||||
return (this.destinationUrl.length > 0 && StringUtils.isValidUrl(this.destinationUrl));
|
||||
}
|
||||
|
||||
public sourceUrlValidators() {
|
||||
this.URLValidators = [];
|
||||
if(this.selectedDestination.destination == 's3') {
|
||||
this.URLValidators = [Validators.required, Validators.pattern('s3:\/\/[a-zA-Z0-9]+')];
|
||||
} else {
|
||||
this.URLValidators = [Validators.required, StringUtils.urlValidator()];
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue