Skip to content

Commit

Permalink
Error manager translate dismissLabel for dialog
Browse files Browse the repository at this point in the history
  • Loading branch information
JeffGreiner-eaton committed Mar 5, 2024
1 parent 02ed02b commit 8d13bac
Showing 1 changed file with 8 additions and 2 deletions.
10 changes: 8 additions & 2 deletions login-workflow/src/components/Error/ErrorManager.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,11 @@ export type ErrorManagerProps = {
*/
title?: string;

/**
* The label on the dismiss button in dialog mode
*/
dismissLabel?: string;

/**
* The function to call when the close/dismiss button is clicked
* @returns void
Expand All @@ -31,7 +36,7 @@ export type ErrorManagerProps = {
/**
* Configuration options when using mode='dialog'
* @param {string} dialogConfig.title - The title used in the dialog header
* @param {string} dialogConfig.dismissLabel - The label on the dismiss button.
* @param {string} dialogConfig.dismissLabel - The label on the dismiss button in dialog mode.
*/
dialogConfig?: {
dismissLabel?: string;
Expand Down Expand Up @@ -76,6 +81,7 @@ const ErrorManager: React.FC<ErrorManagerProps> = (props): JSX.Element => {
mode = 'dialog',
title,
error = '',
dismissLabel,
onClose = (): void => {},
dialogConfig,
messageBoxConfig = {
Expand All @@ -90,7 +96,7 @@ const ErrorManager: React.FC<ErrorManagerProps> = (props): JSX.Element => {
title={dialogConfig?.title ?? title ?? t('bluiCommon:MESSAGES.ERROR')}
body={t(error)}
onClose={onClose}
dismissButtonText={dialogConfig?.dismissLabel}
dismissButtonText={dialogConfig?.dismissLabel ?? dismissLabel ?? t('bluiCommon:ACTIONS.OKAY')}
sx={dialogConfig?.sx}
/>
),
Expand Down

0 comments on commit 8d13bac

Please sign in to comment.