Skip to content

Commit

Permalink
Fix multi entities saved state in the post editor (#47734)
Browse files Browse the repository at this point in the history
  • Loading branch information
youknowriad authored Feb 3, 2023
1 parent 0935351 commit 581eabf
Show file tree
Hide file tree
Showing 4 changed files with 26 additions and 9 deletions.
12 changes: 5 additions & 7 deletions packages/e2e-test-utils-playwright/src/editor/publish-post.ts
Original file line number Diff line number Diff line change
Expand Up @@ -11,18 +11,16 @@ import type { Editor } from './index';
*/
export async function publishPost( this: Editor ) {
await this.page.click( 'role=button[name="Publish"i]' );
const publishEditorPanel = this.page.locator(
'role=region[name="Editor publish"i]'
const entitiesSaveButton = this.page.locator(
'role=region[name="Editor publish"i] >> role=button[name="Save"i]'
);

const isPublishEditorVisible = await publishEditorPanel.isVisible();
const isEntitiesSavePanelVisible = await entitiesSaveButton.isVisible();

// Save any entities.
if ( isPublishEditorVisible ) {
if ( isEntitiesSavePanelVisible ) {
// Handle saving entities.
await this.page.click(
'role=region[name="Editor publish"i] >> role=button[name="Save"i]'
);
await entitiesSaveButton.click();
}

// Handle saving just the post.
Expand Down
4 changes: 4 additions & 0 deletions packages/edit-post/src/components/layout/style.scss
Original file line number Diff line number Diff line change
Expand Up @@ -95,3 +95,7 @@
bottom: 0;
}
}

.edit-post-layout .entities-saved-states__panel-header {
height: $header-height + $border-width;
}
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@
}

.entities-saved-states__panel-header {
box-sizing: border-box;
background: $white;
padding-left: $grid-unit-10;
padding-right: $grid-unit-10;
Expand Down
18 changes: 16 additions & 2 deletions packages/interface/src/components/interface-skeleton/style.scss
Original file line number Diff line number Diff line change
Expand Up @@ -174,12 +174,26 @@ html.interface-interface-skeleton__html-container {
bottom: auto;
left: auto;
right: 0;
width: $sidebar-width;
color: $gray-900;
background: $white;
width: 100vw;

@include break-medium() {
width: $sidebar-width;
}

&:focus,
&:focus-within {
top: auto;
top: $admin-bar-height-big;

@include break-medium() {
border-left: $border-width solid $gray-300;
top: $admin-bar-height;

.is-fullscreen-mode & {
top: 0;
}
}
bottom: 0;
}
}

1 comment on commit 581eabf

@github-actions
Copy link

Choose a reason for hiding this comment

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

Flaky tests detected in 581eabf.
Some tests passed with failed attempts. The failures may not be related to this commit but are still reported for visibility. See the documentation for more information.

🔍 Workflow run URL: https://github.com/WordPress/gutenberg/actions/runs/4086289537
📝 Reported issues:

Please sign in to comment.