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

Save only templates that have been changed #572

Merged
merged 3 commits into from Apr 22, 2024

Conversation

pbking
Copy link
Contributor

@pbking pbking commented Apr 18, 2024

This change ONLY persists CHANGED templates on the SAVE action.

This allows a user to make changes to the template OUTSIDE of the Editor (if desired). Re-processing of these templates might not be desired.

Note: The downside of the way this currently works is that any processing actions the user has selected (such as localizing text or media assets) will ONLY be done on templates that have been changed by the user in some way.

To Test:

  • Activate a theme.
  • Change a template directly (not using the Site Editor) in a way that may be processed (such as adding a paragraph tag)
  • Save the Theme using Create Block Theme with "localize text" selected.
  • Note that the template remains unmodified.
  • Change the template with the site editor (for example, changing the content of the paragraph tag)
  • Save the Theme using Create Block Theme with "localize text" selected.
  • Note that the template has been changed (it points to a pattern and the pattern contains localized text).

@pbking
Copy link
Contributor Author

pbking commented Apr 19, 2024

Per @mikachan suggestion I have added a control to make this optional which kind of negates the negatives. It defaults to true (which will only process the templates with changes).

image

Copy link
Member

@mikachan mikachan left a comment

Choose a reason for hiding this comment

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

This works as described 🎉

I've left one small suggestion but otherwise I think this is good to bring in.

src/editor-sidebar/save-panel.js Outdated Show resolved Hide resolved
Co-authored-by: Sarah Norris <1645628+mikachan@users.noreply.github.com>
@pbking pbking merged commit 09154a8 into trunk Apr 22, 2024
2 checks passed
@pbking pbking deleted the fix/save-only-changed-templates branch April 22, 2024 11:56
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants