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 and ntsekouras committed Feb 7, 2023
1 parent 7d8946d commit c03c7a8
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;
}
}

0 comments on commit c03c7a8

Please sign in to comment.