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

Feat/block chart edit #1136

Merged
merged 8 commits into from
May 11, 2024
Merged

Feat/block chart edit #1136

merged 8 commits into from
May 11, 2024

Conversation

preda-bogdan
Copy link
Contributor

@preda-bogdan preda-bogdan commented May 7, 2024

Summary

Added a button inside Gutenberg to Edit the Chart from a single location. Will open a Media pop-up Modal, the same that is used outside of the editor.
Added a new filter visualizer_legacy_block_edit to allow users to switch to the legacy behavior. Eg.

add_filter( 'visualizer_legacy_block_edit', '__return_true' );

Hide previous controls from the block.
Added E2E test.

Will affect the visual aspect of the product

YES

Screenshots

Edit Chart

image

Media Pop-up

image

Test instructions

  1. All tests should pass.
  2. On a fresh instance add a chart inside the Gutenberg editor.
  3. Check that the Edit Chart button is present and previous controls are not available.
  4. Check that. the button will open the Media pop-up and allows you to edit the current chart.

Check before Pull Request is ready:

Closes Codeinwp/visualizer-pro#440.

@pirate-bot pirate-bot added the pr-checklist-complete The Pull Request checklist is complete. (automatic label) label May 7, 2024
@pirate-bot
Copy link
Contributor

pirate-bot commented May 7, 2024

Plugin build for 48f6d40 is ready 🛎️!

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.

I left some minor remarks on the names of some variables; otherwise, it is a very solid work in bringing the library experience into the editor.

@irinelenache
Copy link

irinelenache commented May 8, 2024

@preda-bogdan Tested and found a single issue:

  • If you edit the chart using the pop-up, there will be a console error after saving and the changes will be visible after refreshing the editor https://vertis.d.pr/v/wsi8xB

Can be checked here:

 Admin area URL: https://block-chart.s3-tastewp.com/wp-admin 
 Username: irinel 
 Password: v9M2uK9vP2Q 

@Soare-Robert-Daniel
Copy link
Contributor

  • If you edit the chart using the pop-up, there will be a console error after saving, and the changes will be visible after refreshing the editor https://vertis.d.pr/v/wsi8xB

@preda-bogdan you can add:

window.send_to_editor = () => {
    view.close();
};

I found the same issue yesterday.

@preda-bogdan
Copy link
Contributor Author

@Soare-Robert-Daniel thank you, but we also need to notify the editor to re-render the block.

@preda-bogdan
Copy link
Contributor Author

@irinelenache The chart should update upon the window closing and no error should be displayed in the console.

Let me know if everything is working as expected now. Thank you!

@irinelenache
Copy link

@preda-bogdan The issue is fixed now, thank you 🚀

@preda-bogdan preda-bogdan mentioned this pull request May 11, 2024
@preda-bogdan preda-bogdan merged commit e9a2ffe into development May 11, 2024
7 checks passed
@preda-bogdan preda-bogdan deleted the feat/block_chart_edit branch May 11, 2024 09:06
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)
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants