From 0d5ac18fcfe685a7b359dc1fc8c646204f92dde9 Mon Sep 17 00:00:00 2001 From: Stefano Pigozzi Date: Wed, 29 Sep 2021 18:05:55 +0200 Subject: [PATCH] =?UTF-8?q?=F0=9F=92=A5=20Make=20progress=20towards=20the?= =?UTF-8?q?=20new=20"Context"=20structure?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This commit is the result of multiple squashed non-atomic commits. --- .idea/inspectionProfiles/Project_Default.xml | 4 + .idea/misc.xml | 3 + frontend/src/App.tsx | 6 +- .../src/components/InstanceDescriptionBox.tsx | 24 -- .../src/components/NewResearchGroupPanel.tsx | 32 -- frontend/src/components/ObjectPanel.tsx | 44 -- .../ResearchGroupDescriptionBox.tsx | 35 -- .../src/components/ResearchGroupListBox.tsx | 34 -- .../src/components/ResearchGroupPanel.tsx | 38 -- .../ResearchProjectsByGroupListBox.tsx | 41 -- .../components/ResearchProjectsListBox.tsx | 34 -- frontend/src/components/UserBox.tsx | 45 -- frontend/src/components/UserLink.tsx | 49 --- .../src/components/{ => elements}/Link.tsx | 20 +- .../src/components/{ => elements}/Loading.tsx | 6 + .../ResourcePanel.module.css} | 10 +- .../src/components/elements/ResourcePanel.tsx | 53 +++ frontend/src/components/errors/ErrorBox.tsx | 26 ++ .../ErrorCatcherBox.tsx} | 43 +- .../src/components/errors/NotFoundBox.tsx | 28 ++ .../components/{ => legacy}/InstanceTitle.tsx | 9 +- .../components/legacy/ResearchGroupPanel.tsx | 35 ++ .../{ => legacy}/ResearchProjectPanel.tsx | 39 +- .../{ => legacy/login}/GuestBox.tsx | 4 +- .../{ => legacy/login}/InstanceBluelib.tsx | 0 .../{ => legacy/login}/InstanceContext.tsx | 28 +- .../legacy/login/InstanceDescriptionBox.tsx | 26 ++ .../{ => legacy/login}/InstanceSelectBox.tsx | 12 +- .../{ => legacy/login}/LoginBox.tsx | 22 +- .../{ => legacy/login}/LoginContext.tsx | 22 +- .../{ => legacy/login}/LogoutBox.tsx | 2 +- .../routing/LocationViewSetRouter.tsx | 20 + .../src/components/routing/ViewSetRouter.tsx | 56 +++ frontend/src/hooks/useDRF.ts | 179 -------- frontend/src/hooks/useManagedViewSet.ts | 387 ++++++++++++++++++ frontend/src/hooks/useViewSet.ts | 151 +++++++ frontend/src/routes/InstancePage.tsx | 13 - frontend/src/routes/LoginPage.tsx | 10 +- frontend/src/routes/ResearchGroupPage.tsx | 18 - frontend/src/routes/Router.jsx | 7 +- frontend/src/routes/UserPage.tsx | 16 - frontend/src/types.ts | 69 ---- frontend/src/utils/ArrayExtension.ts | 12 + frontend/src/utils/AxiosTypesExtension.ts | 16 + frontend/src/utils/DjangoTypes.ts | 22 + frontend/src/utils/InstanceEncoder.test.js | 55 +++ frontend/src/utils/InstanceEncoder.ts | 31 ++ frontend/src/utils/KeySet.ts | 68 +++ frontend/src/utils/SophonTypes.ts | 66 +++ 49 files changed, 1163 insertions(+), 807 deletions(-) delete mode 100644 frontend/src/components/InstanceDescriptionBox.tsx delete mode 100644 frontend/src/components/NewResearchGroupPanel.tsx delete mode 100644 frontend/src/components/ObjectPanel.tsx delete mode 100644 frontend/src/components/ResearchGroupDescriptionBox.tsx delete mode 100644 frontend/src/components/ResearchGroupListBox.tsx delete mode 100644 frontend/src/components/ResearchGroupPanel.tsx delete mode 100644 frontend/src/components/ResearchProjectsByGroupListBox.tsx delete mode 100644 frontend/src/components/ResearchProjectsListBox.tsx delete mode 100644 frontend/src/components/UserBox.tsx delete mode 100644 frontend/src/components/UserLink.tsx rename frontend/src/components/{ => elements}/Link.tsx (68%) rename frontend/src/components/{ => elements}/Loading.tsx (69%) rename frontend/src/components/{ObjectPanel.module.css => elements/ResourcePanel.module.css} (79%) create mode 100644 frontend/src/components/elements/ResourcePanel.tsx create mode 100644 frontend/src/components/errors/ErrorBox.tsx rename frontend/src/components/{ErrorBox.tsx => errors/ErrorCatcherBox.tsx} (51%) create mode 100644 frontend/src/components/errors/NotFoundBox.tsx rename frontend/src/components/{ => legacy}/InstanceTitle.tsx (83%) create mode 100644 frontend/src/components/legacy/ResearchGroupPanel.tsx rename frontend/src/components/{ => legacy}/ResearchProjectPanel.tsx (52%) rename frontend/src/components/{ => legacy/login}/GuestBox.tsx (96%) rename frontend/src/components/{ => legacy/login}/InstanceBluelib.tsx (100%) rename frontend/src/components/{ => legacy/login}/InstanceContext.tsx (76%) create mode 100644 frontend/src/components/legacy/login/InstanceDescriptionBox.tsx rename frontend/src/components/{ => legacy/login}/InstanceSelectBox.tsx (92%) rename frontend/src/components/{ => legacy/login}/LoginBox.tsx (92%) rename frontend/src/components/{ => legacy/login}/LoginContext.tsx (87%) rename frontend/src/components/{ => legacy/login}/LogoutBox.tsx (98%) create mode 100644 frontend/src/components/routing/LocationViewSetRouter.tsx create mode 100644 frontend/src/components/routing/ViewSetRouter.tsx delete mode 100644 frontend/src/hooks/useDRF.ts create mode 100644 frontend/src/hooks/useManagedViewSet.ts create mode 100644 frontend/src/hooks/useViewSet.ts delete mode 100644 frontend/src/routes/InstancePage.tsx delete mode 100644 frontend/src/routes/ResearchGroupPage.tsx delete mode 100644 frontend/src/routes/UserPage.tsx delete mode 100644 frontend/src/types.ts create mode 100644 frontend/src/utils/ArrayExtension.ts create mode 100644 frontend/src/utils/AxiosTypesExtension.ts create mode 100644 frontend/src/utils/DjangoTypes.ts create mode 100644 frontend/src/utils/InstanceEncoder.test.js create mode 100644 frontend/src/utils/InstanceEncoder.ts create mode 100644 frontend/src/utils/KeySet.ts create mode 100644 frontend/src/utils/SophonTypes.ts diff --git a/.idea/inspectionProfiles/Project_Default.xml b/.idea/inspectionProfiles/Project_Default.xml index 8fc0e61..7087452 100644 --- a/.idea/inspectionProfiles/Project_Default.xml +++ b/.idea/inspectionProfiles/Project_Default.xml @@ -60,5 +60,9 @@