diff --git a/ui/app/components/job-page/parts/children.js b/ui/app/components/job-page/parts/children.js index 20f72910d..37aed7bae 100644 --- a/ui/app/components/job-page/parts/children.js +++ b/ui/app/components/job-page/parts/children.js @@ -19,9 +19,6 @@ export default class Children extends Component.extend(Sortable) { sortDescending = null; currentPage = null; - // Provide an action with access to the router - gotoJob() {} - @readOnly('userSettings.pageSize') pageSize; @computed('job.taskGroups.[]') diff --git a/ui/app/components/job-row.js b/ui/app/components/job-row.js index 7413827b0..5d5dbd056 100644 --- a/ui/app/components/job-row.js +++ b/ui/app/components/job-row.js @@ -1,5 +1,6 @@ -import { inject as service } from '@ember/service'; import Component from '@ember/component'; +import { action } from '@ember/object'; +import { inject as service } from '@ember/service'; import { lazyClick } from '../helpers/lazy-click'; import { classNames, tagName } from '@ember-decorators/component'; import classic from 'ember-classic-decorator'; @@ -8,8 +9,9 @@ import classic from 'ember-classic-decorator'; @tagName('tr') @classNames('job-row', 'is-interactive') export default class JobRow extends Component { - @service system; + @service router; @service store; + @service system; job = null; @@ -17,9 +19,15 @@ export default class JobRow extends Component { // based on the relationship of this job to others. context = 'independent'; - onClick() {} - click(event) { - lazyClick([this.onClick, event]); + lazyClick([this.gotoJob, event]); + } + + @action + gotoJob() { + const { job } = this; + this.router.transitionTo('jobs.job', job, { + queryParams: { namespace: job.get('namespace.name') }, + }); } } diff --git a/ui/app/controllers/jobs/index.js b/ui/app/controllers/jobs/index.js index ff38e023b..f47792c03 100644 --- a/ui/app/controllers/jobs/index.js +++ b/ui/app/controllers/jobs/index.js @@ -260,11 +260,4 @@ export default class IndexController extends Controller.extend( setFacetQueryParam(queryParam, selection) { this.set(queryParam, serialize(selection)); } - - @action - gotoJob(job) { - this.transitionToRoute('jobs.job', job.get('plainId'), { - queryParams: { namespace: job.get('namespace.name') }, - }); - } } diff --git a/ui/app/templates/components/job-page/parameterized.hbs b/ui/app/templates/components/job-page/parameterized.hbs index 30368532a..0277a089e 100644 --- a/ui/app/templates/components/job-page/parameterized.hbs +++ b/ui/app/templates/components/job-page/parameterized.hbs @@ -12,7 +12,6 @@ @sortProperty={{@sortProperty}} @sortDescending={{@sortDescending}} @currentPage={{@currentPage}} - @gotoJob={{@gotoJob}} /> diff --git a/ui/app/templates/components/job-page/parts/children.hbs b/ui/app/templates/components/job-page/parts/children.hbs index dc6c27517..89da35b6a 100644 --- a/ui/app/templates/components/job-page/parts/children.hbs +++ b/ui/app/templates/components/job-page/parts/children.hbs @@ -64,12 +64,7 @@ - +
diff --git a/ui/app/templates/components/job-page/periodic.hbs b/ui/app/templates/components/job-page/periodic.hbs index a94ded039..dfef27fc3 100644 --- a/ui/app/templates/components/job-page/periodic.hbs +++ b/ui/app/templates/components/job-page/periodic.hbs @@ -29,7 +29,6 @@ @sortProperty={{@sortProperty}} @sortDescending={{@sortDescending}} @currentPage={{@currentPage}} - @gotoJob={{@gotoJob}} /> diff --git a/ui/app/templates/jobs/index.hbs b/ui/app/templates/jobs/index.hbs index 3962ac332..903453591 100644 --- a/ui/app/templates/jobs/index.hbs +++ b/ui/app/templates/jobs/index.hbs @@ -7,13 +7,21 @@ data-test-jobs-search @searchTerm={{mut this.searchTerm}} @onChange={{action this.resetPagination}} - @placeholder="Search jobs..." /> + @placeholder="Search jobs..." + /> {{/if}}
{{#if (media "isMobile")}}
{{#if (can "run job" namespace=this.qpNamespace)}} - Run Job + + Run Job + {{else}} + > + Run Job + {{/if}}
{{/if}} @@ -33,41 +43,52 @@ @label="Namespace" @options={{this.optionsNamespaces}} @selection={{this.qpNamespace}} - @onSelect={{action (queue - (action this.cacheNamespace) - (action this.setFacetQueryParam "qpNamespace") - )}} /> + @onSelect={{action + (queue (action this.cacheNamespace) (action this.setFacetQueryParam "qpNamespace")) + }} + /> {{/if}} + @onSelect={{action this.setFacetQueryParam "qpType"}} + /> + @onSelect={{action this.setFacetQueryParam "qpStatus"}} + /> + @onSelect={{action this.setFacetQueryParam "qpDatacenter"}} + /> + @onSelect={{action this.setFacetQueryParam "qpPrefix"}} + /> {{#if (not (media "isMobile"))}}
{{#if (can "run job" namespace=this.qpNamespace)}} - Run Job + + Run Job + {{else}} + > + Run Job + {{/if}}
{{/if}} {{#if this.isForbidden}} - {{else}} - {{#if this.sortedJobs}} - - - - Name - {{#if this.system.shouldShowNamespaces}} - Namespace + {{else if this.sortedJobs}} + + + + + Name + + {{#if this.system.shouldShowNamespaces}} + + Namespace + + {{/if}} + + Status + + + Type + + + Priority + + + Groups + + + Summary + + + + + + +
+ +
- {{/if}} +
+ {{else}} +
+ {{#if (eq this.visibleJobs.length 0)}} +

+ No Jobs +

+

+ The cluster is currently empty. +

+ {{else if (eq this.filteredJobs.length 0)}} +

+ No Matches +

+

+ No jobs match your current filter selection. +

+ {{else if this.searchTerm}} +

+ No Matches +

+

+ No jobs match the term + + {{this.searchTerm}} + +

+ {{/if}} +
{{/if}} - + \ No newline at end of file