Commit 226f7f4ebad6e2f1593ca962dabb15c08e8534cd

Authored by Artem Babak
1 parent 4b94ffe5

Move ruleChainType assignment from validateImportedRuleChain() to importRuleChain()

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