Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -217,7 +217,6 @@ class DashAkismet extends Component {
label={ labelName }
module="akismet"
support={ support }
status="is-working"
pro={ true }
>
{ getAkismetCounter( akismetData ) }
Expand Down
22 changes: 1 addition & 21 deletions projects/plugins/jetpack/_inc/client/at-a-glance/backups.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,6 @@ import {
import { hasConnectedOwner, isOfflineMode, connectUser } from 'state/connection';
import { getPartnerCoupon, showBackups } from 'state/initial-state';
import { siteHasFeature, isFetchingSiteData } from 'state/site';
import { isPluginInstalled } from 'state/site/plugins';
import BackupGettingStarted from './backup-getting-started';
import BackupUpgrade from './backup-upgrade';

Expand All @@ -53,7 +52,6 @@ const renderCard = props => (
link: getRedirectUrl( 'jetpack-support-backup' ),
} }
className={ props.className + ' dash-backups' }
status={ props.status }
pro={ true }
overrideContent={ props.overrideContent }
>
Expand All @@ -74,7 +72,6 @@ class DashBackups extends Component {
hasBackups: PropTypes.bool.isRequired,
hasRealTimeBackups: PropTypes.bool.isRequired,
isOfflineMode: PropTypes.bool.isRequired,
isVaultPressInstalled: PropTypes.bool.isRequired,
upgradeUrl: PropTypes.string.isRequired,
hasConnectedOwner: PropTypes.bool.isRequired,
backupUndoEvent: PropTypes.any.isRequired,
Expand All @@ -85,7 +82,6 @@ class DashBackups extends Component {
getOptionValue: noop,
vaultPressData: '',
isOfflineMode: false,
isVaultPressInstalled: false,
rewindStatus: '',
trackUpgradeButtonView: noop,
backupUndoEvent: {},
Expand Down Expand Up @@ -183,19 +179,11 @@ class DashBackups extends Component {
}

getVPContent() {
const {
hasBackups,
isFetchingSite,
isVaultPressInstalled,
getOptionValue,
siteRawUrl,
vaultPressData,
} = this.props;
const { hasBackups, isFetchingSite, getOptionValue, siteRawUrl, vaultPressData } = this.props;

if ( getOptionValue( 'vaultpress' ) && 'success' === ( vaultPressData?.code ?? '' ) ) {
return renderCard( {
className: 'jp-dash-item__is-active',
status: 'is-working',
content: (
<span>
{ vaultPressData?.message ?? '' }
Expand All @@ -219,7 +207,6 @@ class DashBackups extends Component {
if ( hasBackups ) {
return renderCard( {
className: 'jp-dash-item__is-inactive',
status: isVaultPressInstalled ? 'pro-inactive' : 'pro-uninstalled',
content: createInterpolateElement(
__(
'To automatically back up your entire site, please <a>install and activate</a> VaultPress.',
Expand All @@ -243,7 +230,6 @@ class DashBackups extends Component {

return renderCard( {
className: 'jp-dash-item__is-inactive',
status: 'no-pro-uninstalled-or-inactive',
overrideContent: this.getJetpackBackupBanner(),
} );
}
Expand Down Expand Up @@ -308,7 +294,6 @@ class DashBackups extends Component {
const buildCard = message =>
renderCard( {
className: 'jp-dash-item__is-active',
status: 'is-working',
feature: 'rewind',
content: message,
} );
Expand Down Expand Up @@ -378,7 +363,6 @@ class DashBackups extends Component {
renderLoading() {
return renderCard( {
className: '',
status: '',
content: __( 'Loading…', 'jetpack' ),
} );
}
Expand All @@ -391,7 +375,6 @@ class DashBackups extends Component {
) {
return renderCard( {
className: 'jp-dash-item__is-inactive',
status: 'pro-inactive',
content: __(
'Your site is new and may still be preparing backup configuration.',
'jetpack'
Expand Down Expand Up @@ -478,7 +461,6 @@ class DashBackups extends Component {
<>
{ renderCard( {
className: 'jp-dash-item__is-active',
status: 'is-working',
feature: 'rewind',
overrideContent: message,
} ) }
Expand All @@ -505,7 +487,6 @@ class DashBackups extends Component {
<div className="jp-dash-item__interior">
{ renderCard( {
className: 'jp-dash-item__is-inactive',
status: 'no-pro-uninstalled-or-inactive',
content: __( 'Unavailable in Offline Mode.', 'jetpack' ),
} ) }
</div>
Expand All @@ -532,7 +513,6 @@ export default connect(
return {
vaultPressData: getVaultPressData( state ),
isOfflineMode: isOfflineMode( state ),
isVaultPressInstalled: isPluginInstalled( state, 'vaultpress/vaultpress.php' ),
showBackups: showBackups( state ),
upgradeUrl: getProductDescriptionUrl( state, 'backup' ),
hasConnectedOwner: hasConnectedOwner( state ),
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ class DashMonitor extends Component {
this.props.hasConnectedOwner
) {
return (
<DashItem label={ labelName } module="monitor" support={ support } status="is-working">
<DashItem label={ labelName } module="monitor" support={ support }>
<p className="jp-dash-item__description">
{ __(
'Jetpack is monitoring your site. If we think your site is down, you will receive an email.',
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ class DashPhoton extends Component {

if ( this.props.getOptionValue( 'photon' ) ) {
return (
<DashItem label={ labelName } module="photon" support={ support } status="is-working">
<DashItem label={ labelName } module="photon" support={ support }>
<p className="jp-dash-item__description">
{ __(
"Jetpack is optimizing your image sizes and download speed using our fast global network of servers. This improves your site's performance on desktop and mobile devices.",
Expand Down
3 changes: 1 addition & 2 deletions projects/plugins/jetpack/_inc/client/at-a-glance/protect.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,6 @@ class DashProtect extends Component {
label={ labelName }
module="protect"
support={ support }
status="is-working"
className="jp-dash-item__recently-activated"
>
<div className="jp-dash-item__recently-activated-lower">
Expand All @@ -68,7 +67,7 @@ class DashProtect extends Component {
}

return (
<DashItem label={ labelName } module="protect" support={ support } status="is-working">
<DashItem label={ labelName } module="protect" support={ support }>
<h2 className="jp-dash-item__count">{ formatNumber( protectCount ) }</h2>
<p className="jp-dash-item__description">
{ __( 'Total malicious attacks blocked on your site.', 'jetpack' ) }
Expand Down
7 changes: 0 additions & 7 deletions projects/plugins/jetpack/_inc/client/at-a-glance/scan.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,6 @@ const renderCard = props => (
link: getRedirectUrl( 'jetpack-support-security' ),
} }
className={ props.className || '' }
status={ props.status || '' }
pro={ true }
overrideContent={ props.overrideContent }
>
Expand All @@ -69,7 +68,6 @@ const renderCard = props => (
const renderActiveCard = message => {
return renderCard( {
className: 'jp-dash-item__is-active',
status: 'is-working',
content: message,
} );
};
Expand Down Expand Up @@ -145,7 +143,6 @@ class DashScan extends Component {
if ( vaultPressData?.code === 'not_registered' ) {
return renderCard( {
className: 'jp-dash-item__is-inactive',
status: 'not-registered',
content: createInterpolateElement(
__(
'VaultPress is having difficulties scanning. Please make sure your <keyLink>registration key is entered</keyLink>. If you require further assistance please <supportLink>contact support</supportLink>.',
Expand All @@ -172,7 +169,6 @@ class DashScan extends Component {
// No threats; all good
if ( vaultPressData.code === 'success' ) {
return renderCard( {
status: 'is-working',
content: __( "No threats found, you're good to go!", 'jetpack' ),
} );
}
Expand All @@ -196,7 +192,6 @@ class DashScan extends Component {
if ( ! hasSitePlan || ! scanningIncludedInPlan ) {
return renderCard( {
className: 'jp-dash-item__is-inactive',
status: 'no-pro-uninstalled-or-inactive',
overrideContent: hasConnectedOwner ? this.getUpgradeBanner() : this.getConnectBanner(),
} );
}
Expand All @@ -205,7 +200,6 @@ class DashScan extends Component {
if ( this.props.isVaultPressInstalled ) {
return renderCard( {
className: 'jp-dash-item__is-inactive',
status: 'pro-inactive',
content: [
<p className="jp-dash-item__description" key="inactive-scanning">
{ createInterpolateElement(
Expand All @@ -228,7 +222,6 @@ class DashScan extends Component {
// that VaultPress isn't installed at all
return renderCard( {
className: 'jp-dash-item__is-inactive',
status: 'pro-uninstalled',
content: [
<p className="jp-dash-item__description" key="inactive-scanning">
{ createInterpolateElement(
Expand Down
4 changes: 0 additions & 4 deletions projects/plugins/jetpack/_inc/client/at-a-glance/search.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,6 @@ const renderCard = props => (
link: getRedirectUrl( 'jetpack-support-search' ),
} }
className={ props.className }
status={ props.status }
isModule={ props.pro_inactive }
pro={ true }
overrideContent={ props.overrideContent }
Expand Down Expand Up @@ -101,15 +100,13 @@ class DashSearch extends Component {
render() {
if ( this.props.isFetching ) {
return renderCard( {
status: '',
content: __( 'Loading…', 'jetpack' ),
} );
}

if ( this.props.isOfflineMode ) {
return renderCard( {
className: 'jp-dash-item__is-inactive',
status: 'no-pro-uninstalled-or-inactive',
pro_inactive: true,
content: __( 'Unavailable in Offline Mode', 'jetpack' ),
} );
Expand All @@ -118,7 +115,6 @@ class DashSearch extends Component {
if ( ! this.props.hasClassicSearch && ! this.props.hasInstantSearch ) {
return renderCard( {
className: 'jp-dash-item__is-inactive',
status: 'no-pro-uninstalled-or-inactive',
pro_inactive: true,
overrideContent: (
<JetpackBanner
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -84,7 +84,6 @@ class DashVideoPress extends Component {
label={ labelName }
module="videopress"
support={ support }
status="is-working"
overrideContent={
<>
<div className="dops-card jp-dash-item__card">
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
Dash Item
=========

This component is used to display a widget on the At A Glance view. It includes a Section Header with the ability to show the status and a Card.
This component is used to display a widget on the At A Glance view. It includes a Section Header and a Card.

## Example Usage:

Expand All @@ -10,16 +10,15 @@ var DashItem = require( 'components/dashitem' )

render: function() {
return (
<DashItem label="Protect" status="is-success">
<DashItem label="Protect">
Jetpack is actively blocking malicious login attempts.
</DashItem>
);
}
```
## Dash Item
This is the base component and acts as a wrapper for an At A Glance item's title and content. The title and status are displayed within a SectionHeader and the rest of the content is displayed within a Card.
This is the base component and acts as a wrapper for an At A Glance item's title and content. The title is displayed within a SectionHeader and the rest of the content is displayed within a Card.

#### Props
- `label` - *optional* (string) Title of the dash item.
- `status` - *optional* (string) Sets the status colors and icons of the item. Available arguments are `is-success`, `is-warning`, `is-error`, and `is-info`.
- `noToggle` - *optional* (bool) If `true`, the component will not disable the enable/disable toggle.
Original file line number Diff line number Diff line change
Expand Up @@ -18,8 +18,6 @@ import { getModule as _getModule } from 'state/modules';
export class DashItem extends Component {
static propTypes = {
label: PropTypes.string,
status: PropTypes.string,
statusText: PropTypes.string,
disabled: PropTypes.bool,
module: PropTypes.string,
pro: PropTypes.bool,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -41,8 +41,6 @@ describe( 'DashItem', () => {
const testProps = {
label: 'Protect',
module: 'protect',
status: '',
statusText: '',
disabled: true,
pro: true,
isOfflineMode: false,
Expand Down Expand Up @@ -174,7 +172,6 @@ describe( 'DashItem', () => {
const monitorProps = {
module: 'monitor',
label: 'Monitor',
status: '',
pro: false,
isOfflineMode: false,
userCanToggle: true,
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
Significance: patch
Type: other
Comment: Remove the inert DashItem status and statusText props.
Loading