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

Refactor some imports #1093

Merged
merged 4 commits into from
Dec 2, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
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
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import * as associationUtils from '../../../modules-classifications/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', () => {
Expand Down
2 changes: 1 addition & 1 deletion src/packages/modules-classifications/routes/layout.tsx
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import { Outlet } from 'react-router-dom';

import Menu from '../../modules-classifications/menu';
import { useTheme } from '../../utils/hooks/useTheme';
import Menu from '../menu';

export const Component = () => {
useTheme('classifications');
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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) => {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import { render } from '@testing-library/react';

import { empty } from '../../../modules-concepts/collections/utils/general';
import { locales } from '../../../tests-utils/default-values';
import { empty } from '../utils/general';
import CollectionGeneral from './general';

vi.mock('@components/form/input', () => ({ TextInput: () => <></> }));
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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 }) => {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,11 +5,11 @@ 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 { 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';

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,11 +7,11 @@ 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 { 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';
Expand Down
2 changes: 1 addition & 1 deletion src/packages/modules-operations/document/edition/index.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -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();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ vi.mock('@components/loading', () => ({
Loading: () => <div>Loading...</div>,
}));

vi.mock('../../../modules-operations/families/edition/edition', () => ({
vi.mock('./edition', () => ({
default: () => <div>Operations Family Edition Component</div>,
}));

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,8 @@ 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 { CL_FREQ } from '../../../redux/actions/constants/codeList';
import OperationsIndicatorEdition from './edition';

export const Component = (props) => {
const { id } = useParams();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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 '../../../modules-operations/indicators/visualization/general';
import { CL_FREQ } from '../../../redux/actions/constants/codeList';
import OperationsIndicatorVisualization from './general';
import { Menu } from './menu';

export const Component = () => {
Expand Down
Original file line number Diff line number Diff line change
@@ -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;

Expand Down
2 changes: 1 addition & 1 deletion src/packages/modules-operations/msd/outline/index.spec.jsx
Original file line number Diff line number Diff line change
@@ -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',
Expand Down
Original file line number Diff line number Diff line change
@@ -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';
Expand Down
Original file line number Diff line number Diff line change
@@ -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;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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 '../../../modules-operations/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,
Expand Down
1 change: 0 additions & 1 deletion src/vite-env.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down