From 18b8ba3ba8611f188562d41e549c0f5759eea0b0 Mon Sep 17 00:00:00 2001 From: Florian Steffens Date: Wed, 13 Sep 2023 16:21:05 +0200 Subject: [PATCH] fix(FE): parse values to ensure we have integer values - seems that in some older version we stored the ids as strings Signed-off-by: Florian Steffens --- .../components/ncTable/mixins/columnsTypes/selection.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/shared/components/ncTable/mixins/columnsTypes/selection.js b/src/shared/components/ncTable/mixins/columnsTypes/selection.js index e65fa9871..d106e64b9 100644 --- a/src/shared/components/ncTable/mixins/columnsTypes/selection.js +++ b/src/shared/components/ncTable/mixins/columnsTypes/selection.js @@ -28,10 +28,10 @@ export default class SelectionColumn extends AbstractSelectionColumn { sort(mode) { const factor = mode === 'DESC' ? -1 : 1 return (rowA, rowB) => { - const selectionIdA = rowA.data.find(item => item.columnId === this.id)?.value ?? null + const selectionIdA = parseInt(rowA.data.find(item => item.columnId === this.id)?.value ?? null) const vA = selectionIdA !== null ? this.selectionOptions.find(item => item.id === selectionIdA)?.label : '' const valueA = this.removeEmoji(vA).trim() - const selectionIdB = rowB.data.find(item => item.columnId === this.id)?.value ?? null + const selectionIdB = parseInt(rowB.data.find(item => item.columnId === this.id)?.value ?? null) const vB = selectionIdB !== null ? this.selectionOptions.find(item => item.id === selectionIdB)?.label : '' const valueB = this.removeEmoji(vB).trim() return ((valueA < valueB) ? -1 : (valueA > valueB) ? 1 : 0) * factor