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

DataViews: Removing mapping of user patterns to temporary object #63042

Merged
merged 4 commits into from
Jul 5, 2024
Merged
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
18 changes: 7 additions & 11 deletions packages/edit-site/src/components/page-patterns/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -302,23 +302,19 @@ export default function DataviewsPatterns() {
id: 'sync-status',
render: ( { item } ) => {
const syncStatus =
item.wp_pattern_sync_status || PATTERN_SYNC_TYPES.full;
'wp_pattern_sync_status' in item
Copy link
Contributor Author

Choose a reason for hiding this comment

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

How can this condition be false if "type" is always user? (line 299)

Copy link
Contributor

Choose a reason for hiding this comment

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

Probably it's when we merge the theme patterns with the user ones? You can see the issue without this change in categories like about, etc..

? item.wp_pattern_sync_status ||
PATTERN_SYNC_TYPES.full
: PATTERN_SYNC_TYPES.unsynced;
// User patterns can have their sync statuses checked directly.
// Non-user patterns are all unsynced for the time being.
return (
<span
className={ `edit-site-patterns__field-sync-status-${ item.syncStatus }` }
className={ `edit-site-patterns__field-sync-status-${ syncStatus }` }
>
{
(
SYNC_FILTERS.find(
( { value } ) => value === syncStatus
) ||
SYNC_FILTERS.find(
( { value } ) =>
value ===
PATTERN_SYNC_TYPES.unsynced
)
SYNC_FILTERS.find(
( { value } ) => value === syncStatus
).label
}
</span>
Expand Down
Loading