Skip to content

Commit

Permalink
Add job-watching on versions route
Browse files Browse the repository at this point in the history
Without this, if the job’s current version is updated outside
the UI, the “Revert” button won’t be added to the formerly-
current version.
  • Loading branch information
backspace committed Apr 14, 2021
1 parent 8ac2558 commit b510957
Showing 1 changed file with 6 additions and 3 deletions.
9 changes: 6 additions & 3 deletions ui/app/routes/jobs/job/versions.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import Route from '@ember/routing/route';
import { collect } from '@ember/object/computed';
import { watchRelationship } from 'nomad-ui/utils/properties/watch';
import { watchRecord, watchRelationship } from 'nomad-ui/utils/properties/watch';
import WithWatchers from 'nomad-ui/mixins/with-watchers';

export default class VersionsRoute extends Route.extend(WithWatchers) {
Expand All @@ -11,10 +11,13 @@ export default class VersionsRoute extends Route.extend(WithWatchers) {

startWatchers(controller, model) {
if (model) {
controller.set('watcher', this.watchVersions.perform(model));
controller.set('watcher', this.watch.perform(model));
controller.set('watchVersions', this.watchVersions.perform(model));
}
}

@watchRecord('job') watch;
@watchRelationship('versions') watchVersions;
@collect('watchVersions') watchers;

@collect('watch', 'watchVersions') watchers;
}

0 comments on commit b510957

Please sign in to comment.