Skip to content

UI: Fix KV v2 json editor - #24224

Merged
hashishaw merged 5 commits into
mainfrom
ui/VAULT-22115/fix-kv-v2-json-editor
Nov 21, 2023
Merged

hashishaw merged 5 commits into
mainfrom
ui/VAULT-22115/fix-kv-v2-json-editor

Conversation

@hashishaw

Copy link
Copy Markdown
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
@github-actions

Copy link
Copy Markdown

Build Results:
All builds succeeded! ✅

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
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

😂

@zofskeez zofskeez left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

LGTM thanks!

@hellobontempo hellobontempo left a comment

Copy link
Copy Markdown
Contributor

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
@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

This branch was successfully deployed

1 active deployment
Preview — 05f356d4 Deployed Nov 21, 2023 by vercel[bot]
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