Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: migrate some component #881

Merged
merged 39 commits into from
Aug 21, 2024
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
Show all changes
39 commits
Select commit Hold shift + click to select a range
898d9fe
feat: migrate some component
EmmanuelDemey Aug 4, 2024
49de9d2
feat: add missing package.json
EmmanuelDemey Aug 6, 2024
41dac3b
feat: add missing package.json
EmmanuelDemey Aug 6, 2024
3e1c901
feat: migrate code
EmmanuelDemey Aug 6, 2024
4d4f538
fix: solve import
EmmanuelDemey Aug 6, 2024
baff972
feat: migrate one file
EmmanuelDemey Aug 7, 2024
a49b670
feat: migrate one file
EmmanuelDemey Aug 7, 2024
ab21e22
feat: migrate one file
EmmanuelDemey Aug 7, 2024
207981c
feat: migrate one file
EmmanuelDemey Aug 8, 2024
c133a45
feat: migrate one file
EmmanuelDemey Aug 9, 2024
58ef4ce
feat: migrate one file
EmmanuelDemey Aug 9, 2024
1ad509f
feat: migrate redux
EmmanuelDemey Aug 10, 2024
3572b4a
feat: migrate some components
EmmanuelDemey Aug 12, 2024
04fbd68
feat: migrate some components
EmmanuelDemey Aug 13, 2024
2a092c6
feat: remove unused files
EmmanuelDemey Aug 13, 2024
aedfdce
feat: migrate a lot of files
EmmanuelDemey Aug 13, 2024
69cda1d
migrate a couple of files
EmmanuelDemey Aug 14, 2024
c826752
finish the migation to the new structure
EmmanuelDemey Aug 16, 2024
dcaaa41
fix: migrate few tests
EmmanuelDemey Aug 16, 2024
4f9098a
merge main
EmmanuelDemey Aug 16, 2024
f1950d5
fix: solve duplicated import
EmmanuelDemey Aug 16, 2024
1b2cef5
feat: solve sonar issue
EmmanuelDemey Aug 16, 2024
91b6cd1
feat: solve sonar issue
EmmanuelDemey Aug 16, 2024
194fcf1
feat: migrate some files
EmmanuelDemey Aug 16, 2024
ef89450
feat: migrate some unit test to TS
EmmanuelDemey Aug 17, 2024
7b38976
feat: migrate some component
EmmanuelDemey Aug 18, 2024
fceb7a8
feat: remove unused htmlFor
EmmanuelDemey Aug 18, 2024
0cb364c
fix: solve unit test
EmmanuelDemey Aug 18, 2024
072bddd
fix: solve sonar issue
EmmanuelDemey Aug 18, 2024
af2db5d
fix: solve unit test
EmmanuelDemey Aug 19, 2024
79183a4
feat: migrate component
EmmanuelDemey Aug 20, 2024
eeb2109
fix: solve unit test
EmmanuelDemey Aug 20, 2024
c17c891
fix: solve unit test
EmmanuelDemey Aug 20, 2024
dea97f9
feat: remove unused import
EmmanuelDemey Aug 20, 2024
7b74df4
fix: solve sonar issues
EmmanuelDemey Aug 20, 2024
f2c834b
fix: solve sonar issues
EmmanuelDemey Aug 20, 2024
cada248
feat: migrate components
EmmanuelDemey Aug 20, 2024
ed8661c
feat: migrate components
EmmanuelDemey Aug 21, 2024
0a313ef
feat: merge with main and improve unit test
EmmanuelDemey Aug 21, 2024
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion src/index.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { Provider } from 'react-redux';
import Root from './js/router';
import Root from './js/new-architecture/application/router';
import configureStore from './js/store/configure-store';
import Api from './js/remote-api/api';
import { I18NContext, BackToTop, getLang } from '@inseefr/wilco';
Expand Down
2 changes: 1 addition & 1 deletion src/js/actions/operations/metadatastructure/list.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import api from '../../../remote-api/operations-api';
import * as A from '../../../actions/constants';
import { loadCodesList } from '../../../actions/operations/utils/setup';
import { getTree } from '../../../utils/msd';
import { getTree } from '../../../new-architecture/modules-operations/utils/msd';

