Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Chronological most-recent evals by default #12847

Merged
merged 3 commits into from
May 5, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions .changelog/12847.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
```release-note:improvement
ui: change sort-order of evaluations to be reverse-chronological
```
1 change: 1 addition & 0 deletions ui/app/routes/evaluations/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -94,6 +94,7 @@ export default class EvaluationsIndexRoute extends Route {

return this.store.query('evaluation', {
namespace,
reverse: true,
per_page: pageSize,
next_token: nextToken,
filter: generateFilterExpression(),
Expand Down
17 changes: 17 additions & 0 deletions ui/tests/acceptance/evaluations-test.js
Original file line number Diff line number Diff line change
Expand Up @@ -143,6 +143,7 @@ module('Acceptance | evaluations list', function (hooks) {
per_page: '25',
next_token: '',
filter: '',
reverse: 'true',
},
'Forwards the correct query parameters on default query when route initially loads'
);
Expand Down Expand Up @@ -175,6 +176,7 @@ module('Acceptance | evaluations list', function (hooks) {
per_page: '25',
next_token: '',
filter: 'Status contains "pending"',
reverse: 'true',
},
'It makes another server request using the options selected by the user'
);
Expand Down Expand Up @@ -204,6 +206,7 @@ module('Acceptance | evaluations list', function (hooks) {
per_page: '25',
next_token: '',
filter: '',
reverse: 'true',
},
'It makes another server request using the options selected by the user'
);
Expand Down Expand Up @@ -233,6 +236,7 @@ module('Acceptance | evaluations list', function (hooks) {
per_page: '25',
next_token: '',
filter: `TriggeredBy contains "periodic-job"`,
reverse: 'true',
},
'It makes another server request using the options selected by the user'
);
Expand Down Expand Up @@ -265,6 +269,7 @@ module('Acceptance | evaluations list', function (hooks) {
per_page: '25',
next_token: '',
filter: 'NodeID is not empty',
reverse: 'true',
},
'It makes another server request using the options selected by the user'
);
Expand Down Expand Up @@ -295,6 +300,7 @@ module('Acceptance | evaluations list', function (hooks) {
per_page: '25',
next_token: '',
filter: `ID contains "${searchTerm}" or JobID contains "${searchTerm}" or NodeID contains "${searchTerm}" or TriggeredBy contains "${searchTerm}"`,
reverse: 'true',
},
'It makes another server request using the options selected by the user'
);
Expand Down Expand Up @@ -324,6 +330,7 @@ module('Acceptance | evaluations list', function (hooks) {
per_page: '25',
next_token: '',
filter: `ID contains "${searchTerm}" or JobID contains "${searchTerm}" or NodeID contains "${searchTerm}" or TriggeredBy contains "${searchTerm}"`,
reverse: 'true',
},
'It makes another server request using the options selected by the user'
);
Expand All @@ -339,6 +346,7 @@ module('Acceptance | evaluations list', function (hooks) {
per_page: '25',
next_token: '',
filter: `(ID contains "${searchTerm}" or JobID contains "${searchTerm}" or NodeID contains "${searchTerm}" or TriggeredBy contains "${searchTerm}") and NodeID is not empty`,
reverse: 'true',
},
'It makes another server request using the options selected by the user'
);
Expand All @@ -355,6 +363,7 @@ module('Acceptance | evaluations list', function (hooks) {
per_page: '25',
next_token: '',
filter: `NodeID is not empty`,
reverse: 'true',
},
'It makes another server request using the options selected by the user'
);
Expand All @@ -370,6 +379,7 @@ module('Acceptance | evaluations list', function (hooks) {
per_page: '25',
next_token: '',
filter: `NodeID is not empty and Status contains "complete"`,
reverse: 'true',
},
'It makes another server request using the options selected by the user'
);
Expand Down Expand Up @@ -406,6 +416,7 @@ module('Acceptance | evaluations list', function (hooks) {
per_page: '50',
next_token: '',
filter: '',
reverse: 'true',
},
'It makes a request with the per_page set by the user'
);
Expand Down Expand Up @@ -439,6 +450,7 @@ module('Acceptance | evaluations list', function (hooks) {
per_page: '25',
next_token: 'next-token-1',
filter: '',
reverse: 'true',
},
'It makes another server request using the options selected by the user'
);
Expand All @@ -464,6 +476,7 @@ module('Acceptance | evaluations list', function (hooks) {
per_page: '25',
next_token: 'next-token-2',
filter: '',
reverse: 'true',
},
'It makes another server request using the options selected by the user'
);
Expand All @@ -489,6 +502,7 @@ module('Acceptance | evaluations list', function (hooks) {
per_page: '25',
next_token: 'next-token-1',
filter: '',
reverse: 'true',
},
'It makes a request using the stored old token.'
);
Expand All @@ -509,6 +523,7 @@ module('Acceptance | evaluations list', function (hooks) {
per_page: '25',
next_token: '',
filter: '',
reverse: 'true',
},
'When there are no more stored previous tokens, we will request with no next-token.'
);
Expand Down Expand Up @@ -552,6 +567,7 @@ module('Acceptance | evaluations list', function (hooks) {
per_page: '25',
next_token: '',
filter: '',
reverse: 'true',
},
'It clears all query parameters when making a refresh'
);
Expand Down Expand Up @@ -599,6 +615,7 @@ module('Acceptance | evaluations list', function (hooks) {
per_page: '25',
next_token: '',
filter: 'Status contains "pending"',
reverse: 'true',
},
'It clears all next token when filtered request is made'
);
Expand Down