Skip to content

Commit eefe403

Browse files
authored
Merge pull request #14281 from guardian/ph-20250725-0701-prelude
refactoring: avoid using negatives in sign-in gate's behaviour names
2 parents b129db0 + 53789de commit eefe403

File tree

2 files changed

+7
-7
lines changed

2 files changed

+7
-7
lines changed

dotcom-rendering/src/components/SignInGate/types.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -122,7 +122,7 @@ export interface AuxiaProxyGetTreatmentsPayload {
122122
mvtId: number;
123123
should_show_legacy_gate_tmp: boolean; // [1]
124124
hasConsented: boolean;
125-
shouldNotServeMandatory: boolean; // [2]
125+
shouldServeDismissible: boolean; // [2]
126126
mustShowDefaultGate: boolean; // [3]
127127
}
128128

@@ -147,7 +147,7 @@ export interface AuxiaProxyGetTreatmentsPayload {
147147

148148
// [2]
149149
// date: 03rd July 2025
150-
// If shouldNotServeMandatory, we should not show a mandatory gate.
150+
// If shouldServeDismissible is true, we should show a dismissible gate.
151151

152152
// [3]
153153
// date: 23rd July 2025

dotcom-rendering/src/components/SignInGateSelector.importable.tsx

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -290,7 +290,7 @@ const fetchProxyGetTreatments = async (
290290
mvtId: number,
291291
should_show_legacy_gate_tmp: boolean,
292292
hasConsented: boolean,
293-
shouldNotServeMandatory: boolean,
293+
shouldServeDismissible: boolean,
294294
mustShowDefaultGate: boolean,
295295
): Promise<AuxiaProxyGetTreatmentsResponse> => {
296296
// pageId example: 'money/2017/mar/10/ministers-to-criminalise-use-of-ticket-tout-harvesting-software'
@@ -314,7 +314,7 @@ const fetchProxyGetTreatments = async (
314314
mvtId,
315315
should_show_legacy_gate_tmp,
316316
hasConsented,
317-
shouldNotServeMandatory,
317+
shouldServeDismissible,
318318
mustShowDefaultGate,
319319
};
320320
const params = {
@@ -330,7 +330,7 @@ const fetchProxyGetTreatments = async (
330330
return Promise.resolve(response);
331331
};
332332

333-
const decideShouldNotServeMandatory = (): boolean => {
333+
const decideShouldServeDismissible = (): boolean => {
334334
// Return a boolean indicating whether or not we accept mandatory gates for this call.
335335
// If the answer is `false` this doesn't decide whether the gate should be displayed or not,
336336
// it only means that if a gate is returned, then it must be mandatory.
@@ -400,7 +400,7 @@ const buildAuxiaGateDisplayData = async (
400400
);
401401
}
402402

403-
const shouldNotServeMandatory = decideShouldNotServeMandatory();
403+
const shouldServeDismissible = decideShouldServeDismissible();
404404

405405
const mustShowDefaultGate = decideMustShowDefaultGate();
406406

@@ -419,7 +419,7 @@ const buildAuxiaGateDisplayData = async (
419419
readerPersonalData.mvtId,
420420
should_show_legacy_gate_tmp,
421421
readerPersonalData.hasConsented,
422-
shouldNotServeMandatory,
422+
shouldServeDismissible,
423423
mustShowDefaultGate,
424424
);
425425

0 commit comments

Comments
 (0)