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

Fse template import #305

Merged
merged 27 commits into from
Apr 3, 2024
Merged

Fse template import #305

merged 27 commits into from
Apr 3, 2024

Conversation

cristian-ungureanu
Copy link
Contributor

@cristian-ungureanu cristian-ungureanu commented Oct 27, 2023

Summary

  • Implemented the FSE Template import inside the templates cloud

Note

For the images to be properly saved, the website needs to be public, else it will default to a placeholder image when saving the template.

Screenshots

FSE Library image
FSE Import image

Test instructions

  1. Use this version of the plugin
  2. Use a FSE Theme
  3. From the FSE Editor, save a template for the Front Page or any other page
  4. Check that the template is visible inside My Library
  5. Check that the Preview is visible before importing inside the Editor
  6. Import the template on a different FSE Theme

Closes #255.

@pirate-bot
Copy link
Collaborator

pirate-bot commented Oct 27, 2023

Plugin build for dacb33d is ready 🛎️!

@cristian-ungureanu cristian-ungureanu changed the title [WIP]Feat/fse import Fse template import Nov 1, 2023
@preda-bogdan
Copy link
Contributor

preda-bogdan commented Nov 2, 2023

I started the review process here, however I ran into a few issues when trying to replicate the stack. Will follow up wit the review as there are a few things to cover.

Until then I have a question about the implementation, wouldn't this also require changes on the Templates Cloud endpoint?

@cristian-ungureanu
Copy link
Contributor Author

Thank you, Bogdan. There were only some minor changes on the server, no PR for now. I only needed to change https://github.com/Codeinwp/store-themeisle/blob/master/web/app/plugins/templates-cloud/inc/class-db-table.php#L173 with

		if ( ! empty( $args['type'] ) ) {
			// Try to decode it.
			$decoded_array = json_decode( $args['type'], true );
			if ( ! empty( $decoded_array ) && is_array( $decoded_array ) ) {
				$args['type'] = $decoded_array;
			}

@preda-bogdan preda-bogdan removed their request for review November 6, 2023 10:53
@preda-bogdan
Copy link
Contributor

We decided to do some changes to ensure it is easier to test for the QA and do the review after the changes are finished.

@preda-bogdan
Copy link
Contributor

I modified the code so that no other changes are required on the templates-cloud service, it will use the same existing infrastructure.

Copy link
Contributor

@Soare-Robert-Daniel Soare-Robert-Daniel left a comment

Choose a reason for hiding this comment

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

Looking good. NIT: some console logs used for debugging left in the code

@irinelenache
Copy link

irinelenache commented Mar 11, 2024

@preda-bogdan Tested and the imports work as expected 🚀

Found only some small issues:

  • When i'm in the importer window, the FSE toggle is activated and i use the sync button, the FSE templates won't be visible until i deactivate and reactivate the FSE toggle. Here is a video with the behaviour https://vertis.d.pr/v/SOMEtQ
  • When I import a template, the header and footer are also imported, and they appear as groups instead of template parts https://vertis.d.pr/i/4o5QEj . I would expect either to import the content only, without the header and footer, or to import the whole page, header and footer included, but those to be marked as template parts.

@preda-bogdan preda-bogdan added the pr-checklist-skip Allow this Pull Request to skip checklist. label Mar 14, 2024
@pirate-bot pirate-bot added the pr-checklist-complete The Pull Request checklist is complete. (automatic label) label Mar 14, 2024
@preda-bogdan
Copy link
Contributor

@irinelenache I've solved the issue with the toggle not counting on refresh, for the second issue we discussed it on our team and we decided it is the expected behavior for now and we can revisit it once we gather some more feedback from our users.

Once you have another look, let me know if everything is working as expected.

Thank you!

@irinelenache
Copy link

@preda-bogdan Tested and everything's fine now 🚀

@vytisbulkevicius vytisbulkevicius merged commit 1bc00cd into development Apr 3, 2024
8 of 9 checks passed
@vytisbulkevicius vytisbulkevicius deleted the feat/fse-import branch April 3, 2024 07:15
@pirate-bot
Copy link
Collaborator

🎉 This PR is included in version 1.2.8 🎉

The release is available on GitHub release

Your semantic-release bot 📦🚀

@pirate-bot pirate-bot added the released Indicate that an issue has been resolved and released in a particular version of the product. label Apr 3, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
pr-checklist-complete The Pull Request checklist is complete. (automatic label) pr-checklist-skip Allow this Pull Request to skip checklist. released Indicate that an issue has been resolved and released in a particular version of the product.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Evaluate effort of implementing WP FSE templates inside TPC.
6 participants