Skip to content

Commit

Permalink
revert to clear customizations copy
Browse files Browse the repository at this point in the history
  • Loading branch information
ntsekouras committed Aug 8, 2022
1 parent d5f7d13 commit 8d74904
Show file tree
Hide file tree
Showing 6 changed files with 12 additions and 14 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -84,12 +84,12 @@ export default function DeleteTemplate() {
} }
info={
isRevertable
? __( 'Use the template as supplied by the theme' )
? __( 'Use the template as supplied by the theme.' )
: undefined
}
>
{ isRevertable
? __( 'Delete custom template' )
? __( 'Clear customizations' )
: __( 'Delete template' ) }
</MenuItem>
<ConfirmDialog
Expand Down
4 changes: 2 additions & 2 deletions packages/edit-site/src/components/list/actions/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -80,14 +80,14 @@ export default function Actions( { template } ) {
{ isRevertable && (
<MenuItem
info={ __(
'Use the template as supplied by the theme'
'Use the template as supplied by the theme.'
) }
onClick={ () => {
revertAndSaveTemplate();
onClose();
} }
>
{ __( 'Delete custom template' ) }
{ __( 'Clear customizations' ) }
</MenuItem>
) }
</MenuGroup>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -29,14 +29,14 @@ export default function Actions( { template } ) {
<MenuGroup>
<MenuItem
info={ __(
'Use the template as supplied by the theme'
'Use the template as supplied by the theme.'
) }
onClick={ () => {
revertTemplate( template );
onClose();
} }
>
{ __( 'Delete custom template' ) }
{ __( 'Clear customizations' ) }
</MenuItem>
</MenuGroup>
) }
Expand Down
4 changes: 2 additions & 2 deletions packages/edit-site/src/components/template-details/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -80,11 +80,11 @@ export default function TemplateDetails( { template, onClose } ) {
<MenuItem
className="edit-site-template-details__revert-button"
info={ __(
'Use the template as supplied by the theme'
'Use the template as supplied by the theme.'
) }
onClick={ revert }
>
{ __( 'Delete custom template' ) }
{ __( 'Clear customizations' ) }
</MenuItem>
</MenuGroup>
) }
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -60,11 +60,11 @@ function TemplatePartItemMore( {
<MenuGroup>
<MenuItem
info={ __(
'Use the template part as supplied by the theme'
'Use the template part as supplied by the theme.'
) }
onClick={ clearCustomizations }
>
{ __( 'Delete custom template part' ) }
{ __( 'Clear customizations' ) }
</MenuItem>
</MenuGroup>
) }
Expand Down
6 changes: 2 additions & 4 deletions test/e2e/specs/site-editor/template-revert.spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ test.describe( 'Template Revert', () => {

// The revert button isn't visible anymore.
await expect(
page.locator( 'role=menuitem[name=/Delete custom template/i]' )
page.locator( 'role=menuitem[name=/Clear customizations/i]' )
).not.toBeVisible();
} );

Expand Down Expand Up @@ -279,9 +279,7 @@ class TemplateRevertUtils {

async revertTemplate() {
await this.page.click( 'role=button[name="Show template details"i]' );
await this.page.click(
'role=menuitem[name=/Delete custom template/i]'
);
await this.page.click( 'role=menuitem[name=/Clear customizations/i]' );
await this.page.waitForSelector(
'role=button[name="Dismiss this notice"i] >> text="Template reverted."'
);
Expand Down

0 comments on commit 8d74904

Please sign in to comment.