Skip to content

Commit 9695fe3

Browse files
authored
Merge pull request #14507 from guardian/ph-20250916-1117-definitions
[auxia] update the determination of mandatoriness
2 parents 945bd73 + 9c32064 commit 9695fe3

File tree

2 files changed

+7
-3
lines changed

2 files changed

+7
-3
lines changed

dotcom-rendering/src/components/SignInGate/gateDesigns/SignInGateAuxiaV1.tsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -45,11 +45,11 @@ export const SignInGateAuxiaV1 = ({
4545
body,
4646
first_cta_name: firstCtaName,
4747
first_cta_link: firstCtaLink,
48-
second_cta_name: secondCtaName,
4948
} = JSON.parse(userTreatment.treatmentContent) as TreatmentContentDecoded;
5049

5150
const has = (s?: string) => !!s && s.trim() !== '';
52-
const isDismissible = has(secondCtaName);
51+
const isDismissible =
52+
userTreatment.treatmentType === 'DISMISSABLE_SIGN_IN_GATE';
5353
const dismissStatusLabel = isDismissible
5454
? 'dismissible'
5555
: 'non-dismissible';

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

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -98,13 +98,17 @@ export interface TreatmentContentDecoded {
9898
second_cta_name?: string;
9999
}
100100

101+
export type AuxiaAPIResponseDataUserTreatmentType =
102+
| 'DISMISSABLE_SIGN_IN_GATE'
103+
| 'NONDISMISSIBLE_SIGN_IN_GATE';
104+
101105
export interface AuxiaAPIResponseDataUserTreatment {
102106
treatmentId: string;
103107
treatmentTrackingId: string;
104108
rank: string;
105109
contentLanguageCode: string;
106110
treatmentContent: string;
107-
treatmentType: string;
111+
treatmentType: AuxiaAPIResponseDataUserTreatmentType;
108112
surface: string;
109113
}
110114

0 commit comments

Comments
 (0)