From b9936594fa61b381fc6bcd680c7fe2a1d6b70b4d Mon Sep 17 00:00:00 2001 From: Micha?l HENKENS Date: Fri, 10 Feb 2023 11:05:46 +0100 Subject: [PATCH] fix(stark-ui): multi-sorting on stark-table not working after sorting on single field The issue was caused by the fact the ngClass multisorting was not changed. ISSUES CLOSED: #3580 --- .../table/components/table.component.ts | 10 +-- showcase/package-lock.json | 64 +++++++++---------- showcase/package.json | 10 +-- starter/package.json | 8 +-- 4 files changed, 47 insertions(+), 45 deletions(-) diff --git a/packages/stark-ui/src/modules/table/components/table.component.ts b/packages/stark-ui/src/modules/table/components/table.component.ts index 85262bb844..4bf66b7c99 100644 --- a/packages/stark-ui/src/modules/table/components/table.component.ts +++ b/packages/stark-ui/src/modules/table/components/table.component.ts @@ -864,22 +864,23 @@ export class StarkTableComponent extends AbstractStarkUiComponent implements OnI */ public onReorderChange(column: StarkColumnSortChangedOutput): void { if (column.sortable) { - this.resetSorting(column); const sortedColumn = find(this.columns, { name: column.name }); if (sortedColumn) { sortedColumn.sortPriority = 1; switch (column.sortDirection) { case "asc": - sortedColumn.sortDirection = "desc"; + this.orderProperties = ["-" + sortedColumn.name]; break; case "desc": - sortedColumn.sortDirection = ""; + this.orderProperties = []; break; default: - sortedColumn.sortDirection = "asc"; + this.orderProperties = [sortedColumn.name]; break; } } + this.isMultiSorting = false; + this.cdRef.detectChanges(); this.sortData(); } } @@ -919,6 +920,7 @@ export class StarkTableComponent extends AbstractStarkUiComponent implements OnI } this.orderProperties = newOrderProperties; // enforcing immutability :) + this.isMultiSorting = this.orderProperties.length > 1; this.cdRef.detectChanges(); // needed due to ChangeDetectionStrategy.OnPush in order to refresh the columns this.sortData(); diff --git a/showcase/package-lock.json b/showcase/package-lock.json index 4b30495291..e7a434a925 100644 --- a/showcase/package-lock.json +++ b/showcase/package-lock.json @@ -25,9 +25,9 @@ "@angular/platform-server": "~7.2.2", "@angular/router": "~7.2.2", "@nationalbankbelgium/code-style": "^1.4.0", - "@nationalbankbelgium/stark-core": "file:../dist/packages-dist/stark-core/nationalbankbelgium-stark-core-10.2.4-2030164f.tgz", - "@nationalbankbelgium/stark-rbac": "file:../dist/packages-dist/stark-rbac/nationalbankbelgium-stark-rbac-10.2.4-2030164f.tgz", - "@nationalbankbelgium/stark-ui": "file:../dist/packages-dist/stark-ui/nationalbankbelgium-stark-ui-10.2.4-2030164f.tgz", + "@nationalbankbelgium/stark-core": "file:../dist/packages-dist/stark-core/nationalbankbelgium-stark-core-10.3.0-7cb334fc.tgz", + "@nationalbankbelgium/stark-rbac": "file:../dist/packages-dist/stark-rbac/nationalbankbelgium-stark-rbac-10.3.0-7cb334fc.tgz", + "@nationalbankbelgium/stark-ui": "file:../dist/packages-dist/stark-ui/nationalbankbelgium-stark-ui-10.3.0-7cb334fc.tgz", "@uirouter/visualizer": "~7.2.1", "angular-in-memory-web-api": "~0.8.0", "basscss": "~8.1.0", @@ -44,8 +44,8 @@ }, "devDependencies": { "@compodoc/compodoc": "1.1.13", - "@nationalbankbelgium/stark-build": "file:../dist/packages-dist/stark-build/nationalbankbelgium-stark-build-10.2.4-2030164f.tgz", - "@nationalbankbelgium/stark-testing": "file:../dist/packages-dist/stark-testing/nationalbankbelgium-stark-testing-10.2.4-2030164f.tgz", + "@nationalbankbelgium/stark-build": "file:../dist/packages-dist/stark-build/nationalbankbelgium-stark-build-10.3.0-7cb334fc.tgz", + "@nationalbankbelgium/stark-testing": "file:../dist/packages-dist/stark-testing/nationalbankbelgium-stark-testing-10.3.0-7cb334fc.tgz", "@types/core-js": "~2.5.4", "@types/hammerjs": "~2.0.39", "@types/node": "~10.17.54", @@ -3061,9 +3061,9 @@ "integrity": "sha512-vI9TvyTNRQQBqJH1ek/7AoDL8ovMDszWO2Ce+jq2wVAQAH9z+47gX4589ExykD5ZOH0+itpE5of28HyQxd4FvQ==" }, "node_modules/@nationalbankbelgium/stark-build": { - "version": "10.2.4-2030164f", - "resolved": "file:../dist/packages-dist/stark-build/nationalbankbelgium-stark-build-10.2.4-2030164f.tgz", - "integrity": "sha512-8Oo031DJKYUz8X9sLNqDAVpuoPWslbLsltwT6LY7xxrmGF1jKTY+aikoJkgOh7sHAJkuqFEtP/qlzFgGWzjCIA==", + "version": "10.3.0-7cb334fc", + "resolved": "file:../dist/packages-dist/stark-build/nationalbankbelgium-stark-build-10.3.0-7cb334fc.tgz", + "integrity": "sha512-EvWkbcPjCXVJXRW8BbkqwHtRLpkXdM6pGoEi7QMCx0RcG+zmINZYKGHXer5RCoUUh2qeTtEkToHMY1wSTQGtxw==", "dev": true, "license": "MIT", "dependencies": { @@ -3105,9 +3105,9 @@ } }, "node_modules/@nationalbankbelgium/stark-core": { - "version": "10.2.4-2030164f", - "resolved": "file:../dist/packages-dist/stark-core/nationalbankbelgium-stark-core-10.2.4-2030164f.tgz", - "integrity": "sha512-0NVoUsoHZO33n4ze6QHmwCQiEc0d5oDlac0123pDfU1z3z8havH9EyOaeT6io+tntcvNfExz04dQopPECGK7fQ==", + "version": "10.3.0-7cb334fc", + "resolved": "file:../dist/packages-dist/stark-core/nationalbankbelgium-stark-core-10.3.0-7cb334fc.tgz", + "integrity": "sha512-CfmA8TALIyXNMj7ZWZoQmzI0dlwRzqrnqGZMDbv5QrFPSYfCdc1sWYLHwdMvgZJGYhF6vP2a8NhwIM4xKRApDw==", "license": "MIT", "dependencies": { "@angularclass/hmr": "^3.0.0", @@ -3152,9 +3152,9 @@ } }, "node_modules/@nationalbankbelgium/stark-rbac": { - "version": "10.2.4-2030164f", - "resolved": "file:../dist/packages-dist/stark-rbac/nationalbankbelgium-stark-rbac-10.2.4-2030164f.tgz", - "integrity": "sha512-IPiT/TMxnPToyPFaKGj8w2hpCoIjt6QPgUE/ruDhDeRSnrRerVZLdWqX6JIb5VlmHizAEycpOtHc4XxVPvL6HA==", + "version": "10.3.0-7cb334fc", + "resolved": "file:../dist/packages-dist/stark-rbac/nationalbankbelgium-stark-rbac-10.3.0-7cb334fc.tgz", + "integrity": "sha512-v9adB0eRc7Tmt9VKOispuUlgby/cJy8B23DpyFmZkDI2JXW4QOarZkDsAr4i8REhhNonoK2nSchB/oTCSrnLTA==", "license": "MIT", "dependencies": { "@types/lodash-es": "^4.17.4", @@ -3165,13 +3165,13 @@ "npm": ">=5.6.0" }, "peerDependencies": { - "@nationalbankbelgium/stark-core": "10.2.4-2030164f" + "@nationalbankbelgium/stark-core": "10.3.0-7cb334fc" } }, "node_modules/@nationalbankbelgium/stark-testing": { - "version": "10.2.4-2030164f", - "resolved": "file:../dist/packages-dist/stark-testing/nationalbankbelgium-stark-testing-10.2.4-2030164f.tgz", - "integrity": "sha512-WT1cwTCifJ5Ub9WjfGcd59rM4kb6PeAa+4DdTqh7nO9acszbv8dkvdQFs8OLIErqStfUI8EVYpnrB8IxPPfjZA==", + "version": "10.3.0-7cb334fc", + "resolved": "file:../dist/packages-dist/stark-testing/nationalbankbelgium-stark-testing-10.3.0-7cb334fc.tgz", + "integrity": "sha512-+OhsNyT6ATJjc1e0A7Rr2fOSbkjghDD1xdC4Liho37eqwo6JLKHF9NUZ84yPIiZMGZIqr5njmqVNHWRquAPHbA==", "dev": true, "license": "MIT", "dependencies": { @@ -3199,9 +3199,9 @@ } }, "node_modules/@nationalbankbelgium/stark-ui": { - "version": "10.2.4-2030164f", - "resolved": "file:../dist/packages-dist/stark-ui/nationalbankbelgium-stark-ui-10.2.4-2030164f.tgz", - "integrity": "sha512-rzEa1a2NDskw0DEnB8au0TFgVNuiFnTslqpS7xiIKFPmLr5lk1ANbOik6oyBxrRh3azSieeuNFBA2fpKeuPQew==", + "version": "10.3.0-7cb334fc", + "resolved": "file:../dist/packages-dist/stark-ui/nationalbankbelgium-stark-ui-10.3.0-7cb334fc.tgz", + "integrity": "sha512-8rd/GEuLQDV3QfK5gJr2ahC1d6JRIhqfzYlbZ2+phDwMka0JEc+a2seFxvtoBwTEjWnCJKzzoNhzEPauRSVTwg==", "license": "MIT", "dependencies": { "@angular/material-moment-adapter": "^7.0.0", @@ -3228,7 +3228,7 @@ "@angular/cdk": "^7.0.0", "@angular/forms": "^7.0.0", "@angular/material": "^7.0.0", - "@nationalbankbelgium/stark-core": "10.2.4-2030164f" + "@nationalbankbelgium/stark-core": "10.3.0-7cb334fc" } }, "node_modules/@ng-idle/core": { @@ -26983,8 +26983,8 @@ "integrity": "sha512-vI9TvyTNRQQBqJH1ek/7AoDL8ovMDszWO2Ce+jq2wVAQAH9z+47gX4589ExykD5ZOH0+itpE5of28HyQxd4FvQ==" }, "@nationalbankbelgium/stark-build": { - "version": "file:../dist/packages-dist/stark-build/nationalbankbelgium-stark-build-10.2.4-2030164f.tgz", - "integrity": "sha512-8Oo031DJKYUz8X9sLNqDAVpuoPWslbLsltwT6LY7xxrmGF1jKTY+aikoJkgOh7sHAJkuqFEtP/qlzFgGWzjCIA==", + "version": "file:..\\dist\\packages-dist\\stark-build\\nationalbankbelgium-stark-build-10.3.0-7cb334fc.tgz", + "integrity": "sha512-EvWkbcPjCXVJXRW8BbkqwHtRLpkXdM6pGoEi7QMCx0RcG+zmINZYKGHXer5RCoUUh2qeTtEkToHMY1wSTQGtxw==", "dev": true, "requires": { "@angular-builders/custom-webpack": "^7.3.1", @@ -27014,8 +27014,8 @@ } }, "@nationalbankbelgium/stark-core": { - "version": "file:../dist/packages-dist/stark-core/nationalbankbelgium-stark-core-10.2.4-2030164f.tgz", - "integrity": "sha512-0NVoUsoHZO33n4ze6QHmwCQiEc0d5oDlac0123pDfU1z3z8havH9EyOaeT6io+tntcvNfExz04dQopPECGK7fQ==", + "version": "file:..\\dist\\packages-dist\\stark-core\\nationalbankbelgium-stark-core-10.3.0-7cb334fc.tgz", + "integrity": "sha512-CfmA8TALIyXNMj7ZWZoQmzI0dlwRzqrnqGZMDbv5QrFPSYfCdc1sWYLHwdMvgZJGYhF6vP2a8NhwIM4xKRApDw==", "requires": { "@angularclass/hmr": "^3.0.0", "@ng-idle/core": "^7.0.0-beta.1", @@ -27045,16 +27045,16 @@ } }, "@nationalbankbelgium/stark-rbac": { - "version": "file:../dist/packages-dist/stark-rbac/nationalbankbelgium-stark-rbac-10.2.4-2030164f.tgz", - "integrity": "sha512-IPiT/TMxnPToyPFaKGj8w2hpCoIjt6QPgUE/ruDhDeRSnrRerVZLdWqX6JIb5VlmHizAEycpOtHc4XxVPvL6HA==", + "version": "file:..\\dist\\packages-dist\\stark-rbac\\nationalbankbelgium-stark-rbac-10.3.0-7cb334fc.tgz", + "integrity": "sha512-v9adB0eRc7Tmt9VKOispuUlgby/cJy8B23DpyFmZkDI2JXW4QOarZkDsAr4i8REhhNonoK2nSchB/oTCSrnLTA==", "requires": { "@types/lodash-es": "^4.17.4", "tslib": "^1.9.0" } }, "@nationalbankbelgium/stark-testing": { - "version": "file:../dist/packages-dist/stark-testing/nationalbankbelgium-stark-testing-10.2.4-2030164f.tgz", - "integrity": "sha512-WT1cwTCifJ5Ub9WjfGcd59rM4kb6PeAa+4DdTqh7nO9acszbv8dkvdQFs8OLIErqStfUI8EVYpnrB8IxPPfjZA==", + "version": "file:..\\dist\\packages-dist\\stark-testing\\nationalbankbelgium-stark-testing-10.3.0-7cb334fc.tgz", + "integrity": "sha512-+OhsNyT6ATJjc1e0A7Rr2fOSbkjghDD1xdC4Liho37eqwo6JLKHF9NUZ84yPIiZMGZIqr5njmqVNHWRquAPHbA==", "dev": true, "requires": { "@types/jasmine": "~3.6.4", @@ -27077,8 +27077,8 @@ } }, "@nationalbankbelgium/stark-ui": { - "version": "file:../dist/packages-dist/stark-ui/nationalbankbelgium-stark-ui-10.2.4-2030164f.tgz", - "integrity": "sha512-rzEa1a2NDskw0DEnB8au0TFgVNuiFnTslqpS7xiIKFPmLr5lk1ANbOik6oyBxrRh3azSieeuNFBA2fpKeuPQew==", + "version": "file:..\\dist\\packages-dist\\stark-ui\\nationalbankbelgium-stark-ui-10.3.0-7cb334fc.tgz", + "integrity": "sha512-8rd/GEuLQDV3QfK5gJr2ahC1d6JRIhqfzYlbZ2+phDwMka0JEc+a2seFxvtoBwTEjWnCJKzzoNhzEPauRSVTwg==", "requires": { "@angular/material-moment-adapter": "^7.0.0", "@mdi/angular-material": "^4.0.96", diff --git a/showcase/package.json b/showcase/package.json index dd31e8da07..d80631156c 100644 --- a/showcase/package.json +++ b/showcase/package.json @@ -120,9 +120,9 @@ "@angular/platform-server": "~7.2.2", "@angular/router": "~7.2.2", "@nationalbankbelgium/code-style": "^1.4.0", - "@nationalbankbelgium/stark-core": "file:../dist/packages-dist/stark-core/nationalbankbelgium-stark-core-10.2.4-2030164f.tgz", - "@nationalbankbelgium/stark-rbac": "file:../dist/packages-dist/stark-rbac/nationalbankbelgium-stark-rbac-10.2.4-2030164f.tgz", - "@nationalbankbelgium/stark-ui": "file:../dist/packages-dist/stark-ui/nationalbankbelgium-stark-ui-10.2.4-2030164f.tgz", + "@nationalbankbelgium/stark-core": "file:../dist/packages-dist/stark-core/nationalbankbelgium-stark-core-10.3.0-7cb334fc.tgz", + "@nationalbankbelgium/stark-rbac": "file:../dist/packages-dist/stark-rbac/nationalbankbelgium-stark-rbac-10.3.0-7cb334fc.tgz", + "@nationalbankbelgium/stark-ui": "file:../dist/packages-dist/stark-ui/nationalbankbelgium-stark-ui-10.3.0-7cb334fc.tgz", "@uirouter/visualizer": "~7.2.1", "angular-in-memory-web-api": "~0.8.0", "basscss": "~8.1.0", @@ -139,8 +139,8 @@ }, "devDependencies": { "@compodoc/compodoc": "1.1.13", - "@nationalbankbelgium/stark-build": "file:../dist/packages-dist/stark-build/nationalbankbelgium-stark-build-10.2.4-2030164f.tgz", - "@nationalbankbelgium/stark-testing": "file:../dist/packages-dist/stark-testing/nationalbankbelgium-stark-testing-10.2.4-2030164f.tgz", + "@nationalbankbelgium/stark-build": "file:../dist/packages-dist/stark-build/nationalbankbelgium-stark-build-10.3.0-7cb334fc.tgz", + "@nationalbankbelgium/stark-testing": "file:../dist/packages-dist/stark-testing/nationalbankbelgium-stark-testing-10.3.0-7cb334fc.tgz", "@types/core-js": "~2.5.4", "@types/hammerjs": "~2.0.39", "@types/node": "~10.17.54", diff --git a/starter/package.json b/starter/package.json index 55dc20dc48..f799f42a28 100644 --- a/starter/package.json +++ b/starter/package.json @@ -127,8 +127,8 @@ "@angular/platform-server": "~7.2.2", "@angular/router": "~7.2.2", "@nationalbankbelgium/code-style": "^1.2.0", - "@nationalbankbelgium/stark-core": "latest", - "@nationalbankbelgium/stark-ui": "latest", + "@nationalbankbelgium/stark-core": "file:../dist/packages-dist/stark-core/nationalbankbelgium-stark-core-10.3.0-7cb334fc.tgz", + "@nationalbankbelgium/stark-ui": "file:../dist/packages-dist/stark-ui/nationalbankbelgium-stark-ui-10.3.0-7cb334fc.tgz", "@uirouter/visualizer": "~7.2.1", "core-js": "~3.8.0", "eligrey-classlist-js-polyfill": "~1.2.20180112", @@ -143,8 +143,8 @@ }, "devDependencies": { "@compodoc/compodoc": "1.1.13", - "@nationalbankbelgium/stark-build": "latest", - "@nationalbankbelgium/stark-testing": "latest", + "@nationalbankbelgium/stark-build": "file:../dist/packages-dist/stark-build/nationalbankbelgium-stark-build-10.3.0-7cb334fc.tgz", + "@nationalbankbelgium/stark-testing": "file:../dist/packages-dist/stark-testing/nationalbankbelgium-stark-testing-10.3.0-7cb334fc.tgz", "@types/core-js": "~2.5.0", "@types/hammerjs": "~2.0.36", "@types/node": "~10.17.13",