Skip to content

Commit f041e08

Browse files
Fix scale and summary adapters to correct live reloading
1 parent a503191 commit f041e08

File tree

4 files changed

+16
-7
lines changed

4 files changed

+16
-7
lines changed

ui/app/adapters/job-scale.js

+5-1
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,7 @@
11
import WatchableNamespaceIDs from './watchable-namespace-ids';
22

3-
export default class JobScaleAdapter extends WatchableNamespaceIDs {}
3+
export default class JobScaleAdapter extends WatchableNamespaceIDs {
4+
urlForFindRecord(id, type, hash) {
5+
return super.urlForFindRecord(id, 'job', hash, 'scale');
6+
}
7+
}

ui/app/adapters/job-summary.js

+5-1
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,7 @@
11
import WatchableNamespaceIDs from './watchable-namespace-ids';
22

3-
export default class JobSummaryAdapter extends WatchableNamespaceIDs {}
3+
export default class JobSummaryAdapter extends WatchableNamespaceIDs {
4+
urlForFindRecord(id, type, hash) {
5+
return super.urlForFindRecord(id, 'job', hash, 'summary');
6+
}
7+
}

ui/app/adapters/watchable-namespace-ids.js

+2-1
Original file line numberDiff line numberDiff line change
@@ -35,9 +35,10 @@ export default class WatchableNamespaceIDs extends Watchable {
3535
return associateNamespace(url, namespace);
3636
}
3737

38-
urlForFindRecord(id, type, hash) {
38+
urlForFindRecord(id, type, hash, pathSuffix) {
3939
const [name, namespace] = JSON.parse(id);
4040
let url = super.urlForFindRecord(name, type, hash);
41+
if (pathSuffix) url += `/${pathSuffix}`;
4142
return associateNamespace(url, namespace);
4243
}
4344

ui/app/routes/jobs/job/task-group.js

+4-4
Original file line numberDiff line numberDiff line change
@@ -55,17 +55,17 @@ export default class TaskGroupRoute extends Route.extend(WithWatchers) {
5555
const job = model.get('job');
5656
controller.set('watchers', {
5757
job: this.watchJob.perform(job),
58-
summary: this.watchSummary.perform(job),
59-
scale: this.watchScale.perform(job),
58+
summary: this.watchSummary.perform(job.get('summary')),
59+
scale: this.watchScale.perform(job.get('scaleState')),
6060
allocations: this.watchAllocations.perform(job),
6161
latestDeployment: job.get('supportsDeployments') && this.watchLatestDeployment.perform(job),
6262
});
6363
}
6464
}
6565

6666
@watchRecord('job') watchJob;
67-
@watchRelationship('job-summary') watchSummary;
68-
@watchRelationship('job-scale') watchScale;
67+
@watchRecord('job-summary') watchSummary;
68+
@watchRecord('job-scale') watchScale;
6969
@watchRelationship('allocations') watchAllocations;
7070
@watchRelationship('latestDeployment') watchLatestDeployment;
7171

0 commit comments

Comments
 (0)