From 752cd2f6c6beb12f64bb1c28a338c4888738e94d Mon Sep 17 00:00:00 2001 From: Rebecca Dumazert <44778533+rebeccadumazert@users.noreply.github.com> Date: Wed, 10 Jan 2024 14:54:47 +0100 Subject: [PATCH] create dashboard component (#48) --- .../src/oidc-client/oidc-client.controller.ts | 4 +- back/src/oidc-client/oidc-client.dto.ts | 3 ++ .../providers/connectedSpaces/Dashboard.tsx | 41 +++++++++++++++++++ .../src/providers/details/ProviderDetails.tsx | 1 + front/src/routes/Router.tsx | 12 +++--- front/src/types.ts | 3 ++ 6 files changed, 57 insertions(+), 7 deletions(-) create mode 100644 front/src/providers/connectedSpaces/Dashboard.tsx diff --git a/back/src/oidc-client/oidc-client.controller.ts b/back/src/oidc-client/oidc-client.controller.ts index 9d4b3b8..dee1e70 100644 --- a/back/src/oidc-client/oidc-client.controller.ts +++ b/back/src/oidc-client/oidc-client.controller.ts @@ -20,6 +20,7 @@ export class OidcClientController { async findAll() { return [ { + id: 123, clientDescription: 'Description', clientId: 'clientId', clientSecret: 'ClientSecret', @@ -34,6 +35,7 @@ export class OidcClientController { @Get('/:id') async find_by_id(@Param('id') id: string) { return { + id: 123, clientDescription: 'Description', clientId: 'clientId', clientSecret: 'ClientSecret', @@ -57,7 +59,7 @@ export class OidcClientController { HttpStatus.BAD_REQUEST, { cause: error, - } + }, ); } } diff --git a/back/src/oidc-client/oidc-client.dto.ts b/back/src/oidc-client/oidc-client.dto.ts index 2912918..cf353dd 100644 --- a/back/src/oidc-client/oidc-client.dto.ts +++ b/back/src/oidc-client/oidc-client.dto.ts @@ -3,6 +3,9 @@ import { IsNotEmpty } from 'class-validator'; export class CreateOidcClientDto { clientDescription: string | null; + @IsNotEmpty() + id: number; + @IsNotEmpty() clientName: string; diff --git a/front/src/providers/connectedSpaces/Dashboard.tsx b/front/src/providers/connectedSpaces/Dashboard.tsx new file mode 100644 index 0000000..c39798f --- /dev/null +++ b/front/src/providers/connectedSpaces/Dashboard.tsx @@ -0,0 +1,41 @@ +import { Badge } from '@codegouvfr/react-dsfr/Badge'; +import Title1 from '../../titles/Title1'; +import { Card } from '@codegouvfr/react-dsfr/Card'; +import { useRouteLoaderData } from 'react-router-dom'; +import { OidcClients } from '../../types'; + +export const Dashboard = () => { + const oidcClients = useRouteLoaderData('dashboard') as OidcClients; + return ( +