Skip to content

Commit 29290b6

Browse files
capyqTheMaskedTurtlesBouzols
authored
refactor: rework achitecture homogenization (#558)
Signed-off-by: capyq <[email protected]> Co-authored-by: Joris Mancini <[email protected]> Co-authored-by: sBouzols <[email protected]>
1 parent cef52e7 commit 29290b6

File tree

204 files changed

+553
-1539
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

204 files changed

+553
-1539
lines changed

demo/src/FlatParametersTab.jsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77

88
import { useCallback, useState } from 'react';
99
import RightResizableBox from './right-resizable-box';
10-
import { FlatParameters } from '../../src/components/FlatParameters/FlatParameters';
10+
import { FlatParameters } from '../../src/components/flatParameters/FlatParameters';
1111

1212
const EXAMPLE_PARAMETERS = [
1313
{

demo/src/InputsTab.jsx

Lines changed: 13 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -10,19 +10,19 @@ import { yupResolver } from '@hookform/resolvers/yup';
1010
import { useForm } from 'react-hook-form';
1111
import { Box, Grid } from '@mui/material';
1212
import { useState } from 'react';
13-
import AutocompleteInput from '../../src/components/inputs/react-hook-form/autocomplete-inputs/autocomplete-input';
14-
import TextInput from '../../src/components/inputs/react-hook-form/text-input';
15-
import RadioInput from '../../src/components/inputs/react-hook-form/radio-input';
16-
import SliderInput from '../../src/components/inputs/react-hook-form/slider-input';
17-
import FloatInput from '../../src/components/inputs/react-hook-form/numbers/float-input';
18-
import IntegerInput from '../../src/components/inputs/react-hook-form/numbers/integer-input';
19-
import SelectInput from '../../src/components/inputs/react-hook-form/select-inputs/select-input';
20-
import CheckboxInput from '../../src/components/inputs/react-hook-form/booleans/checkbox-input';
21-
import SwitchInput from '../../src/components/inputs/react-hook-form/booleans/switch-input';
22-
import SubmitButton from '../../src/components/inputs/react-hook-form/utils/submit-button';
23-
import ExpandingTextField from '../../src/components/inputs/react-hook-form/ExpandingTextField';
24-
import CustomFormProvider from '../../src/components/inputs/react-hook-form/provider/custom-form-provider';
25-
import SelectClearable from '../../src/components/inputs/select-clearable';
13+
import AutocompleteInput from '../../src/components/inputs/reactHookForm/autocompleteInputs/AutocompleteInput';
14+
import TextInput from '../../src/components/inputs/reactHookForm/text/TextInput';
15+
import RadioInput from '../../src/components/inputs/reactHookForm/booleans/RadioInput';
16+
import SliderInput from '../../src/components/inputs/reactHookForm/numbers/SliderInput';
17+
import FloatInput from '../../src/components/inputs/reactHookForm/numbers/FloatInput';
18+
import IntegerInput from '../../src/components/inputs/reactHookForm/numbers/IntegerInput';
19+
import SelectInput from '../../src/components/inputs/reactHookForm/selectInputs/SelectInput';
20+
import CheckboxInput from '../../src/components/inputs/reactHookForm/booleans/CheckboxInput';
21+
import SwitchInput from '../../src/components/inputs/reactHookForm/booleans/SwitchInput';
22+
import SubmitButton from '../../src/components/inputs/reactHookForm/utils/SubmitButton';
23+
import ExpandingTextField from '../../src/components/inputs/reactHookForm/text/ExpandingTextField';
24+
import CustomFormProvider from '../../src/components/inputs/reactHookForm/provider/CustomFormProvider';
25+
import SelectClearable from '../../src/components/inputs/SelectClearable';
2626

2727
const AUTOCOMPLETE_INPUT = 'autocomplete';
2828
const TEXT_INPUT = 'text';

demo/src/TableTab.jsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ import {
1414
generateMuiVirtualizedTableClass,
1515
KeyedColumnsRowIndexer,
1616
MuiVirtualizedTable,
17-
} from '../../src/components/MuiVirtualizedTable';
17+
} from '../../src/components/muiVirtualizedTable';
1818
import { toNestedGlobalSelectors } from '../../src/utils/styles';
1919

2020
// For demo and fun... all even numbers first, then all ascending odd numbers, only positive numbers...

demo/src/app.jsx

Lines changed: 24 additions & 42 deletions
Original file line numberDiff line numberDiff line change
@@ -29,26 +29,20 @@ import { useMatch } from 'react-router';
2929
import { IntlProvider, useIntl } from 'react-intl';
3030
import { BrowserRouter, useLocation, useNavigate } from 'react-router-dom';
3131
import { useCallback, useEffect, useRef, useState } from 'react';
32-
import SnackbarProvider from '../../src/components/SnackbarProvider';
33-
import AuthenticationRouter from '../../src/components/AuthenticationRouter';
34-
import CardErrorBoundary from '../../src/components/CardErrorBoundary';
32+
import SnackbarProvider from '../../src/components/snackbarProvider';
33+
import { AuthenticationRouter } from '../../src/components/authentication';
34+
import CardErrorBoundary from '../../src/components/cardErrorBoundary';
3535
import {
36-
ElementType,
37-
EQUIPMENT_TYPE,
38-
equipmentStyles,
39-
getFileIcon,
40-
initializeAuthenticationDev,
41-
LANG_ENGLISH,
42-
LANG_FRENCH,
43-
LANG_SYSTEM,
44-
LIGHT_THEME,
45-
logout,
4636
card_error_boundary_en,
4737
card_error_boundary_fr,
4838
element_search_en,
4939
element_search_fr,
40+
ElementType,
5041
equipment_search_en,
5142
equipment_search_fr,
43+
EQUIPMENT_TYPE,
44+
EquipmentItem,
45+
equipmentStyles,
5246
filter_en,
5347
filter_fr,
5448
filter_expert_en,
@@ -61,8 +55,15 @@ import {
6155
csv_fr,
6256
flat_parameters_en,
6357
flat_parameters_fr,
58+
getFileIcon,
59+
initializeAuthenticationDev,
60+
LANG_ENGLISH,
61+
LANG_FRENCH,
62+
LANG_SYSTEM,
63+
LIGHT_THEME,
6464
login_en,
6565
login_fr,
66+
logout,
6667
multiple_selection_dialog_en,
6768
multiple_selection_dialog_fr,
6869
report_viewer_en,
@@ -71,20 +72,19 @@ import {
7172
table_fr,
7273
top_bar_en,
7374
top_bar_fr,
75+
TopBar,
7476
treeview_finder_en,
7577
treeview_finder_fr,
76-
TopBar,
78+
useSnackMessage,
7779
} from '../../src';
78-
import { useSnackMessage } from '../../src/hooks/useSnackMessage';
7980

8081
import translations from './demo_intl';
8182

8283
// eslint-disable-next-line import/no-unresolved
8384
import PowsyblLogo from '../images/powsybl_logo.svg?react';
8485
import AppPackage from '../../package.json';
8586

86-
import ReportViewerDialog from '../../src/components/ReportViewerDialog';
87-
import { TreeViewFinder, generateTreeViewFinderClass } from '../../src/components/TreeViewFinder';
87+
import { generateTreeViewFinderClass, TreeViewFinder } from '../../src/components/treeViewFinder';
8888
import TreeViewFinderConfig from './TreeViewFinderConfig';
8989

9090
import {
@@ -97,20 +97,19 @@ import {
9797
import LOGS_JSON from '../data/ReportViewer';
9898

9999
import searchEquipments from '../data/EquipmentSearchBar';
100-
import { EquipmentItem } from '../../src/components/ElementSearchDialog/equipment-item';
101-
import OverflowableText from '../../src/components/OverflowableText';
100+
import OverflowableText from '../../src/components/overflowableText';
102101

103-
import { setShowAuthenticationRouterLogin } from '../../src/redux/authActions';
102+
import { setShowAuthenticationRouterLogin } from '../../src/redux/actions/authActions';
104103
import TableTab from './TableTab';
105104
import FlatParametersTab from './FlatParametersTab';
106105

107106
import { toNestedGlobalSelectors } from '../../src/utils/styles';
108107
import InputsTab from './InputsTab';
109-
import inputs_en from '../../src/components/translations/inputs-en';
110-
import inputs_fr from '../../src/components/translations/inputs-fr';
108+
import inputs_en from '../../src/translations/en/inputsEn';
109+
import inputs_fr from '../../src/translations/fr/inputsFr';
111110
import { EquipmentSearchDialog } from './equipment-search';
112111
import { InlineSearch } from './inline-search';
113-
import MultipleSelectionDialog from '../../src/components/MultipleSelectionDialog/MultipleSelectionDialog';
112+
import MultipleSelectionDialog from '../../src/components/multipleSelectionDialog';
114113

115114
const messages = {
116115
en: {
@@ -325,8 +324,6 @@ function AppContent({ language, onLanguageClick }) {
325324

326325
const [equipmentLabelling, setEquipmentLabelling] = useState(false);
327326

328-
const [openReportViewer, setOpenReportViewer] = useState(false);
329-
330327
const [openMultiChoiceDialog, setOpenMultiChoiceDialog] = useState(false);
331328
const [openDraggableMultiChoiceDialog, setOpenDraggableMultiChoiceDialog] = useState(false);
332329

@@ -468,12 +465,14 @@ function AppContent({ language, onLanguageClick }) {
468465

469466
const aboutTimerVersion = useRef();
470467
const aboutTimerCmpnt = useRef();
468+
471469
function simulateGetGlobalVersion() {
472470
console.log('getGlobalVersion() called');
473471
return new Promise(
474472
(resolve, reject) => (aboutTimerVersion.current = window.setTimeout(() => resolve('1.0.0-demo'), 1250))
475473
);
476474
}
475+
477476
function simulateGetAdditionalComponents() {
478477
console.log('getAdditionalComponents() called');
479478
return new Promise(
@@ -650,23 +649,6 @@ function AppContent({ language, onLanguageClick }) {
650649
}
651650
}}
652651
/>
653-
654-
<Button
655-
variant="contained"
656-
style={{
657-
float: 'left',
658-
margin: '5px',
659-
}}
660-
onClick={() => setOpenReportViewer(true)}
661-
>
662-
Logs
663-
</Button>
664-
<ReportViewerDialog
665-
title="Logs test"
666-
open={openReportViewer}
667-
onClose={() => setOpenReportViewer(false)}
668-
jsonReport={LOGS_JSON}
669-
/>
670652
<div
671653
style={{
672654
display: 'flex',

src/components/AuthenticationRouter/index.ts

Lines changed: 0 additions & 14 deletions
This file was deleted.

src/components/ElementSearchDialog/index.ts

Lines changed: 0 additions & 13 deletions
This file was deleted.

src/components/Login/index.ts

Lines changed: 0 additions & 9 deletions
This file was deleted.

src/components/ReportViewer/filter-button.tsx

Lines changed: 0 additions & 82 deletions
This file was deleted.

src/components/ReportViewer/index.ts

Lines changed: 0 additions & 10 deletions
This file was deleted.

0 commit comments

Comments
 (0)