diff options
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.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); }; |