From 5dd32abe5394470557b19e5c024e16baa7858883 Mon Sep 17 00:00:00 2001 From: Michael Lange Date: Wed, 25 Jul 2018 15:19:43 -0700 Subject: [PATCH] Use page-layout for job routes --- .../components/job-page/parts/body.hbs | 10 +- ui/app/templates/jobs.hbs | 7 +- ui/app/templates/jobs/index.hbs | 116 +++++------ ui/app/templates/jobs/job/definition.hbs | 16 +- ui/app/templates/jobs/job/deployments.hbs | 10 +- ui/app/templates/jobs/job/evaluations.hbs | 93 ++++----- ui/app/templates/jobs/job/loading.hbs | 6 +- ui/app/templates/jobs/job/task-group.hbs | 196 +++++++++--------- ui/app/templates/jobs/job/versions.hbs | 10 +- ui/app/templates/jobs/loading.hbs | 7 +- ui/app/templates/loading.hbs | 11 +- .../integration/job-page/parts/body-test.js | 4 - 12 files changed, 226 insertions(+), 260 deletions(-) diff --git a/ui/app/templates/components/job-page/parts/body.hbs b/ui/app/templates/components/job-page/parts/body.hbs index f139b52ab2d..4a2b8f89f49 100644 --- a/ui/app/templates/components/job-page/parts/body.hbs +++ b/ui/app/templates/components/job-page/parts/body.hbs @@ -1,6 +1,4 @@ -{{#gutter-menu class="page-body"}} - {{partial "jobs/job/subnav"}} -
- {{yield}} -
-{{/gutter-menu}} +{{partial "jobs/job/subnav"}} +
+ {{yield}} +
diff --git a/ui/app/templates/jobs.hbs b/ui/app/templates/jobs.hbs index a766b9ff647..87dfce6a760 100644 --- a/ui/app/templates/jobs.hbs +++ b/ui/app/templates/jobs.hbs @@ -1,6 +1,3 @@ -
- {{#global-header class="page-header"}} - {{app-breadcrumbs}} - {{/global-header}} +{{#page-layout}} {{outlet}} -
+{{/page-layout}} diff --git a/ui/app/templates/jobs/index.hbs b/ui/app/templates/jobs/index.hbs index a18b2b1c801..3985b9f0008 100644 --- a/ui/app/templates/jobs/index.hbs +++ b/ui/app/templates/jobs/index.hbs @@ -1,60 +1,58 @@ -{{#gutter-menu class="page-body"}} -
- {{#if isForbidden}} - {{partial "partials/forbidden-message"}} - {{else}} - {{#if filteredJobs.length}} -
-
{{search-box data-test-jobs-search searchTerm=(mut searchTerm) placeholder="Search jobs..."}}
-
- {{/if}} - {{#list-pagination - source=sortedJobs - size=pageSize - page=currentPage as |p|}} - {{#list-table - source=p.list - sortProperty=sortProperty - sortDescending=sortDescending - class="with-foot" as |t|}} - {{#t.head}} - {{#t.sort-by prop="name"}}Name{{/t.sort-by}} - {{#t.sort-by prop="status"}}Status{{/t.sort-by}} - {{#t.sort-by prop="type"}}Type{{/t.sort-by}} - {{#t.sort-by prop="priority"}}Priority{{/t.sort-by}} - Groups - Summary - {{/t.head}} - {{#t.body key="model.id" as |row|}} - {{job-row data-test-job-row job=row.model onClick=(action "gotoJob" row.model)}} - {{/t.body}} - {{/list-table}} -
- -
- {{else}} -
- {{#if (eq filteredJobs.length 0)}} -

No Jobs

-

- The cluster is currently empty. -

- {{else if searchTerm}} -

No Matches

-

No jobs match the term {{searchTerm}}

- {{/if}} -
- {{/list-pagination}} +
+ {{#if isForbidden}} + {{partial "partials/forbidden-message"}} + {{else}} + {{#if filteredJobs.length}} +
+
{{search-box data-test-jobs-search searchTerm=(mut searchTerm) placeholder="Search jobs..."}}
+
{{/if}} -
-{{/gutter-menu}} + {{#list-pagination + source=sortedJobs + size=pageSize + page=currentPage as |p|}} + {{#list-table + source=p.list + sortProperty=sortProperty + sortDescending=sortDescending + class="with-foot" as |t|}} + {{#t.head}} + {{#t.sort-by prop="name"}}Name{{/t.sort-by}} + {{#t.sort-by prop="status"}}Status{{/t.sort-by}} + {{#t.sort-by prop="type"}}Type{{/t.sort-by}} + {{#t.sort-by prop="priority"}}Priority{{/t.sort-by}} + Groups + Summary + {{/t.head}} + {{#t.body key="model.id" as |row|}} + {{job-row data-test-job-row job=row.model onClick=(action "gotoJob" row.model)}} + {{/t.body}} + {{/list-table}} +
+ +
+ {{else}} +
+ {{#if (eq filteredJobs.length 0)}} +

No Jobs

+

+ The cluster is currently empty. +

+ {{else if searchTerm}} +

No Matches

+

No jobs match the term {{searchTerm}}

+ {{/if}} +
+ {{/list-pagination}} + {{/if}} +
diff --git a/ui/app/templates/jobs/job/definition.hbs b/ui/app/templates/jobs/job/definition.hbs index efe10b57849..2265ecdbe28 100644 --- a/ui/app/templates/jobs/job/definition.hbs +++ b/ui/app/templates/jobs/job/definition.hbs @@ -1,10 +1,8 @@ -{{#gutter-menu class="page-body"}} - {{partial "jobs/job/subnav"}} -
-
-
- {{json-viewer data-test-definition-view json=model.definition}} -
+{{partial "jobs/job/subnav"}} +
+
+
+ {{json-viewer data-test-definition-view json=model.definition}}
-
-{{/gutter-menu}} +
+
diff --git a/ui/app/templates/jobs/job/deployments.hbs b/ui/app/templates/jobs/job/deployments.hbs index bd67069d684..8bc4cb70790 100644 --- a/ui/app/templates/jobs/job/deployments.hbs +++ b/ui/app/templates/jobs/job/deployments.hbs @@ -1,6 +1,4 @@ -{{#gutter-menu class="page-body"}} - {{partial "jobs/job/subnav"}} -
- {{job-deployments-stream deployments=model.deployments}} -
-{{/gutter-menu}} +{{partial "jobs/job/subnav"}} +
+ {{job-deployments-stream deployments=model.deployments}} +
diff --git a/ui/app/templates/jobs/job/evaluations.hbs b/ui/app/templates/jobs/job/evaluations.hbs index ca660ff74e0..212b6ea426d 100644 --- a/ui/app/templates/jobs/job/evaluations.hbs +++ b/ui/app/templates/jobs/job/evaluations.hbs @@ -1,49 +1,46 @@ -{{#gutter-menu class="page-body"}} - {{partial "jobs/job/subnav"}} -
-
-
- Evaluations -
-
- {{#if sortedEvaluations.length}} - {{#list-table - source=sortedEvaluations - sortProperty=sortProperty - sortDescending=sortDescending as |t|}} - {{#t.head}} - ID - {{#t.sort-by prop="priority"}}Priority{{/t.sort-by}} - {{#t.sort-by prop="triggeredBy"}}Triggered By{{/t.sort-by}} - {{#t.sort-by prop="status"}}Status{{/t.sort-by}} - {{#t.sort-by prop="hasPlacementFailures"}}Placement Failures{{/t.sort-by}} - {{/t.head}} - {{#t.body as |row|}} - - {{row.model.shortId}} - {{row.model.priority}} - {{row.model.triggeredBy}} - {{row.model.status}} - - {{#if (eq row.model.status "blocked")}} - N/A - In Progress - {{else if row.model.hasPlacementFailures}} - True - {{else}} - False - {{/if}} - - - {{/t.body}} - {{/list-table}} - {{else}} -
-

No Evaluations

-

This is most likely due to garbage collection.

-
- {{/if}} +{{partial "jobs/job/subnav"}} +
+
+
+ Evaluations
-
-
-{{/gutter-menu}} - +
+ {{#if sortedEvaluations.length}} + {{#list-table + source=sortedEvaluations + sortProperty=sortProperty + sortDescending=sortDescending as |t|}} + {{#t.head}} + ID + {{#t.sort-by prop="priority"}}Priority{{/t.sort-by}} + {{#t.sort-by prop="triggeredBy"}}Triggered By{{/t.sort-by}} + {{#t.sort-by prop="status"}}Status{{/t.sort-by}} + {{#t.sort-by prop="hasPlacementFailures"}}Placement Failures{{/t.sort-by}} + {{/t.head}} + {{#t.body as |row|}} + + {{row.model.shortId}} + {{row.model.priority}} + {{row.model.triggeredBy}} + {{row.model.status}} + + {{#if (eq row.model.status "blocked")}} + N/A - In Progress + {{else if row.model.hasPlacementFailures}} + True + {{else}} + False + {{/if}} + + + {{/t.body}} + {{/list-table}} + {{else}} +
+

No Evaluations

+

This is most likely due to garbage collection.

+
+ {{/if}} +
+
+
diff --git a/ui/app/templates/jobs/job/loading.hbs b/ui/app/templates/jobs/job/loading.hbs index a90321c319a..911d511739d 100644 --- a/ui/app/templates/jobs/job/loading.hbs +++ b/ui/app/templates/jobs/job/loading.hbs @@ -1,4 +1,2 @@ -{{#gutter-menu class="page-body"}} - {{partial "jobs/job/subnav"}} -
{{partial "partials/loading-spinner"}}
-{{/gutter-menu}} +{{partial "jobs/job/subnav"}} +
{{partial "partials/loading-spinner"}}
diff --git a/ui/app/templates/jobs/job/task-group.hbs b/ui/app/templates/jobs/job/task-group.hbs index 3446a306f5f..0bf01cb84ca 100644 --- a/ui/app/templates/jobs/job/task-group.hbs +++ b/ui/app/templates/jobs/job/task-group.hbs @@ -1,109 +1,107 @@ -{{#gutter-menu class="page-body"}} -
- -
-
-

- {{model.name}} -

+
+
    +
  • {{#link-to "jobs.job.task-group" model.job model activeClass="is-active"}}Overview{{/link-to}}
  • +
+
+
+

+ {{model.name}} +

-
-
- Task Group Details +
+
+ Task Group Details - # Tasks {{model.tasks.length}} - Reserved CPU {{model.reservedCPU}} MHz - Reserved Memory {{model.reservedMemory}} MiB - Reserved Disk {{model.reservedEphemeralDisk}} MiB -
+ # Tasks {{model.tasks.length}} + Reserved CPU {{model.reservedCPU}} MHz + Reserved Memory {{model.reservedMemory}} MiB + Reserved Disk {{model.reservedEphemeralDisk}} MiB
+
-
-
-
Allocation Status {{allocations.length}}
-
-
- {{#allocation-status-bar allocationContainer=model.summary class="split-view" as |chart|}} -
    - {{#each chart.data as |datum index|}} -
  1. - - {{datum.value}} - - {{datum.label}} - -
  2. - {{/each}} -
- {{/allocation-status-bar}} -
+
+
+
Allocation Status {{allocations.length}}
+
+
+ {{#allocation-status-bar allocationContainer=model.summary class="split-view" as |chart|}} +
    + {{#each chart.data as |datum index|}} +
  1. + + {{datum.value}} + + {{datum.label}} + +
  2. + {{/each}} +
+ {{/allocation-status-bar}}
+
-
-
- Allocations - {{search-box - searchTerm=(mut searchTerm) - placeholder="Search allocations..." - class="is-inline pull-right" - inputClass="is-compact"}} -
-
- {{#list-pagination - source=sortedAllocations - size=pageSize - page=currentPage - class="allocations" as |p|}} - {{#list-table - source=p.list - sortProperty=sortProperty - sortDescending=sortDescending - class="with-foot" as |t|}} - {{#t.head}} - - {{#t.sort-by prop="shortId"}}ID{{/t.sort-by}} - {{#t.sort-by prop="modifyIndex" title="Modify Index"}}Modified{{/t.sort-by}} - {{#t.sort-by prop="name"}}Name{{/t.sort-by}} - {{#t.sort-by prop="statusIndex"}}Status{{/t.sort-by}} - {{#t.sort-by prop="jobVersion"}}Version{{/t.sort-by}} - {{#t.sort-by prop="node.shortId"}}Client{{/t.sort-by}} - CPU - Memory - {{/t.head}} - {{#t.body as |row|}} - {{allocation-row data-test-allocation=row.model.id allocation=row.model context="job" onClick=(action "gotoAllocation" row.model)}} - {{/t.body}} - {{/list-table}} -
- +
+
+ Allocations + {{search-box + searchTerm=(mut searchTerm) + placeholder="Search allocations..." + class="is-inline pull-right" + inputClass="is-compact"}} +
+
+ {{#list-pagination + source=sortedAllocations + size=pageSize + page=currentPage + class="allocations" as |p|}} + {{#list-table + source=p.list + sortProperty=sortProperty + sortDescending=sortDescending + class="with-foot" as |t|}} + {{#t.head}} + + {{#t.sort-by prop="shortId"}}ID{{/t.sort-by}} + {{#t.sort-by prop="modifyIndex" title="Modify Index"}}Modified{{/t.sort-by}} + {{#t.sort-by prop="name"}}Name{{/t.sort-by}} + {{#t.sort-by prop="statusIndex"}}Status{{/t.sort-by}} + {{#t.sort-by prop="jobVersion"}}Version{{/t.sort-by}} + {{#t.sort-by prop="node.shortId"}}Client{{/t.sort-by}} + CPU + Memory + {{/t.head}} + {{#t.body as |row|}} + {{allocation-row data-test-allocation=row.model.id allocation=row.model context="job" onClick=(action "gotoAllocation" row.model)}} + {{/t.body}} + {{/list-table}} +
+ +
+ {{else}} + {{#if allocations.length}} +
+
+

No Matches

+

No allocations match the term {{searchTerm}}

+
{{else}} - {{#if allocations.length}} -
-
-

No Matches

-

No allocations match the term {{searchTerm}}

-
-
- {{else}} -
-
-

No Allocations

-

No allocations have been placed.

-
+
+
+

No Allocations

+

No allocations have been placed.

- {{/if}} - {{/list-pagination}} -
+
+ {{/if}} + {{/list-pagination}}
-
-{{/gutter-menu}} + +
diff --git a/ui/app/templates/jobs/job/versions.hbs b/ui/app/templates/jobs/job/versions.hbs index 7e659a2372f..9f2d59b10fa 100644 --- a/ui/app/templates/jobs/job/versions.hbs +++ b/ui/app/templates/jobs/job/versions.hbs @@ -1,6 +1,4 @@ -{{#gutter-menu class="page-body"}} - {{partial "jobs/job/subnav"}} -
- {{job-versions-stream versions=model.versions verbose=true}} -
-{{/gutter-menu}} +{{partial "jobs/job/subnav"}} +
+ {{job-versions-stream versions=model.versions verbose=true}} +
diff --git a/ui/app/templates/jobs/loading.hbs b/ui/app/templates/jobs/loading.hbs index 39002f28aa7..ae06c3078ee 100644 --- a/ui/app/templates/jobs/loading.hbs +++ b/ui/app/templates/jobs/loading.hbs @@ -1,6 +1 @@ -{{#global-header class="page-header"}} - {{app-breadcrumbs}} -{{/global-header}} -{{#gutter-menu class="page-body"}} -
{{partial "partials/loading-spinner"}}
-{{/gutter-menu}} +
{{partial "partials/loading-spinner"}}
diff --git a/ui/app/templates/loading.hbs b/ui/app/templates/loading.hbs index 206f1ebac97..169d53ffba9 100644 --- a/ui/app/templates/loading.hbs +++ b/ui/app/templates/loading.hbs @@ -1,8 +1,3 @@ -
- {{#global-header class="page-header"}} - {{app-breadcrumbs}} - {{/global-header}} - {{#gutter-menu class="page-body"}} -
{{partial "partials/loading-spinner"}}
- {{/gutter-menu}} -
+{{#page-layout}} +
{{partial "partials/loading-spinner"}}
+{{/page-layout}} diff --git a/ui/tests/integration/job-page/parts/body-test.js b/ui/tests/integration/job-page/parts/body-test.js index 3454113acc5..6189dce66b2 100644 --- a/ui/tests/integration/job-page/parts/body-test.js +++ b/ui/tests/integration/job-page/parts/body-test.js @@ -97,10 +97,6 @@ test('body yields content to a section after the subnav', function(assert) { `); return wait().then(() => { - assert.ok( - find('[data-test-page-content] .section > .inner-content'), - 'Content is rendered in a section in a gutter menu' - ); assert.ok( find('[data-test-subnav="job"] + .section > .inner-content'), 'Content is rendered immediately after the subnav'