1
0

[CST-5329] Add validate only check in the Import > Metadata page

This commit is contained in:
Sufiyan Shaikh
2022-03-10 13:04:22 +05:30
parent 22d2c9ed66
commit 2ffb723202
4 changed files with 38 additions and 1 deletions

View File

@@ -30,6 +30,11 @@ export class MetadataImportPageComponent {
*/
fileObject: File;
/**
* The validate only flag
*/
validateOnly = true;
public constructor(private location: Location,
protected translate: TranslateService,
protected notificationsService: NotificationsService,
@@ -62,6 +67,9 @@ export class MetadataImportPageComponent {
const parameterValues: ProcessParameter[] = [
Object.assign(new ProcessParameter(), { name: '-f', value: this.fileObject.name }),
];
if (this.validateOnly) {
parameterValues.push(Object.assign(new ProcessParameter(), { name: '-v', value: true }));
}
this.scriptDataService.invoke(METADATA_IMPORT_SCRIPT_NAME, parameterValues, [this.fileObject]).pipe(
getFirstCompletedRemoteData(),