-
Notifications
You must be signed in to change notification settings - Fork 834
DO NOT MERGE Forms: Hide Google export if disabled #45375
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
base: add/forms-integrations-store
Are you sure you want to change the base?
DO NOT MERGE Forms: Hide Google export if disabled #45375
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 🤖 🔴 Action required: Please add missing changelog entries for the following projects: Use the Jetpack CLI tool to generate changelog entries by running the following command: Follow this PR Review Process:
If you have questions about anything, reach out in #jetpack-developers for guidance! |
const list = store.getIntegrations() || []; | ||
return { integration: list.find( ( i: Integration ) => i.id === 'google-drive' ) }; | ||
}, [] ) as { integration?: Integration }; | ||
const { refreshIntegrations } = useDispatch( INTEGRATIONS_STORE ) as IntegrationsDispatch; |
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.
This file had an extra check for if Google was enabled using the useIntegrationStatus hook. Going forward, we'll want to use the new integrations store for single integrations checks like this too. The store allows for immediate checks without an extra endpoint call. You just check if a particular integration slug exists in the list of integrations. I've updated this file to do that. It also now uses the refreshIntegrations() method from the store.
We must merge #45372 before this PR.
Proposed changes:
As of this PR, users can filter what integrations are enabled for Jetpack Forms.
In CIAB, we disable most. We found that when Google Drive is disabled, we still show the Google Drive export card in the forms dashboard, but the export button is a never ending spinner since have a separate check just for the button. This PR uses the new integrations store to check if Google is enabled, and if not, hide that card. It also updates the check on the Export button to use the same store-based check (we could skip this check since the whole card is now hidden).
Before

After

Other information:
Jetpack product discussion
None.
Does this pull request change what data or activity we track or use?
No.
Testing instructions: