Skip to content

Commit

Permalink
didUpdateAttributes manually called on modify
Browse files Browse the repository at this point in the history
  • Loading branch information
philrenaud committed Jul 11, 2024
1 parent f3de47e commit 6a41f72
Show file tree
Hide file tree
Showing 3 changed files with 19 additions and 16 deletions.
3 changes: 3 additions & 0 deletions .changelog/23548.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
```release-note:bug
ui: Fix the Upload Jobspec button on the Run Job page
```
2 changes: 2 additions & 0 deletions ui/app/modifiers/code-mirror.js
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,8 @@ export default class CodeMirrorModifier extends Modifier {
this.element = element;
this.args = { positional, named };
this._setup();
} else {
this.didUpdateArguments();
}
}

Expand Down
30 changes: 14 additions & 16 deletions ui/app/templates/components/job-editor.hbs
Original file line number Diff line number Diff line change
Expand Up @@ -15,28 +15,26 @@
<p>
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 &amp; dropping a file to the editor.
</p>

{{#if (can "read variable" path="nomad/job-templates/*" namespace="*")}}
<Hds::ButtonSet>
<label
class="job-spec-upload hds-button hds-button--color-secondary hds-button--size-medium"
>
<div class="hds-button__text">Upload file</div>
<input
type="file"
onchange={{action this.uploadJobSpec}}
accept=".hcl,.json,.nomad"
/>
</label>
<Hds::ButtonSet>
<label
class="job-spec-upload hds-button hds-button--color-secondary hds-button--size-medium"
>
<div class="hds-button__text">Upload file</div>
<input
type="file"
onchange={{action this.fns.onUpload}}
accept=".hcl,.json,.nomad"
/>
</label>
{{#if (can "read variable" path="nomad/job-templates/*" namespace="*")}}
<Hds::Button
@text="Choose from template"
@color="secondary"
@route="jobs.run.templates"
data-test-choose-template
/>
</Hds::ButtonSet>
{{/if}}

{{/if}}
</Hds::ButtonSet>
</header>
{{/if}}
{{did-update this.setDefinitionOnModel this.definition}}
Expand Down

0 comments on commit 6a41f72

Please sign in to comment.