Skip to content

Commit 99c07d0

Browse files
authored
Merge pull request #717 from google/fix/668-qa
Follow up fixes after QA for #668
2 parents da291a6 + 73d3e21 commit 99c07d0

File tree

4 files changed

+32
-31
lines changed

4 files changed

+32
-31
lines changed

assets/js/modules/analytics/setup.js

Lines changed: 8 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -80,7 +80,7 @@ class AnalyticsSetup extends Component {
8080
this.processPropertyChange = this.processPropertyChange.bind( this );
8181
this.handleSubmit = this.handleSubmit.bind( this );
8282
this.handleRadioClick = this.handleRadioClick.bind( this );
83-
this.handleAMPClientIdSwitch = this.handleAMPClientIdSwitch.bind( this );
83+
this.handleAMPClientIDSwitch = this.handleAMPClientIDSwitch.bind( this );
8484
this.handleRefetchAccount = this.handleRefetchAccount.bind( this );
8585
}
8686

@@ -252,8 +252,8 @@ class AnalyticsSetup extends Component {
252252
try {
253253
// Send existing tag data to get account.
254254
const queryArgs = existingTagData ? {
255-
existingAccountId: existingTagData.accountId,
256-
existingPropertyId: existingTagData.propertyId,
255+
existingAccountID: existingTagData.accountId, // Capitalization rule exception: `accountId` is a property of an API returned value.
256+
existingPropertyID: existingTagData.propertyId, // Capitalization rule exception: `propertyId` is a property of an API returned value.
257257
} : {};
258258

259259
const responseData = await data.get( TYPE_MODULES, 'analytics', 'accounts-properties-profiles', queryArgs );
@@ -273,10 +273,10 @@ class AnalyticsSetup extends Component {
273273
}
274274

275275
if ( matchedProperty ) {
276-
selectedAccount = matchedProperty.accountId;
276+
selectedAccount = matchedProperty.accountId; // Capitalization rule exception: `accountId` is a property of an API returned value.
277277
selectedProperty = matchedProperty.id;
278278
const matchedProfile = responseData.profiles.find( ( profile ) => {
279-
return profile.accountId === selectedAccount;
279+
return profile.accountId === selectedAccount; // Capitalization rule exception: `accountId` is a property of an API returned value.
280280
} );
281281
if ( matchedProfile ) {
282282
selectedProfile = matchedProfile.id;
@@ -472,6 +472,7 @@ class AnalyticsSetup extends Component {
472472
if ( propertyID === '0' ) {
473473
internalWebPropertyID = '0';
474474
} else {
475+
// Capitalization rule exception: `internalWebPropertyId` is a property of an API returned value.
475476
internalWebPropertyID = selectedinternalWebProperty || ( properties[ 0 ].internalWebPropertyId || properties[ 0 ].internalWebPropertyId === 0 ? properties[ 0 ].internalWebPropertyId.toString() : null );
476477
}
477478

@@ -539,7 +540,7 @@ class AnalyticsSetup extends Component {
539540
sendAnalyticsTrackingEvent( 'analytics_setup', useSnippet ? 'analytics_tag_enabled' : 'analytics_tag_disabled' );
540541
}
541542

542-
handleAMPClientIdSwitch( ) {
543+
handleAMPClientIDSwitch( ) {
543544
this.setState( {
544545
ampClientIDOptIn: ! this.state.ampClientIDOptIn,
545546
} );
@@ -625,7 +626,7 @@ class AnalyticsSetup extends Component {
625626
<Switch
626627
id="ampClientIDOptIn"
627628
label={ __( 'Opt in AMP Client ID', 'google-site-kit' ) }
628-
onClick={ this.handleAMPClientIdSwitch }
629+
onClick={ this.handleAMPClientIDSwitch }
629630
checked={ ampClientIDOptIn }
630631
hideLabel={ false }
631632
/>

assets/js/modules/optimize/setup.js

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -72,7 +72,7 @@ class OptimizeSetup extends Component {
7272
OptimizeIDValidated: true,
7373
};
7474

75-
this.handleOptimizeIdEntry = this.handleOptimizeIdEntry.bind( this );
75+
this.handleOptimizeIDEntry = this.handleOptimizeIDEntry.bind( this );
7676
this.handleSubmit = this.handleSubmit.bind( this );
7777
this.renderInstructionInfo = this.renderInstructionInfo.bind( this );
7878
this.handleAMPOptimizeEntry = this.handleAMPOptimizeEntry.bind( this );
@@ -162,7 +162,7 @@ class OptimizeSetup extends Component {
162162
} );
163163
}
164164

165-
handleOptimizeIdEntry( e ) {
165+
handleOptimizeIDEntry( e ) {
166166
const validOptimizeID = validateOptimizeID( e.target.value );
167167
if ( this._isMounted ) {
168168
this.setState( {
@@ -302,7 +302,7 @@ class OptimizeSetup extends Component {
302302
` }
303303
label={ __( 'Optimize Container ID', 'google-site-kit' ) }
304304
name="optimizeID"
305-
onChange={ this.handleOptimizeIdEntry }
305+
onChange={ this.handleOptimizeIDEntry }
306306
helperText={ <HelperText>{ __( 'Format: GTM-XXXXXXX.', 'google-site-kit' ) }</HelperText> }
307307
outlined
308308
required

assets/js/modules/tagmanager/setup.js

Lines changed: 16 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -142,21 +142,21 @@ class TagmanagerSetup extends Component {
142142
}
143143

144144
// Verify if user has access to the selected account.
145-
if ( selectedAccount && ! responseData.accounts.find( ( account ) => account.accountId === selectedAccount ) ) {
145+
if ( selectedAccount && ! responseData.accounts.find( ( account ) => account.accountId === selectedAccount ) ) { // Capitalization rule exception: `accountId` is a property of an API returned value.
146146
data.invalidateCacheGroup( TYPE_MODULES, 'tagmanager', 'accounts-containers' );
147147
errorCode = 'insufficientPermissions';
148148
errorMsg = __( 'You currently don\'t have access to this Google Tag Manager account. You can either request access from your team, or remove this Google Tag Manager snippet and connect to a different account.', 'google-site-kit' );
149149
}
150150

151151
const chooseContainer = {
152-
containerId: 0,
153-
publicId: 0,
152+
containerId: 0, // Capitalization rule exception: `containerId` matches an API returned value.
153+
publicId: 0, // Capitalization rule exception: `publicId` is a property of an API returned value.
154154
};
155155
responseData.containers.push( chooseContainer );
156156

157157
if ( this._isMounted ) {
158-
const accountID = responseData.accounts[ 0 ] ? responseData.accounts[ 0 ].accountId : null;
159-
const publicID = responseData.containers[ 0 ] ? responseData.containers[ 0 ].publicId : null;
158+
const accountID = responseData.accounts[ 0 ] ? responseData.accounts[ 0 ].accountId : null; // Capitalization rule exception: `accountId` is a property of an API returned value.
159+
const publicID = responseData.containers[ 0 ] ? responseData.containers[ 0 ].publicId : null; // Capitalization rule exception: `publicId` is a property of an API returned value.
160160

161161
this.setState( {
162162
isLoading: false,
@@ -195,15 +195,15 @@ class TagmanagerSetup extends Component {
195195
const responseData = await data.get( TYPE_MODULES, 'tagmanager', 'containers', queryArgs );
196196

197197
const chooseContainer = {
198-
containerId: 0,
199-
publicId: 0,
198+
containerId: 0, // Capitalization rule exception: `containerId` matches an API returned value.
199+
publicId: 0, // Capitalization rule exception: `publicId` matches an API returned value.
200200
};
201201
responseData.push( chooseContainer );
202202
if ( this._isMounted ) {
203203
this.setState( {
204204
containersLoading: false,
205205
containers: responseData,
206-
selectedContainer: responseData[ 0 ].publicId,
206+
selectedContainer: responseData[ 0 ].publicId, // Capitalization rule exception: `publicId` is a property of an API returned value.
207207
errorCode: false,
208208
} );
209209
}
@@ -237,8 +237,8 @@ class TagmanagerSetup extends Component {
237237
}
238238

239239
googlesitekit.modules.tagmanager.settings = {
240-
accountID: responseData.accountId,
241-
containerID: responseData.containerId,
240+
accountID: responseData.accountId, // Capitalization rule exception: `accountId` is a property of an API returned value.
241+
containerID: responseData.containerId, // Capitalization rule exception: `containerId` is a property of an API returned value.
242242
};
243243

244244
if ( this._isMounted ) {
@@ -392,8 +392,8 @@ class TagmanagerSetup extends Component {
392392
>
393393
{ accounts.map( ( account ) =>
394394
<Option
395-
key={ account.accountId }
396-
value={ account.accountId }>
395+
key={ account.accountId /* Capitalization rule exception: `accountId` is a property of an API returned value. */ }
396+
value={ account.accountId /* Capitalization rule exception: `accountId` is a property of an API returned value. */ }>
397397
{ account.name }
398398
</Option> ) }
399399
</Select>
@@ -409,12 +409,12 @@ class TagmanagerSetup extends Component {
409409
>
410410
{ containers.map( ( container ) =>
411411
<Option
412-
key={ container.containerId }
413-
value={ container.publicId }>
412+
key={ container.containerId /* Capitalization rule exception: `containerId` is a property of an API returned value. */ }
413+
value={ container.publicId /* Capitalization rule exception: `publicId` is a property of an API returned value. */ }>
414414
{
415-
0 === container.publicId ?
415+
0 === container.publicId ? // Capitalization rule exception: `publicId` is a property of an API returned value.
416416
__( 'Set up a new container', 'google-site-kit' ) :
417-
container.publicId
417+
container.publicId /* Capitalization rule exception: `publicId` is a property of an API returned value. */
418418
}
419419
</Option> ) }
420420
</Select>

includes/Modules/Analytics.php

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1023,13 +1023,13 @@ function ( Google_Service_Analytics_Account $account ) {
10231023
'profiles' => array(),
10241024
);
10251025

1026-
if ( ! empty( $data['existingAccountId'] ) && ! empty( $data['existingPropertyId'] ) ) {
1026+
if ( ! empty( $data['existingAccountID'] ) && ! empty( $data['existingPropertyID'] ) ) {
10271027
// If there is an existing tag, pass it through to ensure only the existing tag is matched.
10281028
$properties_profiles = $this->get_data(
10291029
'properties-profiles',
10301030
array(
1031-
'accountID' => $data['existingAccountId'],
1032-
'existingPropertyId' => $data['existingPropertyId'],
1031+
'accountID' => $data['existingAccountID'],
1032+
'existingPropertyID' => $data['existingPropertyID'],
10331033
)
10341034
);
10351035
} else {
@@ -1073,8 +1073,8 @@ function ( Google_Service_Analytics_Account $account ) {
10731073
$current_url = $this->context->get_reference_site_url();
10741074

10751075
// If requested for a specific property, only match by property ID.
1076-
if ( ! empty( $data['existingPropertyId'] ) ) {
1077-
$property_id = $data['existingPropertyId'];
1076+
if ( ! empty( $data['existingPropertyID'] ) ) {
1077+
$property_id = $data['existingPropertyID'];
10781078
$current_urls = array();
10791079
} else {
10801080
$property_id = $this->get_data( 'property-id' );

0 commit comments

Comments
 (0)