mirror of
https://github.com/kemko/nomad.git
synced 2026-01-01 16:05:42 +03:00
Fix navigation via clicking recent allocation row (#6087)
This fixes the recent allocation rows to navigate when clicking within them rather than just on the link, which matches the cursor behaviour.
This commit is contained in:
@@ -1,10 +1,13 @@
|
||||
import Component from '@ember/component';
|
||||
import { computed } from '@ember/object';
|
||||
import { inject as service } from '@ember/service';
|
||||
import PromiseArray from 'nomad-ui/utils/classes/promise-array';
|
||||
|
||||
export default Component.extend({
|
||||
classNames: ['boxed-section'],
|
||||
|
||||
router: service(),
|
||||
|
||||
sortProperty: 'modifyIndex',
|
||||
sortDescending: true,
|
||||
sortedAllocations: computed('job.allocations.@each.modifyIndex', function() {
|
||||
@@ -20,7 +23,7 @@ export default Component.extend({
|
||||
|
||||
actions: {
|
||||
gotoAllocation(allocation) {
|
||||
this.transitionToRoute('allocations.allocation', allocation);
|
||||
this.router.transitionTo('allocations.allocation', allocation.id);
|
||||
},
|
||||
},
|
||||
});
|
||||
|
||||
@@ -54,6 +54,19 @@ export default function moduleForJob(title, context, jobFactory, additionalTests
|
||||
assert.ok(JobDetail.allocationsSummary, 'Allocations are shown in the summary section');
|
||||
assert.notOk(JobDetail.childrenSummary, 'Children are not shown in the summary section');
|
||||
});
|
||||
|
||||
test('clicking in an allocation row navigates to that allocation', async function(assert) {
|
||||
const allocationRow = JobDetail.allocations[0];
|
||||
const allocationId = allocationRow.id;
|
||||
|
||||
await allocationRow.visitRow();
|
||||
|
||||
assert.equal(
|
||||
currentURL(),
|
||||
`/allocations/${allocationId}`,
|
||||
'Allocation row links to allocation detail'
|
||||
);
|
||||
});
|
||||
}
|
||||
|
||||
if (context === 'children') {
|
||||
|
||||
@@ -19,6 +19,7 @@ export default function(selector = '[data-test-allocation]', propKey = 'allocati
|
||||
rescheduled: isPresent('[data-test-indicators] [data-test-icon="reschedule"]'),
|
||||
|
||||
visit: clickable('[data-test-short-id] a'),
|
||||
visitRow: clickable(),
|
||||
visitJob: clickable('[data-test-job]'),
|
||||
visitClient: clickable('[data-test-client] a'),
|
||||
}),
|
||||
|
||||
Reference in New Issue
Block a user