Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

UI: fix browser console formatting #20064

Merged
merged 11 commits into from
Apr 11, 2023
Merged
3 changes: 3 additions & 0 deletions changelog/20064.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
```release-note:bug
ui: fixes browser console formatting for help command output
```
2 changes: 1 addition & 1 deletion ui/.template-lintrc.js
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ module.exports = {
},
'require-input-label': 'off',
},
ignore: ['lib/story-md', 'tests/**'],
hellobontempo marked this conversation as resolved.
Show resolved Hide resolved
ignore: ['lib/story-md', 'tests/**', 'app/templates/components/console/*'],
Copy link
Contributor

@zofskeez zofskeez Apr 11, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I wonder if it would be better to use a block quote to disable the specific rule in the file? This disables linting for all the files in that directory which then wouldn't catch any other errors.

// ember language server vscode extension does not currently respect the ignore field
// override all rules manually as workaround to align with cli
overrides: [
Expand Down
2 changes: 1 addition & 1 deletion ui/app/templates/components/console/log-command.hbs
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
{{! using Icon here instead of Chevron because two nested tagless components results in a rendered line break between the tags breaking the layout in the <pre> }}
<pre class="console-ui-command"><Icon @name="chevron-right" />{{@content}}</pre>
<p class="console-ui-command is-font-mono"><Icon @name="chevron-right" />{{@content}}</p>
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

<pre> made the command to appear on a separate line, below the icon
Screenshot 2023-04-10 at 10 33 19 AM

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

:)

23 changes: 17 additions & 6 deletions ui/app/templates/components/console/log-help.hbs
Original file line number Diff line number Diff line change
@@ -1,8 +1,19 @@
{{!-- template-lint-disable --}}
<div class="console-ui-alert has-text-grey">
<Icon @name="info" />
<pre>Usage: vault &lt;command&gt; [args] Commands: read Read data and retrieves secrets write Write data, configuration,
and secrets delete Delete secrets and configuration list List data or secrets Web CLI Commands: api Navigate to the Vault
API explorer. Use 'api [filter]' to prefilter the list. clear Clear output from the log clearall Clear output and command
history fullscreen Toggle fullscreen display refresh Refresh the data on the current screen under the CLI window
</pre>
<Icon @name="info" />
<pre>Usage: vault &lt;command&gt; [args]

Commands:
read Read data and retrieves secrets
write Write data, configuration, and secrets
delete Delete secrets and configuration
list List data or secrets

Web CLI Commands:
api Navigate to the Vault API explorer. Use 'api [filter]' to prefilter the list.
clear Clear output from the log
clearall Clear output and command history
fullscreen Toggle fullscreen display
refresh Refresh the data on the current screen under the CLI window
</pre>
</div>
6 changes: 4 additions & 2 deletions ui/app/templates/components/console/log-list.hbs
Original file line number Diff line number Diff line change
@@ -1,8 +1,10 @@
<div class="console-ui-output has-copy-button">
<pre>Keys
<pre>
Keys
Copy link
Contributor Author

@hellobontempo hellobontempo Apr 10, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

aligns list items (previously, first key was not indented enough)
Screenshot 2023-04-10 at 10 34 00 AM

{{#each this.list as |item|}}
{{item}}

{{/each}}</pre>
{{/each}}
</pre>
<HoverCopyButton @copyValue={{multi-line-join this.list}} />
</div>
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,6 @@ module('Integration | Component | console/log command', function (hooks) {
this.set('content', commandText);

await render(hbs`{{console/log-command content=this.content}}`);

assert.dom('pre').includesText(commandText);
assert.dom('p').includesText(commandText);
});
});