From 35624532ee35102b23f1c6486c381a318d05f7b3 Mon Sep 17 00:00:00 2001 From: Emmanuel Date: Thu, 28 Nov 2024 13:56:57 +0000 Subject: [PATCH] review --- .../visualization/tree/home.jsx | 2 +- .../modules-codelists/components/code-detail/edit.jsx | 3 ++- .../modules-codelists/components/code-detail/view.jsx | 10 ++++++---- .../components/codelist-detail/codes-panel.jsx | 4 ++-- .../modules-codelists/components/home/partial-home.tsx | 2 +- src/packages/modules-codelists/menu/index.jsx | 3 ++- .../modules-concepts/edition-creation/general.jsx | 4 ++-- .../modules-concepts/edition-creation/links/index.jsx | 2 +- src/packages/modules-concepts/menu/index.tsx | 3 ++- .../modules-datasets/datasets/edit/tabs/notes.jsx | 2 +- src/packages/modules-datasets/distributions/edit.jsx | 10 ++++++---- src/packages/modules-operations/document/home.jsx | 9 +++++---- .../modules-operations/families/edition/edition.jsx | 2 +- .../msd/pages/sims-creation/menu.tsx | 4 ++-- .../modules-operations/series/edition/edition.jsx | 2 +- .../modules-operations/series/search/typeCodeInput.tsx | 6 ++++-- .../components/components-table/index.tsx | 3 ++- .../components/mutualized-component-selector/index.jsx | 2 +- src/packages/modules-structures/menu/index.tsx | 3 ++- 19 files changed, 44 insertions(+), 32 deletions(-) diff --git a/src/packages/modules-classifications/visualization/tree/home.jsx b/src/packages/modules-classifications/visualization/tree/home.jsx index 0b98df4c4..8d19707cf 100644 --- a/src/packages/modules-classifications/visualization/tree/home.jsx +++ b/src/packages/modules-classifications/visualization/tree/home.jsx @@ -1,10 +1,10 @@ import { CheckSecondLang } from '@components/check-second-lang'; import { Row } from '@components/layout'; import { PageTitle } from '@components/page-title'; +import { Tree } from '@components/tree'; import { useTitle } from '@utils/hooks/useTitle'; -import { Tree } from '../../../components/tree'; import D from '../../../deprecated-locales'; import Controls from './controls'; diff --git a/src/packages/modules-codelists/components/code-detail/edit.jsx b/src/packages/modules-codelists/components/code-detail/edit.jsx index 87e8ce723..ddd73978c 100644 --- a/src/packages/modules-codelists/components/code-detail/edit.jsx +++ b/src/packages/modules-codelists/components/code-detail/edit.jsx @@ -2,7 +2,9 @@ import { useCallback, useEffect, useState } from 'react'; import { ActionToolbar } from '@components/action-toolbar'; import { SaveButton } from '@components/buttons/buttons-with-icons'; +import { TextInput } from '@components/form/input'; import LabelRequired from '@components/label-required'; +import { Row } from '@components/layout'; import { AddLogo } from '@components/logo/logo-add'; import Select from '@components/select-rmes'; @@ -11,7 +13,6 @@ import { ErrorBloc, GlobalClientSideErrorBloc, } from '../../../../utils'; -import { Row, TextInput } from '../../../components'; import D, { D1, D2 } from '../../i18n/build-dictionary'; import { validateCode } from '../../utils'; import './edit.scss'; diff --git a/src/packages/modules-codelists/components/code-detail/view.jsx b/src/packages/modules-codelists/components/code-detail/view.jsx index 7820b0358..020bcf1f5 100644 --- a/src/packages/modules-codelists/components/code-detail/view.jsx +++ b/src/packages/modules-codelists/components/code-detail/view.jsx @@ -1,9 +1,11 @@ import { ActionToolbar } from '@components/action-toolbar'; import { ReturnButton } from '@components/buttons/buttons-with-icons'; +import { ErrorBloc } from '@components/errors-bloc'; +import { Row } from '@components/layout'; import { Note } from '@components/note'; -import { HTMLUtils } from '../../../../utils'; -import { ErrorBloc, Row } from '../../../components'; +import { renderMarkdownElement } from '@utils/html-utils'; + import D, { D1, D2 } from '../../i18n/build-dictionary'; import './view.scss'; @@ -15,8 +17,8 @@ export const CodeDetailView = ({ col = 3, serverSideError, }) => { - const descriptionLg1 = HTMLUtils.renderMarkdownElement(code.descriptionLg1); - const descriptionLg2 = HTMLUtils.renderMarkdownElement(code.descriptionLg2); + const descriptionLg1 = renderMarkdownElement(code.descriptionLg1); + const descriptionLg2 = renderMarkdownElement(code.descriptionLg2); const codesOptions = codes.map((code) => { return { diff --git a/src/packages/modules-codelists/components/codelist-detail/codes-panel.jsx b/src/packages/modules-codelists/components/codelist-detail/codes-panel.jsx index ae811d5c1..4a8af3c5c 100644 --- a/src/packages/modules-codelists/components/codelist-detail/codes-panel.jsx +++ b/src/packages/modules-codelists/components/codelist-detail/codes-panel.jsx @@ -1,6 +1,7 @@ import { Column } from 'primereact/column'; import { useEffect, useState } from 'react'; +import { DataTable } from '@components/datatable'; import { ClientSideError, GlobalClientSideErrorBloc, @@ -8,9 +9,8 @@ import { import { TextInput } from '@components/form/input'; import LabelRequired from '@components/label-required'; import { Row } from '@components/layout'; +import { RightSlidingPanel } from '@components/sliding-panel'; -import { DataTable } from '../../../components/datatable'; -import { RightSlidingPanel } from '../../../components/sliding-panel'; import { API } from '../../apis'; import D, { D1, D2 } from '../../i18n/build-dictionary'; import { validateCode } from '../../utils'; diff --git a/src/packages/modules-codelists/components/home/partial-home.tsx b/src/packages/modules-codelists/components/home/partial-home.tsx index 979195bb6..35cdc8da3 100644 --- a/src/packages/modules-codelists/components/home/partial-home.tsx +++ b/src/packages/modules-codelists/components/home/partial-home.tsx @@ -5,12 +5,12 @@ import { Loading } from '@components/loading'; import { FeminineButton } from '@components/new-button'; import { PageTitle } from '@components/page-title'; import { SearchableList } from '@components/searchable-list'; +import { VerticalMenu } from '@components/vertical-menu'; import { useTitle } from '@utils/hooks/useTitle'; import Auth from '../../../auth/components/auth'; import { ADMIN } from '../../../auth/roles'; -import { VerticalMenu } from '../../../components/vertical-menu'; import { API } from '../../apis'; import D from '../../i18n/build-dictionary'; import { formatLabel } from '../../utils'; diff --git a/src/packages/modules-codelists/menu/index.jsx b/src/packages/modules-codelists/menu/index.jsx index 1838be554..a9a6cfb8d 100644 --- a/src/packages/modules-codelists/menu/index.jsx +++ b/src/packages/modules-codelists/menu/index.jsx @@ -1,7 +1,8 @@ import { useLocation } from 'react-router-dom'; +import { MainMenu } from '@components/menu'; + import { ADMIN } from '../../auth/roles'; -import { MainMenu } from '../../components/menu'; import { usePermission } from '../../redux/hooks/usePermission'; import D from '../i18n/build-dictionary'; diff --git a/src/packages/modules-concepts/edition-creation/general.jsx b/src/packages/modules-concepts/edition-creation/general.jsx index 3528ff339..6545e3971 100644 --- a/src/packages/modules-concepts/edition-creation/general.jsx +++ b/src/packages/modules-concepts/edition-creation/general.jsx @@ -3,13 +3,13 @@ import { DatePicker } from '@components/date-picker'; import { DisseminationStatusInput } from '@components/dissemination-status/disseminationStatus'; import { ClientSideError } from '@components/errors-bloc'; import { TextInput } from '@components/form/input'; +import { InputMultiRmes } from '@components/input-multi-rmes'; import { InputRmes } from '@components/input-rmes'; import { Row } from '@components/layout'; import { RequiredIcon } from '@components/required-icon'; -import { InputMultiRmes } from '../../components/input-multi-rmes'; import D, { D1, D2 } from '../../deprecated-locales'; -import { fields as generalFields } from '../../modules-concepts/utils/general'; +import { fields as generalFields } from '../utils/general'; const handleFieldChange = (handleChange) => generalFields.reduce((handlers, fieldName) => { diff --git a/src/packages/modules-concepts/edition-creation/links/index.jsx b/src/packages/modules-concepts/edition-creation/links/index.jsx index 9141e6078..464ef1d23 100644 --- a/src/packages/modules-concepts/edition-creation/links/index.jsx +++ b/src/packages/modules-concepts/edition-creation/links/index.jsx @@ -3,6 +3,7 @@ import { Component } from 'react'; import { AddLogo } from '@components/logo/logo-add'; import { DelLogo } from '@components/logo/logo-del'; +import { PickerItem } from '@components/picker-item'; import { BROADER, @@ -16,7 +17,6 @@ import { import { filterDeburr } from '@utils/array-utils'; -import { PickerItem } from '../../../components/picker-item'; import { D1 } from '../../../deprecated-locales'; import ConceptToLink from './concept-to-link'; import { EquivalentLinks } from './equivalentLinks'; diff --git a/src/packages/modules-concepts/menu/index.tsx b/src/packages/modules-concepts/menu/index.tsx index f8da5d7b1..d791d24f5 100644 --- a/src/packages/modules-concepts/menu/index.tsx +++ b/src/packages/modules-concepts/menu/index.tsx @@ -1,6 +1,7 @@ import { useLocation } from 'react-router-dom'; -import { MainMenu } from '../../components/menu'; +import { MainMenu } from '@components/menu'; + import D from '../../deprecated-locales'; const defaultAttrs = { 'aria-current': 'page' }; diff --git a/src/packages/modules-datasets/datasets/edit/tabs/notes.jsx b/src/packages/modules-datasets/datasets/edit/tabs/notes.jsx index f316e2e4e..27a7ad07e 100644 --- a/src/packages/modules-datasets/datasets/edit/tabs/notes.jsx +++ b/src/packages/modules-datasets/datasets/edit/tabs/notes.jsx @@ -1,6 +1,6 @@ import { Row } from '@components/layout'; +import { EditorMarkdown } from '@components/rich-editor/editor-markdown'; -import { EditorMarkdown } from '../../../../components/rich-editor/editor-markdown'; import { D1, D2 } from '../../../../deprecated-locales'; export const Notes = ({ editingDataset, setEditingDataset }) => { diff --git a/src/packages/modules-datasets/distributions/edit.jsx b/src/packages/modules-datasets/distributions/edit.jsx index be81147ab..799fab766 100644 --- a/src/packages/modules-datasets/distributions/edit.jsx +++ b/src/packages/modules-datasets/distributions/edit.jsx @@ -17,13 +17,15 @@ import LabelRequired from '@components/label-required'; import { Row } from '@components/layout'; import { Loading, Saving } from '@components/loading'; import { PageTitleBlock } from '@components/page-title-block'; +import { EditorMarkdown } from '@components/rich-editor/editor-markdown'; + +import { DistributionApi } from '@sdk/index'; + +import { useGoBack } from '@utils/hooks/useGoBack'; +import { useTitle } from '@utils/hooks/useTitle'; -import { EditorMarkdown } from '../../components/rich-editor/editor-markdown'; import { D1, D2 } from '../../deprecated-locales'; import D from '../../deprecated-locales/build-dictionary'; -import { DistributionApi } from '../../sdk'; -import { useGoBack } from '../../utils/hooks/useGoBack'; -import { useTitle } from '../../utils/hooks/useTitle'; import { useDatasetsForDistributions, useDistribution } from '../datasets'; import { ByteSizeInput } from './edit/byte-size-input'; import { validate } from './validation'; diff --git a/src/packages/modules-operations/document/home.jsx b/src/packages/modules-operations/document/home.jsx index 0d74cd773..17127c03e 100644 --- a/src/packages/modules-operations/document/home.jsx +++ b/src/packages/modules-operations/document/home.jsx @@ -2,16 +2,17 @@ import DOMPurify from 'dompurify'; import { useCallback, useEffect, useState } from 'react'; import { Link, useLocation, useNavigate } from 'react-router-dom'; +import FilterToggleButtons from '@components/filter-toggle-buttons'; import { TextInput } from '@components/form/input'; import { Row } from '@components/layout'; +import { NumberResults } from '@components/number-results'; import { PageTitle } from '@components/page-title'; import { Pagination } from '@components/pagination'; -import FilterToggleButtons from '../../components/filter-toggle-buttons'; -import { NumberResults } from '../../components/number-results'; +import { filterKeyDeburr } from '@utils/array-utils'; +import { useTitle } from '@utils/hooks/useTitle'; + import D from '../../deprecated-locales'; -import { filterKeyDeburr } from '../../utils/array-utils'; -import { useTitle } from '../../utils/hooks/useTitle'; import { Menu } from './menu'; import { BOTH, DOCUMENT, LINK, isDocument, isLink } from './utils'; diff --git a/src/packages/modules-operations/families/edition/edition.jsx b/src/packages/modules-operations/families/edition/edition.jsx index ec787296b..2e43d95b6 100644 --- a/src/packages/modules-operations/families/edition/edition.jsx +++ b/src/packages/modules-operations/families/edition/edition.jsx @@ -15,10 +15,10 @@ import LabelRequired from '@components/label-required'; import { Row } from '@components/layout'; import { Saving } from '@components/loading'; import { PageTitleBlock } from '@components/page-title-block'; +import { EditorMarkdown } from '@components/rich-editor/editor-markdown'; import { OperationsApi } from '@sdk/operations-api'; -import { EditorMarkdown } from '../../../components/rich-editor/editor-markdown'; import { D1, D2 } from '../../../deprecated-locales'; import D from '../../../deprecated-locales/build-dictionary'; import { validate } from './validation'; diff --git a/src/packages/modules-operations/msd/pages/sims-creation/menu.tsx b/src/packages/modules-operations/msd/pages/sims-creation/menu.tsx index 2409a5dac..029557396 100644 --- a/src/packages/modules-operations/msd/pages/sims-creation/menu.tsx +++ b/src/packages/modules-operations/msd/pages/sims-creation/menu.tsx @@ -1,8 +1,8 @@ -import { ActionToolbar } from '../../../../components/action-toolbar'; +import { ActionToolbar } from '@components/action-toolbar'; import { CancelButton, SaveButton, -} from '../../../../components/buttons/buttons-with-icons'; +} from '@components/buttons/buttons-with-icons'; type MenuTypes = { goBackUrl: () => void; diff --git a/src/packages/modules-operations/series/edition/edition.jsx b/src/packages/modules-operations/series/edition/edition.jsx index 4a5817ed4..57c5b1d30 100644 --- a/src/packages/modules-operations/series/edition/edition.jsx +++ b/src/packages/modules-operations/series/edition/edition.jsx @@ -16,13 +16,13 @@ import LabelRequired from '@components/label-required'; import { Row } from '@components/layout'; import { Saving } from '@components/loading'; import { PageTitleBlock } from '@components/page-title-block'; +import { EditorMarkdown } from '@components/rich-editor/editor-markdown'; import { Select } from '@components/select-rmes'; import { OperationsApi } from '@sdk/operations-api'; import * as ItemToSelectModel from '@utils/item-to-select-model'; -import { EditorMarkdown } from '../../../components/rich-editor/editor-markdown'; import D, { D1, D2 } from '../../../deprecated-locales'; import { CL_FREQ, diff --git a/src/packages/modules-operations/series/search/typeCodeInput.tsx b/src/packages/modules-operations/series/search/typeCodeInput.tsx index 358bdd97e..13045777f 100644 --- a/src/packages/modules-operations/series/search/typeCodeInput.tsx +++ b/src/packages/modules-operations/series/search/typeCodeInput.tsx @@ -1,8 +1,10 @@ -import { Select } from '../../../components/select-rmes'; +import { Select } from '@components/select-rmes'; + +import { useCodesList } from '@utils/hooks/codeslist'; + import D from '../../../deprecated-locales'; import { Option } from '../../../model/SelectOption'; import { CL_SOURCE_CATEGORY } from '../../../redux/actions/constants/codeList'; -import { useCodesList } from '../../../utils/hooks/codeslist'; type TypeCodeInputTypes = { value: string; diff --git a/src/packages/modules-structures/components/components-table/index.tsx b/src/packages/modules-structures/components/components-table/index.tsx index 51c2806d4..dc12d7647 100644 --- a/src/packages/modules-structures/components/components-table/index.tsx +++ b/src/packages/modules-structures/components/components-table/index.tsx @@ -1,6 +1,7 @@ import { Column } from 'primereact/column'; -import { DataTable } from '../../../components/datatable'; +import { DataTable } from '@components/datatable'; + import D from '../../i18n/build-dictionary'; export const ComponentsTable = ({ diff --git a/src/packages/modules-structures/components/mutualized-component-selector/index.jsx b/src/packages/modules-structures/components/mutualized-component-selector/index.jsx index 0a8b3dafe..28057354a 100644 --- a/src/packages/modules-structures/components/mutualized-component-selector/index.jsx +++ b/src/packages/modules-structures/components/mutualized-component-selector/index.jsx @@ -2,8 +2,8 @@ import { useCallback, useState } from 'react'; import { AddButton } from '@components/buttons/add'; import { SeeButton } from '@components/buttons/see'; +import { RightSlidingPanel } from '@components/sliding-panel'; -import { RightSlidingPanel } from '../../../components/sliding-panel'; import { UNPUBLISHED } from '../../../model/ValidationState'; import D from '../../i18n/build-dictionary'; import { typeUriToLabel } from '../../utils'; diff --git a/src/packages/modules-structures/menu/index.tsx b/src/packages/modules-structures/menu/index.tsx index 515326661..ef2c7fd69 100644 --- a/src/packages/modules-structures/menu/index.tsx +++ b/src/packages/modules-structures/menu/index.tsx @@ -1,7 +1,8 @@ import { useMemo } from 'react'; import { useLocation } from 'react-router-dom'; -import { MainMenu } from '../../components/menu'; +import { MainMenu } from '@components/menu'; + import D from '../../deprecated-locales'; const ACTIVE = 'active';