Skip to content

Commit 145b240

Browse files
committed
Fix vai sort order, and sort all State columns by pseudo type and then name
1 parent 1dfd288 commit 145b240

2 files changed

Lines changed: 5 additions & 6 deletions

File tree

shell/config/pagination-table-headers.js

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -33,11 +33,10 @@ export const STEVE_ID_COL = {
3333
};
3434

3535
export const STEVE_STATE_COL = {
36-
...STATE,
3736
// Note, we're show the 'state' as per model, not the 'metadata.state.name' that's available in the model to remotely sort/filter
38-
// Need to investigate whether we should 'dumb down' the state we show to the native one (tracked via https://github.com/rancher/dashboard/issues/8527)
39-
// This means we'll show something different to what we sort and filter on.
40-
sort: ['metadata.state.name'],
37+
...STATE,
38+
// non vai sort works on colour --> name. the best we can do here is error --> transitioning --> name
39+
sort: ['desc:metadata.state.error', 'desc:metadata.state.transitioning', 'metadata.state.name'],
4140
search: 'metadata.state.name',
4241
};
4342

shell/utils/sort.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -177,8 +177,8 @@ export function compare(a, b) {
177177
export function parseField(str) {
178178
const parts = str.split(/:/);
179179

180-
if ( parts.length === 2 && parts[1] === 'desc' ) {
181-
return { field: parts[0], reverse: true };
180+
if ( parts.length === 2 && parts[0] === 'desc' ) {
181+
return { field: parts[1], reverse: true };
182182
} else {
183183
return { field: str, reverse: false };
184184
}

0 commit comments

Comments
 (0)