-
Notifications
You must be signed in to change notification settings - Fork 2k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
ui: Toggle for
read-only
view (#16279)
* ui: model update for specification * style: add styling for select * style: add styling for select * refact: add spec to view * refact: update component API * test: refactor for new UI state * refact: clean conditional * refact: update component API for prop * chore: correct naming * chore: remove `fn` helper Co-authored-by: Phil Renaud <[email protected]> * update `default` Mirage scenario (#16496) * chore: update mirage scenario: * ui: conditionally render toggle button (#16497) * chore: update css variable name (#16498) --------- Co-authored-by: Phil Renaud <[email protected]>
- Loading branch information
1 parent
f12c957
commit 8ae49a2
Showing
12 changed files
with
1,025 additions
and
185 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,47 @@ | ||
<div class="boxed-section"> | ||
<div class="boxed-section-head"> | ||
Job Definition | ||
{{#if @data.cancelable}} | ||
<button | ||
class="button is-light is-compact pull-right" | ||
onclick={{@fns.onCancel}} | ||
type="button" | ||
data-test-cancel-editing | ||
> | ||
Cancel | ||
</button> | ||
{{/if}} | ||
</div> | ||
<div class="boxed-section-body is-full-bleed"> | ||
<div | ||
data-test-editor | ||
{{code-mirror | ||
screenReaderLabel="Job definition" | ||
content=@data.job._newDefinition | ||
theme="hashi" | ||
onUpdate=@fns.onUpdate | ||
mode="javascript" | ||
}} | ||
/> | ||
</div> | ||
</div> | ||
<div class="is-associative buttonset"> | ||
<Hds::Button | ||
{{on "click" (perform @fns.onPlan)}} | ||
disabled={{or @fns.onPlan.isRunning (not @data.job._newDefinition)}} | ||
data-test-plan | ||
@text="Plan" | ||
/> | ||
{{#if @data.job.isNew}} | ||
<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 @fns.onUpload}} accept=".hcl,.json,.nomad" /> | ||
</label> | ||
{{#if (can "write variable" path="*" namespace="*")}} | ||
<Hds::Button @icon="file-plus" @text="Save as template" @color="tertiary" @route="jobs.run.templates.new" {{on "click" @fns.onSaveAs}} data-test-save-as-template /> | ||
<Hds::Button @icon="file-text" @text="Choose from a template" @color="tertiary" @route="jobs.run.templates" data-test-choose-template /> | ||
{{/if}} | ||
</Hds::ButtonSet> | ||
{{/if}} | ||
</div> |
Oops, something went wrong.