Skip to content
This repository was archived by the owner on Jun 26, 2026. It is now read-only.

Commit 68d603e

Browse files
author
Néstor Diaz
authored
Do not validate file list if field hasn't changed (#623)
1 parent d4f1734 commit 68d603e

5 files changed

Lines changed: 10 additions & 7 deletions

File tree

src/app/submission/submission-edit/shared/field-value-validators.ts

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,10 @@ export class FormValueValidator {
3232
}
3333

3434
static forFileList(control: CustomFormControl, submService: SubmissionService): Observable<ValidationErrors> {
35+
if (!control.touched) {
36+
return of({});
37+
}
38+
3539
return timer(DELAY_IN_MILLISECONDS).pipe(
3640
switchMap(() => submService.validateFileList(control.value)),
3741
catchError(({ error }) => {

src/app/submission/submission-edit/shared/model/field-control.model.ts

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -60,7 +60,6 @@ export class FieldControl {
6060
return [(control: CustomFormControl) => validator(control, this.submService, this.studyAccno)];
6161
}
6262
}
63-
6463
return [];
6564
}
6665

src/app/submission/submission-shared/model/templates/bia/bia.template.v1.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -406,8 +406,8 @@ export const biaTemplateV1 = {
406406
valueType: { name: 'file', allowFolders: false },
407407
display: 'required',
408408
helpLink: 'https://www.ebi.ac.uk/biostudies/BioImages/help',
409-
helpText: 'Help'
410-
// asyncValueValidatorName: 'forFileList'
409+
helpText: 'Help',
410+
asyncValueValidatorName: 'forFileList'
411411
},
412412
{
413413
name: 'Comment',

src/app/submission/submission-shared/model/templates/bia/bia.template.v2.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -399,8 +399,8 @@ export const biaTemplateV2 = {
399399
valueType: { name: 'file', allowFolders: false },
400400
display: 'required',
401401
helpText: 'Examples',
402-
helpLink: '/bioimage-archive/help-submission-form/#study-components-file-list'
403-
// asyncValueValidatorName: 'forFileList'
402+
helpLink: '/bioimage-archive/help-submission-form/#study-components-file-list',
403+
asyncValueValidatorName: 'forFileList'
404404
},
405405
{
406406
name: 'Comment',

src/app/submission/submission-shared/model/templates/bia/bia.template.v3.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -395,8 +395,8 @@ export const biaTemplateV3 = {
395395
valueType: { name: 'file', allowFolders: false },
396396
display: 'required',
397397
helpText: 'Examples',
398-
helpLink: '/bioimage-archive/help-file-list/'
399-
// asyncValueValidatorName: 'forFileList'
398+
helpLink: '/bioimage-archive/help-file-list/',
399+
asyncValueValidatorName: 'forFileList'
400400
},
401401
{
402402
name: 'Comment',

0 commit comments

Comments
 (0)