Skip to content

Commit

Permalink
Merge pull request #4539 from hashicorp/b-ui-job-version-mirage
Browse files Browse the repository at this point in the history
UI: Use the JobID as the Version ID for mirage job versions
  • Loading branch information
DingoEatingFuzz committed Jul 30, 2018
2 parents c6d9dba + 9023bb5 commit b10a2ab
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 0 deletions.
6 changes: 6 additions & 0 deletions ui/mirage/factories/job-version.js
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,12 @@ export default Factory.extend({
jobId: null,
version: 0,

// ID is used for record tracking within Mirage,
// but Nomad uses the JobID as the version ID.
tempVersionId() {
return this.job.id;
},

// Directive to restrict any related deployments from having a 'running' status
noActiveDeployment: false,

Expand Down
3 changes: 3 additions & 0 deletions ui/mirage/serializers/job-version.js
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,9 @@ export default ApplicationSerializer.extend({
hash.Diffs.push(version.Diff);
delete version.Diff;

// ID is used for record tracking within Mirage,
// but Nomad uses the JobID as the version ID.
version.ID = version.TempVersionID;
hash.Versions.push(version);
return hash;
},
Expand Down

0 comments on commit b10a2ab

Please sign in to comment.