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
Show file tree
Hide file tree
Changes from 3 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion ui/app/templates/components/config-pki-ca.hbs
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
/>
{{/if}}
{{#each this.model.attrs as |attr|}}
{{#if attr.options.masked}}
{{#if (and attr.options.masked (get this.model attr.name))}}
<InfoTableRow
data-test-table-row
@label={{capitalize (or attr.options.label (humanize (dasherize attr.name)))}}
Expand Down
6 changes: 0 additions & 6 deletions ui/app/templates/components/generate-credentials.hbs
Original file line number Diff line number Diff line change
Expand Up @@ -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)

<InfoTableRow
data-test-table-row
@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"}}
/>
{{else}}
<InfoTableRow
@label={{capitalize (or attr.options.label (humanize (dasherize attr.name)))}}
Expand Down
4 changes: 2 additions & 2 deletions ui/app/templates/components/pki-cert-show.hbs
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@
@value={{stringify (get this.model attr.name)}}
/>
{{else}}
{{#if attr.options.masked}}
{{#if (and attr.options.masked (get this.model attr.name))}}
<InfoTableRow
data-test-table-row
@label={{capitalize (or attr.options.label (humanize (dasherize attr.name)))}}
Expand All @@ -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

{{else if (eq attr.name "revocationTime")}}
<InfoTableRow
data-test-table-row
@label={{capitalize (or attr.options.label (humanize (dasherize attr.name)))}}
Expand Down