From 0877ca9ce774b7cf64dc33a92ece5e3574cfb0fb Mon Sep 17 00:00:00 2001 From: Arjita Mitra Date: Thu, 18 Jan 2024 16:06:54 +0100 Subject: [PATCH 1/5] feat: update message for enrollment, renewal, error modal when grace period is over --- src/i18n/en-US.json | 7 +++++-- src/script/E2EIdentity/E2EIdentityEnrollment.ts | 10 ++++++++-- src/script/E2EIdentity/Modals/Modals.ts | 14 ++++++++++---- 3 files changed, 23 insertions(+), 8 deletions(-) diff --git a/src/i18n/en-US.json b/src/i18n/en-US.json index a388094f3a7..cfc70f5a9bd 100644 --- a/src/i18n/en-US.json +++ b/src/i18n/en-US.json @@ -168,7 +168,8 @@ "acme.error.button.primary": "Retry", "acme.error.button.secondary": "Cancel", "acme.error.headline": "Something went wrong", - "acme.error.paragraph": "The certificate couldn’t be issued. [br] You can retry to get the certificate now, or you will get a reminder later.", + "acme.error.paragraph": "The certificate couldn't be issued. [br] You can retry to get the certificate now, or you will get a reminder later.", + "acme.error.gracePeriod.paragraph": "The certificate couldn't be issued. [br] Please try again, or reach out to your team admin.", "acme.inProgress.button.close": "Close window 'Getting Certificate'", "acme.inProgress.headline": "Getting Certificate...", "acme.inProgress.paragraph.alt": "Downloading...", @@ -180,6 +181,7 @@ "acme.renewCertificate.button.secondary": "Remind Me Later", "acme.renewCertificate.headline.alt": "Update end-to-end identity certificate", "acme.renewCertificate.paragraph": "The end-to-end identity certificate for this device expires soon. To keep your communication at the highest security level, update your certificate now.

Enter your identity provider’s credentials in the next step to update the certificate automatically.

Learn more about end-to-end identity ", + "acme.renewCertificate.gracePeriodOver.paragraph": "The end-to-end identity certificate for this device has expired. To keep your Wire communication at the highest security level, please update the certificate.

Enter your identity provider’s credentials in the next step to update the certificate automatically.

Learn more about end-to-end identity ", "acme.renewal.done.headline": "Certificate updated", "acme.renewal.done.paragraph": "The certificate is updated and your device is verified. You can find more details about this certificate in your [bold]Wire Preferences[/bold] under [bold]Devices.[/bold]

Learn more about end-to-end identity ", "acme.renewal.inProgress.headline": "Updating Certificate...", @@ -188,7 +190,8 @@ "acme.settingsChanged.button.secondary": "Remind Me Later", "acme.settingsChanged.headline.alt": "End-to-end identity certificate", "acme.settingsChanged.headline.main": "Team settings changed", - "acme.settingsChanged.paragraph": "As of today, your team uses end-to-end identity to make Wire’s usage more secure and practicable. The device verification takes place automatically using a certificate and replaces the previous manual process. This way, you communicate with the highest security standard.

Enter your identity provider’s credentials in the next step to automatically get a verification certificate for this device.

Learn more about end-to-end identity", + "acme.settingsChanged.paragraph": "As of today, your team uses end-to-end identity to make Wire's usage more secure and practicable. The device verification takes place automatically using a certificate and replaces the previous manual process. This way, you communicate with the highest security standard.

Enter your identity provider's credentials in the next step to automatically get a verification certificate for this device.

Learn more about end-to-end identity", + "acme.settingsChanged.gracePeriodOver.paragraph": "Your team now uses end-to-end identity to make Wire's usage more secure. The device verification takes place automatically using a certificate.

Enter your identity provider's credentials in the next step to automatically get a verification certificate for this device.

