From 4531dc5e09e0f5abd115d33322d21fb163ec879e Mon Sep 17 00:00:00 2001 From: Stefano Pigozzi Date: Mon, 4 Oct 2021 19:41:45 +0200 Subject: [PATCH] =?UTF-8?q?=F0=9F=92=A5=20Shuffle=20everything=20around=20?= =?UTF-8?q?until=20it=20makes=20sense?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .idea/inspectionProfiles/Project_Default.xml | 1 + .../Test_sophon_frontend.xml | 12 --- frontend/src/App.tsx | 16 +-- .../src/components/elements/SophonFooter.tsx | 42 ++++++++ .../instance/SophonInstanceContainer.tsx | 57 +++++++++++ .../instance/SophonInstanceContext.tsx | 4 +- .../instance/SophonInstanceFooter.tsx | 40 -------- ...ickerBox.tsx => SophonInstanceFormBox.tsx} | 25 ++++- .../instance/SophonInstanceHeading.tsx | 26 ----- .../instance/SophonInstancePage.tsx | 34 +++++++ .../instance/SophonInstancePageTitle.tsx | 25 ----- .../instance/SophonInstanceProvider.tsx | 16 ++- .../instance/SophonInstanceRouter.tsx | 32 ++++++ .../{Interfaces.ts => SophonInstanceState.ts} | 16 +-- frontend/src/components/instance/index.ts | 11 ++- .../src/components/instance/useSophonAxios.ts | 7 +- .../components/instance/useSophonInstance.ts | 10 +- .../instance/useSophonInstanceLoader.ts | 47 +++++++++ .../src/components/login/LoginContainer.tsx | 25 +++++ .../src/components/login/LoginContext.tsx | 8 ++ .../src/components/login/LoginFormBox.tsx | 97 +++++++++++++++++++ .../src/components/login/LoginGuestBox.tsx | 18 ++++ frontend/src/components/login/LoginPage.tsx | 19 ++++ .../src/components/login/LoginProvider.tsx | 28 ++++++ frontend/src/components/login/LoginRouter.tsx | 21 ++++ frontend/src/components/login/LoginState.ts | 62 ++++++++++++ frontend/src/components/login/useLogin.ts | 7 ++ .../src/components/login/useLoginAxios.ts | 15 +++ .../src/components/placeholder/DebugBox.tsx | 20 ++++ .../routing/LocationViewSetRouter.tsx | 17 ++-- .../src/components/routing/ResourceRouter.tsx | 52 ++++++++++ .../src/components/routing/ViewSetRouter.tsx | 35 +++---- frontend/src/components/routing/index.ts | 3 + .../ThemedBluelib.tsx} | 14 ++- frontend/src/components/theme/ThemedTitle.tsx | 24 +++++ frontend/src/constants.ts | 1 + frontend/src/contexts/authorization.tsx | 94 ++++++++++++++++++ frontend/src/contexts/instance.tsx | 83 ++++++++++++++++ frontend/src/contexts/theme.tsx | 74 ++++++++++++++ .../{useCancellable.ts => useAbortEffect.ts} | 0 frontend/src/hooks/useAsDocumentTitle.ts | 10 ++ frontend/src/hooks/useDefinedContext.ts | 18 ++++ frontend/src/hooks/useManagedViewSet.ts | 6 +- frontend/src/hooks/useNotNullContext.ts | 17 ---- frontend/src/hooks/useSophonPath.ts | 16 +++ frontend/src/hooks/useStorageState.ts | 2 +- frontend/src/hooks/useViewSet.ts | 14 ++- frontend/src/routes/LoginPage.tsx | 26 ----- frontend/src/routes/Router.jsx | 22 ----- frontend/src/types/ContextTypes.ts | 8 ++ frontend/src/types/DjangoTypes.ts | 27 ++++++ frontend/src/types/ExtraTypes.ts | 17 ++++ frontend/src/types/SophonTypes.ts | 74 ++++++++++++++ frontend/src/types/index.ts | 3 + frontend/src/utils/DjangoTypes.ts | 22 ----- frontend/src/utils/InstanceEncoder.test.js | 57 +++++++---- frontend/src/utils/InstanceEncoder.ts | 11 ++- frontend/src/utils/KeySet.ts | 68 ------------- ...PathSplitter.test.js => ParsePath.test.js} | 16 +-- .../utils/{PathSplitter.ts => ParsePath.ts} | 22 +++-- frontend/src/utils/SophonTypes.ts | 66 ------------- 61 files changed, 1208 insertions(+), 452 deletions(-) delete mode 100644 .idea/runConfigurations/Test_sophon_frontend.xml create mode 100644 frontend/src/components/elements/SophonFooter.tsx create mode 100644 frontend/src/components/instance/SophonInstanceContainer.tsx delete mode 100644 frontend/src/components/instance/SophonInstanceFooter.tsx rename frontend/src/components/instance/{SophonInstancePickerBox.tsx => SophonInstanceFormBox.tsx} (73%) delete mode 100644 frontend/src/components/instance/SophonInstanceHeading.tsx create mode 100644 frontend/src/components/instance/SophonInstancePage.tsx delete mode 100644 frontend/src/components/instance/SophonInstancePageTitle.tsx create mode 100644 frontend/src/components/instance/SophonInstanceRouter.tsx rename frontend/src/components/instance/{Interfaces.ts => SophonInstanceState.ts} (53%) create mode 100644 frontend/src/components/instance/useSophonInstanceLoader.ts create mode 100644 frontend/src/components/login/LoginContainer.tsx create mode 100644 frontend/src/components/login/LoginContext.tsx create mode 100644 frontend/src/components/login/LoginFormBox.tsx create mode 100644 frontend/src/components/login/LoginGuestBox.tsx create mode 100644 frontend/src/components/login/LoginPage.tsx create mode 100644 frontend/src/components/login/LoginProvider.tsx create mode 100644 frontend/src/components/login/LoginRouter.tsx create mode 100644 frontend/src/components/login/LoginState.ts create mode 100644 frontend/src/components/login/useLogin.ts create mode 100644 frontend/src/components/login/useLoginAxios.ts create mode 100644 frontend/src/components/placeholder/DebugBox.tsx create mode 100644 frontend/src/components/routing/ResourceRouter.tsx create mode 100644 frontend/src/components/routing/index.ts rename frontend/src/components/{instance/SophonInstanceBluelib.tsx => theme/ThemedBluelib.tsx} (50%) create mode 100644 frontend/src/components/theme/ThemedTitle.tsx create mode 100644 frontend/src/contexts/authorization.tsx create mode 100644 frontend/src/contexts/instance.tsx create mode 100644 frontend/src/contexts/theme.tsx rename frontend/src/hooks/{useCancellable.ts => useAbortEffect.ts} (100%) create mode 100644 frontend/src/hooks/useAsDocumentTitle.ts create mode 100644 frontend/src/hooks/useDefinedContext.ts delete mode 100644 frontend/src/hooks/useNotNullContext.ts create mode 100644 frontend/src/hooks/useSophonPath.ts delete mode 100644 frontend/src/routes/LoginPage.tsx delete mode 100644 frontend/src/routes/Router.jsx create mode 100644 frontend/src/types/ContextTypes.ts create mode 100644 frontend/src/types/DjangoTypes.ts create mode 100644 frontend/src/types/ExtraTypes.ts create mode 100644 frontend/src/types/SophonTypes.ts create mode 100644 frontend/src/types/index.ts delete mode 100644 frontend/src/utils/DjangoTypes.ts delete mode 100644 frontend/src/utils/KeySet.ts rename frontend/src/utils/{PathSplitter.test.js => ParsePath.test.js} (74%) rename frontend/src/utils/{PathSplitter.ts => ParsePath.ts} (55%) delete mode 100644 frontend/src/utils/SophonTypes.ts diff --git a/.idea/inspectionProfiles/Project_Default.xml b/.idea/inspectionProfiles/Project_Default.xml index e4369d0..e101d3f 100644 --- a/.idea/inspectionProfiles/Project_Default.xml +++ b/.idea/inspectionProfiles/Project_Default.xml @@ -2,6 +2,7 @@