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

Update handling of empty template description cell #56394

Closed
wants to merge 2 commits into from
Closed
Changes from 1 commit
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
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ import {
__experimentalText as Text,
__experimentalHStack as HStack,
__experimentalVStack as VStack,
VisuallyHidden,
} from '@wordpress/components';
import { __, _x } from '@wordpress/i18n';
import { useState, useMemo, useCallback } from '@wordpress/element';
Expand Down Expand Up @@ -167,10 +168,19 @@ export default function DataviewsTemplates() {
getValue: ( { item } ) => item.description,
render: ( { item } ) => {
return (
item.description && (
item.description ? (
<Text variant="muted">
{ decodeEntities( item.description ) }
</Text>
) : (
<>
<Text variant="muted" aria-hidden="true">
{ __( '—' ) }
Copy link
Contributor Author

Choose a reason for hiding this comment

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

Unsure if this needs to be translatable 🤔

Copy link
Contributor

Choose a reason for hiding this comment

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

It's not a translatable string in core, so I think you can use the same decision here. I suggest using the same character as is used in core, for consistency: &#8212;

</Text>
<VisuallyHidden>
{ __( 'No description.' ) }
</VisuallyHidden>
</>
)
);
},
Expand Down