aboutsummaryrefslogtreecommitdiffstats
path: root/catalog-ui/src/app
diff options
context:
space:
mode:
authormiriame <miriam.eini@amdocs.com>2019-05-20 09:59:19 +0300
committermiriame <miriam.eini@amdocs.com>2019-05-20 09:59:19 +0300
commit258900e4a46d7e414e526e7322b0d6319fdb79a8 (patch)
tree02868926fe7296e61191f64f875a0a34804fcba1 /catalog-ui/src/app
parentab9e21695465629b1aef32aa92f36c7f6b8e5d34 (diff)
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 <miriam.eini@amdocs.com>
Diffstat (limited to 'catalog-ui/src/app')
-rw-r--r--catalog-ui/src/app/view-models/workspace/tabs/req-and-capabilities/req-and-capabilities-editable-view.html6
-rw-r--r--catalog-ui/src/app/view-models/workspace/tabs/req-and-capabilities/req-and-capabilities-view-model.ts7
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 => {