data-transfer-v2 #6

Merged
konstantina.galouni merged 26 commits from data-transfer-v2 into develop 2023-06-13 16:20:04 +02:00
1 changed files with 9 additions and 2 deletions
Showing only changes of commit bb6707cc0d - Show all commits

View File

@ -71,6 +71,11 @@ export class EGIDataTransferComponent {
jobId = null; jobId = null;
statusMessage = null; statusMessage = null;
jobStatus; jobStatus;
public s3UrlRegex = 's3:\/\/(?:www\.|(?!www))[a-zA-Z0-9][a-zA-Z0-9-]+[a-zA-Z0-9]\.[^\s]{2,}|www\.' +
'[a-zA-Z0-9][a-zA-Z0-9-]+[a-zA-Z0-9]\.[^\s]{2,}|s3:\/\/(?:www\.|(?!www))[a-zA-Z0-9]+\.[^\s]{2,}|www\.' +
'[a-zA-Z0-9]+\.[^\s]{2,}'
constructor(private http: HttpClient, private location: Location, private _router: Router, private cdr: ChangeDetectorRef) { constructor(private http: HttpClient, private location: Location, private _router: Router, private cdr: ChangeDetectorRef) {
} }
@ -476,7 +481,7 @@ export class EGIDataTransferComponent {
validateDestinationUrl():boolean { validateDestinationUrl():boolean {
if(this.selectedDestination.destination == "s3") { 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 && new RegExp("("+this.s3UrlRegex+")|("+StringUtils.urlRegex+")").test(this.destinationUrl));
} }
return (this.destinationUrl.length > 0 && StringUtils.isValidUrl(this.destinationUrl)); return (this.destinationUrl.length > 0 && StringUtils.isValidUrl(this.destinationUrl));
} }
@ -484,7 +489,9 @@ export class EGIDataTransferComponent {
public sourceUrlValidators() { public sourceUrlValidators() {
this.URLValidators = []; this.URLValidators = [];
if(this.selectedDestination.destination == 's3') { if(this.selectedDestination.destination == 's3') {
this.URLValidators = [Validators.required, Validators.pattern('s3:\/\/[a-zA-Z0-9]+')]; this.URLValidators = [Validators.required, Validators.pattern("("+this.s3UrlRegex+")|("+StringUtils.urlRegex+")")];
// this.URLValidators = [Validators.required, Validators.pattern(this.s3UrlRegex) || StringUtils.urlValidator];
// this.URLValidators = [Validators.required, Validators.pattern(this.s3UrlRegex)];
} else { } else {
this.URLValidators = [Validators.required, StringUtils.urlValidator()]; this.URLValidators = [Validators.required, StringUtils.urlValidator()];
} }