summaryrefslogtreecommitdiffstats
path: root/catalog-ui
diff options
context:
space:
mode:
authorandre.schmid <andre.schmid@est.tech>2022-06-10 11:39:07 +0100
committerMichael Morris <michael.morris@est.tech>2022-06-11 19:15:23 +0000
commit1f240151bfac463eb1f5c1df1f497eed8495106e (patch)
tree5d02367e23c53a92b5a9940236cd680ab9e034c9 /catalog-ui
parent615b15a15ded1c428798a3b5411ba9613eb0baf1 (diff)
Fix component workspace metadata not being set
The component metadata was not being initialized when the Component constructor was being used. Also, during the component checkout, instead of setting the ComponentMetadata to the workspaceService, the code was setting the component itself, causing issues in functionalities that uses the metadata after a component checkout. Change-Id: Ie9bb187ea04a2f4711d4df00ea335d531840378e Issue-ID: SDC-4046 Signed-off-by: andre.schmid <andre.schmid@est.tech>
Diffstat (limited to 'catalog-ui')
-rw-r--r--catalog-ui/src/app/models/components/component.ts5
-rw-r--r--catalog-ui/src/app/view-models/workspace/workspace-view-model.ts2
2 files changed, 6 insertions, 1 deletions
diff --git a/catalog-ui/src/app/models/components/component.ts b/catalog-ui/src/app/models/components/component.ts
index e5859abb44..89643d90b0 100644
--- a/catalog-ui/src/app/models/components/component.ts
+++ b/catalog-ui/src/app/models/components/component.ts
@@ -205,6 +205,9 @@ export abstract class Component implements IComponent {
this.isArchived = component.isArchived;
this.vspArchived = component.vspArchived;
+ if (component.componentMetadata) {
+ this.componentMetadata = component.componentMetadata;
+ }
if (component.categorySpecificMetadata && component.categories && component.categories[0]){
this.copyCategoryMetadata(component);
this.copySubcategoryMetadata(component);
@@ -244,8 +247,10 @@ export abstract class Component implements IComponent {
//------------------------------------------ API Calls ----------------------------------------------------------------//
public changeLifecycleState = (state:string, commentObj:AsdcComment):ng.IPromise<Component> => {
+ console.log('changeLifecycleState called', state);
let deferred = this.$q.defer<Component>();
let onSuccess = (componentMetadata:ComponentMetadata):void => {
+ console.log('changeLifecycleState onSuccess', componentMetadata);
this.setComponentMetadata(componentMetadata);
// this.version = componentMetadata.version;
this.lifecycleState = componentMetadata.lifecycleState;
diff --git a/catalog-ui/src/app/view-models/workspace/workspace-view-model.ts b/catalog-ui/src/app/view-models/workspace/workspace-view-model.ts
index 532df0e2f9..7bed071d7e 100644
--- a/catalog-ui/src/app/view-models/workspace/workspace-view-model.ts
+++ b/catalog-ui/src/app/view-models/workspace/workspace-view-model.ts
@@ -568,7 +568,7 @@ export class WorkspaceViewModel {
this.initVersionObject();
this.$scope.isLoading = false;
this.EventListenerService.notifyObservers(EVENTS.ON_CHECKOUT, component);
- this.workspaceService.setComponentMetadata(component);
+ this.workspaceService.setComponentMetadata(component.componentMetadata);
this.Notification.success({
message: this.$filter('translate')("CHECKOUT_SUCCESS_MESSAGE_TEXT"),