Skip to content

Commit

Permalink
Admin Page: Run prettier on files (#11279)
Browse files Browse the repository at this point in the history
* Run yarn reformat-fies

* Update yarn lock file
  • Loading branch information
oskosk authored and brbrr committed Feb 6, 2019
1 parent 39e671b commit 14f5c65
Show file tree
Hide file tree
Showing 14 changed files with 203 additions and 350 deletions.
2 changes: 1 addition & 1 deletion _inc/client/at-a-glance/index.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -139,7 +139,7 @@ class AtAGlance extends Component {

/*
* Non-admin zone...
*/
*/
let stats = '';
if ( this.props.userCanViewStats ) {
stats = <DashStats { ...settingsProps } { ...urls } />;
Expand Down
19 changes: 9 additions & 10 deletions _inc/client/components/jetpack-notices/index.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -205,16 +205,15 @@ class JetpackNotices extends React.Component {
siteConnected={ true === this.props.siteConnectionStatus }
isLinked={ this.props.isLinked }
/>
{ ! this.props.siteConnectionStatus &&
! this.props.userCanConnectSite && (
<SimpleNotice
showDismiss={ false }
status="is-warning"
text={ __(
'This site is not connected to WordPress.com. Please ask the site administrator to connect.'
) }
/>
) }
{ ! this.props.siteConnectionStatus && ! this.props.userCanConnectSite && (
<SimpleNotice
showDismiss={ false }
status="is-warning"
text={ __(
'This site is not connected to WordPress.com. Please ask the site administrator to connect.'
) }
/>
) }
</div>
);
}
Expand Down
41 changes: 20 additions & 21 deletions _inc/client/components/masthead/index.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -99,27 +99,26 @@ export class Masthead extends React.Component {
</div>
{ this.props.userCanEditPosts && (
<div className="jp-masthead__nav">
{ ! isStatic &&
this.props.siteConnectionStatus && (
<ButtonGroup>
<Button
compact={ true }
href="#/dashboard"
primary={ isDashboardView && ! isStatic }
onClick={ this.trackDashClick }
>
{ __( 'Dashboard' ) }
</Button>
<Button
compact={ true }
href="#/settings"
primary={ ! isDashboardView && ! isStatic }
onClick={ this.trackSettingsClick }
>
{ __( 'Settings' ) }
</Button>
</ButtonGroup>
) }
{ ! isStatic && this.props.siteConnectionStatus && (
<ButtonGroup>
<Button
compact={ true }
href="#/dashboard"
primary={ isDashboardView && ! isStatic }
onClick={ this.trackDashClick }
>
{ __( 'Dashboard' ) }
</Button>
<Button
compact={ true }
href="#/settings"
primary={ ! isDashboardView && ! isStatic }
onClick={ this.trackSettingsClick }
>
{ __( 'Settings' ) }
</Button>
</ButtonGroup>
) }
</div>
) }
</div>
Expand Down
19 changes: 9 additions & 10 deletions _inc/client/components/support-card/index.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -103,16 +103,15 @@ class SupportCard extends React.Component {
</p>
</div>
</Card>
{ this.props.siteConnectionStatus &&
noPrioritySupport && (
<JetpackBanner
title={ __( 'Get a faster resolution to your support questions.' ) }
plan={ PLAN_JETPACK_PERSONAL }
callToAction={ __( 'Upgrade' ) }
onClick={ this.trackBannerClick }
href={ this.props.supportUpgradeUrl }
/>
) }
{ this.props.siteConnectionStatus && noPrioritySupport && (
<JetpackBanner
title={ __( 'Get a faster resolution to your support questions.' ) }
plan={ PLAN_JETPACK_PERSONAL }
callToAction={ __( 'Upgrade' ) }
onClick={ this.trackBannerClick }
href={ this.props.supportUpgradeUrl }
/>
) }
</div>
);
}
Expand Down
6 changes: 3 additions & 3 deletions _inc/client/main.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -96,9 +96,9 @@ class Main extends React.Component {
};

/*
* Shows a confirmation dialog if there are unsaved module settings.
*
* Return true or false according to the history.listenBefore specification which is part of react-router
* Shows a confirmation dialog if there are unsaved module settings.
*
* Return true or false according to the history.listenBefore specification which is part of react-router
*/
routerWillLeave = () => {
if ( this.props.areThereUnsavedSettings ) {
Expand Down
38 changes: 18 additions & 20 deletions _inc/client/performance/search.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -58,27 +58,25 @@ class Search extends React.Component {
) }
</ModuleToggle>
) }
{ plan_is_business &&
module_enabled && (
<FormFieldset>
<p className="jp-form-setting-explanation">
{ __(
'Add the Jetpack Search widget to your sidebar to configure sorting and filters.'
) }
</p>
</FormFieldset>
) }
</SettingsGroup>
{ plan_is_business &&
module_enabled && (
<Card
compact
className="jp-settings-card__configure-link"
href="customize.php?autofocus[panel]=widgets"
>
{ __( 'Add Jetpack Search Widget' ) }
</Card>
{ plan_is_business && module_enabled && (
<FormFieldset>
<p className="jp-form-setting-explanation">
{ __(
'Add the Jetpack Search widget to your sidebar to configure sorting and filters.'
) }
</p>
</FormFieldset>
) }
</SettingsGroup>
{ plan_is_business && module_enabled && (
<Card
compact
className="jp-settings-card__configure-link"
href="customize.php?autofocus[panel]=widgets"
>
{ __( 'Add Jetpack Search Widget' ) }
</Card>
) }
</SettingsCard>
);
}
Expand Down
21 changes: 10 additions & 11 deletions _inc/client/security/backups-scan.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -207,17 +207,16 @@ export const BackupsScan = withModuleSettingsFormHelpers(
>
{ this.getCardText() }
</SettingsGroup>
{ ! this.props.isUnavailableInDevMode( 'backups' ) &&
scanEnabled && (
<Card
compact
className="jp-settings-card__configure-link"
onClick={ this.trackConfigureClick }
href="https://dashboard.vaultpress.com/"
>
{ __( 'Configure your Security Scans' ) }
</Card>
) }
{ ! this.props.isUnavailableInDevMode( 'backups' ) && scanEnabled && (
<Card
compact
className="jp-settings-card__configure-link"
onClick={ this.trackConfigureClick }
href="https://dashboard.vaultpress.com/"
>
{ __( 'Configure your Security Scans' ) }
</Card>
) }
</SettingsCard>
);
}
Expand Down
21 changes: 10 additions & 11 deletions _inc/client/traffic/ads.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -233,17 +233,16 @@ export const Ads = withModuleSettingsFormHelpers(
</FormFieldset>
) }
</SettingsGroup>
{ ! unavailableInDevMode &&
isAdsActive && (
<Card
compact
className="jp-settings-card__configure-link"
onClick={ this.trackConfigureClick }
href={ this.props.configureUrl }
>
{ __( 'View your earnings' ) }
</Card>
) }
{ ! unavailableInDevMode && isAdsActive && (
<Card
compact
className="jp-settings-card__configure-link"
onClick={ this.trackConfigureClick }
href={ this.props.configureUrl }
>
{ __( 'View your earnings' ) }
</Card>
) }
</SettingsCard>
);
}
Expand Down
21 changes: 10 additions & 11 deletions _inc/client/traffic/related-posts.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -166,17 +166,16 @@ class RelatedPostsComponent extends React.Component {
) }
</FormFieldset>
</SettingsGroup>
{ ! this.props.isUnavailableInDevMode( 'related-posts' ) &&
isRelatedPostsActive && (
<Card
compact
className="jp-settings-card__configure-link"
onClick={ this.trackConfigureClick }
href={ this.props.configureUrl }
>
{ __( 'Configure related posts in the Customizer' ) }
</Card>
) }
{ ! this.props.isUnavailableInDevMode( 'related-posts' ) && isRelatedPostsActive && (
<Card
compact
className="jp-settings-card__configure-link"
onClick={ this.trackConfigureClick }
href={ this.props.configureUrl }
>
{ __( 'Configure related posts in the Customizer' ) }
</Card>
) }
</SettingsCard>
);
}
Expand Down
39 changes: 18 additions & 21 deletions _inc/client/writing/index.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -75,34 +75,31 @@ export class Writing extends React.Component {
className="jp-settings-description"
/>

{ this.props.isModuleFound( 'masterbar' ) &&
! this.props.masterbarIsAlwaysActive && (
<Masterbar connectUrl={ this.props.connectUrl } { ...commonProps } />
) }
{ this.props.isModuleFound( 'masterbar' ) && ! this.props.masterbarIsAlwaysActive && (
<Masterbar connectUrl={ this.props.connectUrl } { ...commonProps } />
) }
{ showComposing && (
<Composing { ...commonProps } userCanManageModules={ this.props.userCanManageModules } />
) }
{ this.props.isModuleFound( 'custom-content-types' ) && (
<CustomContentTypes { ...commonProps } />
) }
<ThemeEnhancements { ...commonProps } />
{ this.props.isModuleFound( 'post-by-email' ) &&
showPostByEmail && (
<PostByEmail
{ ...commonProps }
connectUrl={ this.props.connectUrl }
isLinked={ this.props.isLinked }
userCanManageModules={ this.props.userCanManageModules }
/>
) }
{ ! showComposing &&
! showPostByEmail && (
<Card>
{ __(
'Writing tools available to you will be shown here when an administrator enables them.'
) }
</Card>
) }
{ this.props.isModuleFound( 'post-by-email' ) && showPostByEmail && (
<PostByEmail
{ ...commonProps }
connectUrl={ this.props.connectUrl }
isLinked={ this.props.isLinked }
userCanManageModules={ this.props.userCanManageModules }
/>
) }
{ ! showComposing && ! showPostByEmail && (
<Card>
{ __(
'Writing tools available to you will be shown here when an administrator enables them.'
) }
</Card>
) }
</div>
);
}
Expand Down
19 changes: 9 additions & 10 deletions _inc/client/writing/masterbar.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -53,16 +53,15 @@ export const Masterbar = withModuleSettingsFormHelpers(
{ __( 'Enable the WordPress.com toolbar' ) }
</ModuleToggle>
</SettingsGroup>
{ ! this.props.isUnavailableInDevMode( 'masterbar' ) &&
! this.props.isLinked && (
<Card
compact
className="jp-settings-card__configure-link"
href={ `${ this.props.connectUrl }&from=unlinked-user-masterbar` }
>
{ __( 'Create a Jetpack account to use this feature' ) }
</Card>
) }
{ ! this.props.isUnavailableInDevMode( 'masterbar' ) && ! this.props.isLinked && (
<Card
compact
className="jp-settings-card__configure-link"
href={ `${ this.props.connectUrl }&from=unlinked-user-masterbar` }
>
{ __( 'Create a Jetpack account to use this feature' ) }
</Card>
) }
</SettingsCard>
);
}
Expand Down
19 changes: 9 additions & 10 deletions _inc/client/writing/post-by-email.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -97,16 +97,15 @@ class PostByEmail extends React.Component {
</Button>
</FormFieldset>
</SettingsGroup>
{ ! this.props.isUnavailableInDevMode( 'post-by-email' ) &&
! this.props.isLinked && (
<Card
compact
className="jp-settings-card__configure-link"
href={ `${ this.props.connectUrl }&from=unlinked-user-pbe` }
>
{ __( 'Create a Jetpack account to use this feature' ) }
</Card>
) }
{ ! this.props.isUnavailableInDevMode( 'post-by-email' ) && ! this.props.isLinked && (
<Card
compact
className="jp-settings-card__configure-link"
href={ `${ this.props.connectUrl }&from=unlinked-user-pbe` }
>
{ __( 'Create a Jetpack account to use this feature' ) }
</Card>
) }
</SettingsCard>
);
}
Expand Down
Loading

0 comments on commit 14f5c65

Please sign in to comment.