Skip to content

Commit

Permalink
ui: hide triggered by and status filters for now (#12472)
Browse files Browse the repository at this point in the history
  • Loading branch information
lgfa29 authored Apr 6, 2022
1 parent 1334712 commit c24c1bf
Show file tree
Hide file tree
Showing 3 changed files with 52 additions and 31 deletions.
7 changes: 5 additions & 2 deletions ui/app/routes/evaluations/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,9 @@ export default class EvaluationsIndexRoute extends Route {
nextToken,
pageSize,
searchTerm,
// eslint-disable-next-line no-unused-vars
status,
// eslint-disable-next-line no-unused-vars
triggeredBy,
type,
qpNamespace: namespace,
Expand All @@ -57,8 +59,9 @@ export default class EvaluationsIndexRoute extends Route {
namespace,
per_page: pageSize,
next_token: nextToken,
status,
triggeredBy,
// TODO: add support for status and triggeredBy filters
//status,
//triggeredBy,
filter: generateFilter(),
});
}
Expand Down
18 changes: 10 additions & 8 deletions ui/app/templates/evaluations/index.hbs
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@
/>
</div>
<div class="toolbar-item is-right-aligned">
{{!-- TODO: add support for status and triggered by
<SingleSelectDropdown
data-test-evaluation-status-facet
@label="Status"
Expand All @@ -26,20 +27,21 @@
@selection={{this.triggeredBy}}
@onSelect={{action this.setQueryParam "triggeredBy"}}
/>
<SingleSelectDropdown
data-test-evaluation-namespace-facet
@label="Namespace"
@options={{this.optionsNamespaces}}
@selection={{this.qpNamespace}}
@onSelect={{action this.setQueryParam "qpNamespace"}}
/>
<SingleSelectDropdown
data-test-evaluation-type-facet
@label="Type"
@options={{this.optionsType}}
@selection={{this.type}}
@onSelect={{action this.setQueryParam "type"}}
/>
--}}
<SingleSelectDropdown
data-test-evaluation-namespace-facet
@label="Namespace"
@options={{this.optionsNamespaces}}
@selection={{this.qpNamespace}}
@onSelect={{action this.setQueryParam "qpNamespace"}}
/>
</div>
</div>
{{#if @model.length}}
Expand Down Expand Up @@ -71,7 +73,7 @@
<tr
data-test-evaluation="{{row.model.shortId}}"
style="cursor: pointer;"
class="{{if (eq this.currentEval row.model.id) "is-active"}}"
class="{{if (eq this.currentEval row.model.id) 'is-active'}}"
tabindex="0"
{{on "click" (fn this.handleEvaluationClick row.model)}}
{{on "keyup" (fn this.handleEvaluationClick row.model)}}
Expand Down
58 changes: 37 additions & 21 deletions ui/tests/acceptance/evaluations-test.js
Original file line number Diff line number Diff line change
Expand Up @@ -141,10 +141,11 @@ module('Acceptance | evaluations list', function (hooks) {
{
namespace: '*',
per_page: '25',
status: '',
next_token: '',
triggeredBy: '',
filter: '',
// TODO: add support for status and triggeredBy filters.
// status: '',
// triggeredBy: '',
},
'Forwards the correct query parameters on default query when route initially loads'
);
Expand All @@ -162,7 +163,8 @@ module('Acceptance | evaluations list', function (hooks) {
});

module('filters', function () {
test('it should enable filtering by evaluation status', async function (assert) {
// TODO: add support for status and triggeredBy filters.
test.skip('it should enable filtering by evaluation status', async function (assert) {
assert.expect(2);

server.get('/evaluations', getStandardRes);
Expand All @@ -185,12 +187,15 @@ module('Acceptance | evaluations list', function (hooks) {
return [];
});

// TODO: add support for status and triggeredBy filters.
/*
await clickTrigger('[data-test-evaluation-status-facet]');
await selectChoose('[data-test-evaluation-status-facet]', 'Pending');
assert
.dom('[data-test-no-eval-match]')
.exists('Renders a message saying no evaluations match filter status');
*/
});

test('it should enable filtering by namespace', async function (assert) {
Expand All @@ -206,10 +211,11 @@ module('Acceptance | evaluations list', function (hooks) {
{
namespace: 'default',
per_page: '25',
status: '',
next_token: '',
triggeredBy: '',
filter: '',
// TODO: add support for status and triggeredBy filters.
// status: '',
// triggeredBy: '',
},
'It makes another server request using the options selected by the user'
);
Expand All @@ -224,7 +230,8 @@ module('Acceptance | evaluations list', function (hooks) {
.exists('Renders a message saying no evaluations match filter status');
});

test('it should enable filtering by triggered by', async function (assert) {
// TODO: add support for status and triggeredBy filters.
test.skip('it should enable filtering by triggered by', async function (assert) {
assert.expect(2);

server.get('/evaluations', getStandardRes);
Expand Down Expand Up @@ -258,7 +265,8 @@ module('Acceptance | evaluations list', function (hooks) {
.exists('Renders a message saying no evaluations match filter status');
});

test('it should enable filtering by type', async function (assert) {
// TODO: add support for type filter.
test.skip('it should enable filtering by type', async function (assert) {
assert.expect(2);

server.get('/evaluations', getStandardRes);
Expand Down Expand Up @@ -303,10 +311,11 @@ module('Acceptance | evaluations list', function (hooks) {
{
namespace: '*',
per_page: '25',
status: '',
next_token: '',
triggeredBy: '',
filter: `ID contains "${searchTerm}" or JobID contains "${searchTerm}" or NodeID contains "${searchTerm}" or TriggeredBy contains "${searchTerm}"`,
// TODO: add support for status and triggeredBy filters.
// status: '',
// triggeredBy: '',
},
'It makes another server request using the options selected by the user'
);
Expand Down Expand Up @@ -341,10 +350,11 @@ module('Acceptance | evaluations list', function (hooks) {
{
namespace: '*',
per_page: '50',
status: '',
next_token: '',
triggeredBy: '',
filter: '',
// TODO: add support for status and triggeredBy filters.
// status: '',
// triggeredBy: '',
},
'It makes a request with the per_page set by the user'
);
Expand Down Expand Up @@ -376,10 +386,11 @@ module('Acceptance | evaluations list', function (hooks) {
{
namespace: '*',
per_page: '25',
status: '',
next_token: 'next-token-1',
triggeredBy: '',
filter: '',
// TODO: add support for status and triggeredBy filters.
// status: '',
// triggeredBy: '',
},
'It makes another server request using the options selected by the user'
);
Expand All @@ -403,10 +414,11 @@ module('Acceptance | evaluations list', function (hooks) {
{
namespace: '*',
per_page: '25',
status: '',
next_token: 'next-token-2',
triggeredBy: '',
filter: '',
// TODO: add support for status and triggeredBy filters.
// status: '',
// triggeredBy: '',
},
'It makes another server request using the options selected by the user'
);
Expand All @@ -430,10 +442,11 @@ module('Acceptance | evaluations list', function (hooks) {
{
namespace: '*',
per_page: '25',
status: '',
next_token: 'next-token-1',
triggeredBy: '',
filter: '',
// TODO: add support for status and triggeredBy filters.
// status: '',
// triggeredBy: '',
},
'It makes a request using the stored old token.'
);
Expand All @@ -452,10 +465,11 @@ module('Acceptance | evaluations list', function (hooks) {
{
namespace: '*',
per_page: '25',
status: '',
next_token: '',
triggeredBy: '',
filter: '',
// TODO: add support for status and triggeredBy filters.
// status: '',
// triggeredBy: '',
},
'When there are no more stored previous tokens, we will request with no next-token.'
);
Expand All @@ -469,7 +483,8 @@ module('Acceptance | evaluations list', function (hooks) {
await click('[data-test-eval-pagination-prev]');
});

test('it should clear all query parameters on refresh', async function (assert) {
// TODO: add support for status and triggeredBy filters.
test.skip('it should clear all query parameters on refresh', async function (assert) {
assert.expect(1);

server.get('/evaluations', function () {
Expand Down Expand Up @@ -514,7 +529,8 @@ module('Acceptance | evaluations list', function (hooks) {
await click('[data-test-eval-refresh]');
});

test('it should reset pagination when filters are applied', async function (assert) {
// TODO: add support for status and triggeredBy filters.
test.skip('it should reset pagination when filters are applied', async function (assert) {
assert.expect(1);

server.get('/evaluations', function () {
Expand Down

0 comments on commit c24c1bf

Please sign in to comment.