Skip to content

Commit

Permalink
mv folders
Browse files Browse the repository at this point in the history
  • Loading branch information
ddecrulle committed May 30, 2024
1 parent 17a55fa commit c9fe2c1
Show file tree
Hide file tree
Showing 44 changed files with 33 additions and 33 deletions.
1 change: 0 additions & 1 deletion src/model/StateData.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
import { assert } from 'tsafe/assert'
import { type Extends } from 'tsafe/Extends'

import type { PageType } from './Page'
import type { StateDataDto, StateDataInput } from './api'

Expand Down
2 changes: 1 addition & 1 deletion src/pages/Accessibility/AccessibilityPage.tsx
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { Breadcrumb } from '@codegouvfr/react-dsfr/Breadcrumb'
import { Grid } from 'components/Grid'
import { Grid } from 'shared/components/Grid'

export function AccessibilityPage() {
return (
Expand Down
8 changes: 4 additions & 4 deletions src/pages/Collect/CollectPage.tsx
Original file line number Diff line number Diff line change
@@ -1,19 +1,19 @@
import { Orchestrator } from 'components/Orchestrator/Orchestrator'
import { Orchestrator } from 'shared/components/Orchestrator/Orchestrator'
import { collectRoute } from './route'
import { useQueryClient } from '@tanstack/react-query'
import { getGetNomenclatureByIdQueryOptions } from 'api/04-nomenclatures'
import type {
LunaticGetReferentiel,
Nomenclature,
} from 'components/Orchestrator/utils/lunaticType'
} from 'shared/components/Orchestrator/utils/lunaticType'
import {
getGenerateDepositProofQueryOptions,
useUpdateSurveyUnitDataStateDataById,
} from 'api/06-survey-units'
import type { LunaticData } from '@inseefr/lunatic'
import type { StateData } from 'model/StateData'
import { useDocumentTitle } from 'hooks/useDocumentTitle'
import { useSetLogoutQuestionnaire } from 'hooks/useLogoutUrl'
import { useDocumentTitle } from 'shared/hooks/useDocumentTitle'
import { useSetLogoutQuestionnaire } from 'shared/hooks/useLogoutUrl'
import { toast } from 'react-toastify'

export function CollectPage() {
Expand Down
2 changes: 1 addition & 1 deletion src/pages/Collect/route.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ import { protectedRouteLoader } from 'router/loader/protectedLoader'
import { getGetQuestionnaireDataQueryOptions } from 'api/03-questionnaires'
import { getGetSurveyUnitByIdQueryOptions } from 'api/06-survey-units'
import { getGetMetadataByQuestionnaireIdQueryOptions } from 'api/05-metadata'
import { ErrorComponent } from 'components/Error/ErrorComponent'
import { ErrorComponent } from 'shared/components/Error/ErrorComponent'
import type { LunaticSource } from '@inseefr/lunatic'
import type { SurveyUnitData } from 'model/SurveyUnitData'

Expand Down
2 changes: 1 addition & 1 deletion src/pages/Legals/LegalsPage.tsx
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { Breadcrumb } from '@codegouvfr/react-dsfr/Breadcrumb'
import { Grid } from 'components/Grid'
import { Grid } from 'shared/components/Grid'

export function LegalPage() {
return (
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import Breadcrumb from '@codegouvfr/react-dsfr/Breadcrumb'
import { Grid } from 'components/Grid'
import { Grid } from 'shared/components/Grid'

export function NavigationAssistancePage() {
return (
Expand Down
2 changes: 1 addition & 1 deletion src/pages/Review/route.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ import { protectedRouteLoader } from 'router/loader/protectedLoader'
import { getGetQuestionnaireDataQueryOptions } from 'api/03-questionnaires'
import { getGetSurveyUnitByIdQueryOptions } from 'api/06-survey-units'
import { getGetMetadataByQuestionnaireIdQueryOptions } from 'api/05-metadata'
import { ErrorComponent } from 'components/Error/ErrorComponent'
import { ErrorComponent } from 'shared/components/Error/ErrorComponent'
import type { LunaticSource } from '@inseefr/lunatic'
import type { SurveyUnitData } from 'model/SurveyUnitData'

Expand Down
2 changes: 1 addition & 1 deletion src/pages/Security/SecurityPage.tsx
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import Breadcrumb from '@codegouvfr/react-dsfr/Breadcrumb'
import { Grid } from 'components/Grid'
import { Grid } from 'shared/components/Grid'

export function SecurityPage() {
return (
Expand Down
2 changes: 1 addition & 1 deletion src/pages/SiteMap/SiteMapPage.tsx
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { Breadcrumb } from '@codegouvfr/react-dsfr/Breadcrumb'
import { Grid } from 'components/Grid'
import { Grid } from 'shared/components/Grid'

import { Link } from '@tanstack/react-router'

Expand Down
4 changes: 2 additions & 2 deletions src/pages/Visualize/Form/VisualizeForm.tsx
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
import { Input } from '@codegouvfr/react-dsfr/Input'
import { Button } from '@codegouvfr/react-dsfr/Button'
import { Grid } from 'components/Grid'
import { Grid } from 'shared/components/Grid'
import { SelectNomenclatures } from './SelectNomenclatures'
import { FormProvider, useForm } from 'react-hook-form'
import { useNavigate } from '@tanstack/react-router'
import { Container } from 'components/Container'
import { Container } from 'shared/components/Container'
import { useEffect } from 'react'

export type FormInputs = {
Expand Down
6 changes: 3 additions & 3 deletions src/pages/Visualize/Visualize.tsx
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
import { Orchestrator } from 'components/Orchestrator/Orchestrator'
import { Orchestrator } from 'shared/components/Orchestrator/Orchestrator'
import { VisualizeForm } from './Form/VisualizeForm'
import { visualizeRoute } from './route'
import { useQueryClient } from '@tanstack/react-query'
import { nomenclatureQueryOptions } from 'utils/query/visualizeQueryOptions'
import type { LunaticGetReferentiel } from 'components/Orchestrator/utils/lunaticType'
import { nomenclatureQueryOptions } from 'shared/query/visualizeQueryOptions'
import type { LunaticGetReferentiel } from 'shared/components/Orchestrator/utils/lunaticType'

export function VisualizePage() {
const loaderResults = visualizeRoute.useLoaderData()
Expand Down
4 changes: 2 additions & 2 deletions src/pages/Visualize/route.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,8 @@ import {
metadataQueryOptions,
sourceQueryOptions,
surveyUnitDataQueryOptions,
} from 'utils/query/visualizeQueryOptions'
import { ErrorComponent } from 'components/Error/ErrorComponent'
} from 'shared/query/visualizeQueryOptions'
import { ErrorComponent } from 'shared/components/Error/ErrorComponent'

const visualizeSearchSchema = z
.object({
Expand Down
4 changes: 2 additions & 2 deletions src/router/Layout/Header.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,8 @@ import { Header as DsfrHeader } from '@codegouvfr/react-dsfr/Header'
import logoInsee from 'assets/logo-insee.png'
import { headerFooterDisplayItem } from '@codegouvfr/react-dsfr/Display'
import { Badge } from '@codegouvfr/react-dsfr/Badge'
import { useLogoutUrl } from 'hooks/useLogoutUrl'
import { executePreLogoutActions } from 'utils/prelogout'
import { useLogoutUrl } from 'shared/hooks/useLogoutUrl'
import { executePreLogoutActions } from 'shared/hooks/prelogout'

export function Header() {
const { isUserLoggedIn, logout } = useOidc()
Expand Down
2 changes: 1 addition & 1 deletion src/router/Layout/Layout.tsx
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import { Header } from './Header'
import { Footer } from './Footer'
import type { PropsWithChildren } from 'react'
import { LogoutPathProvider } from 'hooks/useLogoutUrl'
import { LogoutPathProvider } from 'shared/hooks/useLogoutUrl'

export function Layout(props: PropsWithChildren) {
const { children } = props
Expand Down
4 changes: 2 additions & 2 deletions src/router/router.tsx
Original file line number Diff line number Diff line change
@@ -1,19 +1,19 @@
import type { QueryClient } from '@tanstack/react-query'
import { Layout } from './Layout'
import { createRootRouteWithContext, Outlet } from '@tanstack/react-router'
import { ErrorComponent } from 'components/Error/ErrorComponent'
import { ErrorComponent } from 'shared/components/Error/ErrorComponent'
import { visualizeRoute } from 'pages/Visualize/route'
import { accessibilityRoute } from 'pages/Accessibility/route'
import { securityRoute } from 'pages/Security/route'
import { siteMapRoute } from 'pages/SiteMap/route'
import { legalsRoute } from 'pages/Legals/route'
import { navigationAssistanceRoute } from 'pages/NavigationAssistance/route'
import { collectRoute } from 'pages/Collect/route'
import { NotFoundError } from 'utils/error/notFoundError'
import { reviewRoute } from 'pages/Review/route'
import { ToastContainer } from 'react-toastify'
import 'react-toastify/dist/ReactToastify.css'
import { useIsDark } from '@codegouvfr/react-dsfr/useIsDark'
import { NotFoundError } from 'shared/error/notFoundError'

export const rootRoute = createRootRouteWithContext<{
queryClient: QueryClient
Expand Down
File renamed without changes.
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,9 @@ import { fr } from '@codegouvfr/react-dsfr'
import Button from '@codegouvfr/react-dsfr/Button'
import TechnicalError from '@codegouvfr/react-dsfr/dsfr/artwork/pictograms/system/technical-error.svg'
import { useNavigate } from '@tanstack/react-router'
import { Container } from 'components/Container'
import { useDocumentTitle } from 'hooks/useDocumentTitle'
import { getErrorInformations } from 'utils/error/errorUtils'
import { Container } from 'shared/components/Container'
import { useDocumentTitle } from 'shared/hooks/useDocumentTitle'
import { getErrorInformations } from 'shared/error/errorUtils'

export function ErrorComponent(props: {
error: unknown
Expand Down
File renamed without changes.
File renamed without changes.
Original file line number Diff line number Diff line change
Expand Up @@ -21,12 +21,12 @@ import type { StateData } from 'model/StateData'
import { isBlockingError, isSameErrors } from './utils/controls'
import { slotComponents } from './slotComponents'
import type { LunaticGetReferentiel } from './utils/lunaticType'
import { useUpdateEffect } from 'hooks/useUpdateEffect'
import { useRefSync } from 'hooks/useRefSync'
import { useRefSync } from 'utils/useRefSync'
import { isSequencePage } from './utils/sequence'
import { scrollToFirstError } from './utils/scrollToFirstError'
import { isObjectEmpty } from 'utils/isObjectEmpty'
import { useAddPreLogoutAction } from 'utils/prelogout'
import { useAddPreLogoutAction } from 'shared/hooks/prelogout'
import { useUpdateEffect } from 'utils/useUpdateEffect'

export type OrchestratorProps = OrchestratorProps.Common &
(OrchestratorProps.Visualize | OrchestratorProps.Collect)
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
/* eslint-disable react-refresh/only-export-components */
import type { LunaticSlotComponents } from '@inseefr/lunatic'
import { slotComponents as dsfrSlotsComponents } from '@inseefr/lunatic-dsfr'
import { useSequenceTitle } from 'hooks/useDocumentTitle'
import { useSequenceTitle } from 'shared/hooks/useDocumentTitle'
import { assert } from 'tsafe/assert'

const Sequence: LunaticSlotComponents['Sequence'] = (props) => {
Expand Down
File renamed without changes.
File renamed without changes.
2 changes: 1 addition & 1 deletion src/utils/prelogout.ts → src/shared/hooks/prelogout.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { useEvent } from 'hooks/useEvent'
import { useEffect } from 'react'
import { useEvent } from 'utils/useEvent'

const actions = new Set<() => Promise<void> | void>()

Expand Down
File renamed without changes.
File renamed without changes.
1 change: 1 addition & 0 deletions src/parser/page.ts → src/shared/parser/page.ts
Original file line number Diff line number Diff line change
Expand Up @@ -24,4 +24,5 @@ export const internalPageTypeSchema = z.union([
stromaePageSchema,
z.literal('lunaticPage'),
])

assert<Equals<z.infer<typeof internalPageTypeSchema>, InternalPageType>>()
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ import type { LunaticSource } from '@inseefr/lunatic'
import { queryOptions } from '@tanstack/react-query'
import type { SurveyUnitData } from 'model/SurveyUnitData'
import axios, { type AxiosRequestConfig } from 'axios'
import type { Nomenclature } from 'components/Orchestrator/utils/lunaticType'
import type { Nomenclature } from 'shared/components/Orchestrator/utils/lunaticType'

function axiosGet<T>(url: string, options?: AxiosRequestConfig) {
return axios.get<T>(url, options).then(({ data }) => data)
Expand Down
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.

0 comments on commit c9fe2c1

Please sign in to comment.