From: franciscovila Date: Wed, 25 Oct 2023 09:49:12 +0000 (+0100) Subject: service role and service function metadata not imported X-Git-Tag: 1.13.6~6 X-Git-Url: https://gerrit.onap.org/r/gitweb?p=sdc.git;a=commitdiff_plain;h=da15f0dfe6322bdf347b839a27c2af216b7327a9 service role and service function metadata not imported Issue-ID: SDC-4667 Signed-off-by: franciscovila Change-Id: I5aa1c1b2bb5cce292cf7ddd4541394177f6af465 --- diff --git a/catalog-ui/src/app/view-models/workspace/tabs/general/general-view-model.ts b/catalog-ui/src/app/view-models/workspace/tabs/general/general-view-model.ts index 96ce7d5fb4..86bcab0038 100644 --- a/catalog-ui/src/app/view-models/workspace/tabs/general/general-view-model.ts +++ b/catalog-ui/src/app/view-models/workspace/tabs/general/general-view-model.ts @@ -396,6 +396,12 @@ export class GeneralViewModel { } private setFunctionRole = (service : Service) : void => { + if (!service.serviceFunction && service.componentMetadata) { + service.serviceFunction = service.componentMetadata.serviceFunction; + } + if (!service.serviceRole && service.componentMetadata) { + service.serviceRole = service.componentMetadata.serviceRole; + } if (service.serviceFunction) { const functionList : string[] = this.$scope.getMetadataKeyValidValues('Service Function'); if (functionList.find(value => value == service.serviceFunction) != undefined) { @@ -817,7 +823,12 @@ export class GeneralViewModel { this.$scope.component.categorySpecificMetadata[metadataKey.name] = metadataKey.defaultValue ? metadataKey.defaultValue : ""; } if (metadataKey.name === 'Service Role') { - this.$scope.roleOption = this.$scope.component.categorySpecificMetadata[metadataKey.name]; + if ((this.$scope.component).componentMetadata && (this.$scope.component).componentMetadata.serviceRole) { + this.$scope.roleOption = (this.$scope.component).componentMetadata.serviceRole; + } + else { + this.$scope.roleOption = this.$scope.component.categorySpecificMetadata[metadataKey.name]; + } (this.$scope.component).serviceRole = this.$scope.roleOption; } if (metadataKey.name === 'Service Function') {