Skip to content

Commit

Permalink
removed basic dialog
Browse files Browse the repository at this point in the history
  • Loading branch information
manojleaton committed Aug 12, 2024
1 parent 491a282 commit 7e1d01f
Show file tree
Hide file tree
Showing 4 changed files with 0 additions and 22 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,6 @@ export const ChangePasswordDialog: React.FC<ChangePasswordDialogProps> = (props)
onPrevious,
onFinish,
PasswordProps,
ErrorDialogProps,
loading,
currentPasswordTextFieldProps,
slots = {},
Expand All @@ -41,7 +40,6 @@ export const ChangePasswordDialog: React.FC<ChangePasswordDialogProps> = (props)
const [currentInput, setCurrentInput] = useState('');
const [passwordInput, setPasswordInput] = useState('');
const [confirmInput, setConfirmInput] = useState('');
const [showErrorDialog, setShowErrorDialog] = useState(false);
const [isLoading, setIsLoading] = useState(loading);
const [showSuccessScreen, setShowSuccessScreen] = useState(false);
const { actions, navigate, routeConfig } = useAuthContext();
Expand Down Expand Up @@ -91,7 +89,6 @@ export const ChangePasswordDialog: React.FC<ChangePasswordDialogProps> = (props)
setShowSuccessScreen(true);
} catch (_error) {
setHasVerifyCodeError(true);
setShowErrorDialog(true);
triggerError(_error as Error);
} finally {
setIsLoading(false);
Expand All @@ -106,7 +103,6 @@ export const ChangePasswordDialog: React.FC<ChangePasswordDialogProps> = (props)
onFinish,
props.showSuccessScreen,
triggerError,
setShowErrorDialog,
]);

const passwordProps = {
Expand All @@ -129,15 +125,6 @@ export const ChangePasswordDialog: React.FC<ChangePasswordDialogProps> = (props)
},
};

const errorDialogProps = {
open: showErrorDialog,
title: t('bluiCommon:MESSAGES.ERROR'),
body: t('bluiAuth:CHANGE_PASSWORD.PROBLEM_OCCURRED'),
dismissButtonText: t('bluiCommon:ACTIONS.OKAY'),
...ErrorDialogProps,
onClose: (): void => setShowErrorDialog(false),
};

return (
<ChangePasswordDialogBase
open={open}
Expand All @@ -154,7 +141,6 @@ export const ChangePasswordDialog: React.FC<ChangePasswordDialogProps> = (props)
enableButton={checkPasswords}
onPrevious={onPrevious}
PasswordProps={passwordProps}
ErrorDialogProps={errorDialogProps}
currentPasswordTextFieldProps={currentPasswordTextFieldProps}
onSubmit={async (): Promise<void> => {
await changePasswordSubmit();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,6 @@ import {
import { ChangePasswordDialogProps } from './types';
import { SetPassword } from '../SetPassword';
import { PasswordTextField } from '../PasswordTextField';
import { BasicDialog } from '../Dialog';
import { Spinner } from '../../components';
import { SuccessScreenBase, SuccessScreenProps } from '../../screens';
import { unstable_composeClasses as composeClasses } from '@mui/base';
Expand All @@ -35,7 +34,6 @@ const useUtilityClasses = (ownerState: ChangePasswordDialogProps): Record<Change
const slots = {
root: ['root'],
spinner: ['spinner'],
basicDialog: ['basicDialog'],
title: ['title'],
content: ['content'],
description: ['description'],
Expand All @@ -60,7 +58,6 @@ export const ChangePasswordDialogBase: React.FC<ChangePasswordDialogProps> = (pr
currentPasswordChange,
onSubmit,
onPrevious,
ErrorDialogProps,
PasswordProps,
loading,
currentPasswordTextFieldProps,
Expand Down Expand Up @@ -117,7 +114,6 @@ export const ChangePasswordDialogBase: React.FC<ChangePasswordDialogProps> = (pr
getSuccessScreen(slotProps?.SuccessScreen || {}, slots?.SuccessScreen)
) : (
<>
<BasicDialog {...ErrorDialogProps} className={defaultClasses.basicDialog} />
<DialogTitle
sx={{
pt: { md: 4, sm: 2 },
Expand Down
3 changes: 0 additions & 3 deletions login-workflow/src/components/ChangePasswordDialog/types.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
import { DialogProps, TextFieldProps } from '@mui/material';
import { SuccessScreenProps } from '../../screens';
import { BasicDialogProps } from '../Dialog';
import { SetPasswordProps } from '../SetPassword';
import { ErrorManagerProps } from '../Error/types';

Expand All @@ -25,8 +24,6 @@ export type ChangePasswordDialogSlotsProps = {
};

export type ChangePasswordDialogProps = DialogProps & { PasswordProps?: SetPasswordProps } & {
ErrorDialogProps?: BasicDialogProps;
} & {
/**
* The title to display in the dialog
*/
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@ import generateUtilityClass from '@mui/material/generateUtilityClass';
export type ChangePasswordDialogClasses = {
root?: string;
spinner?: string;
basicDialog?: string;
title?: string;
content?: string;
description?: string;
Expand Down

0 comments on commit 7e1d01f

Please sign in to comment.