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

KV alert banner for white space in KV path #12921

Merged
merged 9 commits into from Oct 28, 2021

Conversation

Monkeychip
Copy link
Contributor

@Monkeychip Monkeychip commented Oct 25, 2021

This PR adds a warning when the user has a space of any kind in the path of a KV 2 secret.

In the screenshot the space is a trailing white space (at the end of the path name).

image

@Monkeychip Monkeychip added the ui label Oct 25, 2021
@Monkeychip Monkeychip added this to the 1.9 milestone Oct 25, 2021
@vercel vercel bot temporarily deployed to Preview – vault October 25, 2021 16:51 Inactive
@vercel vercel bot temporarily deployed to Preview – vault October 25, 2021 16:53 Inactive
@@ -52,7 +52,7 @@ export default Model.extend(Validations, {
defaultValue: 0,
label: 'Maximum number of versions',
subText:
'The number of versions to keep per key. Once the number of keys exceeds the maximum number set here, the oldest version will be permanently deleted. This value applies to all keys, but a key’s metadata settings can overwrite this value.',
'The number of versions to keep per key. Once the number of keys exceeds the maximum number set here, the oldest version will be permanently deleted. This value applies to all keys, but a key’s metadata settings can overwrite this value. When 0 is used or the value is unset, Vault will keep 10 versions.',
Copy link
Contributor Author

Choose a reason for hiding this comment

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

This was a quick fix on the max_version message that I confirmed with design.

Copy link
Contributor

@arnav28 arnav28 left a comment

Choose a reason for hiding this comment

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

Looks good, just one minor cleanup.

Copy link
Contributor

@hashishaw hashishaw left a comment

Choose a reason for hiding this comment

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

A couple cleanup things, otherwise looks great!

@@ -4,3 +4,7 @@

color: $black;
}

.margin-top {
Copy link
Contributor

Choose a reason for hiding this comment

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

In helpers.scss we have .has-top-margin helpers, is there a reason we have it set here specifically rather than using a helper?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Good catch. I missed this. When I search the code I was looking for has-margin-top, I'll remove.

@@ -29,7 +30,7 @@ export default Component.extend({
progressBar: null,
yieldWithoutColumn: false,
marginless: false,
classNameBindings: ['containerClass'],
classNameBindings: ['containerClass', 'marginTop:margin-top'],
Copy link
Contributor

Choose a reason for hiding this comment

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

I'd prefer to wrap the component in classes that adjust the layout, rather than adding the need for this component to know it has a margin top (plus, that implies the need for support of all the margins in the future)

@@ -440,7 +440,7 @@ module('Acceptance | secrets/secret/create', function(hooks) {
}
});

test('create secret with space shows version data', async function(assert) {
test('create secret with space shows version data and shows space warning', async function(assert) {
Copy link
Contributor

Choose a reason for hiding this comment

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

👏

This reverts commit ac83254.
@vercel vercel bot temporarily deployed to Preview – vault October 28, 2021 16:25 Inactive
@@ -28,6 +28,16 @@
The secret path may not end in <code>/</code>
</p>
{{/if}}
{{#if this.pathWhiteSpaceWarning}}
<div class="has-top-margin-m">
Copy link
Contributor Author

Choose a reason for hiding this comment

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

had to add the div to add the margin, unable to add margin class to component itself.

@Monkeychip Monkeychip merged commit 3aac6f3 into main Oct 28, 2021
@Monkeychip Monkeychip deleted the ui/kv-alert-banner-white-space-in-path branch October 28, 2021 16:50
qk4l pushed a commit to qk4l/vault that referenced this pull request Feb 4, 2022
* alert banner

* changelog

* test coverage

* amend message

* address pr comments

* whoops

* Revert "whoops"

This reverts commit ac83254.

* whoops again
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants