Skip to content

Commit

Permalink
chore: move all json files into assets
Browse files Browse the repository at this point in the history
  • Loading branch information
MailineN committed Aug 5, 2024
1 parent b0f9f3f commit f5d224d
Show file tree
Hide file tree
Showing 9 changed files with 40 additions and 35 deletions.
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
"@emotion/react": "^11.10.4",
"@emotion/styled": "^11.10.4",
"@inseefr/lunatic": "2.0.7-v2",
"@inseefrlab/lunatic-edt": "0.12.6",
"@inseefrlab/lunatic-edt": "0.13.2",
"@mui/material": "^5.10.7",
"@mui/styles": "^5.12.0",
"@react-pdf/font": "2.2.1",
Expand Down
File renamed without changes.
File renamed without changes.
Original file line number Diff line number Diff line change
@@ -1,66 +1,66 @@
[
{
"label": "Écouter la radio, des podcasts ou de la musique",
"value": "1"
"value": 1
},
{
"label": "Regarder la télévision, des DVD, des vidéos en ligne",
"value": "2"
"value": 2
},
{
"label": "Conversation",
"value": "3"
"value": 3
},
{
"label": "Consulter mes mails personnels",
"value": "4"
"value": 4
},
{
"label": "Consulter les notifications de mon téléphone",
"value": "5"
"value": 5
},
{
"label": "Publier ou surfer sur les médias sociaux (Facebook, Instagram, Twitter, …)",
"value": "6"
"value": 6
},
{
"label": "Surf sur Internet, visite de sites pour m'informer (hors journaux)",
"value": "7"
"value": 7
},
{
"label": "Jeux sur téléphone",
"value": "8"
"value": 8
},
{
"label": "Lecture de journaux, revues",
"value": "9"
"value": 9
},
{
"label": "Lecture de livres",
"value": "10"
"value": 10
},
{
"label": "Repas",
"value": "11"
"value": 11
},
{
"label": "Travail professionnel (y compris mails)",
"value": "12"
"value": 12
},
{
"label": "Me détendre, fumer",
"value": "13"
"value": 13
},
{
"label": "Conversations avec les enfants, lectures",
"value": "14"
"value": 14
},
{
"label": "Repas, douche, habillage des enfants",
"value": "15"
"value": 15
},
{
"label": "Surveiller les devoirs des enfants",
"value": "16"
"value": 16
}
]
Original file line number Diff line number Diff line change
@@ -1,47 +1,47 @@
[
{
"label": "Écouter la radio, des podcasts ou de la musique",
"value": ""
"value": 1
},
{
"label": "Regarder la télévision, des DVD, des vidéos en ligne",
"value": "2"
"value": 2
},
{
"label": "Conversation",
"value": "3"
"value": 3
},
{
"label": "Conversations téléphoniques",
"value": "4"
"value": 4
},
{
"label": "Consulter mes mails personnels",
"value": "5"
"value": 5
},
{
"label": "Consulter les notifications de mon téléphone",
"value": "6"
"value": 6
},
{
"label": "Surf sur Internet, visite de sites pour m'informer (hors journaux)",
"value": "7"
"value": 7
},
{
"label": "Publier ou surfer sur les médias sociaux (Facebook, Instagram, Twitter, ...)",
"value": "8"
"value": 9
},
{
"label": "Jeux sur téléphone",
"value": "9"
"value": 9
},
{
"label": "Lecture de journaux, revues",
"value": "10"
"value": 10
},
{
"label": "Lecture de livres",
"value": "11"
"value": 11
},
{
"label": "Manger",
Expand Down
4 changes: 4 additions & 0 deletions src/assets/surveyData/index.ts
Original file line number Diff line number Diff line change
@@ -1,2 +1,6 @@
export { default as edtActivitySurvey } from "./edtActivitySurvey.json";
export { default as edtWorkTimeSurvey } from "./edtWorkTimeSurvey.json";
export { default as dataEmptyActivity } from "./dataEmptyActivity.json";
export { default as dataEmptyWeeklyPlanner } from "./dataEmptyWeeklyPlanner.json";
export { default as stopWordsFrench } from "./stop_words_french.json";
export { default as synonymesMisspellings } from "./synonymes-misspellings.json";
File renamed without changes.
File renamed without changes.
15 changes: 8 additions & 7 deletions src/service/survey-service.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@ import {
generateDateFromStringInput,
getFrenchDayFromDate,
} from "@inseefrlab/lunatic-edt";
import activitySurveySource from "assets/surveyData/edtActivitySurvey.json";
import dayjs from "dayjs";
import { EdtRoutesNameEnum } from "enumerations/EdtRoutesNameEnum";
import { EdtSurveyRightsEnum } from "enumerations/EdtSurveyRightsEnum";
Expand Down Expand Up @@ -50,8 +49,6 @@ import { NavigateFunction } from "react-router-dom";
import { fetchReviewerSurveysAssignments } from "service/api-service/getRemoteData";
import { lunaticDatabase } from "service/lunatic-database";
import { LABEL_WORK_TIME_SURVEY, getCurrentPageSource } from "service/orchestrator-service";
import dataEmptyActivity from "utils/dataEmptyActivity.json";
import dataEmptyWorkTime from "utils/dataEmptyWeeklyPlanner.json";
import {
addArrayToSession,
addItemToSession,
Expand All @@ -60,8 +57,12 @@ import {
groupBy,
} from "utils/utils";
import { validate } from "uuid";
import { edtWorkTimeSurvey } from "assets/surveyData";
//import placeWorkSource from "utils/placeWork.json";
import {
edtWorkTimeSurvey,
edtActivitySurvey,
dataEmptyActivity,
dataEmptyWeeklyPlanner,
} from "assets/surveyData";
import { EdtUserRightsEnum } from "./../enumerations/EdtUserRightsEnum";
import { LunaticData } from "./../interface/lunatic/Lunatic";
import {
Expand Down Expand Up @@ -761,7 +762,7 @@ const getDataEmpty = (idSurvey: string) => {
if (surveysIds[SurveysIdsEnum.ACTIVITY_SURVEYS_IDS].includes(idSurvey)) {
return dataEmptyActivity;
} else {
return dataEmptyWorkTime;
return dataEmptyWeeklyPlanner;
}
};

Expand Down Expand Up @@ -1245,7 +1246,7 @@ const getReferentiel = (refName: ReferentielsEnum) => {
};

const getActivitySource = () => {
return sourcesData != null ? sourcesData.edtActivitySurvey : activitySurveySource;
return sourcesData != null ? sourcesData.edtActivitySurvey : edtActivitySurvey;
};

//TODO: Temp solution as place work does not exist
Expand Down

0 comments on commit f5d224d

Please sign in to comment.