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/Hide empty masked PKI row values #14400

Merged
merged 8 commits into from Mar 11, 2022
Merged

Conversation

hellobontempo
Copy link
Contributor

After some changes made to the InfoTableRow component in PR #13585 empty masked values were displaying in the certificate show pages. This PR fixes so only masked inputs with values display

Screeshot of bug
image

With fix
Screen Shot 2022-03-07 at 2 50 33 PM

Screen Shot 2022-03-07 at 3 21 04 PM

Screen Shot 2022-03-07 at 3 23 35 PM

@@ -75,12 +75,6 @@
@label={{capitalize (or attr.options.label (humanize (dasherize attr.name)))}}
@value={{date-format (get this.model attr.name) "MMM dd, yyyy hh:mm:ss a" isFormatted=true}}
/>
{{else if (and (get this.model attr.name) (eq attr.name "revocationTime"))}}
Copy link
Contributor Author

Choose a reason for hiding this comment

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

revocationTime won't exist for a newly generated credential. (I had originally added this before understanding exactly when this template renders)

@@ -45,7 +45,7 @@
@label={{capitalize (or attr.options.label (humanize (dasherize attr.name)))}}
@value={{date-format (get this.model attr.name) "MMM dd, yyyy hh:mm:ss a" isFormatted=true}}
/>
{{else if (and (get this.model attr.name) (eq attr.name "revocationTime"))}}
Copy link
Contributor Author

Choose a reason for hiding this comment

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

(get this.model attr.name) returns 0 so this block wasn't being hit and Revocation time: 0 was displaying in the UI. Now zero is passed to the date-format helper which errors so revocation time isn't displayed unless it has a date value

@vercel vercel bot temporarily deployed to Preview – vault March 8, 2022 20:09 Inactive
@vercel vercel bot temporarily deployed to Preview – vault-storybook March 8, 2022 20:17 Inactive
@@ -8,15 +8,15 @@
{{/if}}
</h2>
{{#if (or this.model.certificate this.model.csr)}}
{{#if (not (eq this.model.canParse true))}}
{{#if (eq this.model.canParse false)}}
Copy link
Contributor Author

Choose a reason for hiding this comment

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

canParse is only set when it goes through the parse-pki-cert helper - so we want to check for false specifically, as it could be undefined

Copy link
Collaborator

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

Great work, excellent test coverage, and thank you for the PR comments 👏

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

2 participants