Skip to content

Commit 1823030

Browse files
authored
fix(externalUrls): provide env var for e2ei certificate support link [WPB-18339] (#19209)
1 parent 5629426 commit 1823030

File tree

3 files changed

+14
-16
lines changed

3 files changed

+14
-16
lines changed

server/config/client.config.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -113,6 +113,7 @@ export function generateConfig(params: ConfigGeneratorParams, env: Env) {
113113
DEVICE_ACCESS_DENIED: env.URL_SUPPORT_DEVICE_ACCESS_DENIED,
114114
DEVICE_NOT_FOUND: env.URL_SUPPORT_DEVICE_NOT_FOUND,
115115
E2EI_VERIFICATION: env.URL_SUPPORT_E2EI_VERIFICATION,
116+
E2EI_VERIFICATION_CERTIFICATE: env.URL_SUPPORT_E2EI_VERIFICATION_CERTIFICATE,
116117
EMAIL_EXISTS: env.URL_SUPPORT_EMAIL_EXISTS,
117118
FEDERATION_STOP: env.URL_SUPPORT_FEDERATION_STOP,
118119
HISTORY: env.URL_SUPPORT_HISTORY,

server/config/env.ts

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -323,6 +323,8 @@ export type Env = {
323323

324324
URL_SUPPORT_E2EI_VERIFICATION: string;
325325

326+
URL_SUPPORT_E2EI_VERIFICATION_CERTIFICATE: string;
327+
326328
URL_SUPPORT_DECRYPT_ERROR: string;
327329

328330
URL_SUPPORT_PRIVACY_UNVERIFIED_USERS: string;

src/script/E2EIdentity/Modals/Modals.ts

Lines changed: 11 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -88,6 +88,8 @@ export const getModalOptions = ({
8888

8989
const settingsChangedParagraph = t('acme.settingsChanged.paragraph', undefined, {br: '<br>', ...replaceLearnMore});
9090

91+
const supportUrl = Config.getConfig().URL.SUPPORT.E2EI_VERIFICATION_CERTIFICATE;
92+
9193
switch (type) {
9294
case ModalType.ENROLL:
9395
options = {
@@ -115,14 +117,8 @@ export const getModalOptions = ({
115117
text: {
116118
closeBtnLabel: t('acme.renewCertificate.button.close'),
117119
htmlMessage: extraParams?.isGracePeriodOver
118-
? // @ts-expect-error
119-
// the "url" should be provided
120-
// TODO: check it when changing this code
121-
t('acme.renewCertificate.gracePeriodOver.paragraph')
122-
: // @ts-expect-error
123-
// the "url" should be provided
124-
// TODO: check it when changing this code
125-
t('acme.renewCertificate.paragraph'),
120+
? t('acme.renewCertificate.gracePeriodOver.paragraph', {url: supportUrl})
121+
: t('acme.renewCertificate.paragraph', {url: supportUrl}),
126122
title: t('acme.renewCertificate.headline.alt'),
127123
},
128124
primaryAction: {
@@ -160,10 +156,10 @@ export const getModalOptions = ({
160156
options = {
161157
text: {
162158
closeBtnLabel: t('acme.settingsChanged.button.close'),
163-
// @ts-expect-error
164-
// the "url" should be provided
165-
// TODO: check it when changing this code
166-
htmlMessage: t('acme.remindLater.paragraph', {delayTime: extraParams?.delayTime}),
159+
htmlMessage: t('acme.remindLater.paragraph', {
160+
delayTime: extraParams?.delayTime ?? 0,
161+
url: supportUrl,
162+
}),
167163
title: t('acme.settingsChanged.headline.alt'),
168164
},
169165
primaryAction: {
@@ -214,10 +210,9 @@ export const getModalOptions = ({
214210
text: {
215211
closeBtnLabel: t('acme.done.button.close'),
216212
htmlMessage: `<div style="text-align: center">${svgHtml}${
217-
// @ts-expect-error
218-
// the "url" should be provided
219-
// TODO: check it when changing this code
220-
extraParams?.isRenewal ? t('acme.renewal.done.paragraph') : t('acme.done.paragraph')
213+
extraParams?.isRenewal
214+
? t('acme.renewal.done.paragraph', {url: supportUrl})
215+
: t('acme.done.paragraph', {url: supportUrl})
221216
}</div>`,
222217
title: extraParams?.isRenewal ? t('acme.renewal.done.headline') : t('acme.done.headline'),
223218
},

0 commit comments

Comments
 (0)