Skip to content

Commit

Permalink
Merge branch 'develop' into new/#5277-setupbanner-create-id.
Browse files Browse the repository at this point in the history
  • Loading branch information
nfmohit committed Aug 24, 2022
2 parents a549c92 + 412f912 commit 7168169
Show file tree
Hide file tree
Showing 243 changed files with 3,483 additions and 2,408 deletions.
5 changes: 2 additions & 3 deletions assets/js/components/ActivateAnalyticsCTA.js
Original file line number Diff line number Diff line change
Expand Up @@ -38,9 +38,8 @@ const { useSelect } = Data;

export default function ActivateAnalyticsCTA( { children } ) {
const activateModuleCallback = useActivateModuleCallback( 'analytics' );
const completeModuleActivationCallback = useCompleteModuleActivationCallback(
'analytics'
);
const completeModuleActivationCallback =
useCompleteModuleActivationCallback( 'analytics' );
const analyticsModuleActive = useSelect( ( select ) =>
select( CORE_MODULES ).isModuleActive( 'analytics' )
);
Expand Down
5 changes: 2 additions & 3 deletions assets/js/components/CompleteModuleActivationCTA.js
Original file line number Diff line number Diff line change
Expand Up @@ -40,9 +40,8 @@ const CompleteModuleActivationCTA = ( { moduleSlug, title, description } ) => {
select( CORE_MODULES ).getModule( moduleSlug )
);

const completeModuleActivationCallback = useCompleteModuleActivationCallback(
moduleSlug
);
const completeModuleActivationCallback =
useCompleteModuleActivationCallback( moduleSlug );

if ( ! completeModuleActivationCallback ) {
return null;
Expand Down
6 changes: 2 additions & 4 deletions assets/js/components/DashboardNavigation/Navigation.js
Original file line number Diff line number Diff line change
Expand Up @@ -247,10 +247,8 @@ export default function Navigation() {
const entityHeader = document
.querySelector( '.googlesitekit-entity-header' )
?.getBoundingClientRect()?.bottom;
const {
bottom: navigationBottom,
top: navigationTop,
} = elementRef?.current?.getBoundingClientRect();
const { bottom: navigationBottom, top: navigationTop } =
elementRef?.current?.getBoundingClientRect();
const margin = 20;

const areas = [
Expand Down
6 changes: 4 additions & 2 deletions assets/js/components/DataBlock.js
Original file line number Diff line number Diff line change
Expand Up @@ -125,7 +125,8 @@ class DataBlock extends Component {
`googlesitekit-data-block--${ context }`,
{
'googlesitekit-data-block--selected': selected,
'googlesitekit-data-block--is-gathering-data': gatheringData,
'googlesitekit-data-block--is-gathering-data':
gatheringData,
}
) }
tabIndex={
Expand Down Expand Up @@ -176,7 +177,8 @@ class DataBlock extends Component {
className={ classnames(
'googlesitekit-data-block__change',
{
'googlesitekit-data-block__change--no-change': ! change,
'googlesitekit-data-block__change--no-change':
! change,
}
) }
>
Expand Down
3 changes: 2 additions & 1 deletion assets/js/components/GatheringDataNotice.js
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,8 @@ function GatheringDataNotice( { style } ) {
return (
<div
className={ classnames( 'googlesitekit-gathering-data-notice', {
[ `googlesitekit-gathering-data-notice--has-style-${ style }` ]: !! style,
[ `googlesitekit-gathering-data-notice--has-style-${ style }` ]:
!! style,
} ) }
>
<span>{ __( 'Gathering data…', 'google-site-kit' ) }</span>
Expand Down
11 changes: 2 additions & 9 deletions assets/js/components/PageHeader.js
Original file line number Diff line number Diff line change
Expand Up @@ -27,15 +27,8 @@ import PropTypes from 'prop-types';
import { Cell, Row } from '../material-components';

export default function PageHeader( props ) {
const {
title,
icon,
className,
status,
statusText,
fullWidth,
children,
} = props;
const { title, icon, className, status, statusText, fullWidth, children } =
props;

const titleCellProps = fullWidth
? {
Expand Down
6 changes: 4 additions & 2 deletions assets/js/components/ReportTable.js
Original file line number Diff line number Diff line change
Expand Up @@ -87,7 +87,8 @@ export default function ReportTable( {
className={ classnames(
'googlesitekit-table__head-item',
{
'googlesitekit-table__head-item--primary': primary,
'googlesitekit-table__head-item--primary':
primary,
},
{ 'hidden-on-mobile': hideOnMobile },
columnClassName
Expand Down Expand Up @@ -152,7 +153,8 @@ export default function ReportTable( {
className={ classnames(
'googlesitekit-table__body-item',
{
'hidden-on-mobile': hideOnMobile,
'hidden-on-mobile':
hideOnMobile,
},
columnClassName
) }
Expand Down
3 changes: 1 addition & 2 deletions assets/js/components/TourTooltips.js
Original file line number Diff line number Diff line change
Expand Up @@ -72,8 +72,7 @@ export const floaterProps = {
spread: 16,
},
floater: {
filter:
'drop-shadow(rgba(60, 64, 67, 0.3) 0px 1px 2px) drop-shadow(rgba(60, 64, 67, 0.15) 0px 2px 6px)',
filter: 'drop-shadow(rgba(60, 64, 67, 0.3) 0px 1px 2px) drop-shadow(rgba(60, 64, 67, 0.15) 0px 2px 6px)',
},
},
};
Expand Down
15 changes: 6 additions & 9 deletions assets/js/components/TourTooltips.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -179,9 +179,8 @@ describe( 'TourTooltips', () => {
} );

it( 'should remove `googlesitekit-showing-feature-tour` class from `body` when tour ends', async () => {
const { baseElement, getByRole } = renderTourTooltipsWithMockUI(
registry
);
const { baseElement, getByRole } =
renderTourTooltipsWithMockUI( registry );

expect(
baseElement.classList.contains(
Expand All @@ -199,9 +198,8 @@ describe( 'TourTooltips', () => {
} );

it( 'should end tour when close icon is clicked', async () => {
const { getByRole, queryByRole } = renderTourTooltipsWithMockUI(
registry
);
const { getByRole, queryByRole } =
renderTourTooltipsWithMockUI( registry );

fireEvent.click( getByRole( 'button', { name: /close/i } ) );

Expand All @@ -212,9 +210,8 @@ describe( 'TourTooltips', () => {
it( 'should end tour when "Got it" button is clicked', async () => {
registry.dispatch( CORE_UI ).setValue( STEP_KEY, FINAL_STEP );

const { getByRole, queryByRole } = renderTourTooltipsWithMockUI(
registry
);
const { getByRole, queryByRole } =
renderTourTooltipsWithMockUI( registry );

fireEvent.click( getByRole( 'button', { name: /got it/i } ) );

Expand Down
5 changes: 2 additions & 3 deletions assets/js/components/UserMenu.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -130,9 +130,8 @@ describe( 'UserMenu', () => {
);

await waitFor( () => {
const dialog = document.querySelector(
'.mdc-dialog--open'
);
const dialog =
document.querySelector( '.mdc-dialog--open' );

expect( dialog ).not.toBeInTheDocument();
} );
Expand Down
2 changes: 1 addition & 1 deletion assets/js/components/ViewOnlyMenu/Service.js
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,7 @@ export default function Service( { module } ) {
owner.login
),
{
strong: <strong />,
strong: <strong title={ owner.login } />,
}
) }
</span>
Expand Down
3 changes: 2 additions & 1 deletion assets/js/components/ViewOnlyMenu/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -79,7 +79,8 @@ export default function ViewOnlyMenu() {
'googlesitekit-dropdown-menu__icon-menu',
'mdc-menu-surface--anchor',
{
'googlesitekit-view-only-menu--user-can-authenticate': canAuthenticate,
'googlesitekit-view-only-menu--user-can-authenticate':
canAuthenticate,
}
) }
>
Expand Down
5 changes: 2 additions & 3 deletions assets/js/components/adminbar/AdminBarClicks.stories.js
Original file line number Diff line number Diff line change
Expand Up @@ -29,9 +29,8 @@ import {
import AdminBarClicks from './AdminBarClicks';
import WithRegistrySetup from '../../../../tests/js/WithRegistrySetup';

const WidgetWithComponentProps = withWidgetComponentProps( 'widget-slug' )(
AdminBarClicks
);
const WidgetWithComponentProps =
withWidgetComponentProps( 'widget-slug' )( AdminBarClicks );

const Template = ( { setupRegistry = () => {}, ...args } ) => (
<WithRegistrySetup func={ setupRegistry }>
Expand Down
5 changes: 2 additions & 3 deletions assets/js/components/adminbar/AdminBarImpressions.stories.js
Original file line number Diff line number Diff line change
Expand Up @@ -29,9 +29,8 @@ import {
import AdminBarImpressions from './AdminBarImpressions';
import WithRegistrySetup from '../../../../tests/js/WithRegistrySetup';

const WidgetWithComponentProps = withWidgetComponentProps( 'widget-slug' )(
AdminBarImpressions
);
const WidgetWithComponentProps =
withWidgetComponentProps( 'widget-slug' )( AdminBarImpressions );

const Template = ( { setupRegistry = () => {}, ...args } ) => (
<WithRegistrySetup func={ setupRegistry }>
Expand Down
5 changes: 2 additions & 3 deletions assets/js/components/adminbar/AdminBarSessions.stories.js
Original file line number Diff line number Diff line change
Expand Up @@ -29,9 +29,8 @@ import {
import WithRegistrySetup from '../../../../tests/js/WithRegistrySetup';
import AdminBarSessions from './AdminBarSessions';

const WidgetWithComponentProps = withWidgetComponentProps( 'widget-slug' )(
AdminBarSessions
);
const WidgetWithComponentProps =
withWidgetComponentProps( 'widget-slug' )( AdminBarSessions );

const Template = ( { setupRegistry = () => {}, ...args } ) => (
<WithRegistrySetup func={ setupRegistry }>
Expand Down
15 changes: 6 additions & 9 deletions assets/js/components/adminbar/AdminBarWidgets.js
Original file line number Diff line number Diff line change
Expand Up @@ -53,19 +53,16 @@ const WIDGET_CLICKS = 'adminBarClicks';
const WIDGET_VISITORS = 'adminBarUniqueVisitors';
const WIDGET_SESSIONS = 'adminBarSessions';
// Search Console widgets.
const AdminBarImpressionsWidget = withWidgetComponentProps(
WIDGET_IMPRESSIONS
)( AdminBarImpressions );
const AdminBarClicksWidget = withWidgetComponentProps( WIDGET_CLICKS )(
AdminBarClicks
);
const AdminBarImpressionsWidget =
withWidgetComponentProps( WIDGET_IMPRESSIONS )( AdminBarImpressions );
const AdminBarClicksWidget =
withWidgetComponentProps( WIDGET_CLICKS )( AdminBarClicks );
// Analytics Widgets.
const AdminBarUniqueVisitorsWidget = withWidgetComponentProps(
WIDGET_VISITORS
)( AdminBarUniqueVisitors );
const AdminBarSessionsWidget = withWidgetComponentProps( WIDGET_SESSIONS )(
AdminBarSessions
);
const AdminBarSessionsWidget =
withWidgetComponentProps( WIDGET_SESSIONS )( AdminBarSessions );

export default function AdminBarWidgets() {
const zeroDataStatesEnabled = useFeature( 'zeroDataStates' );
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -157,8 +157,10 @@ export default function Module( { moduleSlug, moduleName, ownerUsername } ) {
'googlesitekit-dashboard-sharing-settings__module',
'googlesitekit-dashboard-sharing-settings__row',
{
'googlesitekit-dashboard-sharing-settings__row--editing': isEditingUserRoles,
'googlesitekit-dashboard-sharing-settings__row--disabled': isLocked,
'googlesitekit-dashboard-sharing-settings__row--editing':
isEditingUserRoles,
'googlesitekit-dashboard-sharing-settings__row--disabled':
isLocked,
}
) }
ref={ moduleRef }
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -87,7 +87,8 @@ export default function DashboardSharingSettings() {
className={ classnames(
'googlesitekit-dashboard-sharing-settings',
{
'googlesitekit-dashboard-sharing-settings--has-multiple-admins': hasMultipleAdmins,
'googlesitekit-dashboard-sharing-settings--has-multiple-admins':
hasMultipleAdmins,
}
) }
>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -104,8 +104,7 @@ MultipleRecoverableModule.args = {
},
};
MultipleRecoverableModule.scenario = {
label:
'Global/ModuleRecoveryAlert/Multiple Recoverable Modules (with access)',
label: 'Global/ModuleRecoveryAlert/Multiple Recoverable Modules (with access)',
delay: 250,
};

Expand Down Expand Up @@ -153,8 +152,7 @@ MultipleRecoverableModuleNoAccess.args = {
},
};
MultipleRecoverableModuleNoAccess.scenario = {
label:
'Global/ModuleRecoveryAlert/Multiple Recoverable Modules (no access)',
label: 'Global/ModuleRecoveryAlert/Multiple Recoverable Modules (no access)',
delay: 250,
};

Expand Down
10 changes: 4 additions & 6 deletions assets/js/components/legacy-setup/search-console.js
Original file line number Diff line number Diff line change
Expand Up @@ -53,12 +53,10 @@ class SearchConsole extends Component {
};

this.handleURLSelect = this.handleURLSelect.bind( this );
this.insertPropertyToSearchConsole = this.insertPropertyToSearchConsole.bind(
this
);
this.submitPropertyEventHandler = this.submitPropertyEventHandler.bind(
this
);
this.insertPropertyToSearchConsole =
this.insertPropertyToSearchConsole.bind( this );
this.submitPropertyEventHandler =
this.submitPropertyEventHandler.bind( this );
}

async componentDidMount() {
Expand Down
14 changes: 4 additions & 10 deletions assets/js/components/legacy-setup/wizard-progress-step.js
Original file line number Diff line number Diff line change
Expand Up @@ -35,15 +35,8 @@ import CheckIcon from '../../../svg/icons/check.svg';

class WizardProgressStep extends Component {
render() {
const {
currentStep,
step,
title,
status,
warning,
error,
stepKey,
} = this.props;
const { currentStep, step, title, status, warning, error, stepKey } =
this.props;

let statusClass = status;
if ( warning ) {
Expand Down Expand Up @@ -73,7 +66,8 @@ class WizardProgressStep extends Component {
`googlesitekit-wizard-progress-step--${ step }`,
`googlesitekit-wizard-progress-step--${ stepKey }`,
{
'googlesitekit-wizard-progress-step--current': currentStep,
'googlesitekit-wizard-progress-step--current':
currentStep,
}
) }
>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -37,9 +37,8 @@ import Button from '../Button';
class WizardStepCompleteSetup extends Component {
constructor( props ) {
super( props );
const {
hasSearchConsoleProperty,
} = global._googlesitekitLegacyData.setup;
const { hasSearchConsoleProperty } =
global._googlesitekitLegacyData.setup;

// Search console property is set for all but the first user.
if ( hasSearchConsoleProperty ) {
Expand Down
11 changes: 6 additions & 5 deletions assets/js/components/notifications/BannerNotification/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -105,9 +105,8 @@ function BannerNotification( {
const [ isClosed, setIsClosed ] = useState( false );
// Start with an undefined dismissed state due to async resolution.
const [ isDismissed, setIsDismissed ] = useState( false );
const [ isAwaitingCTAResponse, setIsAwaitingCTAResponse ] = useState(
false
);
const [ isAwaitingCTAResponse, setIsAwaitingCTAResponse ] =
useState( false );
const cacheKeyDismissed = `notification::dismissed::${ id }`;
// Persists the notification dismissal to browser storage.
// Dismissed notifications don't expire.
Expand Down Expand Up @@ -344,9 +343,11 @@ function BannerNotification( {
className={ classnames( className, 'googlesitekit-publisher-win', {
[ `googlesitekit-publisher-win--${ format }` ]: format,
[ `googlesitekit-publisher-win--${ type }` ]: type,
[ `googlesitekit-publisher-win--${ closedClass }` ]: closedClass,
[ `googlesitekit-publisher-win--${ closedClass }` ]:
closedClass,
'googlesitekit-publisher-win--rounded': rounded,
'googlesitekit-publisher-win--no-bottom-padding': noBottomPadding,
'googlesitekit-publisher-win--no-bottom-padding':
noBottomPadding,
} ) }
>
<Grid
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -51,9 +51,8 @@ const CoreSiteBannerNotification = ( {
learnMoreURL,
title,
} ) => {
const { dismissNotification, acceptNotification } = useDispatch(
CORE_SITE
);
const { dismissNotification, acceptNotification } =
useDispatch( CORE_SITE );
const viewContext = useViewContext();

useMount( () => {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -41,10 +41,8 @@ const UserInputPromptBannerNotification = () => {

const category = `${ viewContext }_user-input-prompt-notification`;

const [
viewNotificationEventFired,
setViewNotificationEventFired,
] = useState( false );
const [ viewNotificationEventFired, setViewNotificationEventFired ] =
useState( false );

useEffect( () => {
if (
Expand Down
Loading

0 comments on commit 7168169

Please sign in to comment.