Skip to content

Commit 243687b

Browse files
authored
Supporting Double Optin Country (#12342)
### Related Ticket(s) [Noitce & Choice w3 Publisher](https://w3.ibm.com/w3publisher/urx/notice-and-choice-v23) ### Description Notice & Choice is a legally required component to create a form where IBM collects its customer information. This section shows the specific product's legal links, terms, and conditions. Along with this, it collects users' consent regarding communication preferences. ### Changelog **New** **Changed** - Supporting Double Opt-In Country. **Removed** <!-- React and Web Component deploy previews are enabled by default. --> <!-- To enable additional available deploy previews, apply the following --> <!-- labels for the corresponding package: --> <!-- *** "test: e2e": Codesandbox examples and e2e integration tests --> <!-- *** "package: services": Services --> <!-- *** "package: utilities": Utilities --> <!-- *** "RTL": React / Web Components (RTL) --> <!-- *** "feature flag": React / Web Components (experimental) -->
1 parent a2ec2e7 commit 243687b

3 files changed

Lines changed: 420 additions & 247 deletions

File tree

packages/web-components/src/components/notice-choice/__stories__/notice-choice.stories.ts

Lines changed: 29 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -102,6 +102,22 @@ const onEmailStatusChanged = (events: CustomEvent) => {
102102
console.log(`[${events.type}] :`, events.detail);
103103
};
104104

105+
const onCustomNoticeTextChange = (events: CustomEvent) => {
106+
console.log(`[${events.type}] :`, events.detail);
107+
};
108+
109+
const showCustomNotice = {
110+
True: 'true',
111+
False: 'false',
112+
};
113+
114+
const customNoticeText = JSON.stringify({
115+
text: "By providing my contact details, I acknowledge that Apptio, an IBM Company will keep me informed about products, services, and offers. More information on how Apptio, an IBM Company uses data can be found in the <span id='ps'><ps>Apptio, an IBM Company Privacy Statement</ps></span>. California residents, review the <ccpa>California Supplemental Privacy Statement</ccpa>.",
116+
optOutLink: 'https://respond.apptio.com/unsubscribe.html',
117+
psLink: 'https://www.ibm.com/us-en/privacy',
118+
ccpaLink: 'https://www.ibm.com/us-en/privacy/ccpa',
119+
});
120+
105121
const props = () => {
106122
const selectedCountry = select('Country', countryList, 'US');
107123
let availableStates = stateList[selectedCountry] || [{ Unknown: '' }];
@@ -117,13 +133,20 @@ const props = () => {
117133
),
118134
onChange: action('c4d-notice-choice-change'),
119135
onEmailStatusChanged: action('c4d-notice-choice-email-status-changed'),
136+
onCustomNoticeTextChange: action('c4d-notice-choice-text-change'),
120137
hideErrorMessages: select(
121138
'Hide Error Messages',
122139
hideErrorMessages,
123140
'false'
124141
),
125142
environment: select('Environment', environment, 'stage'),
126143
email: text('Email', ''),
144+
customNoticeText: customNoticeText,
145+
showCustomNotice: select(
146+
'Show Custom Notice Text',
147+
showCustomNotice,
148+
'false'
149+
),
127150
};
128151
};
129152

@@ -136,12 +159,10 @@ export const Default = (args) => {
136159
questionchoices,
137160
hideErrorMessages,
138161
enableAllOptIn,
139-
hiddenEmail,
140-
hiddenPhone,
141-
ncTeleDetail,
142-
ncEmailDetail,
162+
customNoticeText,
143163
environment,
144164
email,
165+
showCustomNotice,
145166
} = args?.NoticeChoice ?? {};
146167
return html`
147168
<c4d-notice-choice
@@ -153,13 +174,12 @@ export const Default = (args) => {
153174
terms-condition-link="${termsConditionLink || ''}"
154175
hide-error-message="${hideErrorMessages}"
155176
?enable-all-opt-in=${enableAllOptIn}
156-
.hiddenEmail="${hiddenEmail}"
157-
.hiddenPhone="${hiddenPhone}"
158-
.nc-tele-detail="${ncTeleDetail}"
159-
.nc-email-detail="${ncEmailDetail}"
177+
custom-notice-text=${customNoticeText}
178+
show-custom-notice-text=${showCustomNotice}
160179
environment="${environment}"
161180
@c4d-notice-choice-change=${onChange}
162-
@c4d-notice-choice-email-status-changed=${onEmailStatusChanged}>
181+
@c4d-notice-choice-email-status-changed=${onEmailStatusChanged}
182+
@c4d-notice-choice-text-change=${onCustomNoticeTextChange}>
163183
</c4d-notice-choice>
164184
`;
165185
};

0 commit comments

Comments
 (0)