From 6cc9a11a09a9b650442bf301eb8fd1aa6cad66bc Mon Sep 17 00:00:00 2001 From: Idan Amit Date: Wed, 13 Sep 2017 17:21:33 +0300 Subject: ComponentBaseTest.java enhancement and new onboarding class that test onboarding only And merge release/1710 branch into master Change-Id: I300d897b151010aa26f8732518fa2e3b7ed4291b Issue-Id: SDC-331 Signed-off-by: Idan Amit --- catalog-ui/src/app/models/component-metadata.ts | 4 +++- catalog-ui/src/app/models/components/service.ts | 3 +++ .../workspace/tabs/general/general-view-model.ts | 16 ++++++++++------ .../view-models/workspace/tabs/general/general-view.html | 1 + .../app/view-models/workspace/tabs/general/general.less | 2 +- .../src/app/view-models/workspace/workspace-view.html | 8 +++++--- catalog-ui/src/app/view-models/workspace/workspace.less | 6 +++++- 7 files changed, 28 insertions(+), 12 deletions(-) (limited to 'catalog-ui/src/app') diff --git a/catalog-ui/src/app/models/component-metadata.ts b/catalog-ui/src/app/models/component-metadata.ts index 8c6ed5593d..1545739ce3 100644 --- a/catalog-ui/src/app/models/component-metadata.ts +++ b/catalog-ui/src/app/models/component-metadata.ts @@ -65,6 +65,7 @@ export class ComponentMetadata { public namingPolicy: string; public serviceType:string; public serviceRole:string; + public environmentContext:string; //backend lifecycleState @@ -101,7 +102,7 @@ export class ComponentMetadata { this.projectCode = response.projectCode; this.resourceType = response.resourceType; this.csarUUID = response.csarUUID; - this.csarVersion = response.version; + this.csarVersion = response.csarVersion; this.state = response.state; this.ecompGeneratedNaming = response.ecompGeneratedNaming; this.namingPolicy = response.namingPolicy; @@ -109,6 +110,7 @@ export class ComponentMetadata { this.resourceVendorModelNumber = response.resourceVendorModelNumber; this.serviceType = response.serviceType; this.serviceRole = response.serviceRole; + this.environmentContext = response.environmentContext; return this; } diff --git a/catalog-ui/src/app/models/components/service.ts b/catalog-ui/src/app/models/components/service.ts index 90a38e895b..ce6921b1bb 100644 --- a/catalog-ui/src/app/models/components/service.ts +++ b/catalog-ui/src/app/models/components/service.ts @@ -36,6 +36,7 @@ export class Service extends Component { public namingPolicy:string; public serviceType:string; public serviceRole:string; + public environmentContext:string; constructor(componentService:IServiceService, $q:ng.IQService, component?:Service) { super(componentService, $q, component); @@ -47,6 +48,7 @@ export class Service extends Component { this.namingPolicy = component.namingPolicy; this.serviceType = component.serviceType; this.serviceRole = component.serviceRole; + this.environmentContext = component.environmentContext; if (component.categories && component.categories[0]) { this.mainCategory = component.categories[0].name; this.selectedCategory = this.mainCategory; @@ -161,6 +163,7 @@ export class Service extends Component { this.namingPolicy = componentMetadata.namingPolicy; this.serviceType = componentMetadata.serviceType; this.serviceRole = componentMetadata.serviceRole; + this.environmentContext = componentMetadata.environmentContext; this.setComponentDisplayData(); } 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 48fc9dbb42..c60a490b4b 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,7 +20,7 @@ 'use strict'; import {ModalsHandler, ValidationUtils, EVENTS, CHANGE_COMPONENT_CSAR_VERSION_FLAG, ComponentType, DEFAULT_ICON, - ResourceType} from "app/utils"; + ResourceType, ComponentState} from "app/utils"; import {CacheService, EventListenerService, ProgressService, OnboardingService} from "app/services"; import {IAppConfigurtaion, IValidate, IMainCategory, Resource, ISubCategory,Service, ICsarComponent} from "app/models"; import {IWorkspaceViewModelScope} from "app/view-models/workspace/workspace-view-model"; @@ -41,6 +41,7 @@ export class componentCategories {//categories field bind to this obj in order t selectedCategory:string; } + export interface IGeneralScope extends IWorkspaceViewModelScope { validation:Validation; editForm:ng.IFormController; @@ -56,7 +57,7 @@ export interface IGeneralScope extends IWorkspaceViewModelScope { browseFileLabel:string; componentCategories:componentCategories; - onToscaFileChange():void + onToscaFileChange():void; validateField(field:any):boolean; validateName(isInit:boolean):void; calculateUnique(mainCategory:string, subCategory:string):string; // Build unique string from main and sub category @@ -146,21 +147,24 @@ export class GeneralViewModel { (this.$scope.component).resourceType == ResourceType.VF && (this.$scope.component).csarUUID) { this.$scope.isShowOnboardingSelectionBrowse = true; - let onboardCsarFilesMap:Dictionary = this.cacheService.get('onboardCsarFilesMap'); + let onboardCsarFilesMap:Dictionary> = this.cacheService.get('onboardCsarFilesMap'); // The onboardCsarFilesMap in cache contains map of [packageId]:[vsp display name for brows] // if the map is empty - Do request to BE if(onboardCsarFilesMap) { - this.$scope.importedToscaBrowseFileText = onboardCsarFilesMap[(this.$scope.component).csarUUID]; + if (onboardCsarFilesMap[(this.$scope.component).csarUUID]){ + this.$scope.importedToscaBrowseFileText = onboardCsarFilesMap[(this.$scope.component).csarUUID][(this.$scope.component).csarVersion]; + } } if(!onboardCsarFilesMap || !this.$scope.importedToscaBrowseFileText){ let onSuccess = (vsps:Array): void =>{ onboardCsarFilesMap = {}; _.each(vsps, (vsp:ICsarComponent)=>{ - onboardCsarFilesMap[vsp.packageId] = vsp.vspName + " (" + vsp.version + ")"; + onboardCsarFilesMap[vsp.packageId] = onboardCsarFilesMap[vsp.packageId] || {}; + onboardCsarFilesMap[vsp.packageId][vsp.version] = vsp.vspName + " (" + vsp.version + ")"; }); this.cacheService.set('onboardCsarFilesMap', onboardCsarFilesMap); - this.$scope.importedToscaBrowseFileText = onboardCsarFilesMap[(this.$scope.component).csarUUID]; + this.$scope.importedToscaBrowseFileText = onboardCsarFilesMap[(this.$scope.component).csarUUID][(this.$scope.component).csarVersion]; }; let onError = (): void =>{ diff --git a/catalog-ui/src/app/view-models/workspace/tabs/general/general-view.html b/catalog-ui/src/app/view-models/workspace/tabs/general/general-view.html index d3626803e9..3a3b2d316d 100644 --- a/catalog-ui/src/app/view-models/workspace/tabs/general/general-view.html +++ b/catalog-ui/src/app/view-models/workspace/tabs/general/general-view.html @@ -375,6 +375,7 @@ + -
- {{getTabTitle()}} +
+
+ {{getTabTitle()}} +
+
-
diff --git a/catalog-ui/src/app/view-models/workspace/workspace.less b/catalog-ui/src/app/view-models/workspace/workspace.less index d0799f4bac..8b8b6d624a 100644 --- a/catalog-ui/src/app/view-models/workspace/workspace.less +++ b/catalog-ui/src/app/view-models/workspace/workspace.less @@ -174,7 +174,7 @@ height: calc(~'100% - @{action_nav_height}'); //composition is the only tab without a tab title. need to exclude from calculation. } .w-sdc-main-container-body-content { - height:calc(~'100% - @{action_nav_height} - @{tab_title}'); + // height:calc(~'100% - @{action_nav_height} - @{tab_title}'); align-items: center; padding: 0 100px 20px 100px; &.third-party { @@ -187,6 +187,10 @@ bottom: 0; } } + .w-sdc-main-container-body-content-wrapper { + overflow: auto; + height: calc(~'100% - @{action_nav_height}') + } } } -- cgit 1.2.3-korg