From 2dbff5ec1853f5f48354e0bbdecfae2d7489fbbb Mon Sep 17 00:00:00 2001 From: "Eran (ev672n), Vosk" Date: Mon, 29 Oct 2018 19:33:00 +0200 Subject: Sync code Sync the code between repositories Change-Id: Ib7ee4d0e0f53b58a9bf97dadb15e094789b4f915 Issue-ID: SDC-1874 Signed-off-by: Eran (ev672n), Vosk --- public/src/app/bar-icons/bar-icons.component.html | 10 +- public/src/app/diagram/diagram.component.html | 15 +- public/src/app/diagram/diagram.component.scss | 1 - public/src/app/diagram/diagram.component.spec.ts | 186 ++++++++++----------- public/src/app/general/general.component.html | 6 +- public/src/app/home/home.component.html | 65 +++---- public/src/app/home/home.component.scss | 12 ++ public/src/app/home/home.component.ts | 5 +- .../app/import-rules/import-rules.component.html | 6 +- .../src/app/import-rules/import-rules.component.ts | 142 +++++++++------- public/src/app/main/main.component.html | 3 +- public/src/app/main/main.component.ts | 3 +- .../app/revert-dialog/revert-dialog.component.ts | 2 +- .../action-list/action-list.component.html | 5 +- .../action-list/action-list.component.ts | 21 +++ .../app/rule-engine/action/action.component.html | 16 +- .../src/app/rule-engine/action/action.component.ts | 65 +++---- .../app/rule-engine/api/rule-engine-api.service.ts | 9 +- .../rule-engine/condition/condition.component.html | 18 +- .../src/app/rule-engine/from/from.component.html | 10 +- .../rule-engine/rule-list/rule-list.component.html | 19 ++- .../rule-engine/rule-list/rule-list.component.ts | 160 +++++++++++------- .../version-type-select.component.html | 21 +-- .../version-type-select.component.ts | 7 +- public/src/app/store/store.ts | 1 + 25 files changed, 461 insertions(+), 347 deletions(-) (limited to 'public/src/app') diff --git a/public/src/app/bar-icons/bar-icons.component.html b/public/src/app/bar-icons/bar-icons.component.html index 761a5cb..b855ede 100644 --- a/public/src/app/bar-icons/bar-icons.component.html +++ b/public/src/app/bar-icons/bar-icons.component.html @@ -15,7 +15,7 @@
- + diff --git a/public/src/app/import-rules/import-rules.component.ts b/public/src/app/import-rules/import-rules.component.ts index b581dc6..7403518 100644 --- a/public/src/app/import-rules/import-rules.component.ts +++ b/public/src/app/import-rules/import-rules.component.ts @@ -1,6 +1,13 @@ -import { Component, EventEmitter, Output } from '@angular/core'; +import { + Component, + EventEmitter, + Output, + ViewChild, + ElementRef +} from '@angular/core'; import { Store } from '../store/store'; import { RuleEngineApiService } from '../rule-engine/api/rule-engine-api.service'; +import { ToastrService } from 'ngx-toastr'; @Component({ selector: 'app-import-rules', @@ -11,12 +18,16 @@ export class ImportRulesComponent { fileToUpload: File = null; fileName = ''; mappingTarget: string; - advancedSetting: Array; tabName: string; isGroup = false; @Output() refrashRuleList = new EventEmitter(); + @ViewChild('fileInput') fileInput: ElementRef; - constructor(public _ruleApi: RuleEngineApiService, public store: Store) { + constructor( + public _ruleApi: RuleEngineApiService, + private toastr: ToastrService, + public store: Store + ) { this._ruleApi.tabIndex // .filter(index => { if (index >= 0) { const tabName = // this.store.cdump.nodes[index].name; console.log('tab name:', tabName); if @@ -30,20 +41,20 @@ export class ImportRulesComponent { this.tabName.toLowerCase().includes('highlandpark') || this.tabName.toLowerCase().includes('hp') ) { - this.advancedSetting = this.store.tabsProperties[index].filter( - item => { - if ( - !( - item.hasOwnProperty('constraints') && - item.value !== undefined && - !item.value.includes('get_input') - ) - ) { - return item; - } + this.store.advancedSetting = this.store.tabsProperties[ + index + ].filter(item => { + if ( + !( + item.hasOwnProperty('constraints') && + item.value !== undefined && + !item.value.includes('get_input') + ) + ) { + return item; } - ); - this.mappingTarget = this.advancedSetting[0].name; + }); + this.mappingTarget = this.store.advancedSetting[0].name; this._ruleApi.setParams({ userId: this.store.sdcParmas.userId, @@ -65,7 +76,7 @@ export class ImportRulesComponent { 'generateMappingRulesFileName response: ', response ); - this.advancedSetting.forEach(element => { + this.store.advancedSetting.forEach(element => { if (response.includes(element.name)) { element.isExist = true; } else { @@ -73,7 +84,7 @@ export class ImportRulesComponent { } }); }); - console.log('advancedSetting', this.advancedSetting); + console.log('advancedSetting', this.store.advancedSetting); } } }); @@ -93,48 +104,61 @@ export class ImportRulesComponent { } handleFileInput(files: FileList) { - this.store.loader = true; - this.fileToUpload = files.item(0); - console.log('file to load:', this.fileToUpload); - this.fileName = this.fileToUpload !== null ? this.fileToUpload.name : ''; const reader = new FileReader(); - reader.readAsText(this.fileToUpload, 'UTF-8'); - reader.onload = () => { - console.log(reader.result); - this._ruleApi - .getLatestMcUuid({ - contextType: this.store.sdcParmas.contextType, - serviceUuid: this.store.sdcParmas.uuid, - vfiName: this.store.vfiName, - vfcmtUuid: this.store.mcUuid - }) - .subscribe( - res => { - this.store.mcUuid = res.uuid; - if ( - this.tabName.toLowerCase().includes('highlandpark') || - this.tabName.toLowerCase().includes('hp') - ) { - this.isGroup = true; + if (files && files.length > 0) { + this.store.loader = true; + this.fileToUpload = files.item(0); + console.log('file to load:', this.fileToUpload); + this.fileName = this.fileToUpload !== null ? this.fileToUpload.name : ''; + reader.readAsText(this.fileToUpload, 'UTF-8'); + reader.onload = () => { + console.log(reader.result); + this._ruleApi + .getLatestMcUuid({ + contextType: this.store.sdcParmas.contextType, + serviceUuid: this.store.sdcParmas.uuid, + vfiName: this.store.vfiName, + vfcmtUuid: this.store.mcUuid + }) + .subscribe( + res => { + this.store.mcUuid = res.uuid; + if ( + this.tabName.toLowerCase().includes('highlandpark') || + this.tabName.toLowerCase().includes('hp') + ) { + this.isGroup = true; + } + this._ruleApi + .importRules(reader.result, res.uuid, this.isGroup) + .subscribe( + response => { + console.log('success import', response); + this.toastr.success('', 'success import'); + this.store.expandImports[this.store.tabIndex] = false; + this.clearFile(); + this.store.loader = false; + this._ruleApi.callUpdateTabIndex(this.store.tabIndex); + }, + error => { + this.notifyError(error); + this.clearFile(); + } + ); + }, + error => { + this.notifyError(error); + this.clearFile(); } - this._ruleApi - .importRules(reader.result, res.uuid, this.isGroup) - .subscribe( - response => { - console.log('success import', response); - this.store.expandImports[this.store.tabIndex] = false; - this.store.loader = false; - this._ruleApi.callUpdateTabIndex(this.store.tabIndex); - }, - error => { - this.notifyError(error); - } - ); - }, - error => { - this.notifyError(error); - } - ); - }; + ); + }; + } else { + this.clearFile(); + } + } + + clearFile() { + this.fileInput.nativeElement.value = ''; + this.fileName = ''; } } diff --git a/public/src/app/main/main.component.html b/public/src/app/main/main.component.html index 182ed9c..10d86e2 100644 --- a/public/src/app/main/main.component.html +++ b/public/src/app/main/main.component.html @@ -39,10 +39,9 @@
-
- + diff --git a/public/src/app/rule-engine/action-list/action-list.component.ts b/public/src/app/rule-engine/action-list/action-list.component.ts index f8fd6dd..466b6a9 100644 --- a/public/src/app/rule-engine/action-list/action-list.component.ts +++ b/public/src/app/rule-engine/action-list/action-list.component.ts @@ -407,6 +407,7 @@ export class ActionListComponent implements AfterViewInit { // clear temp copy rule. this.clearCopyRuleFromList(); // then update the rule list and sync with server + this.updateTaregtListExisiting(); this.store.updateRuleInList(response); this._ruleApi.callUpdateVersionLock(); this.store.loader = false; @@ -424,6 +425,25 @@ export class ActionListComponent implements AfterViewInit { } } + updateTaregtListExisiting() { + this._ruleApi + .generateMappingRulesFileName( + this.store.ruleListExistParams.nodeName, + this.store.ruleListExistParams.nodeId, + this.store.ruleListExistParams.vfcmtUuid + ) + .subscribe(response => { + console.log('generateMappingRulesFileName response: ', response); + this.store.advancedSetting.forEach(element => { + if (response.includes(element.name)) { + element.isExist = true; + } else { + element.isExist = false; + } + }); + }); + } + private clearCopyRuleFromList() { this.store.ruleList = this.store.ruleList.filter(item => item.uid !== ''); } @@ -452,6 +472,7 @@ export class ActionListComponent implements AfterViewInit { // clear temp copy rule. this.clearCopyRuleFromList(); // then update the rule list and sync with server + this.updateTaregtListExisiting(); this.store.updateRuleInList(response); this._ruleApi.callUpdateVersionLock(); this.uid = response.uid; diff --git a/public/src/app/rule-engine/action/action.component.html b/public/src/app/rule-engine/action/action.component.html index f439c5c..21f03b1 100644 --- a/public/src/app/rule-engine/action/action.component.html +++ b/public/src/app/rule-engine/action/action.component.html @@ -17,7 +17,7 @@ Start Value - @@ -34,7 +34,7 @@ Target case - @@ -162,7 +162,8 @@ @@ -217,7 +218,8 @@ @@ -421,7 +423,8 @@ @@ -433,7 +436,6 @@
Add Row
@@ -447,7 +449,7 @@ align-items: center;" [innerHTML]="'download' | feather:20"> - + diff --git a/public/src/app/rule-engine/action/action.component.ts b/public/src/app/rule-engine/action/action.component.ts index dfdb83f..380ff43 100644 --- a/public/src/app/rule-engine/action/action.component.ts +++ b/public/src/app/rule-engine/action/action.component.ts @@ -4,7 +4,8 @@ import { Input, OnInit, ViewChild, - AfterViewInit + AfterViewInit, + ElementRef } from '@angular/core'; // import { Copy } from "../model"; import { Http, Response, Headers, RequestOptions } from '@angular/http'; @@ -17,6 +18,7 @@ import * as Papa from 'papaparse'; import { metricData } from './metric.data'; import { Store } from '../../store/store'; import { ToastrService } from 'ngx-toastr'; +import { toJS } from 'mobx'; @Component({ selector: 'app-action', @@ -28,6 +30,7 @@ export class ActionComponent implements OnInit, AfterViewInit { @ViewChild('from') fromInstance; @ViewChild('target') targetInstance; @ViewChild('actionFrm') actionFrm: NgForm; + @ViewChild('csvInput') fileInput: ElementRef; highlight = 'black'; hoveredIndex; fileToUpload: File = null; @@ -42,12 +45,12 @@ export class ActionComponent implements OnInit, AfterViewInit { ngAfterViewInit(): void { console.log(this.action.id); if (this.action.from !== undefined && this.action.from !== '') { - console.log('Action %o', this.action); this.fromInstance.updateMode(this.action.from); } if (this.action.target !== undefined && this.action.target !== '') { this.targetInstance.updateMode(this.action); } + console.log('Action %o', this.action); } updateFrom(data) { @@ -93,34 +96,40 @@ export class ActionComponent implements OnInit, AfterViewInit { this.action.search.updates.splice(index, 1); } - handleFileInput(files: FileList) { - this.fileToUpload = files.item(0); - console.log('file to load:', this.fileToUpload); - this.fileName = this.fileToUpload !== null ? this.fileToUpload.name : ''; + clearFile() { + this.fileInput.nativeElement.value = ''; + this.fileName = ''; + } - this.store.loader = true; - Papa.parse(this.fileToUpload, { - complete: result => { - if (result.data) { - const mapConvert = result.data - .slice(0, 300) - .filter(item => item[0] !== undefined && item[1] !== undefined) - .map(item => { - console.log(`item 0: ${item[0]} item 1: ${item[1]}`); - return { - key: item[0].trim(), - value: item[1].trim() - }; - }); + handleFileInput(files: FileList) { + if (files && files.length > 0) { + this.fileToUpload = files.item(0); + console.log('file to load:', this.fileToUpload); + this.fileName = this.fileToUpload !== null ? this.fileToUpload.name : ''; + this.store.loader = true; + Papa.parse(this.fileToUpload, { + complete: result => { + if (result.data) { + const mapConvert = result.data + .slice(0, 300) + .filter(item => item[0] !== undefined && item[1] !== undefined) + .map(item => { + console.log(`item 0: ${item[0]} item 1: ${item[1]}`); + return { + key: item[0].trim(), + value: item[1].trim() + }; + }); + this.store.loader = false; + this.action.map.values = mapConvert; + } + }, + error: (err, file) => { this.store.loader = false; - this.action.map.values = mapConvert; + console.log(`error: ${err}, in file ${file}`); + this.toastr.error('', err); } - }, - error: (err, file) => { - this.store.loader = false; - console.log(`error: ${err}, in file ${file}`); - this.toastr.error('', err); - } - }); + }); + } } } diff --git a/public/src/app/rule-engine/api/rule-engine-api.service.ts b/public/src/app/rule-engine/api/rule-engine-api.service.ts index f19fd15..ed0d25c 100644 --- a/public/src/app/rule-engine/api/rule-engine-api.service.ts +++ b/public/src/app/rule-engine/api/rule-engine-api.service.ts @@ -25,7 +25,8 @@ export class RuleEngineApiService { flowType: string; editorData: Subject = new Subject(); updateVersionLock: Subject = new Subject(); - tabIndex: Subject = new BehaviorSubject(-1); + currentTab: Subject = new BehaviorSubject(-1); + tabIndex = this.currentTab.asObservable(); constructor(private http: Http) { this.baseUrl = `${environment.apiBaseUrl}/rule-editor`; @@ -171,9 +172,9 @@ export class RuleEngineApiService { }); } - deleteFilter() { + deleteFilter(vfcmtUuid) { const deleteFilter = { - vfcmtUuid: this.vfcmtUuid, + vfcmtUuid: vfcmtUuid, dcaeCompLabel: this.dcaeCompName, nid: this.nid, configParam: this.configParam @@ -271,6 +272,6 @@ export class RuleEngineApiService { } callUpdateTabIndex(index) { - this.tabIndex.next(index); + this.currentTab.next(index); } } diff --git a/public/src/app/rule-engine/condition/condition.component.html b/public/src/app/rule-engine/condition/condition.component.html index 3a26823..e4a8775 100644 --- a/public/src/app/rule-engine/condition/condition.component.html +++ b/public/src/app/rule-engine/condition/condition.component.html @@ -59,8 +59,13 @@
- Add Condition @@ -68,8 +73,13 @@
Add Condition Group diff --git a/public/src/app/rule-engine/from/from.component.html b/public/src/app/rule-engine/from/from.component.html index 0da7173..835946a 100644 --- a/public/src/app/rule-engine/from/from.component.html +++ b/public/src/app/rule-engine/from/from.component.html @@ -52,7 +52,8 @@
@@ -81,7 +82,8 @@
@@ -112,7 +114,8 @@
@@ -122,7 +125,6 @@ Add input diff --git a/public/src/app/rule-engine/rule-list/rule-list.component.html b/public/src/app/rule-engine/rule-list/rule-list.component.html index 5085563..b0d3d9b 100644 --- a/public/src/app/rule-engine/rule-list/rule-list.component.html +++ b/public/src/app/rule-engine/rule-list/rule-list.component.html @@ -26,7 +26,7 @@
Entry Phase
- @@ -53,7 +53,7 @@
- @@ -66,7 +66,7 @@
-
+
@@ -111,8 +111,7 @@
-
@@ -176,7 +176,7 @@ align-items: center;" [innerHTML]="'download' | feather:18"> - + Import phase
@@ -188,7 +188,7 @@
-
@@ -244,7 +244,8 @@ [innerHTML]="'copy' | feather:20">
diff --git a/public/src/app/rule-engine/rule-list/rule-list.component.ts b/public/src/app/rule-engine/rule-list/rule-list.component.ts index 6e3c877..1bbed87 100644 --- a/public/src/app/rule-engine/rule-list/rule-list.component.ts +++ b/public/src/app/rule-engine/rule-list/rule-list.component.ts @@ -1,4 +1,9 @@ -import { Component, ViewChild, ViewEncapsulation } from '@angular/core'; +import { + Component, + ViewChild, + ViewEncapsulation, + ElementRef +} from '@angular/core'; import { MatDialog } from '@angular/material'; import { isEmpty } from 'lodash'; import { ToastrService } from 'ngx-toastr'; @@ -21,6 +26,7 @@ const primaryColor = '#009fdb'; }) export class RuleListComponent { @ViewChild('versionEventType') versionType; + @ViewChild('groupUpload') fileInput: ElementRef; error: Array; // list = new Array(); schema; @@ -43,6 +49,7 @@ export class RuleListComponent { // filter ifStatement = false; condition: any; + filterSave = false; private errorHandler(error: any) { this.store.loader = false; @@ -82,14 +89,18 @@ export class RuleListComponent { filterCheckbox() { this.ifStatement = !this.ifStatement; - if (!this.ifStatement && this.condition !== undefined) { - this.deleteFilter(); + if (!this.ifStatement) { + if (this.filterSave) { + this.deleteFilter(); + } else { + this.condition = null; + } } } removeConditionCheck(flag) { this.ifStatement = flag; - if (this.condition !== undefined) { + if (this.filterSave) { this.deleteFilter(); } } @@ -107,10 +118,14 @@ export class RuleListComponent { .subscribe( res => { this.store.mcUuid = res.uuid; - this._ruleApi.deleteFilter().subscribe( + this._ruleApi.deleteFilter(res.uuid).subscribe( response => { - console.log('success import', response); + if (this.store.ruleList.length === 0) { + this.versionType.updateVersionTypeFlag(false); + } this.condition = null; + this.filterSave = false; + this.ifStatement = false; this.store.loader = false; }, error => { @@ -174,63 +189,76 @@ export class RuleListComponent { } } + clearFile() { + this.fileInput.nativeElement.value = ''; + this.fileName = ''; + } + handleImportCDAP(files: FileList, groupId, phaseName) { this.error = null; - this.store.loader = true; - this.fileToUpload = files.item(0); - console.log('file to load:', this.fileToUpload); - this.fileName = this.fileToUpload !== null ? this.fileToUpload.name : ''; const reader = new FileReader(); - reader.readAsText(this.fileToUpload, 'UTF-8'); - reader.onload = () => { - console.log(reader.result); - this._ruleApi - .getLatestMcUuid({ - contextType: this.store.sdcParmas.contextType, - serviceUuid: this.store.sdcParmas.uuid, - vfiName: this.store.vfiName, - vfcmtUuid: this.store.mcUuid - }) - .subscribe( - res => { - this.store.mcUuid = res.uuid; - let data = ''; - try { - data = JSON.parse(reader.result as any); - const input = { - version: this.versionType.selectedVersion, - eventType: this.versionType.selectedEvent, - groupId: groupId, - phase: phaseName, - payload: data - }; - this._ruleApi.importPhase(input).subscribe( - response => { - console.log('success import', response); - this.store.loader = false; - this.store.updateRuleList(Object.values(response.rules)); - }, - error => { - this.notifyError(error); - } - ); - } catch (e) { - console.log(e); - this.errorHandler({ - policyException: { - messageId: 'Invalid JSON', - text: 'Invalid JSON', - variables: [], - formattedErrorMessage: 'Invalid JSON' - } - }); + if (files && files.length > 0) { + this.store.loader = true; + this.fileToUpload = files.item(0); + console.log('file to load:', this.fileToUpload); + this.fileName = this.fileToUpload !== null ? this.fileToUpload.name : ''; + reader.readAsText(this.fileToUpload, 'UTF-8'); + reader.onload = () => { + console.log(reader.result); + this._ruleApi + .getLatestMcUuid({ + contextType: this.store.sdcParmas.contextType, + serviceUuid: this.store.sdcParmas.uuid, + vfiName: this.store.vfiName, + vfcmtUuid: this.store.mcUuid + }) + .subscribe( + res => { + this.store.mcUuid = res.uuid; + let data = ''; + try { + data = JSON.parse(reader.result as any); + const input = { + version: this.versionType.selectedVersion, + eventType: this.versionType.selectedEvent, + groupId: groupId, + phase: phaseName, + payload: data + }; + this._ruleApi.importPhase(input).subscribe( + response => { + console.log('success import', response); + this.clearFile(); + this.store.loader = false; + this.store.updateRuleList(Object.values(response.rules)); + }, + error => { + this.clearFile(); + this.notifyError(error); + } + ); + } catch (e) { + console.log(e); + this.clearFile(); + this.errorHandler({ + policyException: { + messageId: 'Invalid JSON', + text: 'Invalid JSON', + variables: [], + formattedErrorMessage: 'Invalid JSON' + } + }); + } + }, + error => { + this.clearFile(); + this.errorHandler(error); } - }, - error => { - this.errorHandler(error); - } - ); - }; + ); + }; + } else { + this.clearFile(); + } } addGroup(type) { @@ -306,10 +334,12 @@ export class RuleListComponent { this.entryPhase = response.entryPhase; this.publishPhase = response.publishPhase; this.condition = response.filter; + this.filterSave = response.filter !== undefined ? true : false; this.ifStatement = this.condition == null ? false : true; } else { this.store.resetRuleList(); this.condition = null; + this.filterSave = false; this.ifStatement = false; this.versionType.updateVersionTypeFlag(false); this.targetSource = null; @@ -412,6 +442,7 @@ export class RuleListComponent { .subscribe( res => { this.store.mcUuid = res.uuid; + this.filterSave = true; let conditionData2server = null; conditionData2server = this.convertConditionToServer(this.condition); const newFilter = { @@ -423,6 +454,9 @@ export class RuleListComponent { }; this._ruleApi.applyFilter(newFilter).subscribe( success => { + if (this.store.ruleList.length === 0) { + this.versionType.updateVersionTypeFlag(true); + } this.store.loader = false; }, error => { @@ -549,7 +583,9 @@ export class RuleListComponent { console.log(data); this.versions = data.map(x => x.version); this.metaData = data; - this.versionType.updateVersionTypeFlag(false); + if (this.filterSave === false) { + this.versionType.updateVersionTypeFlag(false); + } this.targetSource = null; }); } @@ -597,7 +633,9 @@ export class RuleListComponent { this.store.isLeftVisible = false; this._ruleApi.updateVersionLock.subscribe(() => { - this.versionType.updateVersionTypeFlag(true); + if (this.filterSave === true) { + this.versionType.updateVersionTypeFlag(true); + } }); } } diff --git a/public/src/app/rule-engine/version-type-select/version-type-select.component.html b/public/src/app/rule-engine/version-type-select/version-type-select.component.html index fd3cfab..1539c49 100644 --- a/public/src/app/rule-engine/version-type-select/version-type-select.component.html +++ b/public/src/app/rule-engine/version-type-select/version-type-select.component.html @@ -10,10 +10,10 @@ style="height: 35px; padding: 0.3rem; border: 1px solid #d2d2d2; width:250px;" class="field-select"> - + - +
@@ -45,23 +45,6 @@ | slice:0:selectedEvent.length-6}} - - diff --git a/public/src/app/rule-engine/version-type-select/version-type-select.component.ts b/public/src/app/rule-engine/version-type-select/version-type-select.component.ts index 6869260..791919c 100644 --- a/public/src/app/rule-engine/version-type-select/version-type-select.component.ts +++ b/public/src/app/rule-engine/version-type-select/version-type-select.component.ts @@ -19,7 +19,6 @@ export class VersionTypeSelectComponent { @Input() metaData; @Output() nodesUpdated = new EventEmitter(); @Output() refrashRuleList = new EventEmitter(); - advancedSetting: Array; notifyIdCheckbox = false; constructor(private _ruleApi: RuleEngineApiService, public store: Store) { @@ -36,7 +35,7 @@ export class VersionTypeSelectComponent { tabName.toLowerCase().includes('highlandpark') || tabName.toLowerCase().includes('hp') ) { - this.advancedSetting = this.store.tabsProperties[index].filter( + this.store.advancedSetting = this.store.tabsProperties[index].filter( item => { if ( !( @@ -49,7 +48,7 @@ export class VersionTypeSelectComponent { } } ); - this.mappingTarget = this.advancedSetting[0].name; + this.mappingTarget = this.store.advancedSetting[0].name; this._ruleApi .generateMappingRulesFileName( @@ -59,7 +58,7 @@ export class VersionTypeSelectComponent { ) .subscribe(response => { console.log('generateMappingRulesFileName response: ', response); - this.advancedSetting.forEach(element => { + this.store.advancedSetting.forEach(element => { if (response.includes(element.name)) { element.isExist = true; } else { diff --git a/public/src/app/store/store.ts b/public/src/app/store/store.ts index 5bd8c3e..a994e94 100644 --- a/public/src/app/store/store.ts +++ b/public/src/app/store/store.ts @@ -19,6 +19,7 @@ export class Store { @observable loader = false; @observable cdumpIsDirty = false; @observable expandAdvancedSetting = []; + @observable advancedSetting = []; @observable expandImports = []; @observable generalflow; @observable vfiName; -- cgit 1.2.3-korg