Skip to content

Commit

Permalink
Switch from href-to to link-to for QP persistence
Browse files Browse the repository at this point in the history
  • Loading branch information
DingoEatingFuzz committed Oct 24, 2017
1 parent c2aba57 commit 855ebf9
Show file tree
Hide file tree
Showing 15 changed files with 37 additions and 37 deletions.
18 changes: 0 additions & 18 deletions ui/app/helpers/href-to-spread.js

This file was deleted.

4 changes: 2 additions & 2 deletions ui/app/templates/allocations/allocation.hbs
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
<section class="section">
<h1 class="title">Allocation {{model.name}}</h1>
<h3 class="subtitle">
For job <a href="{{href-to "jobs.job" model.job}}">{{model.job.name}}</a>
on node <a href="{{href-to "nodes.node" model.node}}">{{model.node.shortId}}</a>
For job {{#link-to "jobs.job" model.job}}{{model.job.name}}{{/link-to}}
on node {{#link-to "nodes.node" model.node}}{{model.node.shortId}}{{/link-to}}
</h3>

<div class="message">
Expand Down
8 changes: 4 additions & 4 deletions ui/app/templates/components/allocation-row.hbs
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<td>
<a href="{{href-to "allocations.allocation" allocation}}" class="is-primary">
{{#link-to "allocations.allocation" allocation class="is-primary"}}
{{allocation.shortId}}
</a>
{{/link-to}}
</td>
<td>{{allocation.modifyIndex}}</td>
<td>{{allocation.name}}</td>
Expand All @@ -10,13 +10,13 @@
</td>
{{#if (eq context "job")}}
<td>{{allocation.jobVersion}}</td>
<td><a href="{{href-to "nodes.node" allocation.node}}">{{allocation.node.shortId}}</a></td>
<td>{{#link-to "nodes.node" allocation.node}}{{allocation.node.shortId}}{{/link-to}}</td>
{{else if (eq context "node")}}
<td>
{{#if (or allocation.job.isPending allocation.job.isReloading)}}
...
{{else}}
<a href="{{href-to "jobs.job" allocation.job}}">{{allocation.job.name}}</a>
{{#link-to "jobs.job" allocation.job}}{{allocation.job.name}}{{/link-to}}
<span class="is-faded">/ {{allocation.taskGroup.name}}</span>
{{/if}}
</td>
Expand Down
2 changes: 1 addition & 1 deletion ui/app/templates/components/client-node-row.hbs
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
<td><a href="{{href-to "nodes.node" node.id}}" class="is-primary">{{node.shortId}}</a></td>
<td>{{#link-to "nodes.node" node.id class="is-primary"}}{{node.shortId}}{{/link-to}}</td>
<td class="is-200px is-truncatable" title="{{node.name}}">{{node.name}}</td>
<td>{{node.status}}</td>
<td>{{node.address}}</td>
Expand Down
2 changes: 1 addition & 1 deletion ui/app/templates/components/job-row.hbs
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
<td><a href="{{href-to "jobs.job" job.id}}" class="is-primary">{{job.name}}</a></td>
<td>{{#link-to "jobs.job" job.id class="is-primary"}}{{job.name}}{{/link-to}}</td>
<td>
<span class="tag {{job.statusClass}}">{{job.status}}</span>
</td>
Expand Down
2 changes: 1 addition & 1 deletion ui/app/templates/components/server-agent-row.hbs
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
<td><a href="{{href-to "servers.server" agent.id}}" class="is-primary">{{agent.name}}</a></td>
<td>{{#link-to "servers.server" agent.id class="is-primary"}}{{agent.name}}{{/link-to}}</td>
<td>{{agent.status}}</td>
<td>{{if agent.isLeader "True" "False"}}</td>
<td>{{agent.address}}</td>
Expand Down
6 changes: 5 additions & 1 deletion ui/app/templates/components/task-group-row.hbs
Original file line number Diff line number Diff line change
@@ -1,4 +1,8 @@
<td><a href="{{href-to "jobs.job.task-group" taskGroup.job taskGroup}}" class="is-primary">{{taskGroup.name}}</a></td>
<td>
{{#link-to "jobs.job.task-group" taskGroup.job taskGroup class="is-primary"}}
{{taskGroup.name}}
{{/link-to}}
</td>
<td>{{taskGroup.count}}</td>
<td>
<div class="inline-chart">{{allocation-status-bar allocationContainer=taskGroup.summary isNarrow=true}}</div>
Expand Down
2 changes: 1 addition & 1 deletion ui/app/templates/jobs/job/definition.hbs
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{{#global-header class="page-header"}}
{{#each breadcrumbs as |breadcrumb|}}
<a href="{{href-to-spread breadcrumb.args}}" class="breadcrumb">{{breadcrumb.label}}</a>
{{#link-to params=breadcrumb.args class="breadcrumb"}}{{breadcrumb.label}}{{/link-to}}
{{/each}}
{{/global-header}}
{{#gutter-menu class="page-body"}}
Expand Down
2 changes: 1 addition & 1 deletion ui/app/templates/jobs/job/deployments.hbs
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{{#global-header class="page-header"}}
{{#each breadcrumbs as |breadcrumb|}}
<a href="{{href-to-spread breadcrumb.args}}" class="breadcrumb">{{breadcrumb.label}}</a>
{{#link-to params=breadcrumb.args class="breadcrumb"}}{{breadcrumb.label}}{{/link-to}}
{{/each}}
{{/global-header}}
{{#gutter-menu class="page-body"}}
Expand Down
2 changes: 1 addition & 1 deletion ui/app/templates/jobs/job/index.hbs
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{{#global-header class="page-header"}}
{{#each breadcrumbs as |breadcrumb|}}
<a href="{{href-to-spread breadcrumb.args}}" class="breadcrumb">{{breadcrumb.label}}</a>
{{#link-to params=breadcrumb.args class="breadcrumb"}}{{breadcrumb.label}}{{/link-to}}
{{/each}}
{{/global-header}}
{{#gutter-menu class="page-body"}}
Expand Down
2 changes: 1 addition & 1 deletion ui/app/templates/jobs/job/loading.hbs
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{{#global-header class="page-header"}}
{{#each breadcrumbs as |breadcrumb|}}
<a href="{{href-to-spread breadcrumb.args}}" class="breadcrumb">{{breadcrumb.label}}</a>
{{#link-to params=breadcrumb.args class="breadcrumb"}}{{breadcrumb.label}}{{/link-to}}
{{/each}}
{{/global-header}}
{{#gutter-menu class="page-body"}}
Expand Down
2 changes: 1 addition & 1 deletion ui/app/templates/jobs/job/task-group.hbs
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{{#global-header class="page-header"}}
{{#each breadcrumbs as |breadcrumb|}}
<a href="{{href-to-spread breadcrumb.args}}" class="breadcrumb">{{breadcrumb.label}}</a>
{{#link-to params=breadcrumb.args class="breadcrumb"}}{{breadcrumb.label}}{{/link-to}}
{{/each}}
{{/global-header}}
{{#gutter-menu class="page-body"}}
Expand Down
2 changes: 1 addition & 1 deletion ui/app/templates/jobs/job/versions.hbs
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{{#global-header class="page-header"}}
{{#each breadcrumbs as |breadcrumb|}}
<a href="{{href-to-spread breadcrumb.args}}" class="breadcrumb">{{breadcrumb.label}}</a>
{{#link-to params=breadcrumb.args class="breadcrumb"}}{{breadcrumb.label}}{{/link-to}}
{{/each}}
{{/global-header}}
{{#gutter-menu class="page-body"}}
Expand Down
2 changes: 1 addition & 1 deletion ui/app/templates/nodes/node.hbs
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{{#global-header class="page-header"}}
<a href="{{href-to "nodes"}}" class="breadcrumb">Nodes</a>
{{#link-to "nodes" class="breadcrumb"}}Nodes{{/link-to}}
<span class="breadcrumb">{{model.shortId}}</span>
{{/global-header}}
{{#gutter-menu class="page-body"}}
Expand Down
18 changes: 16 additions & 2 deletions ui/tests/acceptance/job-detail-test.js
Original file line number Diff line number Diff line change
Expand Up @@ -58,8 +58,22 @@ test('each row in the task group table should show basic information about the t
const tasks = server.db.tasks.where({ taskGroupId: taskGroup.id });
const sum = (list, key) => list.reduce((sum, item) => sum + get(item, key), 0);

assert.equal(taskGroupRow.find('td:eq(0)').text(), taskGroup.name, 'Name');
assert.equal(taskGroupRow.find('td:eq(1)').text(), taskGroup.count, 'Count');
assert.equal(
taskGroupRow
.find('td:eq(0)')
.text()
.trim(),
taskGroup.name,
'Name'
);
assert.equal(
taskGroupRow
.find('td:eq(1)')
.text()
.trim(),
taskGroup.count,
'Count'
);
assert.equal(
taskGroupRow.find('td:eq(3)').text(),
`${sum(tasks, 'Resources.CPU')} MHz`,
Expand Down

0 comments on commit 855ebf9

Please sign in to comment.