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

Fix issues in Tiled Gallery block #26363

Closed
9 tasks done
simison opened this issue Jul 27, 2018 · 6 comments
Closed
9 tasks done

Fix issues in Tiled Gallery block #26363

simison opened this issue Jul 27, 2018 · 6 comments
Assignees
Labels
[Goal] Gutenberg Working towards full integration with Gutenberg [Type] Task

Comments

@simison
Copy link
Member

simison commented Jul 27, 2018

Tiled Gallery block was merged in #26223

We left off most of the changes the block needs to be properly up-to-date with latest Gutenberg/React.

TODO

  • Add Prettier @format pragma

  • Block uses React components → they should be nested blocks if possible

    • If that cannot be done, then: Block uses deprecated lifecycle methods. They now have UNSAFE_'s in them.
  • CSS is currently what was in Jetpack previously and doesn't follow Calypso's CSS naming guidelines. Linting for this was disabled using /* eslint wpcalypso/jsx-classname-namespace: 0 */ — CSS should be rewritten and possibly use flexbox. See SDK: refactor the style file for the tiled gallery block #26551 (comment)

  • not able to upload files directly by clicking the "Upload" button in the media placeholder - after selecting files, nothing happens:

    Using media library and already uploaded images or uploading new ones there works for a fresh block. Perhaps the MediaPlaceholder component API has changed?

  • Adding new images to an already existing gallery throws an error. Insert a tile gallery with some images. Then try adding images to it and uploading new image fails with an error:

  • After saving the block with some images in it, and refreshing the page, it either isn't saved properly or isn't recognized properly:

    This is also reproducible without saving and refreshing the page if you "Edit as HTML", then click inside the HTML code.

  • Looking at the frontend, it seems the images are not saved with the block output:

  • Tried to save the block as a shared block, and then reuse it, but the images are again lost when attempting to reuse it in another post. This might be related to the above issue of images not being saved properly when saving the block.


/cc @haszari has offered to help with any questions. He originally worked on Tiled Gallery Block in Automattic/jetpack#9434. Further reading: p7rd6c-1Kz-p2

@haszari
Copy link
Contributor

haszari commented Jul 29, 2018

Thanks for setting up an issue to cover all these loose ends @simison.

I'm afraid I can't commit to tackling any of these any time soon, but I'll make time to answer questions for anyone who gets stuck in :)

@alisterscott alisterscott added [Type] Task [Goal] Gutenberg Working towards full integration with Gutenberg labels Jul 31, 2018
@simison simison self-assigned this Sep 12, 2018
@markfinst
Copy link

Should users be able to convert from Jetpack Gallery to default gallery and vice versa? (like it's done with old [gallery] implementation).

If user creates a Jetpack Gallery and then deactivates the plugin, it will break. Or I am missing something?

@simison
Copy link
Member Author

simison commented Oct 5, 2018 via email

@markfinst
Copy link

and vice versa?

I mean two scenarios:

First

  • A user has a 100 posts, each with a gallery created via default Gutenberg gallery block.
  • Installs Jetpack plugin.
  • Checks option "[] Display all your gallery pictures as a cool mosaic"

Expected behavior: all galleries are now displayed as a tiled mosaic.

Second

  • A user has a 100 posts, each with a gallery created via Jetpack gallery block.
  • User deactivates Jetpack plugin

Expected behavior: all galleries are now displayed as default Gutenberg gallery.


Should the gallery block be rendered just on the backend to preserve backward compatibility? (instead of being rendered only on frontend via React)

@MichaelArestad
Copy link
Contributor

Expected behavior: all galleries are now displayed as default Gutenberg gallery.

I think this really gets at the core of how blocks should behave when a block is no longer available. There are certain blocks like Tiled Galleries, where it would make sense to just fall back to a core gallery. However, I do not really know the best way to make that happen. It seems like something core Gutenberg should support at some point. @mtias what do you think?

@simison
Copy link
Member Author

simison commented Nov 6, 2018

Follow-ups to #27458

@simison simison closed this as completed Nov 6, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
[Goal] Gutenberg Working towards full integration with Gutenberg [Type] Task
Projects
None yet
Development

No branches or pull requests

5 participants