summaryrefslogtreecommitdiffstats
path: root/catalog-ui/src/app/ng2/components
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/ng2/components
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/ng2/components')
-rw-r--r--catalog-ui/src/app/ng2/components/modals/onboarding-modal/import-vsp.service.ts5
-rw-r--r--catalog-ui/src/app/ng2/components/modals/onboarding-modal/onboarding-modal.component.ts11
2 files changed, 11 insertions, 5 deletions
diff --git a/catalog-ui/src/app/ng2/components/modals/onboarding-modal/import-vsp.service.ts b/catalog-ui/src/app/ng2/components/modals/onboarding-modal/import-vsp.service.ts
index 8e7364660f..ad80bcda49 100644
--- a/catalog-ui/src/app/ng2/components/modals/onboarding-modal/import-vsp.service.ts
+++ b/catalog-ui/src/app/ng2/components/modals/onboarding-modal/import-vsp.service.ts
@@ -1,8 +1,7 @@
import { Injectable, Inject } from "@angular/core";
-import { OnboardingModalComponent } from "./onboarding-modal.component";
+import {ImportVSPdata, OnboardingModalComponent} from "./onboarding-modal.component";
import { SdcUiServices, SdcUiCommon } from "onap-ui-angular";
import { Observable, Subject } from "rxjs";
-import { CHANGE_COMPONENT_CSAR_VERSION_FLAG } from "../../../../utils/constants";
import { CacheService } from "../../../services/cache.service";
@@ -25,7 +24,7 @@ export class ImportVSPService {
} as SdcUiCommon.IModalConfig;
const onboardingModalInstance = this.modalService.openCustomModal(onboardingModalConfig, OnboardingModalComponent, {currentCsarUUID: csarUUID, currentCsarVersion: csarVersion});
onboardingModalInstance.innerModalContent.instance.closeModalEvent.subscribe(
- (result: any) => {
+ (result: ImportVSPdata) => {
subject.next(result);
onboardingModalInstance.closeModal();
}, (err) =>{}
diff --git a/catalog-ui/src/app/ng2/components/modals/onboarding-modal/onboarding-modal.component.ts b/catalog-ui/src/app/ng2/components/modals/onboarding-modal/onboarding-modal.component.ts
index 10d7f67860..1e07c8b2ef 100644
--- a/catalog-ui/src/app/ng2/components/modals/onboarding-modal/onboarding-modal.component.ts
+++ b/catalog-ui/src/app/ng2/components/modals/onboarding-modal/onboarding-modal.component.ts
@@ -18,6 +18,12 @@ export interface ImportVSPdata {
componentCsar: Resource;
previousComponent?: Resource;
type: string;
+ actionType: ImportVSPActionType;
+}
+
+export enum ImportVSPActionType {
+ IMPORT_VSP,
+ UPDATE_VSP
}
// tslint:disable-next-line:interface-name
@@ -118,13 +124,14 @@ export class OnboardingModalComponent implements OnInit {
}
importOrUpdateCsar = (): void => {
- const selectedComponentConverted = this.onBoardingService.convertMetaDataToComponent(this.selectedComponent);
+ const selectedComponentConverted: Resource = this.onBoardingService.convertMetaDataToComponent(this.selectedComponent);
const componentFromServerConverted = this.componentFromServer ?
this.onBoardingService.convertMetaDataToComponent(this.componentFromServer) : undefined;
const importVSPdata: ImportVSPdata = {
componentCsar: selectedComponentConverted,
previousComponent: componentFromServerConverted,
- type: ComponentType.RESOURCE.toLowerCase()
+ type: ComponentType.RESOURCE.toLowerCase(),
+ actionType: this.isCsarComponentExists ? ImportVSPActionType.UPDATE_VSP : ImportVSPActionType.IMPORT_VSP
};
this.closeModalEvent.emit(importVSPdata);
}