didUpdateAttributes manually called on modify (#23548)

This commit is contained in:
Phil Renaud
2024-07-11 14:55:01 -04:00
committed by GitHub
parent 0324e781d4
commit 370952e390
3 changed files with 19 additions and 16 deletions

3
.changelog/23548.txt Normal file
View File

@@ -0,0 +1,3 @@
```release-note:bug
ui: Fix the Upload Jobspec button on the Run Job page
```

View File

@@ -31,6 +31,8 @@ export default class CodeMirrorModifier extends Modifier {
this.element = element;
this.args = { positional, named };
this._setup();
} else {
this.didUpdateArguments();
}
}

View File

@@ -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}}