aboutsummaryrefslogtreecommitdiffstats
path: root/catalog-ui/src
diff options
context:
space:
mode:
authorfranciscovila <javier.paradela.vila@est.tech>2023-10-25 10:49:12 +0100
committerMichael Morris <michael.morris@est.tech>2023-10-26 17:36:09 +0000
commitda15f0dfe6322bdf347b839a27c2af216b7327a9 (patch)
treefaf07947c5621b3827ed55ebf7e6cfa8c3a2e26f /catalog-ui/src
parent031b8e1c7eb7d7b2e8c0bbd575dfbde36aaf8736 (diff)
service role and service function metadata not imported
Issue-ID: SDC-4667 Signed-off-by: franciscovila <javier.paradela.vila@est.tech> Change-Id: I5aa1c1b2bb5cce292cf7ddd4541394177f6af465
Diffstat (limited to 'catalog-ui/src')
-rw-r--r--catalog-ui/src/app/view-models/workspace/tabs/general/general-view-model.ts13
1 files changed, 12 insertions, 1 deletions
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 ((<Service>this.$scope.component).componentMetadata && (<Service>this.$scope.component).componentMetadata.serviceRole) {
+ this.$scope.roleOption = (<Service>this.$scope.component).componentMetadata.serviceRole;
+ }
+ else {
+ this.$scope.roleOption = this.$scope.component.categorySpecificMetadata[metadataKey.name];
+ }
(<Service>this.$scope.component).serviceRole = this.$scope.roleOption;
}
if (metadataKey.name === 'Service Function') {