Skip to content

Commit

Permalink
Merge branch 'develop' into issue/8049-schedule-crontask-to-sync-adSe…
Browse files Browse the repository at this point in the history
…nseLinked-status.
  • Loading branch information
aaemnnosttv committed Mar 7, 2024
2 parents 6e3d91f + 9a5b02e commit f9ac773
Show file tree
Hide file tree
Showing 191 changed files with 4,711 additions and 2,180 deletions.
2 changes: 2 additions & 0 deletions assets/js/components/DashboardEntityApp.js
Original file line number Diff line number Diff line change
Expand Up @@ -56,6 +56,7 @@ import { Cell, Grid, Row } from '../material-components';
import PageHeader from './PageHeader';
import Layout from './layout/Layout';
import { CORE_WIDGETS } from '../googlesitekit/widgets/datastore/constants';
import ConsentModeSetupCTAWidget from './consent-mode/ConsentModeSetupCTAWidget';
import ScrollEffect from './ScrollEffect';
import EntityBannerNotifications from './notifications/EntityBannerNotifications';
import DashboardSharingSettingsButton from './dashboard-sharing/DashboardSharingSettingsButton';
Expand Down Expand Up @@ -218,6 +219,7 @@ function DashboardEntityApp() {
{ ! viewOnlyDashboard && <DashboardSharingSettingsButton /> }
<HelpMenu />
</Header>
<ConsentModeSetupCTAWidget />
<WidgetContextRenderer
id={ ANCHOR_ID_TRAFFIC }
slug={ CONTEXT_ENTITY_DASHBOARD_TRAFFIC }
Expand Down
2 changes: 2 additions & 0 deletions assets/js/components/DashboardMainApp.js
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,7 @@ import HelpMenu from './help/HelpMenu';
import BannerNotifications from './notifications/BannerNotifications';
import SurveyViewTrigger from './surveys/SurveyViewTrigger';
import CurrentSurveyPortal from './surveys/CurrentSurveyPortal';
import ConsentModeSetupCTAWidget from './consent-mode/ConsentModeSetupCTAWidget';
import ScrollEffect from './ScrollEffect';
import MetricsSelectionPanel from './KeyMetrics/MetricsSelectionPanel';
import {
Expand Down Expand Up @@ -246,6 +247,7 @@ export default function DashboardMainApp() {
{ ! viewOnlyDashboard && <DashboardSharingSettingsButton /> }
<HelpMenu />
</Header>
<ConsentModeSetupCTAWidget />
{ isKeyMetricsWidgetHidden !== true && (
<WidgetContextRenderer
id={ ANCHOR_ID_KEY_METRICS }
Expand Down
4 changes: 4 additions & 0 deletions assets/js/components/Header.js
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,9 @@ import SetupErrorNotification from './notifications/SetupErrorNotification';
import useViewOnly from '../hooks/useViewOnly';
import useDashboardType from '../hooks/useDashboardType';
import Link from './Link';
import SubtleNotifications from './notifications/SubtleNotifications';
import { CORE_SITE } from '../googlesitekit/datastore/site/constants';

const { useSelect } = Data;

function Header( { children, subHeader, showNavigation } ) {
Expand Down Expand Up @@ -117,6 +119,8 @@ function Header( { children, subHeader, showNavigation } ) {

{ showNavigation && <DashboardNavigation /> }

<SubtleNotifications />

<EntityHeader />
</Fragment>
);
Expand Down
101 changes: 101 additions & 0 deletions assets/js/components/consent-mode/ConfirmDisableConsentModeDialog.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,101 @@
/**
* Site Kit by Google, Copyright 2024 Google LLC
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* https://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/

/**
* External dependencies
*/
import PropTypes from 'prop-types';
import { useMount } from 'react-use';

/**
* WordPress dependencies
*/
import { __, sprintf } from '@wordpress/i18n';

/**
* Internal dependencies
*/
import Data from 'googlesitekit-data';
import { CORE_MODULES } from '../../googlesitekit/modules/datastore/constants';
import { listFormat, trackEvent } from '../../util';
import ModalDialog from '../ModalDialog';
import useViewContext from '../../hooks/useViewContext';

const { useSelect } = Data;

export default function ConfirmDisableConsentModeDialog( {
onConfirm,
onCancel,
} ) {
const viewContext = useViewContext();

const dependentModuleNames = useSelect( ( select ) =>
// TODO: Add the Ads module to this list when the Ads Conversion ID is migrated to it.
[ 'analytics-4' ].reduce( ( names, slug ) => {
if ( select( CORE_MODULES ).isModuleConnected( slug ) ) {
return [
...names,
select( CORE_MODULES ).getModule( slug ).name,
];
}
return names;
}, [] )
);

const dependentModulesText =
dependentModuleNames.length > 0
? sprintf(
/* translators: %s: list of dependent modules */
__(
'these active modules depend on consent mode and will be affected: %s',
'google-site-kit'
),
listFormat( dependentModuleNames )
)
: null;

useMount( () => {
trackEvent( `${ viewContext }_CoMo`, 'view_modal' );
} );

return (
<ModalDialog
dialogActive
title={ __( 'Disable consent mode?', 'google-site-kit' ) }
subtitle={ __(
'Disabling consent mode will remove the additional tag from your website. In the European Economic Area, you will no longer be able to track:',
'google-site-kit'
) }
handleConfirm={ onConfirm }
handleDialog={ onCancel }
provides={ [
__( 'Performance of your Ad campaigns', 'google-site-kit' ),
__(
'How visitors interact with your site via Analytics',
'google-site-kit'
),
] }
dependentModules={ dependentModulesText }
confirmButton={ __( 'Disable', 'google-site-kit' ) }
danger
/>
);
}

ConfirmDisableConsentModeDialog.propTypes = {
onConfirm: PropTypes.func.isRequired,
onCancel: PropTypes.func.isRequired,
};
Loading

0 comments on commit f9ac773

Please sign in to comment.