-
Notifications
You must be signed in to change notification settings - Fork 4.4k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
ui: Fix code editor resizing and restyle (#11474)
Fixes an issue where the code editor would not resizing to the full extent of the browser window plus CodeEditor restyling/refactoring - :label named block - :tools named block - :content named block - code and CSS cleanup - CodeEditor.mdx Signed-off-by: Alessandro De Blasis <alex@deblasis.net> Co-authored-by: John Cowen <johncowen@users.noreply.github.com>
- Loading branch information
Showing
9 changed files
with
225 additions
and
52 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,6 @@ | ||
```release-note:bug | ||
ui: code editor styling (layout consistency + wide screen support) | ||
``` | ||
```release-note:improvement | ||
ui: added copy to clipboard button in code editor toolbars | ||
``` |
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
37 changes: 27 additions & 10 deletions
37
ui/packages/consul-ui/app/components/code-editor/index.hbs
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 |
---|---|---|
@@ -1,11 +1,28 @@ | ||
<div class="toolbar-container"> | ||
<div class="toolbar"> | ||
<label class="title"> | ||
{{#if (has-block "label")}} | ||
{{yield to="label"}} | ||
{{/if}} | ||
</label> | ||
<div class="tools"> | ||
{{#if (has-block "tools")}} | ||
{{yield to="tools"}} | ||
{{else}} | ||
{{#if (and (not readonly) (not syntax))}} | ||
<PowerSelect | ||
@onChange={{action "change"}} | ||
@selected={{mode}} | ||
@searchEnabled={{false}} | ||
@options={{modes}} as |mode|> | ||
{{mode.name}} | ||
</PowerSelect> | ||
<div class="toolbar-separator"></div> | ||
<CopyButton @value={{value}} @name="value" /> | ||
{{/if}} | ||
{{/if}} | ||
</div> | ||
</div> | ||
</div> | ||
<IvyCodemirror @value={{value}} @name={{name}} @class={{class}} @options={{options}} @valueUpdated={{action onkeyup}} /> | ||
<pre><code>{{yield}}</code></pre> | ||
{{#if (and (not readonly) (not syntax))}} | ||
<PowerSelect | ||
@onChange={{action "change"}} | ||
@selected={{mode}} | ||
@searchEnabled={{false}} | ||
@options={{modes}} as |mode|> | ||
{{mode.name}} | ||
</PowerSelect> | ||
{{/if}} | ||
<pre><code>{{#if (has-block "content")}}{{yield to="content"}}{{else}}{{value}}{{/if}}</code></pre> |
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