diff options
author | zhaoxiangjun666 <xjzhaop@isoftstone.com> | 2020-09-10 14:01:50 +0800 |
---|---|---|
committer | zhaoxiangjun666 <xjzhaop@isoftstone.com> | 2020-09-21 20:39:48 +0800 |
commit | a8d3e1b8c759c21227690a425552a245da883e97 (patch) | |
tree | 4e9731f7e7c4df8088187e7501a0d9a8a516f215 /catalog-ui/src/app/view-models | |
parent | 591810df468a8e2c59569e701f514bff61203940 (diff) |
Support for Test Topology Auto Design- Service Import
Add some test code and use lombok in catalog-model
Test Topology Auto Design (NFV Testing Automatic Platform)
Delete useless test code and add test code for new function
Issue-ID: SDC-3179
Issue-ID: SDC-3085
Signed-off-by: zhaoxiangjun666 <xjzhaop@isoftstone.com>
Change-Id: I7f555633a00848c273014caa18ea0e30d0b22113
Diffstat (limited to 'catalog-ui/src/app/view-models')
-rw-r--r-- | catalog-ui/src/app/view-models/workspace/tabs/general/general-view-model.ts | 17 | ||||
-rw-r--r-- | catalog-ui/src/app/view-models/workspace/workspace-view-model.ts | 9 |
2 files changed, 23 insertions, 3 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 87937dd761..e10dc98fac 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 @@ -219,7 +219,7 @@ export class GeneralViewModel { this.$scope.importCsarProgressKey = "importCsarProgressKey"; - this.$scope.browseFileLabel = this.$scope.component.isResource() && (<Resource>this.$scope.component).resourceType === ResourceType.VF ? 'Upload File:' : 'Upload VFC:'; + this.$scope.browseFileLabel = (this.$scope.component.isResource() && ((<Resource>this.$scope.component).resourceType === ResourceType.VF || (<Resource>this.$scope.component).resourceType === 'SRVC')) || this.$scope.component.isService() ? 'Upload File:' : 'Upload VFC:'; this.$scope.progressService = this.progressService; this.$scope.componentCategories = new componentCategories(); this.$scope.componentCategories.selectedCategory = this.$scope.component.selectedCategory; @@ -245,6 +245,15 @@ export class GeneralViewModel { this.$scope.isShowFileBrowse = true; } } else if(this.$scope.component.isService()){ + let service: Service = <Service>this.$scope.component; + console.log(service.name + ": " + service.csarUUID); + if (service.importedFile) { // Component has imported file. + this.$scope.isShowFileBrowse = true; + (<Service>this.$scope.component).serviceType = 'Service'; + } + if (this.$scope.isEditMode() && service.serviceType == 'Service' && !service.csarUUID) { + this.$scope.isShowFileBrowse = true; + } // Init Instantiation types this.$scope.initInstantiationTypes(); } @@ -497,7 +506,11 @@ export class GeneralViewModel { return; } - const subtype:string = ComponentType.RESOURCE == this.$scope.componentType ? this.$scope.component.getComponentSubType() : undefined; + + let subtype:string = ComponentType.RESOURCE == this.$scope.componentType ? this.$scope.component.getComponentSubType() : undefined; + if (subtype == "SRVC") { + subtype = "VF" + } const onFailed = (response) => { // console.info('onFaild', response); 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 11667283b2..e132d53eaf 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 @@ -27,6 +27,7 @@ import { IUserProperties, IAppMenu, Resource, + Service, Component, Plugin, PluginsConfiguration, @@ -431,8 +432,14 @@ export class WorkspaceViewModel { components: this.components }, {inherit: false}); }; + + console.log(this.$scope.component, "this.$scope.component") + if ((<Service>this.$scope.component).serviceType == "Service") { + this.ComponentFactory.importComponentOnServer(this.$scope.component).then(onSuccessCreate, onFailed); + } else { + this.ComponentFactory.createComponentOnServer(this.$scope.component).then(onSuccessCreate, onFailed); + } - this.ComponentFactory.createComponentOnServer(this.$scope.component).then(onSuccessCreate, onFailed); }; |