From 99f1cd7bae721e258631743119b526ad5d5f06ec Mon Sep 17 00:00:00 2001 From: TOURI ANIS Date: Wed, 18 Oct 2023 11:51:26 +0200 Subject: [PATCH] change appearance validate and cancel button --- decs.d.ts | 7 +++++++ src/components/app-wrapper.js | 10 ++++++++++ .../dialogs/access-rights-dialog.js | 5 +++-- .../custom-mui-dialog/custom-mui-dialog.tsx | 20 ++++++++++--------- .../dialogs/create-directory-dialog.js | 5 +++-- .../csv-import-filter-creation-dialog.js | 9 +++++---- src/components/dialogs/delete-dialog.js | 6 +++--- src/components/dialogs/rename-dialog.js | 5 +++-- .../dialogs/replace-with-script-dialog.js | 5 +++-- .../utils/popup-confirmation-dialog.js | 5 +++-- .../csv-uploader/csv-uploader.js | 9 +++++---- src/translations/en.json | 2 +- src/translations/fr.json | 4 ++-- 13 files changed, 59 insertions(+), 33 deletions(-) diff --git a/decs.d.ts b/decs.d.ts index c7035f7dd..59148e627 100644 --- a/decs.d.ts +++ b/decs.d.ts @@ -142,6 +142,13 @@ declare module '@gridsuite/commons-ui' { disabled?: boolean; }>; + export const CancelButton: FunctionComponent<{ + onClick: (() => void) | ((event: React.MouseEvent) => void); + disabled?: boolean; + variant?: string; + children?: ReactNode; + }>; + export const FieldLabel: FunctionComponent<{ label: string; optional?: boolean; diff --git a/src/components/app-wrapper.js b/src/components/app-wrapper.js index f9f717402..afef46d1c 100644 --- a/src/components/app-wrapper.js +++ b/src/components/app-wrapper.js @@ -76,6 +76,11 @@ const lightTheme = createTheme({ agGridBackground: { color: 'white', }, + typography: { + button: { + textTransform: 'none', + }, + }, }); const darkTheme = createTheme({ @@ -110,6 +115,11 @@ const darkTheme = createTheme({ agGridBackground: { color: '#383838', }, + typography: { + button: { + textTransform: 'none', + }, + }, }); const getMuiTheme = (theme) => { diff --git a/src/components/dialogs/access-rights-dialog.js b/src/components/dialogs/access-rights-dialog.js index deada7ec1..c4a49a1f6 100644 --- a/src/components/dialogs/access-rights-dialog.js +++ b/src/components/dialogs/access-rights-dialog.js @@ -18,6 +18,7 @@ import CircularProgress from '@mui/material/CircularProgress'; import DialogActions from '@mui/material/DialogActions'; import Button from '@mui/material/Button'; import PropTypes from 'prop-types'; +import { CancelButton } from '@gridsuite/commons-ui'; /** * Dialog to change the access rights @@ -110,9 +111,9 @@ const AccessRightsDialog = ({ )} - + diff --git a/src/components/dialogs/commons/custom-mui-dialog/custom-mui-dialog.tsx b/src/components/dialogs/commons/custom-mui-dialog/custom-mui-dialog.tsx index 507269a16..fddfb15a3 100644 --- a/src/components/dialogs/commons/custom-mui-dialog/custom-mui-dialog.tsx +++ b/src/components/dialogs/commons/custom-mui-dialog/custom-mui-dialog.tsx @@ -1,13 +1,15 @@ import React, { FunctionComponent } from 'react'; import { FieldErrors, FormProvider } from 'react-hook-form'; -import Dialog from '@mui/material/Dialog'; -import DialogTitle from '@mui/material/DialogTitle'; -import { Grid, LinearProgress } from '@mui/material'; import { FormattedMessage } from 'react-intl'; -import DialogContent from '@mui/material/DialogContent'; -import DialogActions from '@mui/material/DialogActions'; -import Button from '@mui/material/Button'; -import { SubmitButton } from '@gridsuite/commons-ui'; +import { + DialogActions, + DialogContent, + Grid, + LinearProgress, + Dialog, + DialogTitle, +} from '@mui/material'; +import { CancelButton, SubmitButton } from '@gridsuite/commons-ui'; interface ICustomMuiDialog { open: boolean; @@ -91,9 +93,9 @@ const CustomMuiDialog: FunctionComponent = ({ {children} - + {error}} - + + + + + + diff --git a/src/components/utils/popup-confirmation-dialog.js b/src/components/utils/popup-confirmation-dialog.js index dfb07f61c..b05900433 100644 --- a/src/components/utils/popup-confirmation-dialog.js +++ b/src/components/utils/popup-confirmation-dialog.js @@ -6,6 +6,7 @@ import DialogActions from '@mui/material/DialogActions'; import Button from '@mui/material/Button'; import { FormattedMessage } from 'react-intl'; import React from 'react'; +import { CancelButton } from '@gridsuite/commons-ui'; const PopupConfirmationDialog = ({ openConfirmationPopup, @@ -26,9 +27,9 @@ const PopupConfirmationDialog = ({ - + diff --git a/src/components/utils/rhf-inputs/ag-grid-table-rhf/csv-uploader/csv-uploader.js b/src/components/utils/rhf-inputs/ag-grid-table-rhf/csv-uploader/csv-uploader.js index 976d6c16f..2270d107b 100644 --- a/src/components/utils/rhf-inputs/ag-grid-table-rhf/csv-uploader/csv-uploader.js +++ b/src/components/utils/rhf-inputs/ag-grid-table-rhf/csv-uploader/csv-uploader.js @@ -20,6 +20,7 @@ import PropTypes from 'prop-types'; import { DialogContentText } from '@mui/material'; import { useWatch } from 'react-hook-form'; import { AG_GRID_ROW_UUID } from '../../../field-constants'; +import { CancelButton } from '@gridsuite/commons-ui'; const CsvUploader = ({ name, @@ -156,9 +157,9 @@ const CsvUploader = ({ - + @@ -233,9 +234,9 @@ const CsvUploader = ({ - +