Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Enhancement/9902 capitalization first party mode #10010

Merged
merged 10 commits into from
Jan 20, 2025
6 changes: 3 additions & 3 deletions assets/js/components/first-party-mode/FirstPartyModeToggle.js
Original file line number Diff line number Diff line change
Expand Up @@ -141,7 +141,7 @@ export default function FirstPartyModeToggle( { className } ) {
} }
external
aria-label={ __(
'Learn more about first-party mode',
'Learn more about First-party mode',
'google-site-kit'
) }
/>
Expand All @@ -153,7 +153,7 @@ export default function FirstPartyModeToggle( { className } ) {
<SubtleNotificationWithIntersectionObserver
title={ createInterpolateElement(
__(
'Your server’s current settings prevent first-party mode from working. To enable it, please contact your hosting provider and request access to external resources and plugin files. <a>Learn more</a>',
'Your server’s current settings prevent First-party mode from working. To enable it, please contact your hosting provider and request access to external resources and plugin files. <a>Learn more</a>',
'google-site-kit'
),
{
Expand All @@ -168,7 +168,7 @@ export default function FirstPartyModeToggle( { className } ) {
} }
external
aria-label={ __(
'Learn more about first-party mode server requirements',
'Learn more about First-party mode server requirements',
'google-site-kit'
) }
/>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -146,7 +146,7 @@ describe( 'FirstPartyModeToggle', () => {
expect( getByLabelText( 'First-party mode' ) ).toBeDisabled();

expect( container ).toHaveTextContent(
'Your server’s current settings prevent first-party mode from working. To enable it, please contact your hosting provider and request access to external resources and plugin files.'
'Your server’s current settings prevent First-party mode from working. To enable it, please contact your hosting provider and request access to external resources and plugin files.'
);

expect( container ).toMatchSnapshot();
Expand Down Expand Up @@ -174,7 +174,7 @@ describe( 'FirstPartyModeToggle', () => {

expect(
queryByText(
'Your server’s current settings prevent first-party mode from working. To enable it, please contact your hosting provider and request access to external resources and plugin files.'
'Your server’s current settings prevent First-party mode from working. To enable it, please contact your hosting provider and request access to external resources and plugin files.'
)
).not.toBeInTheDocument();

Expand Down Expand Up @@ -213,7 +213,7 @@ describe( 'FirstPartyModeToggle', () => {

expect(
getByText(
'Your server’s current settings prevent first-party mode from working. To enable it, please contact your hosting provider and request access to external resources and plugin files.'
'Your server’s current settings prevent First-party mode from working. To enable it, please contact your hosting provider and request access to external resources and plugin files.'
)
).toBeInTheDocument();

Expand Down Expand Up @@ -255,7 +255,7 @@ describe( 'FirstPartyModeToggle', () => {
expect( mockTrackEvent ).toHaveBeenCalledTimes( 0 );

const learnMoreLink = getByRole( 'link', {
name: 'Learn more about first-party mode (opens in a new tab)',
name: 'Learn more about First-party mode (opens in a new tab)',
} );

learnMoreLink.click();
Expand Down Expand Up @@ -290,7 +290,7 @@ describe( 'FirstPartyModeToggle', () => {
expect( mockTrackEvent ).toHaveBeenCalledTimes( 0 );

const learnMoreLink = getByRole( 'link', {
name: 'Learn more about first-party mode server requirements (opens in a new tab)',
name: 'Learn more about First-party mode server requirements (opens in a new tab)',
} );

learnMoreLink.click();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@ exports[`FirstPartyModeToggle should render in default state 1`] = `
>
Your tag data will be sent through your own domain to improve data quality and help you recover measurement signals.
<a
aria-label="Learn more about first-party mode (opens in a new tab)"
aria-label="Learn more about First-party mode (opens in a new tab)"
class="googlesitekit-cta-link"
href="undefined?doc=first-party-mode-introduction"
rel="noopener noreferrer"
Expand Down Expand Up @@ -136,7 +136,7 @@ exports[`FirstPartyModeToggle should render in disabled state if server requirem
>
Your tag data will be sent through your own domain to improve data quality and help you recover measurement signals.
<a
aria-label="Learn more about first-party mode (opens in a new tab)"
aria-label="Learn more about First-party mode (opens in a new tab)"
class="googlesitekit-cta-link"
href="undefined?doc=first-party-mode-introduction"
rel="noopener noreferrer"
Expand Down Expand Up @@ -167,9 +167,9 @@ exports[`FirstPartyModeToggle should render in disabled state if server requirem
class="googlesitekit-subtle-notification__content"
>
<p>
Your server’s current settings prevent first-party mode from working. To enable it, please contact your hosting provider and request access to external resources and plugin files.
Your server’s current settings prevent First-party mode from working. To enable it, please contact your hosting provider and request access to external resources and plugin files.
<a
aria-label="Learn more about first-party mode server requirements (opens in a new tab)"
aria-label="Learn more about First-party mode server requirements (opens in a new tab)"
class="googlesitekit-cta-link"
href="undefined?doc=first-party-mode-server-requirements"
rel="noopener noreferrer"
Expand Down Expand Up @@ -232,7 +232,7 @@ exports[`FirstPartyModeToggle should render in loading state if the server requi
>
Your tag data will be sent through your own domain to improve data quality and help you recover measurement signals.
<a
aria-label="Learn more about first-party mode (opens in a new tab)"
aria-label="Learn more about First-party mode (opens in a new tab)"
class="googlesitekit-cta-link"
href="undefined?doc=first-party-mode-introduction"
rel="noopener noreferrer"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,7 @@ export default function FirstPartyModeWarningNotification( {
} }
external
aria-label={ __(
'Learn more about first-party mode server requirements',
'Learn more about First-party mode server requirements',
'google-site-kit'
) }
/>
Expand Down
12 changes: 6 additions & 6 deletions assets/js/googlesitekit/datastore/site/first-party-mode.js
Original file line number Diff line number Diff line change
Expand Up @@ -101,7 +101,7 @@ const baseInitialState = {

const baseActions = {
/**
* Saves the first-party mode settings.
* Saves the First-party mode settings.
*
* @since 1.141.0
* @since n.e.x.t Added the survey trigger.
Expand All @@ -125,7 +125,7 @@ const baseActions = {
},

/**
* Sets the first-party mode enabled status.
* Sets the First-party mode enabled status.
*
* @since 1.141.0
*
Expand Down Expand Up @@ -188,7 +188,7 @@ const baseResolvers = {

const baseSelectors = {
/**
* Gets the first-party mode settings.
* Gets the First-party mode settings.
*
* @since 1.141.0
*
Expand All @@ -200,12 +200,12 @@ const baseSelectors = {
},

/**
* Checks if first-party mode is enabled.
* Checks if First-party mode is enabled.
*
* @since 1.141.0
*
* @param {Object} state Data store's state.
* @return {boolean|undefined} True if first-party mode is enabled, otherwise false. Returns undefined if the state is not loaded.
* @return {boolean|undefined} True if First-party mode is enabled, otherwise false. Returns undefined if the state is not loaded.
*/
isFirstPartyModeEnabled: createRegistrySelector( ( select ) => () => {
const { isEnabled } =
Expand Down Expand Up @@ -245,7 +245,7 @@ const baseSelectors = {
} ),

/**
* Indicates whether the current first-party mode settings have changed from what is saved.
* Indicates whether the current First-party mode settings have changed from what is saved.
*
* @since 1.142.0
*
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ import { CORE_SITE } from './constants';
import { surveyTriggerEndpoint } from '../../../../../tests/js/mock-survey-endpoints';
import { CORE_USER } from '../user/constants';

describe( 'core/site First-party Mode', () => {
describe( 'core/site First-party mode', () => {
let registry;

const firstPartyModeSettingsEndpointRegExp = new RegExp(
Expand Down
2 changes: 1 addition & 1 deletion assets/js/modules/ads/components/settings/SettingsView.js
Original file line number Diff line number Diff line change
Expand Up @@ -105,7 +105,7 @@ export default function SettingsView() {
},
{
label: __(
'First-party Mode',
'First-party mode',
'google-site-kit'
),
status: isFPMEnabled,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@ IceEnabled.parameters = {
};

export const FPMEnabled = Template.bind( null );
FPMEnabled.storyName = 'With First-party Mode Enabled';
FPMEnabled.storyName = 'With First-party mode Enabled';
FPMEnabled.args = {
firstPartyMode: true,
};
Expand Down Expand Up @@ -112,9 +112,7 @@ export default {

export const PaxConnected = Template.bind( null );
PaxConnected.storyName = 'With PAX onboarding';
PaxConnected.scenario = {
label: 'Modules/Ads/Settings/SettingsView/PAX',
};
PaxConnected.scenario = {};
hussain-t marked this conversation as resolved.
Show resolved Hide resolved
PaxConnected.parameters = {
features: [ 'adsPax', 'firstPartyMode' ],
};
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -245,7 +245,7 @@ export default function SettingsView() {
? [
{
label: __(
'First-party Mode',
'First-party mode',
'google-site-kit'
),
status: isFPMEnabled,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -81,7 +81,7 @@ IceResolving.parameters = {
};

export const FPMEnabled = Template.bind( null );
FPMEnabled.storyName = 'SettingsView First-party Mode Enabled';
FPMEnabled.storyName = 'SettingsView First-party mode Enabled';
FPMEnabled.args = {
enhancedConversionTracking: false,
firstPartyMode: true,
Expand Down
6 changes: 3 additions & 3 deletions includes/Core/Tags/First_Party_Mode/First_Party_Mode.php
Original file line number Diff line number Diff line change
Expand Up @@ -136,17 +136,17 @@ public function get_debug_fields() {

return array(
'first_party_mode_is_enabled' => array(
'label' => __( 'First-Party Mode: Enabled', 'google-site-kit' ),
'label' => __( 'First-party mode: Enabled', 'google-site-kit' ),
'value' => $this->health_check_debug_field_value( $settings['isEnabled'] ),
'debug' => $this->health_check_debug_field_debug( $settings['isEnabled'] ),
),
'first_party_mode_is_fpm_healthy' => array(
'label' => __( 'First-Party Mode: Service healthy', 'google-site-kit' ),
'label' => __( 'First-party mode: Service healthy', 'google-site-kit' ),
'value' => $this->health_check_debug_field_value( $settings['isFPMHealthy'] ),
'debug' => $this->health_check_debug_field_debug( $settings['isFPMHealthy'] ),
),
'first_party_mode_is_script_access_enabled' => array(
'label' => __( 'First-Party Mode: Script accessible', 'google-site-kit' ),
'label' => __( 'First-party mode: Script accessible', 'google-site-kit' ),
'value' => $this->health_check_debug_field_value( $settings['isScriptAccessEnabled'] ),
'debug' => $this->health_check_debug_field_debug( $settings['isScriptAccessEnabled'] ),
),
Expand Down
8 changes: 4 additions & 4 deletions includes/Core/Tags/GTag.php
Original file line number Diff line number Diff line change
Expand Up @@ -214,7 +214,7 @@ function ( $arg ) {
* Returns the gtag source URL.
*
* @since 1.124.0
* @since 1.142.0 Provides support for first-party mode.
* @since 1.142.0 Provides support for First-party mode.
*
* @return string|false The gtag source URL. False if no tags are added.
*/
Expand All @@ -228,7 +228,7 @@ public function get_gtag_src() {
// of which is used to load the source.
$tag_id = rawurlencode( $this->tags[0]['tag_id'] );

// If first-party mode is active, use the proxy URL to load the GTag script.
// If First-party mode is active, use the proxy URL to load the GTag script.
if ( Feature_Flags::enabled( 'firstPartyMode' ) && $this->is_first_party_mode_active() ) {
return add_query_arg(
array(
Expand All @@ -243,11 +243,11 @@ public function get_gtag_src() {
}

/**
* Checks if first-party mode is active.
* Checks if First-party mode is active.
*
* @since 1.142.0
*
* @return bool True if first-party mode is active, false otherwise.
* @return bool True if First-party mode is active, false otherwise.
*/
protected function is_first_party_mode_active() {
$first_party_mode_settings = new First_Party_Mode_Settings( $this->options );
Expand Down
2 changes: 1 addition & 1 deletion includes/Modules/Ads.php
Original file line number Diff line number Diff line change
Expand Up @@ -315,7 +315,7 @@ public function get_debug_fields() {
),
);

// Add fields from First-party Mode.
// Add fields from First-party mode.
// Note: fields are added in both Analytics and Ads so that the debug fields will show if either module is enabled.
if ( Feature_Flags::enabled( 'firstPartyMode' ) ) {
$first_party_mode = new First_Party_Mode( $this->context );
Expand Down
2 changes: 1 addition & 1 deletion includes/Modules/Analytics_4.php
Original file line number Diff line number Diff line change
Expand Up @@ -596,7 +596,7 @@ public function get_debug_fields() {
);
}

// Add fields from First-party Mode.
// Add fields from First-party mode.
// Note: fields are added in both Analytics and Ads so that the debug fields will show if either module is enabled.
if ( Feature_Flags::enabled( 'firstPartyMode' ) ) {
$first_party_mode = new First_Party_Mode( $this->context );
Expand Down
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading