Skip to content

NEW block variation "Add to calendar"#954

Merged
mauteri merged 15 commits intoGatherPress:developfrom
carstingaxion:feature/blockvariation-add-to-calendar
Oct 22, 2024
Merged

NEW block variation "Add to calendar"#954
mauteri merged 15 commits intoGatherPress:developfrom
carstingaxion:feature/blockvariation-add-to-calendar

Conversation

@carstingaxion
Copy link
Copy Markdown
Collaborator

@carstingaxion carstingaxion commented Oct 18, 2024

Description of the Change

Bildschirmaufzeichnung.vom.18.10.2024.14.10.24.mp4

Closes #606

How to test the Change

  1. Open an event
  2. Add the new "Add to calendar (BUTTONS)" block.
  3. Add the new "Add to calendar (DETAILS)" block.
  4. Save
  5. View in frontend and check that Google & Yahoo buttons work.

Known Issue: ical & outlook have no href attribute.

I guess that WordPress added some escaping to the sources bound to the url attribute of a button.

Because, when I make a debug-change and direct the Block Binding API to output the values into the text attribute, instead of url, one can see that the URLs are properly delivered into the block.

metadata: {
	bindings: {
		text: {
			source: 'gatherpress/add-to-calendar',
			args: {
				service,
			},
		},
	},
},

I think the ical data-uri might just fail against esc_url() or something similar.

grafik

I would not recommend trying to fix this or to do any changes to this PR, but instead move #928 forward!

#928 and another, yet unfinished necessary follow-up (to fully align with #831) will introduce new named endoints like https://example.org/event/test-event-954/ical, which will make the escaping pass and the blocks work like expected.

Changelog Entry

Added - New block variation "Add to calendar"

Credits

Props @carstingaxion

Checklist:

  • I agree to follow this project's Code of Conduct.
  • I have updated the documentation accordingly.
  • I have added tests to cover my change.
  • All new and existing tests pass.

@carstingaxion carstingaxion marked this pull request as ready for review October 21, 2024 16:32
@github-actions
Copy link
Copy Markdown
Contributor

Preview changes with Playground

You can preview the recent changes for PR#954 with the following PHP versions:

PHP Version 8.3

PHP Version 7.4

Download .zip with build changes

Made with 💙 from GatherPress & a little bit of WordPress Playground. Changes will not persist between sessions.

@carstingaxion carstingaxion requested a review from mauteri October 21, 2024 16:33
@mauteri mauteri merged commit df180c7 into GatherPress:develop Oct 22, 2024
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.

Convert add-to-calendar into interactive button block-variation

2 participants