Learn more about end-to-end identity", "addParticipantsConfirmLabel": "Add", "addParticipantsHeader": "Add participants", "addParticipantsHeaderWithCounter": "Add participants ({{number}})", diff --git a/src/script/E2EIdentity/E2EIdentityEnrollment.ts b/src/script/E2EIdentity/E2EIdentityEnrollment.ts index c0469af0c2f..27eed6ee137 100644 --- a/src/script/E2EIdentity/E2EIdentityEnrollment.ts +++ b/src/script/E2EIdentity/E2EIdentityEnrollment.ts @@ -365,13 +365,13 @@ export class E2EIHandler extends TypedEventEmitter { // Clear the e2e identity progress this.coreE2EIService.clearAllProgress(); - const isSoftLockEnabled = await shouldEnableSoftLock(this.config!); + const disableSnooze = await shouldEnableSoftLock(this.config!); return new Promise(resolve => { const {modalOptions, modalType} = getModalOptions({ type: ModalType.ERROR, hideClose: true, - hideSecondary: isSoftLockEnabled, + hideSecondary: disableSnooze, primaryActionFn: async () => { this.currentStep = E2EIHandlerStep.INITIALIZED; await this.enroll(); @@ -381,6 +381,9 @@ export class E2EIHandler extends TypedEventEmitter { await this.startEnrollment(ModalType.ENROLL); resolve(); }, + extraParams: { + isGracePeriodOver: disableSnooze, + }, }); PrimaryModal.show(modalType, modalOptions); @@ -406,6 +409,9 @@ export class E2EIHandler extends TypedEventEmitter { this.showSnoozeConfirmationModal(); resolve(); }, + extraParams: { + isGracePeriodOver: disableSnooze, + }, type: modalType, hideClose: true, }); diff --git a/src/script/E2EIdentity/Modals/Modals.ts b/src/script/E2EIdentity/Modals/Modals.ts index 1872b752f12..5d9a9dfe66f 100644 --- a/src/script/E2EIdentity/Modals/Modals.ts +++ b/src/script/E2EIdentity/Modals/Modals.ts @@ -40,7 +40,7 @@ interface GetModalOptions { hideSecondary?: boolean; hidePrimary?: boolean; hideClose?: boolean; - extraParams?: {delayTime?: string; isRenewal?: boolean}; + extraParams?: {delayTime?: string; isRenewal?: boolean; isGracePeriodOver?: boolean}; } export const getModalOptions = ({ type, @@ -69,7 +69,9 @@ export const getModalOptions = ({ options = { text: { closeBtnLabel: t('acme.settingsChanged.button.close'), - htmlMessage: t('acme.settingsChanged.paragraph', {}, {br: '
', ...replaceLearnMore}), + htmlMessage: hideSecondary + ? t('acme.settingsChanged.gracePeriodOver.paragraph', {}, {br: '
', ...replaceLearnMore}) + : t('acme.settingsChanged.paragraph', {}, {br: '
', ...replaceLearnMore}), title: t('acme.settingsChanged.headline.alt'), }, primaryAction: { @@ -90,7 +92,9 @@ export const getModalOptions = ({ options = { text: { closeBtnLabel: t('acme.renewCertificate.button.close'), - htmlMessage: t('acme.renewCertificate.paragraph'), + htmlMessage: extraParams?.isGracePeriodOver + ? t('acme.renewCertificate.gracePeriodOver.paragraph') + : t('acme.renewCertificate.paragraph'), title: t('acme.renewCertificate.headline.alt'), }, primaryAction: { @@ -128,7 +132,9 @@ export const getModalOptions = ({ options = { text: { closeBtnLabel: t('acme.error.button.close'), - htmlMessage: t('acme.error.paragraph', {}, {br: '
'}), + htmlMessage: extraParams?.isGracePeriodOver + ? t('acme.error.gracePeriod.paragraph', {}, {br: '
'}) + : t('acme.error.paragraph', {}, {br: '
'}), title: t('acme.error.headline'), }, primaryAction: { From fa0aa7f557b1bfd34f94dd5b59ccda42feb9173b Mon Sep 17 00:00:00 2001 From: Arjita Mitra Date: Thu, 18 Jan 2024 16:14:04 +0100 Subject: [PATCH 2/5] fix: replace hidesecondary with isGracePeriodOver --- src/script/E2EIdentity/Modals/Modals.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/script/E2EIdentity/Modals/Modals.ts b/src/script/E2EIdentity/Modals/Modals.ts index 5d9a9dfe66f..d6959c6f1e8 100644 --- a/src/script/E2EIdentity/Modals/Modals.ts +++ b/src/script/E2EIdentity/Modals/Modals.ts @@ -69,7 +69,7 @@ export const getModalOptions = ({ options = { text: { closeBtnLabel: t('acme.settingsChanged.button.close'), - htmlMessage: hideSecondary + htmlMessage: extraParams?.isGracePeriodOver ? t('acme.settingsChanged.gracePeriodOver.paragraph', {}, {br: '
', ...replaceLearnMore}) : t('acme.settingsChanged.paragraph', {}, {br: '
', ...replaceLearnMore}), title: t('acme.settingsChanged.headline.alt'), From 83630512bc516c9e470d36d87f7c63f7c2189ab4 Mon Sep 17 00:00:00 2001 From: Arjita Mitra Date: Thu, 18 Jan 2024 16:22:17 +0100 Subject: [PATCH 3/5] fix: add jsdoc for GetModalOptions interface --- src/script/E2EIdentity/Modals/Modals.ts | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/src/script/E2EIdentity/Modals/Modals.ts b/src/script/E2EIdentity/Modals/Modals.ts index d6959c6f1e8..cbee3ee0a53 100644 --- a/src/script/E2EIdentity/Modals/Modals.ts +++ b/src/script/E2EIdentity/Modals/Modals.ts @@ -33,6 +33,20 @@ export enum ModalType { SNOOZE_REMINDER = 'snooze_reminder', } +/** + * Options for configuring a modal. + * @typedef {Object} GetModalOptions + * @property {ModalType} type - The type of modal to display. + * @property {Function} [primaryActionFn] - Function to execute for the primary action. + * @property {Function} [secondaryActionFn] - Function to execute for the secondary action. + * @property {boolean} [hideSecondary=false] - Flag to hide the secondary action button. + * @property {boolean} [hidePrimary=false] - Flag to hide the primary action button. + * @property {boolean} [hideClose=false] - Flag to hide the close button. + * @property {Object} [extraParams] - Additional parameters for the modal. + * @property {string} [extraParams.delayTime] - time left to remind the user again for enroll/renewal. + * @property {boolean} [extraParams.isRenewal] - Flag indicating if this is a renewal action. + * @property {boolean} [extraParams.isGracePeriodOver] - Flag indicating if the grace period is over. + */ interface GetModalOptions { type: ModalType; primaryActionFn?: () => void; From f2ec9365a2f7646de12df02b946a916d5053c6e4 Mon Sep 17 00:00:00 2001 From: Arjita Date: Thu, 18 Jan 2024 16:32:28 +0100 Subject: [PATCH 4/5] Update src/script/E2EIdentity/Modals/Modals.ts Co-authored-by: Thomas Belin --- src/script/E2EIdentity/Modals/Modals.ts | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/src/script/E2EIdentity/Modals/Modals.ts b/src/script/E2EIdentity/Modals/Modals.ts index cbee3ee0a53..59a9f090aab 100644 --- a/src/script/E2EIdentity/Modals/Modals.ts +++ b/src/script/E2EIdentity/Modals/Modals.ts @@ -54,7 +54,15 @@ interface GetModalOptions { hideSecondary?: boolean; hidePrimary?: boolean; hideClose?: boolean; - extraParams?: {delayTime?: string; isRenewal?: boolean; isGracePeriodOver?: boolean}; + extraParams?: { + /** time left to remind the user again (only for enroll and renewal modal types). */ + delayTime?: string; + + /** Flag indicating if this is a renewal action */ + isRenewal?: boolean; + + /** Flag indicating if the grace period is over (only for enroll, renew or error modals) */ + isGracePeriodOver?: boolean}; } export const getModalOptions = ({ type, From 732c42742ca526eb1aabcdf51aaf6c2af7cf05ee Mon Sep 17 00:00:00 2001 From: Arjita Mitra Date: Thu, 18 Jan 2024 17:03:19 +0100 Subject: [PATCH 5/5] refactor: remove duplicate jsdoc --- src/script/E2EIdentity/Modals/Modals.ts | 25 ++++++------------------- 1 file changed, 6 insertions(+), 19 deletions(-) diff --git a/src/script/E2EIdentity/Modals/Modals.ts b/src/script/E2EIdentity/Modals/Modals.ts index 59a9f090aab..10d80d80757 100644 --- a/src/script/E2EIdentity/Modals/Modals.ts +++ b/src/script/E2EIdentity/Modals/Modals.ts @@ -33,20 +33,6 @@ export enum ModalType { SNOOZE_REMINDER = 'snooze_reminder', } -/** - * Options for configuring a modal. - * @typedef {Object} GetModalOptions - * @property {ModalType} type - The type of modal to display. - * @property {Function} [primaryActionFn] - Function to execute for the primary action. - * @property {Function} [secondaryActionFn] - Function to execute for the secondary action. - * @property {boolean} [hideSecondary=false] - Flag to hide the secondary action button. - * @property {boolean} [hidePrimary=false] - Flag to hide the primary action button. - * @property {boolean} [hideClose=false] - Flag to hide the close button. - * @property {Object} [extraParams] - Additional parameters for the modal. - * @property {string} [extraParams.delayTime] - time left to remind the user again for enroll/renewal. - * @property {boolean} [extraParams.isRenewal] - Flag indicating if this is a renewal action. - * @property {boolean} [extraParams.isGracePeriodOver] - Flag indicating if the grace period is over. - */ interface GetModalOptions { type: ModalType; primaryActionFn?: () => void; @@ -56,13 +42,14 @@ interface GetModalOptions { hideClose?: boolean; extraParams?: { /** time left to remind the user again (only for enroll and renewal modal types). */ - delayTime?: string; - + delayTime?: string; + /** Flag indicating if this is a renewal action */ - isRenewal?: boolean; - + isRenewal?: boolean; + /** Flag indicating if the grace period is over (only for enroll, renew or error modals) */ - isGracePeriodOver?: boolean}; + isGracePeriodOver?: boolean; + }; } export const getModalOptions = ({ type,