Skip to content

Commit

Permalink
Jetpack: Add WAF settings notice and Protect CTA (#38741)
Browse files Browse the repository at this point in the history
* Security Settings: Redirect to Protect dashboard for Firewall settings, when available

changelog

Updates

* Use isPluginActive instead of isPluginInstalled when considering whether to direct user to standalone plugin screen

* Add WAF settings notice, and Protect CTA

* Make CTA not external

* Fix typo

---------

Co-authored-by: Nate Weller <[email protected]>
  • Loading branch information
2 people authored and gogdzl committed Oct 25, 2024
1 parent 9cfb5b6 commit 647a244
Show file tree
Hide file tree
Showing 2 changed files with 19 additions and 0 deletions.
15 changes: 15 additions & 0 deletions projects/plugins/jetpack/_inc/client/security/waf.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,8 @@ import { FormFieldset } from 'components/forms';
import { createNotice, removeNotice } from 'components/global-notices/state/notices/actions';
import JetpackBanner from 'components/jetpack-banner';
import { withModuleSettingsFormHelpers } from 'components/module-settings/with-module-settings-form-helpers';
import SimpleNotice from 'components/notice';
import NoticeAction from 'components/notice/notice-action';
import SettingsCard from 'components/settings-card';
import SettingsGroup from 'components/settings-group';
import {
Expand Down Expand Up @@ -499,6 +501,18 @@ export const Waf = class extends Component {
hideButton={ true }
>
{ isWafActive && <QueryWafSettings /> }
<SimpleNotice
showDismiss={ false }
status="is-info"
text={ __(
'The settings for the Firewall will be moved to Jetpack Protect in Jetpack version 13.10.',
'jetpack'
) }
>
<NoticeAction href={ this.props.getProtectUrl }>
{ __( 'Get Jetpack Protect', 'jetpack' ) }
</NoticeAction>
</SimpleNotice>
<SettingsGroup
disableInOfflineMode
module={ this.props.getModule( 'waf' ) }
Expand Down Expand Up @@ -545,6 +559,7 @@ export default connect(
isProtectActive: PROTECT_PLUGIN_FILES.some( pluginFile =>
isPluginActive( state, pluginFile )
),
getProtectUrl: `${ getSiteAdminUrl( state ) }admin.php?page=my-jetpack#/add-protect`,
isFetchingSettings: isFetchingWafSettings( state ),
isUpdatingWafSettings: isUpdatingWafSettings( state ),
settings: getWafSettings( state ),
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
Significance: minor
Type: other

Security Settings: Redirect to Protect dashboard for Firewall settings, when available.

0 comments on commit 647a244

Please sign in to comment.