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: Fix patterns, templates and template parts pagination z-index #58965

Merged
merged 2 commits into from
Feb 13, 2024
Merged
Show file tree
Hide file tree
Changes from all 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
3 changes: 2 additions & 1 deletion packages/base-styles/_z-index.scss
Original file line number Diff line number Diff line change
Expand Up @@ -190,7 +190,8 @@ $z-layers: (
".edit-site-page-header": 2,
".edit-site-page-content": 1,
".edit-site-patterns__header": 2,
".edit-site-patterns__grid-pagination": 2,
".edit-site-patterns__dataviews-list-pagination": 2,
".edit-site-templates__dataviews-list-pagination": 2,
".edit-site-layout__canvas-container": 2,
".edit-site-layout__sidebar": 1,
".edit-site-layout__canvas-container.is-resizing::after": 100,
Expand Down
4 changes: 4 additions & 0 deletions packages/edit-site/src/components/page-patterns/style.scss
Original file line number Diff line number Diff line change
Expand Up @@ -101,6 +101,10 @@
text-overflow: ellipsis;
color: inherit;
}

.dataviews-pagination {
Copy link
Member

@oandregal oandregal Apr 1, 2024

Choose a reason for hiding this comment

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

@ntsekouras @t-hamano I've noticed that we use a dataviews internal class to do this. Can we do this differently? In my view, consumers shouldn't target dataviews internal classes, otherwise they'll become public API.

related thread

Copy link
Contributor

Choose a reason for hiding this comment

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

I think the Data Views pagination component cannot be wrapped in an element with a specific class, nor can we add a specific class name.

<HStack
expanded={ false }
spacing={ 6 }
justify="end"
className="dataviews-pagination"
>

For example, should we add a prop like paginationClassName to the DataViews component?

export default function DataViews( {
view,
onChangeView,
fields,
search = true,
searchLabel = undefined,
actions = [],
data,
getItemId = defaultGetItemId,
isLoading = false,
paginationInfo,
supportedLayouts,
onSelectionChange = defaultOnSelectionChange,
onDetailsChange = null,
deferredRendering = false,
} ) {

z-index: z-index(".edit-site-patterns__dataviews-list-pagination");
}
}

.dataviews-action-modal__duplicate-pattern {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -429,6 +429,7 @@ export default function PageTemplatesTemplateParts( { postType } ) {

return (
<Page
className="edit-site-page-template-template-parts-dataviews"
title={
postType === TEMPLATE_POST_TYPE
? __( 'Templates' )
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -58,3 +58,9 @@
.page-templates-description {
white-space: normal;
}

.edit-site-page-template-template-parts-dataviews {
.dataviews-pagination {
z-index: z-index(".edit-site-templates__dataviews-list-pagination");
}
}
Loading