{"text": "Properties Assignment", "action": "onMenuItemPressed", "state": "workspace.properties_assignment"}
],
"SERVICE": [
- {"text": "General", "action": "onMenuItemPressed", "state": "workspace.general"},
+ {"text": "General", "action": "onMenuItemPressed", "state": "workspace.general", "hiddenCategories":["Partner Domain Service"]},
{"text": "TOSCA Artifacts", "action": "onMenuItemPressed", "state": "workspace.tosca_artifacts"},
{"text": "Composition", "action": "onMenuItemPressed", "state": "workspace.composition.details", "disabledCategories":["Partner Domain Service"]},
{"text": "Operation", "action":"onMenuItemPressed", "state": "workspace.interface_operation"},
browseFileLabel:string;
componentCategories:componentCategories;
instantiationTypes:Array<instantiationType>;
+ isHiddenCategorySelected: boolean;
save():Promise<any>;
revert():void;
this.$scope.updateMenuComponentName(this.$scope.component.name);
};
+ //Find if a category is applicable for External API or not
+ private isHiddenCategory = (category: string) => {
+ let items: Array<any> = new Array<any>();
+ items = this.$scope.sdcMenu.component_workspace_menu_option[this.$scope.component.getComponentSubType()];
+ for(let index = 0; index < items.length; ++index) {
+ if ((items[index].hiddenCategories && items[index].hiddenCategories.indexOf(category) > -1)) {
+ return true;
+ }
+ }
+ return false;
+ };
+
+ private filteredCategories = () => {
+ let tempCategories: Array<IMainCategory> = new Array<IMainCategory>();
+ this.$scope.categories.forEach((category) => {
+ if (!this.isHiddenCategory(category.name)
+ && this.$scope.isCreateMode()
+ ) {
+ tempCategories.push(category);
+ } else if ((ComponentState.NOT_CERTIFIED_CHECKOUT === this.$scope.component.lifecycleState)
+ && !this.isHiddenCategory(this.$scope.component.selectedCategory)
+ && !this.isHiddenCategory(category.name)
+ ) {
+ tempCategories.push(category);
+ } else if ((ComponentState.NOT_CERTIFIED_CHECKOUT === this.$scope.component.lifecycleState)
+ && this.isHiddenCategory(this.$scope.component.selectedCategory)) {
+ tempCategories.push(category);
+ }
+ });
+
+ return tempCategories;
+ };
+
private initScopeMethods = ():void => {
this.$scope.initCategoreis = ():void => {
}
if (this.$scope.componentType === ComponentType.SERVICE) {
this.$scope.categories = this.cacheService.get('serviceCategories');
+
+ //Remove categories from dropdown applicable for External API
+ if (this.$scope.isCreateMode() || (ComponentState.NOT_CERTIFIED_CHECKOUT === this.$scope.component.lifecycleState)) {
+ this.$scope.categories = this.filteredCategories();
+ //Flag to disbale category if service is created through External API
+ this.$scope.isHiddenCategorySelected = this.isHiddenCategory(this.$scope.component.selectedCategory);
+ }
+
}
};
};
}
+
name="category"
data-ng-class="{'view-mode': isViewMode()}"
data-ng-change="onCategoryChange()"
- data-ng-disabled="component.isAlreadyCertified() || (component.isCsarComponent() && component.selectedCategory && component.selectedCategory!=='')"
+ data-ng-disabled="component.isAlreadyCertified() || (component.isCsarComponent() && component.selectedCategory && component.selectedCategory!=='') || isHiddenCategorySelected"
data-ng-model="componentCategories.selectedCategory"
data-tests-id="selectGeneralCategory"
>