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 KV v2 json editor #24224

Merged
merged 5 commits into from
Nov 21, 2023
Merged

Conversation

hashishaw
Copy link
Contributor

After the KV V2 refactor, there was strange behavior when attempting to paste into the JSON editor as described in #23940. This PR fixes that issue, and restores previous behavior where the edit mode defaulted to JSON when the KV secret is "complex" (has nested objects within it).

@hashishaw hashishaw added ui bug Used to indicate a potential bug backport/1.15.x labels Nov 21, 2023
@hashishaw hashishaw added this to the 1.15.3 milestone Nov 21, 2023
@github-actions github-actions bot added the hashicorp-contributed-pr If the PR is HashiCorp (i.e. not-community) contributed label Nov 21, 2023
@hashishaw hashishaw linked an issue Nov 21, 2023 that may be closed by this pull request
Copy link

Build Results:
All builds succeeded! ✅


constructor() {
super(...arguments);
this.originalSecret = JSON.stringify(this.args.secret.secretData || {});
if (this.originalSecret.lastIndexOf('{') > 0) {
// Dumb way to check if there's a nested object in the secret
Copy link
Contributor

Choose a reason for hiding this comment

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

😂

Copy link
Contributor

@zofskeez zofskeez left a comment

Choose a reason for hiding this comment

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

LGTM thanks!

Copy link
Contributor

@hellobontempo hellobontempo left a comment

Choose a reason for hiding this comment

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

Nice work fixing this! 👏

@hashishaw hashishaw merged commit 82ca52d into main Nov 21, 2023
69 checks passed
@hashishaw hashishaw deleted the ui/VAULT-22115/fix-kv-v2-json-editor branch November 21, 2023 21:11
fopina-ci pushed a commit to fopina/vault that referenced this pull request Dec 1, 2023
)

* Fix JSON editor in KVv2 unable to paste. Fixes hashicorp#23940

* Default to JSON view on edit with secret is complex

* Add changelog
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Used to indicate a potential bug hashicorp-contributed-pr If the PR is HashiCorp (i.e. not-community) contributed ui
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1.15 web-ui kv2 -- issue adding new lines to secret in json view
3 participants