forked from hashicorp/vault
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Updated code mirror component for consistency (hashicorp#11500)
* Updated code mirror component for consistency - Hide gutters, line number and selection while read only - Show toolbar with copy functionality for all instances * Moved toolbar and actions to json editor component * Updated form-field-from-model template * Added test for toolbar
- Loading branch information
Showing
23 changed files
with
253 additions
and
153 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
```release-note:improvement | ||
ui: Updated ivy code mirror component for consistency | ||
``` |
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,32 @@ | ||
{{#if showToolbar }} | ||
<div data-test-component="json-editor-toolbar"> | ||
<Toolbar> | ||
<label class="is-label" data-test-component="json-editor-title"> | ||
{{title}} | ||
{{#if subTitle }} | ||
<span class="is-size-9 is-lowercase has-text-grey">({{ subTitle }})</span> | ||
{{/if}} | ||
</label> | ||
<ToolbarActions> | ||
{{yield}} | ||
<div class="toolbar-separator"></div> | ||
<CopyButton class="button is-transparent" @clipboardText={{value}} | ||
@buttonType="button" @success={{action (set-flash-message 'Data copied!')}}> | ||
<Icon @glyph="copy-action" aria-label="Copy" /> | ||
</CopyButton> | ||
</ToolbarActions> | ||
</Toolbar> | ||
</div> | ||
{{/if}} | ||
{{ivy-codemirror | ||
data-test-component="json-editor" | ||
value=value | ||
options=options | ||
valueUpdated=(action "updateValue") | ||
onFocusOut=(action "onFocus") | ||
}} | ||
{{#if helpText }} | ||
<div class="box is-shadowless is-fullwidth has-short-padding"> | ||
<p class="sub-text">{{ helpText }}</p> | ||
</div> | ||
{{/if}} |
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
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
Oops, something went wrong.