From ab5458387889156a5a8b105f8ba4e62267890b6f Mon Sep 17 00:00:00 2001 From: Michael Lange Date: Fri, 27 Jul 2018 16:31:25 -0700 Subject: [PATCH] Use the JobID as the Version ID for mirage job versions --- ui/mirage/factories/job-version.js | 6 ++++++ ui/mirage/serializers/job-version.js | 3 +++ 2 files changed, 9 insertions(+) diff --git a/ui/mirage/factories/job-version.js b/ui/mirage/factories/job-version.js index 9e545bd30..3e1db492d 100644 --- a/ui/mirage/factories/job-version.js +++ b/ui/mirage/factories/job-version.js @@ -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, diff --git a/ui/mirage/serializers/job-version.js b/ui/mirage/serializers/job-version.js index 49cb47bb1..9bf1d6bab 100644 --- a/ui/mirage/serializers/job-version.js +++ b/ui/mirage/serializers/job-version.js @@ -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; },