-
Notifications
You must be signed in to change notification settings - Fork 798
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
Refactor: register business hours block with block.json path #32698
Refactor: register business hours block with block.json path #32698
Conversation
Are you an Automattician? Please test your changes on all WordPress.com environments to help mitigate accidental explosions.
Interested in more tips and information?
|
Thank you for your PR! When contributing to Jetpack, we have a few suggestions that can help us test and review your patch:
This comment will be updated as you work on your PR and make changes. If you think that some of those checks are not needed for your PR, please explain why you think so. Thanks for cooperation 🤖 The e2e test report can be found here. Please note that it can take a few minutes after the e2e tests checks are complete for the report to be available. Once your PR is ready for review, check one last time that all required checks (other than "Required review") appearing at the bottom of this PR are passing or skipped. Jetpack plugin:
|
projects/plugins/jetpack/extensions/blocks/business-hours/business-hours.php
Show resolved
Hide resolved
2d37e5e
to
61f2abf
Compare
21784c9
to
b6c3022
Compare
861d7ba
to
bfcfea7
Compare
5f5bc9f
to
fb2e82e
Compare
bfcfea7
to
100c54d
Compare
ffc5868
to
3e88fae
Compare
projects/plugins/jetpack/extensions/shared/get-block-icon-from-metadata.js
Outdated
Show resolved
Hide resolved
7b0f5c3
to
da6a8e0
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for working on this, Kevin!
I tested this as follows:
- Added a business hours block on latest stable
- Made a few changes and switched to the current branch
- Confirmed the block is there and my changes persisted
- Added a new business hours block and confirmed it behaves as expected
- Confirmed no related errors in console
The only thing I found confusing (though doesn't look related to your changes) is that when editing the block the hours seem to be in my timezone but in view mode they appear in UTC
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Let's give this a try! 🚢
…n path (#32698) * [not verified] Enable block registration by specifying block.json path * [not verified] Add test for registering block by its metadata file * [not verified] Fix failing test * [not verified] Refactor: register business hours block with block.json path * [not verified] Make block CSS right-to-left compatible * [not verified] Remove hardcoded editorScript value in business hours block.json * [not verified] Move code to get block metadata path in Blocks * [not verified] Move logic to render a block icon on the client * [not verified] Remove deprecated file * [not verified] Add changelogs * [not verified] Fix failing JS test * [not verified] Pass package build dir to get_path_to_block_metadata * [not verified] Move block icon helpers to shared-extension-utils package * [not verified] changelog * [not verified] Add missing import * [not verified] Update package version * [not verified] Add missing color-studio dependency to shared-extension-utils * [not verified] Add missing jetpack-constants dep to blocks package * [not verified] Remove call to realpath from get_block_metadata_from_file * [not verified] Fix monorepo package version refs * [not verified] Pass path to source block.json to jetpack_register_block * [not verified] Fix wrong getIconColor import * [not verified] Falls back to reading block.json in source directory * [not verified] Remove color studio dep in shared-extensions-util * [not verified] Bump yoast/phpunit-polyfills version in blocks package * [not verified] Update composer.lock in Jetpack plugin * [not verified] Remove unhelpful changelogs * [not verified] Add fallback logic to get_path_to_block_metadata * Update package version * Fix styling issues caused by span in getBlockIconComponent
See #32602
Proposed changes:
Registers the Business Hours block by specifying the path to its
block.json
file. This was made possible by #32697. The goal is to avoid the duplication of block metadata and useblock.json
as the source of truth.In more details:
block.json
editorScript
fromblock.json
file (automatically added during the build)index.js
toblock.json
index.js
shared-extension-utils
Other information:
Jetpack product discussion
pedMtX-RS-p2
Does this pull request change what data or activity we track or use?
No.
Testing instructions:
Test that the Business Hours block behaves as in production.
Note: blocks metadata don't seem to be localized at the moment in production.