-
Notifications
You must be signed in to change notification settings - Fork 34
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
PLANET-7625: Move scripts away from Twig templates #2502
Open
mardelnet
wants to merge
8
commits into
main
Choose a base branch
from
PLANET-7625_move-scripts-from-twig-templates
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
- Move share buttons script
- Move toggle comment submit script
- Fix share buttons script
- Refactor main enqueuer file
- Move hubspot cookies script
planet-4
added a commit
to greenpeace/planet4-test-deimos
that referenced
this pull request
Jan 16, 2025
/unhold 83279419-b56c-4bef-a1e0-3a3f85efb3ec
- Fix php lint issues
mardelnet
changed the title
PLANET 7625: Move scripts away from Twig templates
PLANET-7625: Move scripts away from Twig templates
Jan 16, 2025
planet-4
added a commit
to greenpeace/planet4-test-nix
that referenced
this pull request
Jan 16, 2025
/unhold e72c5194-204d-41d4-a2ed-f5053a60512a
Test instance is ready 🚀🌑 nix | admin | blocks report | CircleCI | composer-local.json ⌚ 2025.01.16 20:38:32 |
- Fix action names
planet-4
added a commit
to greenpeace/planet4-test-nix
that referenced
this pull request
Jan 16, 2025
/unhold 60ddcb6a-3d6b-4e0d-b6e9-a9e6f95f6b63
- Replace functions
planet-4
added a commit
to greenpeace/planet4-test-nix
that referenced
this pull request
Jan 17, 2025
/unhold 1398557b-c023-4bc6-bbbf-927488377481
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Summary
This PR removes JS scripts from the Twig templates and enqueue them correctly using WordPress methods and Webpack.
Ref: https://jira.greenpeace.org/browse/PLANET-7625
Testing
assets/src/js/toggle_comment_submit.js
. Check the script is not loading on the pages not using a comments form.assets/src/js/share_buttons.js
. Check the script is not loading on the pages that are not using share buttons.assets/src/js/hubspot_cookie.js
Notes
There's still one Twig template using JS scripts:
templates/blocks/google_tag_manager.twig
.Another PR was be opened for it because of its complexity: #2503