-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
15 changed files
with
317 additions
and
134 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
import type { useLunatic } from '@inseefr/lunatic' | ||
|
||
export type StateData = { | ||
state: 'INIT' | 'COMPLETED' | 'VALIDATED' | 'TOEXTRACT' | 'EXTRACTED' | null | ||
date: number | ||
currentPage: | ||
| 'welcomePage' | ||
| 'validationPage' | ||
| 'endPage' | ||
| ReturnType<typeof useLunatic>['pageTag'] // We hope Lunatic will better type this with template literal type | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
import type { LunaticData } from '@inseefr/lunatic' | ||
import type { StateData } from './StateData' | ||
|
||
export type SurveyUnitData = { | ||
stateData?: StateData | ||
data?: LunaticData | ||
personalization?: Array<unknown> | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
import type { LunaticSource } from '@inseefr/lunatic' | ||
import { queryOptions } from '@tanstack/react-query' | ||
import type { SurveyUnitData } from 'model/SurveyUnitData' | ||
import { axiosGet } from 'utils/axios' | ||
|
||
export const sourceQueryOptions = (sourceUrl: string) => | ||
queryOptions({ | ||
queryKey: [sourceUrl], | ||
queryFn: () => axiosGet<LunaticSource>(sourceUrl), | ||
}) | ||
|
||
export const surveyUnitDataQueryOptions = (surveyUnitDataUrl: string) => | ||
queryOptions({ | ||
queryKey: [surveyUnitDataUrl], | ||
queryFn: () => axiosGet<SurveyUnitData>(surveyUnitDataUrl), | ||
}) | ||
|
||
//TODO Type metadata | ||
export const metadataQueryOptions = (metadataUrl: string) => | ||
queryOptions({ | ||
queryKey: [metadataUrl], | ||
queryFn: () => axiosGet<unknown>(metadataUrl), | ||
}) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1,40 @@ | ||
/// <reference types="vite/client" /> | ||
/// <reference types="vite-envs/client" /> | ||
|
||
|
||
type ImportMetaEnv = { | ||
// Auto-generated by `npx vite-envs update-types` and hot-reloaded by the `vite-env` plugin | ||
VITE_OIDC_ISSUER: string | ||
VITE_OIDC_CLIENT_ID: string | ||
VITE_PORTAIL_URL: string | ||
VITE_APP_VERSION: string | ||
VITE_LUNATIC_VERSION: string | ||
BASE_URL: string | ||
MODE: string | ||
DEV: boolean | ||
PROD: boolean | ||
// @user-defined-start | ||
/* | ||
* Here you can define your own special variables | ||
* that would be available on `import.meta.env` but | ||
* that vite-envs does not know about. | ||
* This section will be preserved thanks to the special comments. | ||
* Example: | ||
*/ | ||
SSR: boolean; | ||
// @user-defined-end | ||
} | ||
|
||
|
||
|
||
interface ImportMeta { | ||
// Auto-generated by `npx vite-envs update-types` | ||
|
||
url: string | ||
|
||
readonly hot?: import('vite-envs/types/hot').ViteHotContext | ||
|
||
readonly env: ImportMetaEnv | ||
|
||
glob: import('vite-envs/types/importGlob').ImportGlobFunction | ||
} | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,7 +1,9 @@ | ||
import { defineConfig } from 'vite' | ||
import react from '@vitejs/plugin-react' | ||
import tsconfigPaths from 'vite-tsconfig-paths' | ||
import { viteEnvs } from 'vite-envs' | ||
|
||
// https://vitejs.dev/config/ | ||
export default defineConfig({ | ||
plugins: [react(), tsconfigPaths()], | ||
plugins: [react(), tsconfigPaths(), viteEnvs()], | ||
}) |
Oops, something went wrong.