-
Notifications
You must be signed in to change notification settings - Fork 808
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
Protect: Add routing and blank Firewall page #27245
Conversation
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. 🔴 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: 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. Protect plugin:
|
Are you an Automattician? You can now test your Pull Request on WordPress.com. On your sandbox, run |
052da4a
to
aff1142
Compare
c10236e
to
50ad35d
Compare
e0047ca
to
144532c
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.
Works great! A few minor merge conflicts to address, but otherwise ready to go!
… reusable page wrapper
ff63c22
to
9eb7904
Compare
* Initialize project branch * Protect: Add WAF package (#27530) * Protect: Clean up components (#27256) * Protect: Add routing and blank Firewall page (#27245) * Protect: Add Tabbed Navigation (#27259) * Protect: Add "new" badge for users who have never viewed the Firewall tab (#27265) * Protect: Add useWafData hook (#27307) * Add: Protect WAF header (#27279) * Add hook for interfacing with WAF data * [not verified] Add firewall-header component folder structure * [not verified] Apply header component code and styling * [not verified] Remove unneeded comments * [not verified] Update hasRequiredPlan check to useProtectData * [not verified] Fix typo * Add FirewallHeader component stories and improve portability * Add useWafData hook placeholder for moduleIsEnabled check * [not verified] Remove isModuleEnabled property in favor of currently available WAF data * [not verified] Remove console logging * [not verified] Add upgrade functionality to button * [not verified] Add Popover component for upgrade info * Fix styling issues * Create ConnectedFirewallHeader component and move all logic out of FirewallPage * Improve code efficiency * Update FirewallHeader status check, and checkout flow redirect URL * changelog * [not verified] Remove changelog entry * Change FirewallUrl to firewallUrl Co-authored-by: Nate Weller <nate.weller@automattic.com> * Protect: Add WAF footer (#27280) * Add hook for interfacing with WAF data * [not verified] Add firewall-header component folder structure * [not verified] Apply header component code and styling * [not verified] Remove unneeded comments * [not verified] Update hasRequiredPlan check to useProtectData * [not verified] Fix typo * Add FirewallHeader component stories and improve portability * Add useWafData hook placeholder for moduleIsEnabled check * [not verified] Remove isModuleEnabled property in favor of currently available WAF data * [not verified] Remove console logging * [not verified] Add upgrade functionality to button * [not verified] Add Popover component for upgrade info * Introduce and apply FirewallFooter component * Add central AdminSection component for better visualization * Improve spacing * [not verified] Apply initial run at StandaloneModeModal component * [not verified] Update Footer component to ScanFooter * [not verified] Improve StandaloneModeModal structure and styling * [not verified] Add FirewallFooter stories * [not verified] Update FirewallFooter to use SeventyFiveLayout * [not verified] Update styling comments * Fix styling issues * Create ConnectedFirewallHeader component and move all logic out of FirewallPage * Improve code efficiency * Update FirewallHeader status check, and checkout flow redirect URL * changelog * [not verified] Remove changelog entry * Change FirewallUrl to firewallUrl * Fix styling issues Co-authored-by: Nate Weller <nate.weller@automattic.com> * Fix composer.json * Changelog * Protect: Add upgrade prompt while WAF enabled with no rules access (#27584) * Add upgrade prompt when WAF enabled but no rules access * Create separate internal component for upgrade prompt * Add story for on with no plan * WAF: Remove has_rules_access in favour of external checks (#27479) * [not verified] Update WAF package to use portable Current_Plan over Jetpack_Plan for upgrade detection * Add jetpack-plans dependency direct to the WAF package * Add and use hasScan (over hasRulesAccess) check in Jetpack settings for the WAF module * Remove hasRulesAccess property from WAF module component * Remove has_rules_access method in favour of external plan checks * Protect: Add Basic WAF Controls (#27291) * Update Protect to version 1.2.0-alpha * Protect: WAF share data toggle (#27577) * [not verified] Add jetpack_waf_share_data option value to initial state, and use for checked value * [not verified] Remove comments * [not verified] Remove prior solution in favor of WAF endpoints solution and apply toggleShareData functionality to FirewallFooter checkbox * [not verified] Improve share data toggle functionality * [not verified] Improve code organization * [not verified] Add isEnabled check for share data section display * Remove wafShareData from initial state Co-authored-by: Nate Weller <nate.weller@automattic.com> * Changelogs * Remove outdated TODO comment * Protect: Add notices to the Firewall screen (#27621) * Fix invalid HTML - pre cannot be a child of p * Fix notice duration timeout * Remove manual WAF initialization * Register REST routes on WAF init * Create foundation for automatic and manual rules usage separation * Update naming * Update WAF after settings have changed * Add action for tracking initial WAF setup and use for loading header display, swap wording of WAF loading and updating actions, remove redundant actions from useWafData * Remove comments and testing code * Minor updates to pending conditional checks * Add Now Available badge to automatic rules section and an action to check whether the WAF has been toggled since the upgrade * Add popover for upgrade notice regarding automatic rules, assign same conditional as new feature badge * Add option to temporarily dismiss the popover only, rather than permanently remove both popover and new feature badge * Improve variable naming * Revert changes to useWafData hook usage of setWafIsUpdating (previously setWafIsLoading) * Add/remove styling comments * Update tracks events in Jetpack Protect (#27659) * Initialize project branch * Initialize project branch * Update mock data to include WAF properties * Update FirewallHeader component to export sub component and import for story usage * Improve upgrade popover and badge logic and handling * Improve upgrade popover and badge logic and handling * Remove auto vs manual toggle separation and upgrade messaging * Delete old changelog entries * Remove endpoints for upgrade messaging * Remove upgrade messaging endpoints, handling, and content * Remove state handlers for seen upgrade * Remove unneeded comments * Fix footer styling issues in mobile when WAF module not enabled * Remove unneeded comments * Add endpoints, methods, actions and handling for post upgrade messaging * Extract JETPACK_SCAN variable to constants file * Update automatic rules toggle to connect to correlated waf setting * Ensure module is enabled before attempting to update settings * Show a notice when the waf module is disabled * [not verified] Activate WAF module on plugin activation * Disable WAF controls when the module is disabled * Document and organize FirewallPage * Include automatic rules in default formState object * Update styles * Remove CurrentlyEnabledFeatures * Fix saving of automatic rules option in endpoint * Remove testing code * Revert Boost changes introduced in merge * [not verified] Revert Boost changes forced by commit actions * Initialize project branch * [not verified] Revert unrelated masterbar changes auto-merged * Fix indentation * Improve organization and efficiency * Remove unneeded REST_Controller class methods, and apply class and styling suggestions Co-authored-by: Nate Weller <nate.weller@automattic.com>
* Initialize project branch * Protect: Add WAF package (#27530) * Protect: Clean up components (#27256) * Protect: Add routing and blank Firewall page (#27245) * Protect: Add Tabbed Navigation (#27259) * Protect: Add "new" badge for users who have never viewed the Firewall tab (#27265) * Protect: Add useWafData hook (#27307) * Add: Protect WAF header (#27279) * Add hook for interfacing with WAF data * [not verified] Add firewall-header component folder structure * [not verified] Apply header component code and styling * [not verified] Remove unneeded comments * [not verified] Update hasRequiredPlan check to useProtectData * [not verified] Fix typo * Add FirewallHeader component stories and improve portability * Add useWafData hook placeholder for moduleIsEnabled check * [not verified] Remove isModuleEnabled property in favor of currently available WAF data * [not verified] Remove console logging * [not verified] Add upgrade functionality to button * [not verified] Add Popover component for upgrade info * Fix styling issues * Create ConnectedFirewallHeader component and move all logic out of FirewallPage * Improve code efficiency * Update FirewallHeader status check, and checkout flow redirect URL * changelog * [not verified] Remove changelog entry * Change FirewallUrl to firewallUrl Co-authored-by: Nate Weller <nate.weller@automattic.com> * Protect: Add WAF footer (#27280) * Add hook for interfacing with WAF data * [not verified] Add firewall-header component folder structure * [not verified] Apply header component code and styling * [not verified] Remove unneeded comments * [not verified] Update hasRequiredPlan check to useProtectData * [not verified] Fix typo * Add FirewallHeader component stories and improve portability * Add useWafData hook placeholder for moduleIsEnabled check * [not verified] Remove isModuleEnabled property in favor of currently available WAF data * [not verified] Remove console logging * [not verified] Add upgrade functionality to button * [not verified] Add Popover component for upgrade info * Introduce and apply FirewallFooter component * Add central AdminSection component for better visualization * Improve spacing * [not verified] Apply initial run at StandaloneModeModal component * [not verified] Update Footer component to ScanFooter * [not verified] Improve StandaloneModeModal structure and styling * [not verified] Add FirewallFooter stories * [not verified] Update FirewallFooter to use SeventyFiveLayout * [not verified] Update styling comments * Fix styling issues * Create ConnectedFirewallHeader component and move all logic out of FirewallPage * Improve code efficiency * Update FirewallHeader status check, and checkout flow redirect URL * changelog * [not verified] Remove changelog entry * Change FirewallUrl to firewallUrl * Fix styling issues Co-authored-by: Nate Weller <nate.weller@automattic.com> * Fix composer.json * Changelog * Protect: Add upgrade prompt while WAF enabled with no rules access (#27584) * Add upgrade prompt when WAF enabled but no rules access * Create separate internal component for upgrade prompt * Add story for on with no plan * WAF: Remove has_rules_access in favour of external checks (#27479) * [not verified] Update WAF package to use portable Current_Plan over Jetpack_Plan for upgrade detection * Add jetpack-plans dependency direct to the WAF package * Add and use hasScan (over hasRulesAccess) check in Jetpack settings for the WAF module * Remove hasRulesAccess property from WAF module component * Remove has_rules_access method in favour of external plan checks * Protect: Add Basic WAF Controls (#27291) * Update Protect to version 1.2.0-alpha * Protect: WAF share data toggle (#27577) * [not verified] Add jetpack_waf_share_data option value to initial state, and use for checked value * [not verified] Remove comments * [not verified] Remove prior solution in favor of WAF endpoints solution and apply toggleShareData functionality to FirewallFooter checkbox * [not verified] Improve share data toggle functionality * [not verified] Improve code organization * [not verified] Add isEnabled check for share data section display * Remove wafShareData from initial state Co-authored-by: Nate Weller <nate.weller@automattic.com> * Changelogs * Remove outdated TODO comment * Protect: Add notices to the Firewall screen (#27621) * Fix invalid HTML - pre cannot be a child of p * Fix notice duration timeout * Remove manual WAF initialization * Register REST routes on WAF init * Update WAF after settings have changed * Update tracks events in Jetpack Protect (#27659) * Initialize project branch * Initialize project branch * Add existing plan link to pricing page and fix registration redirect to check for plan when rendering the UI * Initialize project branch * Remove changelog entries * Use addQueryArgs and getQueryArgs to check plan and redirect after successful user connection * Update redirect handling after user connection to managed with PHP * changelog * Initial commit. * Check for licenses and redirect users to the license activation page. * Add changelogs and version bumps. * Add changelog files. * Adding filter to backup class * changelog * Fix constant naming * Add Jetpack Complete plan ID's. * Add the filter comment. * Revert prior changes and update as per new standards * Update filter callback format * Revert changes to getProtectFree registration flow * Add plan and status refresh to getProtectFree reg flow and update getStarted button to have a unique loading state * Require jetpack-connection package * Revert direct require of jetpack-connection package * Add checkout flow to get started button to handle license check * Provide plugins with a plugin slug to make sure we only verify licenses for the products we need. * Fix license check based on the plugin slug. * If an appropriate unattached license is found, check if the plugin already has a license activated on the site before redirecting them. * Move the license check code from connection to licensing package. * Update changelog files. * Bump package version. * Replace parse_url() with wp_parse_url(). * Update license check callback to include a plan check * Update UI handling for the loading of various buttons * Remove siteProductAvailabilityHandler arg in the existing checkout flow in favour of plan check in the filter callback * Fix project versions * Add missing product IDs, remove plan check from filter callback in favour of reattaching siteProductAvailabilityHandler to the checkout flow --------- Co-authored-by: Nate Weller <nate.weller@automattic.com> Co-authored-by: Sergey Mitroshin <sergeymitr@gmail.com> Co-authored-by: bindlegirl <1242807+bindlegirl@users.noreply.github.com>
Changes proposed in this Pull Request:
react-router-dom
to Protect, in order to provide routing for the sub-sections within the admin area.<AdminPage />
, and a new<FirewallPage />
is added to the/firewall
route.<ScrollToTop />
component is added to automatically scroll the user to the top of the page on route change.Other information:
Jetpack product discussion
1202232924268038-as-1203279663034176
Does this pull request change what data or activity we track or use?
No
Testing instructions:
/wp-admin/admin.php?page=jetpack-protect
renders the<AdminPage />
component as usual./wp-admin/admin.php?page=jetpack-protect#/firewall
renders the empty<FirewallPage />
component.