From cb7544a2d13ef99dbcd696053f23bfa0f096d620 Mon Sep 17 00:00:00 2001 From: Pierre Vasseur Date: Fri, 29 Nov 2024 16:43:29 +0100 Subject: [PATCH 1/4] refactor: simplify imports in classifications module --- .../correspondences/association/home.spec.jsx | 2 +- src/packages/modules-classifications/routes/layout.tsx | 2 +- src/vite-env.d.ts | 1 - 3 files changed, 2 insertions(+), 3 deletions(-) diff --git a/src/packages/modules-classifications/correspondences/association/home.spec.jsx b/src/packages/modules-classifications/correspondences/association/home.spec.jsx index 50ef7a635..bc4c7f9be 100644 --- a/src/packages/modules-classifications/correspondences/association/home.spec.jsx +++ b/src/packages/modules-classifications/correspondences/association/home.spec.jsx @@ -1,4 +1,4 @@ -import * as associationUtils from '../../../modules-classifications/utils/correspondence/association'; +import * as associationUtils from '../../utils/correspondence/association'; import { locales } from '../../../tests-utils/default-values'; import { renderWithAppContext } from '../../../tests-utils/render'; import Home from './home'; diff --git a/src/packages/modules-classifications/routes/layout.tsx b/src/packages/modules-classifications/routes/layout.tsx index ac9e89e84..b6908b6fb 100644 --- a/src/packages/modules-classifications/routes/layout.tsx +++ b/src/packages/modules-classifications/routes/layout.tsx @@ -1,6 +1,6 @@ import { Outlet } from 'react-router-dom'; -import Menu from '../../modules-classifications/menu'; +import Menu from '../menu'; import { useTheme } from '../../utils/hooks/useTheme'; export const Component = () => { diff --git a/src/vite-env.d.ts b/src/vite-env.d.ts index 8060c8d06..32dbbb4ca 100644 --- a/src/vite-env.d.ts +++ b/src/vite-env.d.ts @@ -11,7 +11,6 @@ type ImportMetaEnv = { VITE_CONCEPTS_DOCUMENTATION: string VITE_OPERATIONS_DOCUMENTATION: string VITE_VALIDATION_OPERATION_SERIES_EXTRA_MANDATORY_FIELDS: string - VITE_INSEE: string VITE_DEV_TOOLS_ENABLED: string BASE_URL: string MODE: string From 962f3c184521d89274f65490e5b20b822b9ac6ac Mon Sep 17 00:00:00 2001 From: Pierre Vasseur Date: Fri, 29 Nov 2024 16:50:54 +0100 Subject: [PATCH 2/4] refactor: simplify imports in concepts module --- .../modules-concepts/collections/edition-creation/general.jsx | 2 +- .../collections/edition-creation/general.spec.jsx | 2 +- src/packages/modules-concepts/collections/edition/members.jsx | 2 +- .../modules-concepts/edition-creation/creation-container.jsx | 4 ++-- .../modules-concepts/edition-creation/edition-container.jsx | 4 ++-- 5 files changed, 7 insertions(+), 7 deletions(-) diff --git a/src/packages/modules-concepts/collections/edition-creation/general.jsx b/src/packages/modules-concepts/collections/edition-creation/general.jsx index e44fcc283..e9069fea8 100644 --- a/src/packages/modules-concepts/collections/edition-creation/general.jsx +++ b/src/packages/modules-concepts/collections/edition-creation/general.jsx @@ -6,7 +6,7 @@ import { Row } from '@components/layout'; import { RequiredIcon } from '@components/required-icon'; import D, { D1, D2 } from '../../../deprecated-locales'; -import { fields as generalFields } from '../../../modules-concepts/collections/utils/general'; +import { fields as generalFields } from '../utils/general'; const handleFieldChange = (handleChange) => generalFields.reduce((handlers, fieldName) => { diff --git a/src/packages/modules-concepts/collections/edition-creation/general.spec.jsx b/src/packages/modules-concepts/collections/edition-creation/general.spec.jsx index b003f6759..02dba13f7 100644 --- a/src/packages/modules-concepts/collections/edition-creation/general.spec.jsx +++ b/src/packages/modules-concepts/collections/edition-creation/general.spec.jsx @@ -1,6 +1,6 @@ import { render } from '@testing-library/react'; -import { empty } from '../../../modules-concepts/collections/utils/general'; +import { empty } from '../utils/general'; import { locales } from '../../../tests-utils/default-values'; import CollectionGeneral from './general'; diff --git a/src/packages/modules-concepts/collections/edition/members.jsx b/src/packages/modules-concepts/collections/edition/members.jsx index d1aa53c2a..7a7927349 100644 --- a/src/packages/modules-concepts/collections/edition/members.jsx +++ b/src/packages/modules-concepts/collections/edition/members.jsx @@ -11,7 +11,7 @@ import { PickerItem } from '@components/picker-item'; import { arrayDifferenceByID, filterDeburr } from '@utils/array-utils'; import MainDictonary from '../../../deprecated-locales'; -import { D1 } from '../../../modules-concepts/i18n'; +import { D1 } from '../../i18n'; const extractMembers = (concepts) => { return concepts.reduce((members, { id, label, isAdded }) => { diff --git a/src/packages/modules-concepts/edition-creation/creation-container.jsx b/src/packages/modules-concepts/edition-creation/creation-container.jsx index db757ccb2..5c0cda4c8 100644 --- a/src/packages/modules-concepts/edition-creation/creation-container.jsx +++ b/src/packages/modules-concepts/edition-creation/creation-container.jsx @@ -5,8 +5,8 @@ import { Loading, Saving } from '@components/loading'; import { useAppContext } from '../../application/app-context'; import D from '../../deprecated-locales'; -import buildPayloadCreation from '../../modules-concepts/utils/build-payload-creation-update/build-payload-creation'; -import emptyConcept from '../../modules-concepts/utils/empty-concept'; +import buildPayloadCreation from '../utils/build-payload-creation-update/build-payload-creation'; +import emptyConcept from '../utils/empty-concept'; import { ConceptsApi } from '../../sdk'; import { sortArrayByLabel } from '../../utils/array-utils'; import { useTitle } from '../../utils/hooks/useTitle'; diff --git a/src/packages/modules-concepts/edition-creation/edition-container.jsx b/src/packages/modules-concepts/edition-creation/edition-container.jsx index 8dd7686a6..0db9b1bc3 100644 --- a/src/packages/modules-concepts/edition-creation/edition-container.jsx +++ b/src/packages/modules-concepts/edition-creation/edition-container.jsx @@ -7,8 +7,8 @@ import { CLOSE_MATCH } from '@sdk/constants'; import { useAppContext } from '../../application/app-context'; import D from '../../deprecated-locales'; -import buildPayloadUpdate from '../../modules-concepts/utils/build-payload-creation-update/build-payload-update'; -import * as generalUtils from '../../modules-concepts/utils/general'; +import buildPayloadUpdate from '../utils/build-payload-creation-update/build-payload-update'; +import * as generalUtils from '../utils/general'; import { ConceptsApi } from '../../sdk'; import { useTitle } from '../../utils/hooks/useTitle'; import { rmesHtmlToRawHtml } from '../../utils/html-utils'; From 599955816edc9fef543f37712b0ae4f03269eff8 Mon Sep 17 00:00:00 2001 From: Pierre Vasseur Date: Fri, 29 Nov 2024 16:57:19 +0100 Subject: [PATCH 3/4] refactor: simplify imports in operations module --- src/packages/modules-operations/document/edition/index.jsx | 2 +- src/packages/modules-operations/families/edition/index.spec.tsx | 2 +- src/packages/modules-operations/indicators/edition/index.jsx | 2 +- .../modules-operations/indicators/visualization/index.jsx | 2 +- src/packages/modules-operations/msd/help-information/index.jsx | 2 +- src/packages/modules-operations/msd/outline/index.spec.jsx | 2 +- .../msd/pages/sims-visualisation/sims-block.jsx | 2 +- src/packages/modules-operations/msd/sims-field-title/index.jsx | 2 +- src/packages/modules-operations/series/visualization/home.jsx | 2 +- 9 files changed, 9 insertions(+), 9 deletions(-) diff --git a/src/packages/modules-operations/document/edition/index.jsx b/src/packages/modules-operations/document/edition/index.jsx index 55bc93a5e..66cceafb6 100644 --- a/src/packages/modules-operations/document/edition/index.jsx +++ b/src/packages/modules-operations/document/edition/index.jsx @@ -7,7 +7,7 @@ import { GeneralApi } from '@sdk/general-api'; import { useCodesList } from '@utils/hooks/codeslist'; -import DocumentationEdition from '../../../modules-operations/document/edition/edition'; +import DocumentationEdition from './edition'; export const Component = (props) => { const { id } = useParams(); diff --git a/src/packages/modules-operations/families/edition/index.spec.tsx b/src/packages/modules-operations/families/edition/index.spec.tsx index 873733436..22cedecdb 100644 --- a/src/packages/modules-operations/families/edition/index.spec.tsx +++ b/src/packages/modules-operations/families/edition/index.spec.tsx @@ -31,7 +31,7 @@ vi.mock('@components/loading', () => ({ Loading: () =>
Loading...
, })); -vi.mock('../../../modules-operations/families/edition/edition', () => ({ +vi.mock('./edition', () => ({ default: () =>
Operations Family Edition Component
, })); diff --git a/src/packages/modules-operations/indicators/edition/index.jsx b/src/packages/modules-operations/indicators/edition/index.jsx index 334b71497..314291836 100644 --- a/src/packages/modules-operations/indicators/edition/index.jsx +++ b/src/packages/modules-operations/indicators/edition/index.jsx @@ -11,7 +11,7 @@ import { useGoBack } from '@utils/hooks/useGoBack'; import { useTitle } from '@utils/hooks/useTitle'; import D from '../../../deprecated-locales'; -import OperationsIndicatorEdition from '../../../modules-operations/indicators/edition/edition'; +import OperationsIndicatorEdition from './edition'; import { CL_FREQ } from '../../../redux/actions/constants/codeList'; export const Component = (props) => { diff --git a/src/packages/modules-operations/indicators/visualization/index.jsx b/src/packages/modules-operations/indicators/visualization/index.jsx index c12fa83be..65c088555 100644 --- a/src/packages/modules-operations/indicators/visualization/index.jsx +++ b/src/packages/modules-operations/indicators/visualization/index.jsx @@ -12,7 +12,7 @@ import { useCodesList } from '@utils/hooks/codeslist'; import { useSecondLang } from '@utils/hooks/second-lang'; import D from '../../../deprecated-locales'; -import OperationsIndicatorVisualization from '../../../modules-operations/indicators/visualization/general'; +import OperationsIndicatorVisualization from './general'; import { CL_FREQ } from '../../../redux/actions/constants/codeList'; import { Menu } from './menu'; diff --git a/src/packages/modules-operations/msd/help-information/index.jsx b/src/packages/modules-operations/msd/help-information/index.jsx index 175ec8c09..f7b5e8a76 100644 --- a/src/packages/modules-operations/msd/help-information/index.jsx +++ b/src/packages/modules-operations/msd/help-information/index.jsx @@ -1,5 +1,5 @@ import D from '../../../deprecated-locales'; -import { rangeType } from '../../../modules-operations/utils/msd'; +import { rangeType } from '../../utils/msd'; const { CODE_LIST, ORGANIZATION } = rangeType; diff --git a/src/packages/modules-operations/msd/outline/index.spec.jsx b/src/packages/modules-operations/msd/outline/index.spec.jsx index b447e4b9c..9c64054f1 100644 --- a/src/packages/modules-operations/msd/outline/index.spec.jsx +++ b/src/packages/modules-operations/msd/outline/index.spec.jsx @@ -1,7 +1,7 @@ import { renderWithRouter } from '../../../tests-utils/render'; import Outline from './index'; -vi.mock('../../../modules-operations/msd/utils'); +vi.mock('../../msd/utils'); const metadataStructureOpened = { idMas: '1', diff --git a/src/packages/modules-operations/msd/pages/sims-visualisation/sims-block.jsx b/src/packages/modules-operations/msd/pages/sims-visualisation/sims-block.jsx index 9440c67a6..1b4fe4823 100644 --- a/src/packages/modules-operations/msd/pages/sims-visualisation/sims-block.jsx +++ b/src/packages/modules-operations/msd/pages/sims-visualisation/sims-block.jsx @@ -1,4 +1,4 @@ -import { rangeType } from '../../../../modules-operations/utils/msd'; +import { rangeType } from '../../../utils/msd'; import SimsBlockCodeList from './sims-block-codelist'; import SimsBlockDate from './sims-block-date'; import SimsBlockGeography from './sims-block-geography'; diff --git a/src/packages/modules-operations/msd/sims-field-title/index.jsx b/src/packages/modules-operations/msd/sims-field-title/index.jsx index 8912f8e79..4fbbadf6c 100644 --- a/src/packages/modules-operations/msd/sims-field-title/index.jsx +++ b/src/packages/modules-operations/msd/sims-field-title/index.jsx @@ -1,5 +1,5 @@ import D from '../../../deprecated-locales/build-dictionary'; -import { rangeType } from '../../../modules-operations/utils/msd'; +import { rangeType } from '../../utils/msd'; const { RICH_TEXT, TEXT, CODE_LIST, ORGANIZATION, GEOGRAPHY } = rangeType; diff --git a/src/packages/modules-operations/series/visualization/home.jsx b/src/packages/modules-operations/series/visualization/home.jsx index 4fef7c89f..8b979197d 100644 --- a/src/packages/modules-operations/series/visualization/home.jsx +++ b/src/packages/modules-operations/series/visualization/home.jsx @@ -9,7 +9,7 @@ import { renderMarkdownElement } from '@utils/html-utils'; import { D1, D2 } from '../../../deprecated-locales'; import D from '../../../deprecated-locales/build-dictionary'; -import SeeAlso from '../../../modules-operations/shared/seeAlso'; +import SeeAlso from '../../shared/seeAlso'; import CreatorsView from '../../components/creators-view'; import PublishersView from '../../components/publishers-view'; import DisplayLinks from '../../shared/links/'; From 8b2fdc1ca2b47b10872b84986e91463579ee1a66 Mon Sep 17 00:00:00 2001 From: Pierre Vasseur Date: Mon, 2 Dec 2024 10:18:16 +0100 Subject: [PATCH 4/4] format --- .../correspondences/association/home.spec.jsx | 2 +- src/packages/modules-classifications/routes/layout.tsx | 2 +- .../collections/edition-creation/general.spec.jsx | 2 +- .../modules-concepts/edition-creation/creation-container.jsx | 4 ++-- .../modules-concepts/edition-creation/edition-container.jsx | 4 ++-- src/packages/modules-operations/indicators/edition/index.jsx | 2 +- .../modules-operations/indicators/visualization/index.jsx | 2 +- src/packages/modules-operations/series/visualization/home.jsx | 2 +- 8 files changed, 10 insertions(+), 10 deletions(-) diff --git a/src/packages/modules-classifications/correspondences/association/home.spec.jsx b/src/packages/modules-classifications/correspondences/association/home.spec.jsx index bc4c7f9be..3fbd62667 100644 --- a/src/packages/modules-classifications/correspondences/association/home.spec.jsx +++ b/src/packages/modules-classifications/correspondences/association/home.spec.jsx @@ -1,6 +1,6 @@ -import * as associationUtils from '../../utils/correspondence/association'; import { locales } from '../../../tests-utils/default-values'; import { renderWithAppContext } from '../../../tests-utils/render'; +import * as associationUtils from '../../utils/correspondence/association'; import Home from './home'; describe('association-home', () => { diff --git a/src/packages/modules-classifications/routes/layout.tsx b/src/packages/modules-classifications/routes/layout.tsx index b6908b6fb..b46aacc25 100644 --- a/src/packages/modules-classifications/routes/layout.tsx +++ b/src/packages/modules-classifications/routes/layout.tsx @@ -1,7 +1,7 @@ import { Outlet } from 'react-router-dom'; -import Menu from '../menu'; import { useTheme } from '../../utils/hooks/useTheme'; +import Menu from '../menu'; export const Component = () => { useTheme('classifications'); diff --git a/src/packages/modules-concepts/collections/edition-creation/general.spec.jsx b/src/packages/modules-concepts/collections/edition-creation/general.spec.jsx index 02dba13f7..26a956d93 100644 --- a/src/packages/modules-concepts/collections/edition-creation/general.spec.jsx +++ b/src/packages/modules-concepts/collections/edition-creation/general.spec.jsx @@ -1,7 +1,7 @@ import { render } from '@testing-library/react'; -import { empty } from '../utils/general'; import { locales } from '../../../tests-utils/default-values'; +import { empty } from '../utils/general'; import CollectionGeneral from './general'; vi.mock('@components/form/input', () => ({ TextInput: () => <> })); diff --git a/src/packages/modules-concepts/edition-creation/creation-container.jsx b/src/packages/modules-concepts/edition-creation/creation-container.jsx index 5c0cda4c8..72240f6f8 100644 --- a/src/packages/modules-concepts/edition-creation/creation-container.jsx +++ b/src/packages/modules-concepts/edition-creation/creation-container.jsx @@ -5,11 +5,11 @@ import { Loading, Saving } from '@components/loading'; import { useAppContext } from '../../application/app-context'; import D from '../../deprecated-locales'; -import buildPayloadCreation from '../utils/build-payload-creation-update/build-payload-creation'; -import emptyConcept from '../utils/empty-concept'; import { ConceptsApi } from '../../sdk'; import { sortArrayByLabel } from '../../utils/array-utils'; import { useTitle } from '../../utils/hooks/useTitle'; +import buildPayloadCreation from '../utils/build-payload-creation-update/build-payload-creation'; +import emptyConcept from '../utils/empty-concept'; import { mergeWithAllConcepts } from '../utils/links'; import ConceptEditionCreation from './home'; diff --git a/src/packages/modules-concepts/edition-creation/edition-container.jsx b/src/packages/modules-concepts/edition-creation/edition-container.jsx index 0db9b1bc3..be16727f7 100644 --- a/src/packages/modules-concepts/edition-creation/edition-container.jsx +++ b/src/packages/modules-concepts/edition-creation/edition-container.jsx @@ -7,11 +7,11 @@ import { CLOSE_MATCH } from '@sdk/constants'; import { useAppContext } from '../../application/app-context'; import D from '../../deprecated-locales'; -import buildPayloadUpdate from '../utils/build-payload-creation-update/build-payload-update'; -import * as generalUtils from '../utils/general'; import { ConceptsApi } from '../../sdk'; import { useTitle } from '../../utils/hooks/useTitle'; import { rmesHtmlToRawHtml } from '../../utils/html-utils'; +import buildPayloadUpdate from '../utils/build-payload-creation-update/build-payload-update'; +import * as generalUtils from '../utils/general'; import { mergeWithAllConcepts } from '../utils/links'; import { emptyNotes } from '../utils/notes'; import ConceptEditionCreation from './home'; diff --git a/src/packages/modules-operations/indicators/edition/index.jsx b/src/packages/modules-operations/indicators/edition/index.jsx index 314291836..7000621d3 100644 --- a/src/packages/modules-operations/indicators/edition/index.jsx +++ b/src/packages/modules-operations/indicators/edition/index.jsx @@ -11,8 +11,8 @@ import { useGoBack } from '@utils/hooks/useGoBack'; import { useTitle } from '@utils/hooks/useTitle'; import D from '../../../deprecated-locales'; -import OperationsIndicatorEdition from './edition'; import { CL_FREQ } from '../../../redux/actions/constants/codeList'; +import OperationsIndicatorEdition from './edition'; export const Component = (props) => { const { id } = useParams(); diff --git a/src/packages/modules-operations/indicators/visualization/index.jsx b/src/packages/modules-operations/indicators/visualization/index.jsx index 65c088555..b4ff48a0f 100644 --- a/src/packages/modules-operations/indicators/visualization/index.jsx +++ b/src/packages/modules-operations/indicators/visualization/index.jsx @@ -12,8 +12,8 @@ import { useCodesList } from '@utils/hooks/codeslist'; import { useSecondLang } from '@utils/hooks/second-lang'; import D from '../../../deprecated-locales'; -import OperationsIndicatorVisualization from './general'; import { CL_FREQ } from '../../../redux/actions/constants/codeList'; +import OperationsIndicatorVisualization from './general'; import { Menu } from './menu'; export const Component = () => { diff --git a/src/packages/modules-operations/series/visualization/home.jsx b/src/packages/modules-operations/series/visualization/home.jsx index 8b979197d..1e1c799ee 100644 --- a/src/packages/modules-operations/series/visualization/home.jsx +++ b/src/packages/modules-operations/series/visualization/home.jsx @@ -9,12 +9,12 @@ import { renderMarkdownElement } from '@utils/html-utils'; import { D1, D2 } from '../../../deprecated-locales'; import D from '../../../deprecated-locales/build-dictionary'; -import SeeAlso from '../../shared/seeAlso'; import CreatorsView from '../../components/creators-view'; import PublishersView from '../../components/publishers-view'; import DisplayLinks from '../../shared/links/'; import { getSeeAlsoByType } from '../../shared/links/utils'; import RelationsView from '../../shared/relations'; +import SeeAlso from '../../shared/seeAlso'; function OperationsSerieVisualization({ attr,