From 258900e4a46d7e414e526e7322b0d6319fdb79a8 Mon Sep 17 00:00:00 2001 From: miriame Date: Mon, 20 May 2019 09:59:19 +0300 Subject: fix bug [SDC-2317] - Auto collapse properties tables after sorting by capability column is not applied Change-Id: Ife53616c79b9cc5271dfde6204775afdfaa3b646 Issue-ID: SDC-2317 Signed-off-by: miriame --- .../req-and-capabilities/req-and-capabilities-editable-view.html | 6 +++--- .../tabs/req-and-capabilities/req-and-capabilities-view-model.ts | 7 +++++-- 2 files changed, 8 insertions(+), 5 deletions(-) diff --git a/catalog-ui/src/app/view-models/workspace/tabs/req-and-capabilities/req-and-capabilities-editable-view.html b/catalog-ui/src/app/view-models/workspace/tabs/req-and-capabilities/req-and-capabilities-editable-view.html index 8e1822193b..566cc5fc2c 100644 --- a/catalog-ui/src/app/view-models/workspace/tabs/req-and-capabilities/req-and-capabilities-editable-view.html +++ b/catalog-ui/src/app/view-models/workspace/tabs/req-and-capabilities/req-and-capabilities-editable-view.html @@ -74,7 +74,7 @@
{{header.title}} @@ -133,7 +133,7 @@
{{header.title}} @@ -200,7 +200,7 @@
+ data-ng-click="sort(header.property, propertiesSortTableDefined, false)"> {{header.title}} ; filter: {txt: string; show: boolean}; - sort(sortBy:string, sortByTableDefined:SortTableDefined):void; + sort(sortBy: string, sortByTableDefined: SortTableDefined, autoCollapseCapabilitiesRows: boolean): void; sortByIsCreatedManually(arrToSort: Array): Array; updateProperty(property:PropertyModel, indexInFilteredProperties:number):void; allCapabilitiesSelected(selected:boolean):void; @@ -229,9 +229,12 @@ export class ReqAndCapabilitiesViewModel { this.$scope.filteredCapabilitiesList = this.$scope.sortByIsCreatedManually(this.$scope.capabilities); this.$scope.filteredRequirementsList = this.$scope.sortByIsCreatedManually(this.$scope.requirements); - this.$scope.sort = (sortBy:string, sortByTableDefined:SortTableDefined):void => { + this.$scope.sort = (sortBy: string, sortByTableDefined: SortTableDefined, autoCollapseCapabilitiesRows: boolean): void => { sortByTableDefined.reverse = (sortByTableDefined.sortByField === sortBy) ? !sortByTableDefined.reverse : false; sortByTableDefined.sortByField = sortBy; + if (autoCollapseCapabilitiesRows) { + this.$scope.allCapabilitiesSelected(false); + } }; this.$scope.updateProperty = (property:PropertyModel, indexInFilteredProperties:number):void => { -- cgit 1.2.3-korg