Commit 226f7f4ebad6e2f1593ca962dabb15c08e8534cd
1 parent
4b94ffe5
Move ruleChainType assignment from validateImportedRuleChain() to importRuleChain()
Showing
1 changed file
with
3 additions
and
3 deletions
@@ -406,6 +406,9 @@ export class ImportExportService { | @@ -406,6 +406,9 @@ export class ImportExportService { | ||
406 | public importRuleChain(expectedRuleChainType: RuleChainType): Observable<RuleChainImport> { | 406 | public importRuleChain(expectedRuleChainType: RuleChainType): Observable<RuleChainImport> { |
407 | return this.openImportDialog('rulechain.import', 'rulechain.rulechain-file').pipe( | 407 | return this.openImportDialog('rulechain.import', 'rulechain.rulechain-file').pipe( |
408 | mergeMap((ruleChainImport: RuleChainImport) => { | 408 | mergeMap((ruleChainImport: RuleChainImport) => { |
409 | + if (isUndefined(ruleChainImport.ruleChain.type)) { | ||
410 | + ruleChainImport.ruleChain.type = ruleChainType.core; | ||
411 | + } | ||
409 | if (!this.validateImportedRuleChain(ruleChainImport)) { | 412 | if (!this.validateImportedRuleChain(ruleChainImport)) { |
410 | this.store.dispatch(new ActionNotificationShow( | 413 | this.store.dispatch(new ActionNotificationShow( |
411 | {message: this.translate.instant('rulechain.invalid-rulechain-file-error'), | 414 | {message: this.translate.instant('rulechain.invalid-rulechain-file-error'), |
@@ -469,9 +472,6 @@ export class ImportExportService { | @@ -469,9 +472,6 @@ export class ImportExportService { | ||
469 | || isUndefined(ruleChainImport.ruleChain.name)) { | 472 | || isUndefined(ruleChainImport.ruleChain.name)) { |
470 | return false; | 473 | return false; |
471 | } | 474 | } |
472 | - if (isUndefined(ruleChainImport.ruleChain.type)) { | ||
473 | - ruleChainImport.ruleChain.type = ruleChainType.core; | ||
474 | - } | ||
475 | return true; | 475 | return true; |
476 | } | 476 | } |
477 | 477 |