From a765681c3ff330b399495d2f98671400399d3302 Mon Sep 17 00:00:00 2001 From: Stefano Pigozzi Date: Thu, 7 Oct 2021 02:14:34 +0200 Subject: [PATCH] =?UTF-8?q?=E2=9C=A8=20Create=20`GroupRouter`?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- frontend/src/App.tsx | 8 +++++++- frontend/src/components/group/GroupRouter.tsx | 15 +++++++++++++++ frontend/src/components/routing/ViewSetRouter.tsx | 6 +++++- 3 files changed, 27 insertions(+), 2 deletions(-) create mode 100644 frontend/src/components/group/GroupRouter.tsx diff --git a/frontend/src/App.tsx b/frontend/src/App.tsx index 2c438f1..a6d91fa 100644 --- a/frontend/src/App.tsx +++ b/frontend/src/App.tsx @@ -6,6 +6,7 @@ import {AuthorizationRouter} from "./components/authorization/AuthorizationRoute import {AuthorizationStepPage} from "./components/authorization/AuthorizationStepPage" import {SophonFooter} from "./components/elements/SophonFooter" import {ErrorCatcherBox} from "./components/errors/ErrorCatcherBox" +import {GroupRouter} from "./components/group/GroupRouter" import {InstanceRouter} from "./components/instance/InstanceRouter" import {InstanceStepPage} from "./components/instance/InstanceStepPage" import {DebugBox} from "./components/placeholder/DebugBox" @@ -29,7 +30,12 @@ function App({...props}: RouteComponentProps) { unselectedRoute={() => <> } - selectedRoute={DebugBox} + selectedRoute={() => <> + + } /> } diff --git a/frontend/src/components/group/GroupRouter.tsx b/frontend/src/components/group/GroupRouter.tsx new file mode 100644 index 0000000..6a4a5ef --- /dev/null +++ b/frontend/src/components/group/GroupRouter.tsx @@ -0,0 +1,15 @@ +import * as React from "react" +import {useManagedViewSet} from "../../hooks/useManagedViewSet" +import {SophonResearchGroup} from "../../types/SophonTypes" +import {ViewSetRouter} from "../routing" +import {SpecificViewSetRouterProps} from "../routing/ViewSetRouter" + + +export function GroupRouter({...props}: SpecificViewSetRouterProps): JSX.Element { + return ( + ("/api/core/groups/", "slug")} + /> + ) +} diff --git a/frontend/src/components/routing/ViewSetRouter.tsx b/frontend/src/components/routing/ViewSetRouter.tsx index 327c2af..e2a90ad 100644 --- a/frontend/src/components/routing/ViewSetRouter.tsx +++ b/frontend/src/components/routing/ViewSetRouter.tsx @@ -17,7 +17,11 @@ export interface DetailsRouteProps { } -export interface ViewSetRouterProps extends ResourceRouterProps, ListRouteProps, DetailsRouteProps> { +export interface SpecificViewSetRouterProps extends ResourceRouterProps, ListRouteProps, DetailsRouteProps> { +} + + +export interface ViewSetRouterProps extends SpecificViewSetRouterProps { viewSet: ManagedViewSet, }