From 05ac83d920014f501c752aaf5aa79cadd89bc0f1 Mon Sep 17 00:00:00 2001 From: Clara Ni Date: Thu, 17 Aug 2023 10:49:55 +0200 Subject: [PATCH] front: remove custom GET --- front/README.md | 6 - front/public/locales/de/home/home.json | 1 - front/public/locales/en/customget.json | 8 - front/public/locales/en/home/home.json | 1 - front/public/locales/en/translation.json | 5 + front/public/locales/es/home/home.json | 1 - front/public/locales/fr/customget.json | 8 - front/public/locales/fr/home/home.json | 1 - front/public/locales/fr/translation.json | 6 + front/public/locales/it/home/home.json | 1 - front/public/locales/jp/home/home.json | 1 - front/public/locales/ru/home/home.json | 1 - front/public/locales/uk/home/home.json | 1 - front/src/applications/customget/Home.jsx | 66 ---- front/src/applications/customget/Home.scss | 7 - .../customget/components/ChartHelpers.jsx | 208 ----------- .../customget/components/ChartModal.jsx | 66 ---- .../customget/components/ChartModal.scss | 53 --- .../components/SpaceTimeChart/createChart.jsx | 67 ---- .../components/SpaceTimeChart/createTrain.jsx | 17 - .../components/SpaceTimeChart/drawTrain.jsx | 147 -------- .../customget/components/consts.jsx | 9 - .../customget/components/convertData.jsx | 83 ----- .../customget/components/defineChart.jsx | 100 ------ .../customget/components/drawCurve.jsx | 41 --- .../customget/components/drawGuideLines.jsx | 24 -- .../customget/components/drawText.jsx | 17 - .../components/enableInteractivity.jsx | 326 ------------------ .../customget/components/svgDefs.jsx | 44 --- .../customget/testdata/manal_results_get.json | 1 - .../customget/views/CustomGET.jsx | 138 -------- .../customget/views/CustomGET.scss | 26 -- .../views/DeprecatedSpaceTimeChart.jsx | 296 ---------------- .../customget/views/TimeButtons.jsx | 116 ------- .../customget/views/TimeTable.jsx | 103 ------ .../customget/views/TrainDetails.jsx | 28 -- .../customget/views/TrainList.jsx | 235 ------------- .../ImportTrainScheduleConfig.tsx | 2 +- front/src/assets/pictures/home/customget.svg | 1 - .../InfraSelectorModalBodyEdition.tsx | 6 +- .../components => common}/uploadFileModal.jsx | 12 +- front/src/main/app.jsx | 2 - front/src/main/home.jsx | 4 - front/tests/pages/home-page-model.ts | 1 - 44 files changed, 21 insertions(+), 2266 deletions(-) delete mode 100644 front/public/locales/en/customget.json delete mode 100644 front/public/locales/fr/customget.json delete mode 100644 front/src/applications/customget/Home.jsx delete mode 100644 front/src/applications/customget/Home.scss delete mode 100644 front/src/applications/customget/components/ChartHelpers.jsx delete mode 100644 front/src/applications/customget/components/ChartModal.jsx delete mode 100644 front/src/applications/customget/components/ChartModal.scss delete mode 100644 front/src/applications/customget/components/SpaceTimeChart/createChart.jsx delete mode 100644 front/src/applications/customget/components/SpaceTimeChart/createTrain.jsx delete mode 100644 front/src/applications/customget/components/SpaceTimeChart/drawTrain.jsx delete mode 100644 front/src/applications/customget/components/consts.jsx delete mode 100644 front/src/applications/customget/components/convertData.jsx delete mode 100644 front/src/applications/customget/components/defineChart.jsx delete mode 100644 front/src/applications/customget/components/drawCurve.jsx delete mode 100644 front/src/applications/customget/components/drawGuideLines.jsx delete mode 100644 front/src/applications/customget/components/drawText.jsx delete mode 100644 front/src/applications/customget/components/enableInteractivity.jsx delete mode 100644 front/src/applications/customget/components/svgDefs.jsx delete mode 100644 front/src/applications/customget/testdata/manal_results_get.json delete mode 100644 front/src/applications/customget/views/CustomGET.jsx delete mode 100644 front/src/applications/customget/views/CustomGET.scss delete mode 100644 front/src/applications/customget/views/DeprecatedSpaceTimeChart.jsx delete mode 100644 front/src/applications/customget/views/TimeButtons.jsx delete mode 100644 front/src/applications/customget/views/TimeTable.jsx delete mode 100644 front/src/applications/customget/views/TrainDetails.jsx delete mode 100644 front/src/applications/customget/views/TrainList.jsx delete mode 100644 front/src/assets/pictures/home/customget.svg rename front/src/{applications/customget/components => common}/uploadFileModal.jsx (88%) diff --git a/front/README.md b/front/README.md index b594a7eed26..7d1013b1b24 100644 --- a/front/README.md +++ b/front/README.md @@ -111,7 +111,6 @@ organized in folders. **The components propose the main JS/TS file and eventually another folder with same name containing some minors subcomponents linked to.** -- [customget/](#isolated-space-time-chart-for-research-needs-customget) - components/ - views/ - [editor/](#infrastructure-editor-editor) @@ -200,11 +199,6 @@ This is an implementation reference for all map concerns. It aims to display all a ready-to-use map component reference. When adding a new common layer inside an application map component, please add it first to this application. -### Isolated space-time chart for research needs `customGET/` - -_EXPERIMENTATION_ This application, which is not intended to remain as is, is a space-time graph fed -by external data, to be used for thesis work on optimization. - ## Common components `/src/common` All common code (and shared components) supposed to be in `common/`. diff --git a/front/public/locales/de/home/home.json b/front/public/locales/de/home/home.json index 230d805ae20..9c1e40315a4 100644 --- a/front/public/locales/de/home/home.json +++ b/front/public/locales/de/home/home.json @@ -1,5 +1,4 @@ { - "customget": "Visualisierung JSON GET", "editor": "Infrastrukturverlag", "map": "Kartografie", "operationalStudies": "Eisenbahnbetriebsstudien", diff --git a/front/public/locales/en/customget.json b/front/public/locales/en/customget.json deleted file mode 100644 index 1e404fc7257..00000000000 --- a/front/public/locales/en/customget.json +++ /dev/null @@ -1,8 +0,0 @@ -{ - "badJSON": "The JSON file is malformed", - "emptyFile": "The file is empty", - "noData": "Please import data using the + button", - "notJSONFormat": "The file is not in JSON format ", - "results": "Results", - "uploadFile": "Import" -} diff --git a/front/public/locales/en/home/home.json b/front/public/locales/en/home/home.json index 4ca036caf5f..2bef41f2c2f 100644 --- a/front/public/locales/en/home/home.json +++ b/front/public/locales/en/home/home.json @@ -1,5 +1,4 @@ { - "customget": "JSON Space-Time diagram viewer", "editor": "Infrastructure editor", "map": "Map viewer", "operationalStudies": "Operational studies", diff --git a/front/public/locales/en/translation.json b/front/public/locales/en/translation.json index c9a848be352..b440163e274 100644 --- a/front/public/locales/en/translation.json +++ b/front/public/locales/en/translation.json @@ -359,5 +359,10 @@ "show-more-ranges_other": "See {{count}} additional track sections" } } + }, + "jsonUpload": { + "badJSON": "The JSON file is malformed", + "emptyFile": "The file is empty", + "notJSONFormat": "The file is not in JSON format " } } diff --git a/front/public/locales/es/home/home.json b/front/public/locales/es/home/home.json index 5d1e49946e1..db4a4bc72e8 100644 --- a/front/public/locales/es/home/home.json +++ b/front/public/locales/es/home/home.json @@ -1,5 +1,4 @@ { - "customget": "Visualización JSON GET", "editor": "Editor de infraestructuras", "map": "Cartografía", "operationalStudies": "Estudios operativos", diff --git a/front/public/locales/fr/customget.json b/front/public/locales/fr/customget.json deleted file mode 100644 index 5094afe12d6..00000000000 --- a/front/public/locales/fr/customget.json +++ /dev/null @@ -1,8 +0,0 @@ -{ - "badJSON": "Le fichier JSON est malformé", - "emptyFile": "Le fichier est vide", - "noData": "Veuillez importer des données à l'aide du bouton +", - "notJSONFormat": "Le fichier n'est pas au format JSON", - "results": "Résultats", - "uploadFile": "Importer" -} diff --git a/front/public/locales/fr/home/home.json b/front/public/locales/fr/home/home.json index 00baec2dee4..2e211417314 100644 --- a/front/public/locales/fr/home/home.json +++ b/front/public/locales/fr/home/home.json @@ -1,5 +1,4 @@ { - "customget": "Visualisation JSON GET", "editor": "Éditeur d'infrastructure", "map": "Cartographie", "operationalStudies": "Études d'exploitation", diff --git a/front/public/locales/fr/translation.json b/front/public/locales/fr/translation.json index 3375c91fa28..aacae0e0c85 100644 --- a/front/public/locales/fr/translation.json +++ b/front/public/locales/fr/translation.json @@ -359,5 +359,11 @@ "show-more-ranges_other": "Voir {{count}} sections de lignes de plus" } } + }, + "jsonUpload": { + "badJSON": "Le fichier JSON est malformé", + "emptyFile": "Le fichier est vide", + "notJSONFormat": "Le fichier n'est pas au format JSON" } + } diff --git a/front/public/locales/it/home/home.json b/front/public/locales/it/home/home.json index 07c77262cd8..d763f6fe5bb 100644 --- a/front/public/locales/it/home/home.json +++ b/front/public/locales/it/home/home.json @@ -1,5 +1,4 @@ { - "customget": "Visualizzazione JSON GET", "editor": "Editor di infrastrutture", "map": "Mappatura", "operationalStudies": "Studi operativi", diff --git a/front/public/locales/jp/home/home.json b/front/public/locales/jp/home/home.json index 18d51f99062..a9ef0ec3096 100644 --- a/front/public/locales/jp/home/home.json +++ b/front/public/locales/jp/home/home.json @@ -1,5 +1,4 @@ { - "customget": "ビジュアライゼーション JSON GET", "editor": "インフラストラクチャー編集部", "map": "マッピング", "operationalStudies": "オペレーションスタディ", diff --git a/front/public/locales/ru/home/home.json b/front/public/locales/ru/home/home.json index 459932de0bb..c5dfa364425 100644 --- a/front/public/locales/ru/home/home.json +++ b/front/public/locales/ru/home/home.json @@ -1,5 +1,4 @@ { - "customget": "Визуализация JSON GET", "editor": "Редактор инфраструктуры", "map": "Составление карт", "operationalStudies": "Эксплуатационные исследования", diff --git a/front/public/locales/uk/home/home.json b/front/public/locales/uk/home/home.json index 49294ffda8d..25aeee3b952 100644 --- a/front/public/locales/uk/home/home.json +++ b/front/public/locales/uk/home/home.json @@ -1,5 +1,4 @@ { - "customget": "Візуалізація JSON GET", "editor": "Редактор інфраструктури", "map": "Картографування", "operationalStudies": "Експлуатаційні дослідження", diff --git a/front/src/applications/customget/Home.jsx b/front/src/applications/customget/Home.jsx deleted file mode 100644 index 3de03e90c0f..00000000000 --- a/front/src/applications/customget/Home.jsx +++ /dev/null @@ -1,66 +0,0 @@ -import { Route, Routes } from 'react-router-dom'; - -import MastNavItemSNCF from 'common/BootstrapSNCF/MastNavItemSNCF'; -import MastNavSNCF from 'common/BootstrapSNCF/MastNavSNCF'; -import NavBarSNCF from 'common/BootstrapSNCF/NavBarSNCF'; -import React from 'react'; -import logo from 'assets/pictures/home/customget.svg'; -import { useTranslation } from 'react-i18next'; -import { useDispatch } from 'react-redux'; -import { updateSimulation } from 'reducers/osrdsimulation/actions'; -import convertData from 'applications/customget/components/convertData'; - -import CustomGET from 'applications/customget/views/CustomGET'; - -import './Home.scss'; -import { useModal } from 'common/BootstrapSNCF/ModalSNCF'; -import UploadFileModal from './components/uploadFileModal'; - -function HomeCustomGET() { - const { t } = useTranslation(['customget', 'home/home']); - const { openModal, closeModal } = useModal(); - const dispatch = useDispatch(); - - const handleSubmit = async (file) => { - closeModal(); - if (file) { - dispatch( - updateSimulation({ - trains: convertData(JSON.parse(file)), - }) - ); - } - }; - - return ( -
- - -
  • -