From 370952e39025805ee3097a36476eccaf3bf388c1 Mon Sep 17 00:00:00 2001 From: Phil Renaud Date: Thu, 11 Jul 2024 14:55:01 -0400 Subject: [PATCH] didUpdateAttributes manually called on modify (#23548) --- .changelog/23548.txt | 3 +++ ui/app/modifiers/code-mirror.js | 2 ++ ui/app/templates/components/job-editor.hbs | 30 ++++++++++------------ 3 files changed, 19 insertions(+), 16 deletions(-) create mode 100644 .changelog/23548.txt diff --git a/.changelog/23548.txt b/.changelog/23548.txt new file mode 100644 index 000000000..54881f1ce --- /dev/null +++ b/.changelog/23548.txt @@ -0,0 +1,3 @@ +```release-note:bug +ui: Fix the Upload Jobspec button on the Run Job page +``` diff --git a/ui/app/modifiers/code-mirror.js b/ui/app/modifiers/code-mirror.js index a73048a79..8710f11ba 100644 --- a/ui/app/modifiers/code-mirror.js +++ b/ui/app/modifiers/code-mirror.js @@ -31,6 +31,8 @@ export default class CodeMirrorModifier extends Modifier { this.element = element; this.args = { positional, named }; this._setup(); + } else { + this.didUpdateArguments(); } } diff --git a/ui/app/templates/components/job-editor.hbs b/ui/app/templates/components/job-editor.hbs index f9532e129..b788a285a 100644 --- a/ui/app/templates/components/job-editor.hbs +++ b/ui/app/templates/components/job-editor.hbs @@ -15,28 +15,26 @@

Paste or author HCL or JSON to submit to your cluster, or select from a list of templates. A plan will be requested before the job is submitted. You can also attach a job spec by uploading a job file or dragging & dropping a file to the editor.

- - {{#if (can "read variable" path="nomad/job-templates/*" namespace="*")}} - - + + + {{#if (can "read variable" path="nomad/job-templates/*" namespace="*")}} - - {{/if}} - + {{/if}} + {{/if}} {{did-update this.setDefinitionOnModel this.definition}}