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
Changes from all commits
Commits
Show all changes
9 commits
Select commit
Hold shift + click to select a range
5908b29
alert banner
Monkeychip 408a374
changelog
Monkeychip 95ccce4
test coverage
Monkeychip 26adc01
amend message
Monkeychip defe48c
Merge branch 'main' into ui/kv-alert-banner-white-space-in-path
Monkeychip fda90a6
address pr comments
Monkeychip ac83254
whoops
Monkeychip 4cb7e69
Revert "whoops"
Monkeychip 95f6025
whoops again
Monkeychip File filter
Filter by extension
Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
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: Adds warning about white space in KV secret engine. | ||
``` |
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 |
---|---|---|
|
@@ -28,6 +28,16 @@ | |
The secret path may not end in <code>/</code> | ||
</p> | ||
{{/if}} | ||
{{#if this.pathWhiteSpaceWarning}} | ||
<div class="has-top-margin-m"> | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe 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. |
||
<AlertBanner | ||
@type="warning" | ||
@message="Your secret path contains whitespace. If this is desired, you'll need to encode it with %20 in API calls." | ||
@marginTop=true | ||
data-test-whitespace-warning | ||
/> | ||
</div> | ||
{{/if}} | ||
</div> | ||
{{#if @showAdvancedMode}} | ||
<div class="form-section"> | ||
|
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 |
---|---|---|
|
@@ -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) { | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 👏 |
||
let enginePath = `kv-${new Date().getTime()}`; | ||
let secretPath = 'space space'; | ||
// mount version 2 | ||
|
@@ -452,7 +452,13 @@ module('Acceptance | secrets/secret/create', function(hooks) { | |
.submit(); | ||
await settled(); | ||
await listPage.create(); | ||
await editPage.createSecret(secretPath, 'foo', 'bar'); | ||
await editPage.createSecretDontSave(secretPath, 'foo', 'bar'); | ||
// to trigger warning need to hit keyup on the secret path | ||
await triggerKeyEvent('[data-test-secret-path="true"]', 'keyup', 65); | ||
await settled(); | ||
assert.dom('[data-test-whitespace-warning]').exists('renders warning about their being a space'); | ||
await settled(); | ||
await click('[data-test-secret-save="true"]'); | ||
await settled(); | ||
await click('[data-test-popup-menu-trigger="version"]'); | ||
await settled(); | ||
|
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
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
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.