Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 6 additions & 1 deletion ui/app/models/job.js
Original file line number Diff line number Diff line change
Expand Up @@ -567,7 +567,12 @@ export default class Job extends Model {
return undefined;
}

@equal('type', 'service') supportsDeployments;
@computed('type')
get supportsDeployments() {
const { type } = this;
if (type === 'service' || type === 'system') return true;
return false;
}

@belongsTo('deployment', { inverse: 'jobForLatest' }) latestDeployment;

Expand Down
50 changes: 50 additions & 0 deletions ui/tests/acceptance/job-status-panel-test.js
Original file line number Diff line number Diff line change
Expand Up @@ -1013,5 +1013,55 @@ module('Acceptance | job status panel', function (hooks) {

assert.dom('.running-allocs-title').hasText('4 Allocations Running');
});

test('System jobs display deployments', async function (assert) {
this.store = this.owner.lookup('service:store');

server.db.nodes.remove();

server.createList('node', 3, {
status: 'ready',
drain: false,
schedulingEligibility: 'eligible',
});

let job = server.create('job', {
status: 'running',
datacenters: ['*'],
type: 'system',
activeDeployment: true,
createAllocations: true,
allocStatusDistribution: {
running: 0.5,
failed: 0.5,
unknown: 0,
lost: 0,
},
shallow: true,
version: 0,
});

await visit(`/jobs/${job.id}`);

assert.dom('.job-status-panel').exists().hasClass('active-deployment');
assert.dom('[data-test-tab="deployments"]').exists();

assert.dom('.job-status-panel h2').hasTextContaining('Status: Deploying');

const allocCount = server.schema.allocations.where({
jobId: job.id,
clientStatus: 'running',
}).length;

assert
.dom('.previous-allocations .represented-allocation')
.exists({ count: allocCount });

assert.dom('.job-status-panel').exists();

assert
.dom('.previous-allocations-heading')
.hasTextContaining(`Previous allocations: ${allocCount} running`);
});
});
});
9 changes: 9 additions & 0 deletions ui/tests/acceptance/keyboard-test.js
Original file line number Diff line number Diff line change
Expand Up @@ -368,6 +368,15 @@ module('Acceptance | keyboard', function (hooks) {
'Shift+ArrowRight takes you to the next tab (Version)'
);

await triggerKeyEvent('.page-layout', 'keydown', 'ArrowRight', {
shiftKey: true,
});
assert.equal(
currentURL(),
`/jobs/${jobID}@default/deployments`,
'Shift+ArrowRight takes you to the next tab (Deployments)'
);

await triggerKeyEvent('.page-layout', 'keydown', 'ArrowRight', {
shiftKey: true,
});
Expand Down
Loading