aboutsummaryrefslogtreecommitdiffstats
path: root/catalog-ui/src/app/view-models
diff options
context:
space:
mode:
Diffstat (limited to 'catalog-ui/src/app/view-models')
-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 => {