diff options
author | miriame <miriam.eini@amdocs.com> | 2019-05-20 09:59:19 +0300 |
---|---|---|
committer | miriame <miriam.eini@amdocs.com> | 2019-05-20 10:07:52 +0300 |
commit | 9b8c4cc7504a5dc459d9401733a63ffd99e148c3 (patch) | |
tree | ccd37b18db659cbf4f6171e36803d61c3b8ee7a9 /catalog-ui/src/app/view-models | |
parent | 7b9415d18d42329ac46c506e5728689b2cce01e3 (diff) |
fix bug [SDC-2317] - Auto collapse properties tables after sorting by capability column is not applied
Change-Id: I1c67560d53b18c91f0c47d5c3885492541b43f86
Issue-ID: SDC-2317
Signed-off-by: miriame <miriam.eini@amdocs.com>
Diffstat (limited to 'catalog-ui/src/app/view-models')
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 @@ <div class="table" data-ng-class="{'view-mode': isViewMode()}" data-tests-id="requirement-table"> <div class="head flex-container"> <div data-ng-repeat="header in editableRequirementsTableHeadersList track by $index" - data-ng-click="sort(header.property, requirementsSortTableDefined)" + data-ng-click="sort(header.property, requirementsSortTableDefined, false)" class="table-header head-row hand flex-item {{header.property}}" data-tests-id="table-header-{{header.property}}"> {{header.title}} @@ -133,7 +133,7 @@ <div class="table" data-ng-class="{'view-mode': isViewMode()}"> <div class="head flex-container"> <div data-ng-repeat="header in editableCapabilitiesTableHeadersList track by $index" - data-ng-click="sort(header.property, capabilitiesSortTableDefined)" + data-ng-click="sort(header.property, capabilitiesSortTableDefined, true)" class="table-header head-row hand flex-item {{header.property}}" data-tests-id="header-{{header.property}}"> {{header.title}} @@ -200,7 +200,7 @@ <div class="head flex-container"> <div class="table-header head-row hand flex-item" data-ng-repeat="header in capabilityPropertiesTableHeadersList track by $index" - data-ng-click="sort(header.property, propertiesSortTableDefined)"> + data-ng-click="sort(header.property, propertiesSortTableDefined, false)"> {{header.title}} <span data-ng-if="propertiesSortTableDefined.sortByField === header.property" class="table-header-sort-arrow" diff --git a/catalog-ui/src/app/view-models/workspace/tabs/req-and-capabilities/req-and-capabilities-view-model.ts b/catalog-ui/src/app/view-models/workspace/tabs/req-and-capabilities/req-and-capabilities-view-model.ts index 165578d008..14b45cbdf3 100644 --- a/catalog-ui/src/app/view-models/workspace/tabs/req-and-capabilities/req-and-capabilities-view-model.ts +++ b/catalog-ui/src/app/view-models/workspace/tabs/req-and-capabilities/req-and-capabilities-view-model.ts @@ -84,7 +84,7 @@ interface IReqAndCapabilitiesViewModelScope extends IWorkspaceViewModelScope { modalInstance: ComponentRef<ModalComponent>; filter: {txt: string; show: boolean}; - sort(sortBy:string, sortByTableDefined:SortTableDefined):void; + sort(sortBy: string, sortByTableDefined: SortTableDefined, autoCollapseCapabilitiesRows: boolean): void; sortByIsCreatedManually(arrToSort: Array<RequirementUI|CapabilityUI>): Array<any>; 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 => { |