Skip to content

Commit

Permalink
Fix scale and summary adapters to correct live reloading
Browse files Browse the repository at this point in the history
  • Loading branch information
DingoEatingFuzz committed Jul 29, 2020
1 parent cb801aa commit 6c6eb05
Show file tree
Hide file tree
Showing 4 changed files with 16 additions and 7 deletions.
6 changes: 5 additions & 1 deletion ui/app/adapters/job-scale.js
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
import WatchableNamespaceIDs from './watchable-namespace-ids';

export default class JobScaleAdapter extends WatchableNamespaceIDs {}
export default class JobScaleAdapter extends WatchableNamespaceIDs {
urlForFindRecord(id, type, hash) {
return super.urlForFindRecord(id, 'job', hash, 'scale');
}
}
6 changes: 5 additions & 1 deletion ui/app/adapters/job-summary.js
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
import WatchableNamespaceIDs from './watchable-namespace-ids';

export default class JobSummaryAdapter extends WatchableNamespaceIDs {}
export default class JobSummaryAdapter extends WatchableNamespaceIDs {
urlForFindRecord(id, type, hash) {
return super.urlForFindRecord(id, 'job', hash, 'summary');
}
}
3 changes: 2 additions & 1 deletion ui/app/adapters/watchable-namespace-ids.js
Original file line number Diff line number Diff line change
Expand Up @@ -35,9 +35,10 @@ export default class WatchableNamespaceIDs extends Watchable {
return associateNamespace(url, namespace);
}

urlForFindRecord(id, type, hash) {
urlForFindRecord(id, type, hash, pathSuffix) {
const [name, namespace] = JSON.parse(id);
let url = super.urlForFindRecord(name, type, hash);
if (pathSuffix) url += `/${pathSuffix}`;
return associateNamespace(url, namespace);
}

Expand Down
8 changes: 4 additions & 4 deletions ui/app/routes/jobs/job/task-group.js
Original file line number Diff line number Diff line change
Expand Up @@ -55,17 +55,17 @@ export default class TaskGroupRoute extends Route.extend(WithWatchers) {
const job = model.get('job');
controller.set('watchers', {
job: this.watchJob.perform(job),
summary: this.watchSummary.perform(job),
scale: this.watchScale.perform(job),
summary: this.watchSummary.perform(job.get('summary')),
scale: this.watchScale.perform(job.get('scaleState')),
allocations: this.watchAllocations.perform(job),
latestDeployment: job.get('supportsDeployments') && this.watchLatestDeployment.perform(job),
});
}
}

@watchRecord('job') watchJob;
@watchRelationship('job-summary') watchSummary;
@watchRelationship('job-scale') watchScale;
@watchRecord('job-summary') watchSummary;
@watchRecord('job-scale') watchScale;
@watchRelationship('allocations') watchAllocations;
@watchRelationship('latestDeployment') watchLatestDeployment;

Expand Down

0 comments on commit 6c6eb05

Please sign in to comment.