Skip to content

Commit 49cb80c

Browse files
authored
Feed language to form context instead of Custom mui dialog (#421)
Signed-off-by: Hugo Marcellin <[email protected]>
1 parent 4c62766 commit 49cb80c

File tree

2 files changed

+6
-0
lines changed

2 files changed

+6
-0
lines changed

src/components/dialogs/contingency-list/edition/criteria-based/criteria-based-edition-dialog.jsx

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,8 @@ import CriteriaBasedEditionForm from './criteria-based-edition-form';
2828
import { useDispatch, useSelector } from 'react-redux';
2929
import { noSelectionForCopy } from 'utils/constants';
3030
import { setSelectionForCopy } from '../../../../../redux/actions';
31+
import { useParameterState } from '../../../parameters-dialog';
32+
import { PARAM_LANGUAGE } from '../../../../../utils/config-params';
3133

3234
const schema = yup.object().shape({
3335
[FieldConstants.NAME]: yup.string().trim().required('nameEmpty'),
@@ -46,6 +48,7 @@ const CriteriaBasedEditionDialog = ({
4648
name,
4749
broadcastChannel,
4850
}) => {
51+
const [languageLocal] = useParameterState(PARAM_LANGUAGE);
4952
const [isFetching, setIsFetching] = useState(!!contingencyListId);
5053
const { snackError } = useSnackMessage();
5154
const selectionForCopy = useSelector((state) => state.selectionForCopy);
@@ -130,6 +133,7 @@ const CriteriaBasedEditionDialog = ({
130133
removeOptional={true}
131134
disabledSave={!!nameError || isValidating}
132135
isDataFetching={isFetching}
136+
language={languageLocal}
133137
>
134138
{!isFetching && <CriteriaBasedEditionForm />}
135139
</CustomMuiDialog>

src/components/directory-content.jsx

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -40,6 +40,7 @@ import {
4040
getFilterById,
4141
fetchDirectoryContent,
4242
fetchRootFolders,
43+
updateElement,
4344
} from '../utils/rest-api';
4445

4546
import ContentContextualMenu from './menus/content-contextual-menu';
@@ -1000,6 +1001,7 @@ const DirectoryContent = () => {
10001001
setActiveElement(null);
10011002
setOpenDescModificationDialog(false);
10021003
}}
1004+
updateElement={updateElement}
10031005
/>
10041006
);
10051007
}

0 commit comments

Comments
 (0)