-
Notifications
You must be signed in to change notification settings - Fork 292
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
feat: update message for enrolment, renewal, error modal when grace period is over #16551
Changes from 3 commits
0877ca9
fa0aa7f
8363051
f2ec936
732c427
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -33,14 +33,28 @@ 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. | ||
*/ | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Oh, you did it the hard way. There is actually a super nice jsdoc/typescript feature where you can inline jsdoc directly in the types. I'll show you in a diff comment There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Ahh ok, shall i remove my jsdoc then? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I think you can remove them then :) |
||
interface GetModalOptions { | ||
type: ModalType; | ||
primaryActionFn?: () => void; | ||
secondaryActionFn?: () => void; | ||
hideSecondary?: boolean; | ||
hidePrimary?: boolean; | ||
hideClose?: boolean; | ||
extraParams?: {delayTime?: string; isRenewal?: boolean}; | ||
extraParams?: {delayTime?: string; isRenewal?: boolean; isGracePeriodOver?: boolean}; | ||
arjita-mitra marked this conversation as resolved.
Show resolved
Hide resolved
|
||
} | ||
export const getModalOptions = ({ | ||
type, | ||
|
@@ -69,7 +83,9 @@ export const getModalOptions = ({ | |
options = { | ||
text: { | ||
closeBtnLabel: t('acme.settingsChanged.button.close'), | ||
htmlMessage: t('acme.settingsChanged.paragraph', {}, {br: '<br>', ...replaceLearnMore}), | ||
htmlMessage: extraParams?.isGracePeriodOver | ||
? t('acme.settingsChanged.gracePeriodOver.paragraph', {}, {br: '<br>', ...replaceLearnMore}) | ||
: t('acme.settingsChanged.paragraph', {}, {br: '<br>', ...replaceLearnMore}), | ||
title: t('acme.settingsChanged.headline.alt'), | ||
}, | ||
primaryAction: { | ||
|
@@ -90,7 +106,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 +146,9 @@ export const getModalOptions = ({ | |
options = { | ||
text: { | ||
closeBtnLabel: t('acme.error.button.close'), | ||
htmlMessage: t('acme.error.paragraph', {}, {br: '<br>'}), | ||
htmlMessage: extraParams?.isGracePeriodOver | ||
? t('acme.error.gracePeriod.paragraph', {}, {br: '<br>'}) | ||
: t('acme.error.paragraph', {}, {br: '<br>'}), | ||
title: t('acme.error.headline'), | ||
}, | ||
primaryAction: { | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
👍 nice renaming