diff options
author | Mohamed Asgar Samiulla(ma926a) <ma926a@us.att.com> | 2018-03-16 16:10:26 +0530 |
---|---|---|
committer | Mohamed Asgar Samiulla(ma926a) <ma926a@us.att.com> | 2018-03-16 16:27:17 +0530 |
commit | 2ad624cfde8a529f539afcfd12ee28165e3bc939 (patch) | |
tree | 69cb7dddb082cb2f25f15d0b6f4c4f294c4cd8a3 /src/app/vnfs/build-artifacts/parameter-definitions/parameter-definition.service.ts | |
parent | 90174648e4553018398f88c6acbd9dc905aa17ff (diff) |
[Appc-1806] Removing INSTAR from CDT for ONAP.
The source name for INSTAR made configurable through a property file.
Issue-ID: APPC-750
Change-Id: I7e0d2ae657d4469f6fae54b5358ddb6f5476b211
Signed-off-by: Mohamed Asgar Samiulla(ma926a) <ma926a@us.att.com>
Diffstat (limited to 'src/app/vnfs/build-artifacts/parameter-definitions/parameter-definition.service.ts')
-rw-r--r-- | src/app/vnfs/build-artifacts/parameter-definitions/parameter-definition.service.ts | 10 |
1 files changed, 4 insertions, 6 deletions
diff --git a/src/app/vnfs/build-artifacts/parameter-definitions/parameter-definition.service.ts b/src/app/vnfs/build-artifacts/parameter-definitions/parameter-definition.service.ts index 89eeec2..cfcab03 100644 --- a/src/app/vnfs/build-artifacts/parameter-definitions/parameter-definition.service.ts +++ b/src/app/vnfs/build-artifacts/parameter-definitions/parameter-definition.service.ts @@ -63,13 +63,12 @@ export class ParameterDefinitionService { private selectedActionReference: any; private apiToken = localStorage['apiToken']; private userId = localStorage['userId']; - + public configurable_source = require('../../../CDTProperties.json').source; constructor(private mappingEditorService: MappingEditorService, private paramShareService: ParamShareService, private nService: NotificationsService, private httpService: HttpUtilService, private utilService: UtilityService) { - } public initialize() { @@ -313,7 +312,7 @@ export class ParameterDefinitionService { let isValid = true; if (undefined != objs || null != objs) { for (var i = 0; i < objs.length; i++) { - if (objs[i].source == 'INSTAR' && (null == objs[i]['response-keys'] || undefined == objs[i]['response-keys'])) { + if (objs[i].source == this.configurable_source && (null == objs[i]['response-keys'] || undefined == objs[i]['response-keys'])) { isValid = false; return isValid; } @@ -355,7 +354,6 @@ export class ParameterDefinitionService { jsonString = jsonString.replace(/"null"/g, 'null'); let saveModel = JSON.parse(jsonString); let pdFileObject = this.processResponseKeys(saveModel); - //Validate for Source =INSTAR and responsekeys present if (this.isValidateSourceAndResponseKeys(pdFileObject)) { let yamlObject = { 'kind': 'Property Definition', @@ -386,7 +384,7 @@ export class ParameterDefinitionService { for (var i = 0; i < this.modelParamDefinitionObjects.length; i++) { this.formatKeys(this.modelParamDefinitionObjects[i]); } - this.nService.error('Error', 'Response Keys cannot be empty if source is INSTAR'); + this.nService.error('Error', 'Response Keys cannot be empty if source is '+this.configurable_source); return; } //Restore Keys for display @@ -437,7 +435,7 @@ export class ParameterDefinitionService { parameterDefinitionObject['source'] = fields[0]; parameterDefinitionObject['rule-type'] = fields[1]; } else { - if (parameterDefinitionObject['source'] === 'INSTAR') { + if (parameterDefinitionObject['source'] === this.configurable_source) { parameterDefinitionObject['source'] = 'Manual'; parameterDefinitionObject['ruleTypeValues'] = [null]; parameterDefinitionObject['rule-type'] = null; |