diff options
author | Manor, Yanir (ym903w) <ym903w@intl.att.com> | 2018-09-20 14:18:38 +0300 |
---|---|---|
committer | yanir manor <ym903w@intl.att.com> | 2018-09-26 09:34:04 +0000 |
commit | 22eda038b6cb646d63bfaf617372fce2b5d98631 (patch) | |
tree | 0bb3ef9104e02c031305ecfb2ab0692a57b1ed73 /public/src/app/rule-engine/version-type-select/version-type-select.component.ts | |
parent | 40bb7dc4a104dc7b387b3586e610299b85f903a3 (diff) |
update code to latest
update code to latest
Change-Id: I6ed427434b0da47e0d33507a0992b09fe48f9c52
Issue-ID: DCAEGEN2-821
Signed-off-by: Manor, Yanir (ym903w) <ym903w@intl.att.com>
Diffstat (limited to 'public/src/app/rule-engine/version-type-select/version-type-select.component.ts')
-rw-r--r-- | public/src/app/rule-engine/version-type-select/version-type-select.component.ts | 68 |
1 files changed, 37 insertions, 31 deletions
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 ff229cd..6869260 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 @@ -28,40 +28,46 @@ export class VersionTypeSelectComponent { // set ddl with the first option value. this._ruleApi.tabIndex.subscribe(index => { - console.log('rule index:', index); - - const tabName = this.store.cdump.nodes[index].name; - console.log('tab name:', tabName); + if (index >= 0) { + const tabName = this.store.cdump.nodes[index].name; + console.log('tab name:', tabName); + if ( + tabName.toLowerCase().includes('map') || + tabName.toLowerCase().includes('highlandpark') || + 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.mappingTarget = this.advancedSetting[0].name; - if (tabName.toLowerCase().includes('map')) { - this.mappingTarget = this.store.tabsProperties[index][0].name; - this.advancedSetting = this.store.tabsProperties[index].filter(item => { - if ( - !( - item.hasOwnProperty('constraints') && - !item.value.includes('get_input') + this._ruleApi + .generateMappingRulesFileName( + this.store.ruleListExistParams.nodeName, + this.store.ruleListExistParams.nodeId, + this.store.ruleListExistParams.vfcmtUuid ) - ) { - return item; - } - }); - - this._ruleApi - .generateMappingRulesFileName( - this.store.ruleListExistParams.nodeName, - this.store.ruleListExistParams.nodeId, - this.store.ruleListExistParams.vfcmtUuid - ) - .subscribe(response => { - console.log('generateMappingRulesFileName response: ', response); - this.advancedSetting.forEach(element => { - if (response.includes(element.name)) { - element.isExist = true; - } else { - element.isExist = false; - } + .subscribe(response => { + console.log('generateMappingRulesFileName response: ', response); + this.advancedSetting.forEach(element => { + if (response.includes(element.name)) { + element.isExist = true; + } else { + element.isExist = false; + } + }); }); - }); + } } }); } |