Commit 9e9882ef authored by Alicia.DeDiosFuente's avatar Alicia.DeDiosFuente
Browse files

fix: the file in metadata type form is optional

parent c1f67c9a
......@@ -125,7 +125,7 @@
color="primary"
type="submit"
(keydown.enter)="onSubmit()"
[disabled]="!form.valid || !form.dirty"
[disabled]="form.invalid || (form.pristine && !this.uploadedOrChangedFile)"
>
{{'admin.metadataType.form.submit' | translate }}
</button>
......
......@@ -37,6 +37,7 @@ export class AdminMetadataTypeFormPresentational extends SharedAbstractFormPrese
readonly files: string = "files";
readonly filesAccepted: string[] = [".xml", ".json", ".xsd", ".txt"];
readonly maxSizeFile: number = 25000000;
uploadedOrChangedFile: boolean = false;
metadataFormatEnum: KeyValue[] = MetadataTypeFormatEnumHelper.getListKeyValue();
......@@ -95,6 +96,7 @@ export class AdminMetadataTypeFormPresentational extends SharedAbstractFormPrese
this._notificationService.showInformation(TRANSLATE("admin.metadataType.readUploadedFileSuccessfully"));
};
fileReader.readAsText(file);
this.uploadedOrChangedFile = true;
}
onTestFileUpload(event: Event & any): void {
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment