summaryrefslogtreecommitdiffstats
path: root/catalog-ui/src/app/view-models/workspace
diff options
context:
space:
mode:
authorandre.schmid <andre.schmid@est.tech>2021-04-15 18:47:55 +0100
committerAndré Schmid <andre.schmid@est.tech>2021-04-20 10:30:55 +0000
commit39b533344f0a86401f5c41025cfdcf3139934569 (patch)
tree2a6b48a5368525aaf0d167c43afade6a5c532f30 /catalog-ui/src/app/view-models/workspace
parentcd12a2ac6ddc43493c4ba0685dfc75f11bf2aa6b (diff)
Fix VSP update for checked-in resources
Checkout the VF (if checked-in) related to the VSP before loading the VF workspace. Change-Id: I9576fd5b429fdae2ac00de5bfbd38e183b93be59 Issue-ID: SDC-3560 Signed-off-by: André Schmid <andre.schmid@est.tech>
Diffstat (limited to 'catalog-ui/src/app/view-models/workspace')
-rw-r--r--catalog-ui/src/app/view-models/workspace/tabs/general/general-view-model.ts39
1 files changed, 18 insertions, 21 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 28765444b6..b456bece19 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
@@ -20,17 +20,24 @@
'use strict';
import * as _ from "lodash";
-import {ModalsHandler, ValidationUtils, EVENTS, CHANGE_COMPONENT_CSAR_VERSION_FLAG, ComponentType, DEFAULT_ICON,
- ResourceType, ComponentState, instantiationType, ComponentFactory} from "app/utils";
-import { EventListenerService, ProgressService} from "app/services";
-import {CacheService, OnboardingService, ImportVSPService, ElementService} from "app/services-ng2";
-import {IAppConfigurtaion, IValidate, IMainCategory, Resource, ISubCategory,Service, ICsarComponent, Component, IMetadataKey} from "app/models";
-import {IWorkspaceViewModelScope} from "app/view-models/workspace/workspace-view-model";
import {Dictionary} from "lodash";
-import { PREVIOUS_CSAR_COMPONENT, CATEGORY_SERVICE_METADATA_KEYS } from "../../../../utils/constants";
-import { Observable, Subject } from "rxjs";
-import { MetadataEntry } from "app/models/metadataEntry";
-import { Metadata } from "app/models/metadata";
+import {
+ ComponentFactory,
+ ComponentState,
+ ComponentType,
+ DEFAULT_ICON,
+ EVENTS,
+ instantiationType,
+ ModalsHandler,
+ ResourceType,
+ ValidationUtils
+} from "app/utils";
+import {EventListenerService, ProgressService} from "app/services";
+import {CacheService, ElementService, ImportVSPService, OnboardingService} from "app/services-ng2";
+import {Component, IAppConfigurtaion, ICsarComponent, IMainCategory, IMetadataKey, ISubCategory, IValidate, Resource, Service} from "app/models";
+import {IWorkspaceViewModelScope} from "app/view-models/workspace/workspace-view-model";
+import {CATEGORY_SERVICE_METADATA_KEYS, PREVIOUS_CSAR_COMPONENT} from "../../../../utils/constants";
+import {Observable} from "rxjs";
export class Validation {
componentNameValidationPattern:RegExp;
@@ -272,19 +279,9 @@ export class GeneralViewModel {
if (this.$stateParams.componentCsar && !this.$scope.isCreateMode()) {
this.$scope.updateUnsavedFileFlag(true);
- // We are coming from update VSP modal we need to automatically checkout (if needed) and save the VF
- if (this.$scope.component.lifecycleState !== ComponentState.NOT_CERTIFIED_CHECKOUT) {
- // Checkout is needed after that a save will be invoked in workspace-view.handleLifeCycleStateChange
- this.EventListenerService.notifyObservers(EVENTS.ON_LIFECYCLE_CHANGE_WITH_SAVE, 'checkOut');
- // if(this.$scope.component.lifecycleState !== 'NOT_CERTIFIED_CHECKIN') {
- // (<Resource>this.$scope.component).csarVersion = this.$stateParams.componentCsar.csarVersion;
- // }
- } else {
- this.$scope.save();
- }
+ this.$scope.save();
}
-
if (this.$scope.component.isResource() &&
(this.$scope.component as Resource).resourceType === ResourceType.VF ||
(this.$scope.component as Resource).resourceType === ResourceType.PNF && (this.$scope.component as Resource).csarUUID) {