Skip to content

Commit

Permalink
Add multisite conditional for backup AAG card
Browse files Browse the repository at this point in the history
  • Loading branch information
kraftbj committed Feb 12, 2020
1 parent 1d185ab commit 33ff0c9
Showing 1 changed file with 23 additions and 11 deletions.
34 changes: 23 additions & 11 deletions _inc/client/at-a-glance/index.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,12 @@ import DashSearch from './search';
import DashConnections from './connections';
import QuerySitePlugins from 'components/data/query-site-plugins';
import QuerySite from 'components/data/query-site';
import { userCanManageModules, userCanViewStats, userIsSubscriber } from 'state/initial-state';
import {
isMultisite,
userCanManageModules,
userCanViewStats,
userIsSubscriber,
} from 'state/initial-state';
import { isDevMode } from 'state/connection';
import { getModuleOverride } from 'state/modules';

Expand All @@ -48,6 +53,7 @@ class AtAGlance extends Component {
updateOptions: this.props.updateOptions,
getOptionValue: this.props.getOptionValue,
isUpdating: this.props.isUpdating,
multisite: this.props.multisite,
};
const urls = {
siteAdminUrl: this.props.siteAdminUrl,
Expand Down Expand Up @@ -78,20 +84,25 @@ class AtAGlance extends Component {
);
// Status can be unavailable, active, provisioning, awaiting_credentials
const rewindStatus = get( this.props.rewindStatus, [ 'state' ], '' );
const securityCards = [
const securityCards = [];
securityCards.push(
<DashScan
{ ...settingsProps }
siteRawUrl={ this.props.siteRawUrl }
rewindStatus={ rewindStatus }
/>,
<DashBackups
{ ...settingsProps }
siteRawUrl={ this.props.siteRawUrl }
rewindStatus={ rewindStatus }
/>,
<DashAkismet { ...urls } />,
<DashPluginUpdates { ...settingsProps } { ...urls } />,
];
/>
);
if ( ! this.props.multisite ) {
securityCards.push(
<DashBackups
{ ...settingsProps }
siteRawUrl={ this.props.siteRawUrl }
rewindStatus={ rewindStatus }
/>
);
}
securityCards.push( <DashAkismet { ...urls } /> );
securityCards.push( <DashPluginUpdates { ...settingsProps } { ...urls } /> );

if ( 'inactive' !== this.props.getModuleOverride( 'protect' ) ) {
securityCards.push( <DashProtect { ...settingsProps } /> );
Expand Down Expand Up @@ -177,5 +188,6 @@ export default connect( state => {
userIsSubscriber: userIsSubscriber( state ),
isDevMode: isDevMode( state ),
getModuleOverride: module_name => getModuleOverride( state, module_name ),
multisite: isMultisite( state ),
};
} )( withModuleSettingsFormHelpers( AtAGlance ) );

0 comments on commit 33ff0c9

Please sign in to comment.