const fetchMsd = () => (dispatch, getState) => {
dispatch({
Expand Down
Original file line number Diff line number Diff line change
@@ -1,10 +1,13 @@
import { Note } from '@inseefr/wilco';
import CorrespondenceControls from './controls';
import { generalFields } from './general-fields';
import { ExplanatoryNote } from '../../../../applications/shared/explanatory-note';
import { D2, D1 } from '../../../../i18n';
import { CheckSecondLang } from '../../../../utils';
import { PageTitle, Row } from '../../../../new-architecture/components';
import {
PageTitle,
Row,
ExplanatoryNote,
} from '../../../../new-architecture/components';

const Home = ({ association, secondLang, langs }) => {
const {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,10 +1,13 @@
import { Note } from '@inseefr/wilco';
import CorrespondenceControls from './controls';
import { generalFields } from './general-fields';
import { ExplanatoryNote } from '../../../../applications/shared/explanatory-note';
import { D1, D2 } from '../../../../i18n';
import { CheckSecondLang, useTitle } from '../../../../utils';
import { PageTitle, Row } from '../../../../new-architecture/components';
import {
PageTitle,
Row,
ExplanatoryNote,
} from '../../../../new-architecture/components';
import D from '../../../../i18n/build-dictionary';

const HomeGeneral = ({ correspondence, secondLang, langs: { lg1, lg2 } }) => {
Expand Down
3 changes: 2 additions & 1 deletion src/js/applications/classifications/edition/index.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import { useClassification, useUpdateClassification } from '../hooks';
import { useParams, Redirect } from 'react-router-dom';
import { ActionToolbar, LabelRequired } from '@inseefr/wilco';
import { EditorMarkdown, PageTitleBlock, useTitle } from '../../../utils';
import { EditorMarkdown, useTitle } from '../../../utils';
import { useForm, Controller } from 'react-hook-form';
import SelectRmes from '../../../utils/components/select-rmes';
import D, { D1, D2 } from '../../../i18n';
Expand All @@ -13,6 +13,7 @@ import {
Loading,
ClientSideError,
GlobalClientSideErrorBloc,
PageTitleBlock,
} from '../../../new-architecture/components';
import { useStampsOptions } from '../../../new-architecture/utils/hooks/stamps';
import { useOrganizationsOptions } from '../../../new-architecture/utils/hooks/organizations';
Expand Down
3 changes: 2 additions & 1 deletion src/js/applications/classifications/item/edition/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ import { useMutation, useQuery, useQueryClient } from '@tanstack/react-query';
import api from '../../../../remote-api/classifications-api';
import { ActionToolbar, ErrorBloc, LabelRequired } from '@inseefr/wilco';
import { Redirect, useParams } from 'react-router-dom';
import { EditorMarkdown, PageTitleBlock } from '../../../../utils';
import { EditorMarkdown } from '../../../../utils';
import { Controller, useForm } from 'react-hook-form';
import D, { D1, D2 } from '../../../../i18n/build-dictionary';
import useClassificationItem from '../hook';
Expand All @@ -12,6 +12,7 @@ import {
TextInput,
Loading,
Row,
PageTitleBlock,
} from '../../../../new-architecture/components';
import { useGoBack } from '../../../../new-architecture/utils/hooks/useGoBack';

Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
import { ExplanatoryNote } from '../../../shared/explanatory-note';
import { D1, D2 } from '../../../../i18n';
import { Row } from '../../../../new-architecture/components';
import { Row, ExplanatoryNote } from '../../../../new-architecture/components';

const Notes = ({
notes: { scopeNoteLg1, scopeNoteLg2 },
Expand Down
3 changes: 1 addition & 2 deletions src/js/applications/classifications/visualization/notes.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
import { ExplanatoryNote } from '../../../applications/shared/explanatory-note';
import { D1, D2 } from '../../../i18n';
import { Row } from '../../../new-architecture/components';
import { Row, ExplanatoryNote } from '../../../new-architecture/components';

const Notes = ({
notes: {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,8 +1,7 @@
import Controls from './controls';
import DnDTree from '../../../../applications/shared/tree/dnd';
import D from '../../../../i18n';
import { CheckSecondLang, useTitle } from '../../../../utils';
import { PageTitle, Row } from '../../../../new-architecture/components';
import { PageTitle, Row, Tree } from '../../../../new-architecture/components';

const ClassificationTree = ({ data, prefLabel }) => {
useTitle(
Expand All @@ -20,7 +19,7 @@ const ClassificationTree = ({ data, prefLabel }) => {
{data.length !== 0 && (
<Row>
<div className="col-md-12">
<DnDTree treeData={data} linkPath={(id) => `item/${id}`} />
<Tree treeData={data} linkPath={(id) => `item/${id}`} />
</div>
</Row>
)}
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
import { CheckSecondLang, PageTitleBlock } from '../../../../utils';
import { CheckSecondLang } from '../../../../utils';
import { PageTitleBlock } from '../../../../new-architecture/components';
const ComponentTitle = ({ component, secondLang }) => {
return (
<>
Expand Down
10 changes: 4 additions & 6 deletions src/js/applications/concepts/visualization/home.js
Original file line number Diff line number Diff line change
Expand Up @@ -6,14 +6,12 @@ import ModalRmes from '../../../applications/shared/modal-rmes/modal-rmes';
import D from '../../../i18n';
import { buildNotes } from '../../../utils/concepts/notes';
import { getModalMessage } from '../../../utils/concepts/build-validation-message';
import { CheckSecondLang, DateUtils, useTitle } from '../../../utils';
import NoteVisualization from '../../shared/note-visualization';
import {
CheckSecondLang,
DateUtils,
ErrorBloc,
PageTitleBlock,
useTitle,
} from '../../../utils';
import NoteVisualization from '../../shared/note-visualization';
import { ErrorBloc } from '../../../new-architecture/components';
} from '../../../new-architecture/components';
const ConceptVisualization = ({
id,
permission,
Expand Down
3 changes: 2 additions & 1 deletion src/js/applications/datasets/datasets/edit/edit.js
Original file line number Diff line number Diff line change
Expand Up @@ -8,10 +8,11 @@ import api from '../../api/datasets-api';
import {
Loading,
GlobalClientSideErrorBloc,
PageTitleBlock,
} from '../../../../new-architecture/components';

import { ActionToolbar, CancelButton, SaveButton } from '@inseefr/wilco';
import { Auth, PageTitleBlock, useTitle } from '../../../../utils';
import { Auth, useTitle } from '../../../../utils';
import { GlobalInformation } from './tabs/global-information';
import { InternalManagement } from './tabs/internal-management';
import { Notes } from './tabs/notes';
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import { D1, D2 } from '../../../../../i18n';
import { useThemes } from '../../useThemes';
import { withCodesLists } from '../../../../../hooks/hooks';
import { withCodesLists } from '../../../../../new-architecture/utils/hoc/withCodesLists';
import ReactSelect from 'react-select';
import { LabelRequired } from '@inseefr/wilco';
import { convertCodesListsToSelectOption } from '../../../../../utils/datasets/codelist-to-select-options';
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import { D1 } from '../../../../../i18n';
import { useEffect, useState } from 'react';
import { withCodesLists } from '../../../../../hooks/hooks';
import { withCodesLists } from '../../../../../new-architecture/utils/hoc/withCodesLists';
import api from '../../../api/datasets-api';
import { LabelRequired } from '@inseefr/wilco';
import { SelectRmes } from '../../../../../utils';
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import { D1 } from '../../../../../i18n';
import { useQuery } from '@tanstack/react-query';
import { withCodesLists } from '../../../../../hooks/hooks';
import { withCodesLists } from '../../../../../new-architecture/utils/hoc/withCodesLists';
import ReactSelect from 'react-select';
import StructureAPI from '../../../../structures/apis/structure-api';
import { TemporalField } from '../../components/temporalField';
Expand Down
4 changes: 2 additions & 2 deletions src/js/applications/datasets/datasets/view/view.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@ import * as select from '../../../../reducers';
import {
CheckSecondLang,
DateUtils,
PageTitleBlock,
Stores,
useTitle,
} from '../../../../utils';
Expand All @@ -16,7 +15,7 @@ import api from '../../api/datasets-api';
import StructureAPI from '../../../structures/apis/structure-api';
import { useMutation, useQuery, useQueryClient } from '@tanstack/react-query';
import { useThemes } from '../useThemes';
import { withCodesLists } from '../../../../hooks/hooks';
import { withCodesLists } from '../../../../new-architecture/utils/hoc/withCodesLists';
import { useDataset } from '../../hooks';
import { ViewMenu } from './menu';
import {
Expand All @@ -29,6 +28,7 @@ import {
Organizations,
ContributorsVisualisation,
DisseminationStatusVisualisation,
PageTitleBlock,
} from '../../../../new-architecture/components';
import { CL_FREQ } from '../../../../actions/constants/codeList';
import { useOrganizations } from '../../../../new-architecture/utils/hooks/organizations';
Expand Down
3 changes: 2 additions & 1 deletion src/js/applications/datasets/distributions/edit.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { EditorMarkdown, PageTitleBlock, useTitle } from '../../../utils';
import { EditorMarkdown, useTitle } from '../../../utils';
import {
ActionToolbar,
CancelButton,
Expand All @@ -20,6 +20,7 @@ import {
Row,
ClientSideError,
GlobalClientSideErrorBloc,
PageTitleBlock,
} from '../../../new-architecture/components';
import { useGoBack } from '../../../new-architecture/utils/hooks/useGoBack';

Expand Down
7 changes: 5 additions & 2 deletions src/js/applications/datasets/distributions/view/view.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,11 +4,14 @@ import * as select from '../../../../reducers';
import {
CheckSecondLang,
DateUtils,
PageTitleBlock,
Stores,
useTitle,
} from '../../../../utils';
import { Loading, Row } from '../../../../new-architecture/components';
import {
Loading,
Row,
PageTitleBlock,
} from '../../../../new-architecture/components';
import { renderMarkdownElement } from '../../../../new-architecture/utils/html-utils';
import { Note } from '@inseefr/wilco';
import D, { D1, D2 } from '../../../../i18n/build-dictionary';
Expand Down
3 changes: 2 additions & 1 deletion src/js/applications/operations/document/edition/edition.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import { useMemo, useState } from 'react';
import D, { D1, D2 } from '../../../../i18n';
import { EditorMarkdown, PageTitleBlock, useTitle } from '../../../../utils';
import { EditorMarkdown, useTitle } from '../../../../utils';
import { validate } from './validation';
import { LINK, DOCUMENT, isDocument } from '../utils';
import Dropzone from 'react-dropzone';
Expand All @@ -22,6 +22,7 @@ import {
GlobalClientSideErrorBloc,
ClientSideError,
DatePicker,
PageTitleBlock,
} from '../../../../new-architecture/components';
import Select from '../../../../utils/components/select-rmes';

Expand Down
12 changes: 5 additions & 7 deletions src/js/applications/operations/document/visualization/index.js
Original file line number Diff line number Diff line change
@@ -1,13 +1,11 @@
import { Button, ActionToolbar, ReturnButton } from '@inseefr/wilco';
import { Loading } from '../../../../new-architecture/components';

import { useGoBack } from '../../../../new-architecture/utils/hooks/useGoBack';
import {
Auth,
CheckSecondLang,
Stores,
Loading,
PageTitleBlock,
} from '../../../../utils';
} from '../../../../new-architecture/components';

import { useGoBack } from '../../../../new-architecture/utils/hooks/useGoBack';
import { Auth, CheckSecondLang, Stores } from '../../../../utils';
import { loadCodesList } from '../../../../actions/operations/utils/setup';

import D from '../../../../i18n';
Expand Down
3 changes: 2 additions & 1 deletion src/js/applications/operations/families/edition/edition.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import { Component } from 'react';
import { D1, D2 } from '../../../../i18n';
import { EditorMarkdown, PageTitleBlock } from '../../../../utils';
import { EditorMarkdown } from '../../../../utils';

import {
CancelButton,
Expand All @@ -18,6 +18,7 @@ import {
ErrorBloc,
GlobalClientSideErrorBloc,
ClientSideError,
PageTitleBlock,
} from '../../../../new-architecture/components';

const defaultFamily = {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,19 +7,15 @@ import {
Loading,
ErrorBloc,
ValidationButton,
PageTitleBlock,
} from '../../../../new-architecture/components';

import { useGoBack } from '../../../../new-architecture/utils/hooks/useGoBack';
import api from '../../../../remote-api/operations-api';

import { useCallback, useEffect, useState } from 'react';
import OperationsFamilyVisualization from '../../../../applications/operations/families/visualization/visualization';
import {
Auth,
Stores,
CheckSecondLang,
PageTitleBlock,
} from '../../../../utils';
import { Auth, Stores, CheckSecondLang } from '../../../../utils';
import { containUnsupportedStyles } from '../../../../new-architecture/utils/html-utils';
const Family = () => {
const { id } = useParams();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@ import D, { D1, D2 } from '../../../../i18n';
import {
EditorMarkdown,
ItemToSelectModel,
PageTitleBlock,
SelectRmes,
} from '../../../../utils';
import PublishersInput from '../../../../applications/operations/components/publishers-input';
Expand All @@ -17,6 +16,7 @@ import {
ErrorBloc,
GlobalClientSideErrorBloc,
ClientSideError,
PageTitleBlock,
RequiredIcon,
} from '../../../../new-architecture/components';
import api from '../../../../remote-api/operations-api';
Expand Down
2 changes: 1 addition & 1 deletion src/js/applications/operations/indicators/edition/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ import OperationsIndicatorEdition from '../../../../applications/operations/indi
import { CL_FREQ } from '../../../../actions/constants/codeList';
import api from '../../../../remote-api/operations-api';
import { useGoBack } from '../../../../new-architecture/utils/hooks/useGoBack';
import { useCodesList } from '../../../../hooks/hooks';
import { useCodesList } from '../../../../new-architecture/utils/hooks/codeslist';
import D from '../../../../i18n';
import { useTitle } from '../../../../utils';

Expand Down
10 changes: 3 additions & 7 deletions src/js/applications/operations/indicators/visualization/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -9,18 +9,14 @@ import {
Loading,
ErrorBloc,
ValidationButton,
PageTitleBlock,
} from '../../../../new-architecture/components';
import { useGoBack } from '../../../../new-architecture/utils/hooks/useGoBack';
import api from '../../../../remote-api/operations-api';

import { CL_FREQ } from '../../../../actions/constants/codeList';
import {
Auth,
Stores,
CheckSecondLang,
PageTitleBlock,
} from '../../../../utils';
import { useCodesList } from '../../../../hooks/hooks';
import { Auth, Stores, CheckSecondLang } from '../../../../utils';
import { useCodesList } from '../../../../new-architecture/utils/hooks/codeslist';
import { containUnsupportedStyles } from '../../../../new-architecture/utils/html-utils';
const IndicatorVisualizationContainer = () => {
const { id } = useParams();
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import D from '../../../../i18n';
import { rangeType } from '../../../../utils/msd/';
import { rangeType } from '../../../../new-architecture/modules-operations/utils/msd';
const { CODE_LIST, ORGANIZATION } = rangeType;

export default function HelpInformation({ msd, codesLists, organisations }) {
Expand Down
4 changes: 2 additions & 2 deletions src/js/applications/operations/msd/index.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import { Component, useEffect, useState } from 'react';
import MSDLayout from '../../../applications/operations/msd/layout/';
import { connect } from 'react-redux';
import { Loading } from '../../../new-architecture/components';
import { Loading, PageTitleBlock } from '../../../new-architecture/components';
import { NOT_LOADED, LOADED } from '../../../constants';
import loadMetadataStructure from '../../../actions/operations/metadatastructure/list';
import { D1, D2 } from '../../../i18n';
Expand All @@ -19,7 +19,7 @@ import MSDHelp from '../../../applications/operations/msd/pages/help';
import SimsVisualisation from '../../../applications/operations/msd/pages/sims-visualisation/';
import SimsCreation from '../../../applications/operations/msd/pages/sims-creation/';
import * as select from '../../../reducers';
import { Stores, PageTitleBlock, ArrayUtils } from '../../../utils';
import { Stores, ArrayUtils } from '../../../utils';
import api from '../../../remote-api/operations-api';
import './msd.scss';
import { isEssentialRubricKo } from './sims-field-title';
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import { Component, Fragment, useEffect, useState } from 'react';
import D from '../../../../../i18n';
import Field from '../../../../../applications/operations/msd/pages/sims-creation/sims-field';
import { flattenTree } from '../../../../../utils/msd';
import { flattenTree } from '../../../../../new-architecture/modules-operations/utils/msd';
import SimsDocumentField from '../../../../../applications/operations/msd/pages/sims-creation/sims-document-field';
import { Loading } from '../../../../../new-architecture/components';
import {
Expand All @@ -22,7 +22,7 @@ import {
import { ArrayUtils } from '../../../../../utils';
import { mdFromEditorState } from '../../../../../new-architecture/utils/html-utils';
import './sims-creation.scss';
import { rangeType } from '../../../../../utils/msd/';
import { rangeType } from '../../../../../new-architecture/modules-operations/utils/msd';
EmmanuelDemey marked this conversation as resolved.
Show resolved Hide resolved
import api from '../../../../../remote-api/operations-api';
import { RubricEssentialMsg } from '../../rubric-essantial-msg';

Expand Down
Loading
Loading