From 5d2688a25740b62807675e2e7b280a8bdc274e03 Mon Sep 17 00:00:00 2001 From: Phil Renaud Date: Fri, 8 Dec 2023 11:21:14 -0500 Subject: [PATCH] [ui] Two small UI quality of life changes (#19377) * Jobs index without groups * Download button only appears if you have content in your template * No longer need to test for the group count in jobs index --- .changelog/19377.txt | 3 +++ ui/app/templates/components/job-editor/edit.hbs | 2 +- ui/app/templates/components/job-page/parts/children.hbs | 3 --- ui/app/templates/components/job-row.hbs | 7 ------- ui/app/templates/jobs/index.hbs | 3 --- ui/tests/acceptance/jobs-list-test.js | 2 -- 6 files changed, 4 insertions(+), 16 deletions(-) create mode 100644 .changelog/19377.txt diff --git a/.changelog/19377.txt b/.changelog/19377.txt new file mode 100644 index 000000000..fdebb9d33 --- /dev/null +++ b/.changelog/19377.txt @@ -0,0 +1,3 @@ +```release-note:improvement +ui: dont allow new jobspec download until template is populated, and remove group count from jobs index +``` diff --git a/ui/app/templates/components/job-editor/edit.hbs b/ui/app/templates/components/job-editor/edit.hbs index 20f3f3182..371b779b4 100644 --- a/ui/app/templates/components/job-editor/edit.hbs +++ b/ui/app/templates/components/job-editor/edit.hbs @@ -114,6 +114,6 @@ @text="Save as .nomad.hcl" @color="secondary" {{on "click" @fns.onSaveFile}} - + disabled={{not @data.job._newDefinition}} /> diff --git a/ui/app/templates/components/job-page/parts/children.hbs b/ui/app/templates/components/job-page/parts/children.hbs index a7ef1b80c..492129d2d 100644 --- a/ui/app/templates/components/job-page/parts/children.hbs +++ b/ui/app/templates/components/job-page/parts/children.hbs @@ -52,9 +52,6 @@ Status - - Groups - Summary diff --git a/ui/app/templates/components/job-row.hbs b/ui/app/templates/components/job-row.hbs index a3cce9727..3f062378b 100644 --- a/ui/app/templates/components/job-row.hbs +++ b/ui/app/templates/components/job-row.hbs @@ -53,13 +53,6 @@ {{this.job.priority}} {{/if}} - - {{#if this.job.taskGroupCount}} - {{this.job.taskGroupCount}} - {{else}} - -- - {{/if}} -
{{#if this.job.hasChildren}} diff --git a/ui/app/templates/jobs/index.hbs b/ui/app/templates/jobs/index.hbs index 735827419..0c577a7e7 100644 --- a/ui/app/templates/jobs/index.hbs +++ b/ui/app/templates/jobs/index.hbs @@ -155,9 +155,6 @@ Priority - - Groups - Summary diff --git a/ui/tests/acceptance/jobs-list-test.js b/ui/tests/acceptance/jobs-list-test.js index 3de5597e8..820a2ad79 100644 --- a/ui/tests/acceptance/jobs-list-test.js +++ b/ui/tests/acceptance/jobs-list-test.js @@ -63,7 +63,6 @@ module('Acceptance | jobs list', function (hooks) { test('each job row should contain information about the job', async function (assert) { server.createList('job', 2); const job = server.db.jobs.sortBy('modifyIndex').reverse()[0]; - const taskGroups = server.db.taskGroups.where({ jobId: job.id }); await JobsList.visit(); @@ -76,7 +75,6 @@ module('Acceptance | jobs list', function (hooks) { assert.equal(jobRow.status, job.status, 'Status'); assert.equal(jobRow.type, typeForJob(job), 'Type'); assert.equal(jobRow.priority, job.priority, 'Priority'); - assert.equal(jobRow.taskGroups, taskGroups.length, '# Groups'); }); test('each job row should link to the corresponding job', async function (assert) {