From 226f7f4ebad6e2f1593ca962dabb15c08e8534cd Mon Sep 17 00:00:00 2001 From: Artem Babak Date: Wed, 13 Jan 2021 16:26:16 +0200 Subject: [PATCH] Move ruleChainType assignment from validateImportedRuleChain() to importRuleChain() --- .../home/components/import-export/import-export.service.ts | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/ui-ngx/src/app/modules/home/components/import-export/import-export.service.ts b/ui-ngx/src/app/modules/home/components/import-export/import-export.service.ts index c55027d10c..e850215928 100644 --- a/ui-ngx/src/app/modules/home/components/import-export/import-export.service.ts +++ b/ui-ngx/src/app/modules/home/components/import-export/import-export.service.ts @@ -406,6 +406,9 @@ export class ImportExportService { public importRuleChain(expectedRuleChainType: RuleChainType): Observable { return this.openImportDialog('rulechain.import', 'rulechain.rulechain-file').pipe( mergeMap((ruleChainImport: RuleChainImport) => { + if (isUndefined(ruleChainImport.ruleChain.type)) { + ruleChainImport.ruleChain.type = ruleChainType.core; + } if (!this.validateImportedRuleChain(ruleChainImport)) { this.store.dispatch(new ActionNotificationShow( {message: this.translate.instant('rulechain.invalid-rulechain-file-error'), @@ -469,9 +472,6 @@ export class ImportExportService { || isUndefined(ruleChainImport.ruleChain.name)) { return false; } - if (isUndefined(ruleChainImport.ruleChain.type)) { - ruleChainImport.ruleChain.type = ruleChainType.core; - } return true; }