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: [VAULT-20186] decode uri for all attributes in the table #23695

Merged
merged 3 commits into from
Oct 17, 2023

Conversation

kiannaquach
Copy link
Contributor

@kiannaquach kiannaquach commented Oct 17, 2023

Description
connection_url was being displayed with encoded characters. I added a decode_uri helper to decode_uri's in templates.

Bug:
Screenshot 2023-10-17 at 9 22 06 AM

After decoding:
Screenshot 2023-10-17 at 9 22 27 AM

@kiannaquach kiannaquach added this to the 1.14.5 milestone Oct 17, 2023
@kiannaquach kiannaquach changed the title VAULT-20186 decode uri for all attributes in the table UI: [VAULT-20186] decode uri for all attributes in the table Oct 17, 2023
@github-actions github-actions bot added the hashicorp-contributed-pr If the PR is HashiCorp (i.e. not-community) contributed label Oct 17, 2023
@kiannaquach kiannaquach marked this pull request as ready for review October 17, 2023 16:26
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.

This looks good to me but maybe a test to cover the specific case would be good to ensure an encoded connection url is decoded as expected?

@github-actions
Copy link

Build Results:
All builds succeeded! ✅

@kiannaquach
Copy link
Contributor Author

@zofskeez Just added the test! 😬

Comment on lines +487 to +498
test('connection_url must be decoded', async function (assert) {
const backend = this.backend;
const connection = await newConnection(
backend,
'mongodb-database-plugin',
'{{username}}/{{password}}@oracle-xe:1521/XEPDB1'
);
await navToConnection(backend, connection);
assert
.dom('[data-test-row-value="Connection URL"]')
.hasText('{{username}}/{{password}}@oracle-xe:1521/XEPDB1');
});
Copy link
Contributor

Choose a reason for hiding this comment

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

Just to verify, if you remove the decode-uri helper from the template this test fails?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Screenshot 2023-10-17 at 10 34 33 AM Yup it fails 😊

Copy link
Contributor

Choose a reason for hiding this comment

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

Perfect thanks for adding this test!

Comment on lines +487 to +498
test('connection_url must be decoded', async function (assert) {
const backend = this.backend;
const connection = await newConnection(
backend,
'mongodb-database-plugin',
'{{username}}/{{password}}@oracle-xe:1521/XEPDB1'
);
await navToConnection(backend, connection);
assert
.dom('[data-test-row-value="Connection URL"]')
.hasText('{{username}}/{{password}}@oracle-xe:1521/XEPDB1');
});
Copy link
Contributor

Choose a reason for hiding this comment

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

Perfect thanks for adding this test!

@kiannaquach kiannaquach merged commit 7a93c8f into main Oct 17, 2023
70 checks passed
@kiannaquach kiannaquach deleted the ui/VAULT-20186/db-connection-url branch October 17, 2023 17:38
@kiannaquach kiannaquach added the bug Used to indicate a potential bug label Oct 17, 2023
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 pr/no-changelog ui
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants