Добавлены страницы для списка дашбордов и отображения отдельного дашборда

This commit is contained in:
Pavel Gnedov 2023-10-03 07:34:56 +07:00
parent 14e0108f02
commit 0e28eba615
5 changed files with 91 additions and 38 deletions

24
frontend/src/.eslintrc.js Normal file
View file

@ -0,0 +1,24 @@
module.exports = {
parser: '@typescript-eslint/parser',
parserOptions: {
project: 'tsconfig.json',
sourceType: 'module',
},
plugins: ['@typescript-eslint/eslint-plugin'],
extends: [
'plugin:@typescript-eslint/recommended',
'plugin:prettier/recommended',
],
root: true,
env: {
node: true,
jest: true,
},
ignorePatterns: ['.eslintrc.js'],
rules: {
'@typescript-eslint/interface-name-prefix': 'off',
'@typescript-eslint/explicit-function-return-type': 'off',
'@typescript-eslint/explicit-module-boundary-types': 'off',
'@typescript-eslint/no-explicit-any': 'off',
},
};

View file

@ -0,0 +1,8 @@
import React from 'react';
import { useParams } from 'react-router-dom';
export const DashboardPage = (): JSX.Element => {
const params = useParams();
const id = params.id as string;
return <p>Dashboard</p>;
};

View file

@ -0,0 +1,6 @@
import React from 'react';
export const DashboardsPage = (): JSX.Element => {
// TODO: code for DashboardsPage
return <p>Dashboards</p>;
};

View file

@ -15,8 +15,13 @@ export const KanbanBoardsPage = (): JSX.Element => {
});
// DEBUG: end
const store = Stores.PageStore.create({loaded: false, type: type, name: name, data: null});
const store = Stores.PageStore.create({
loaded: false,
type: type,
name: name,
data: null,
});
Stores.PageStoreLoadData(store);
return <KBS.KanbanBoards store={store}/>;
}
return <KBS.KanbanBoards store={store} />;
};

View file

@ -1,25 +1,35 @@
import React from "react";
import { createBrowserRouter } from "react-router-dom";
import StartPage from "./start-page/start-page";
import UnknownPage from "./unknown-page";
import { KanbanBoardsPage } from "./kanban-board/kanban-boards-page";
import { IssuesListBoardPage } from "./issues-list-board/issues-list-boards-page";
import React from 'react';
import { createBrowserRouter } from 'react-router-dom';
import StartPage from './start-page/start-page';
import UnknownPage from './unknown-page';
import { KanbanBoardsPage } from './kanban-board/kanban-boards-page';
import { IssuesListBoardPage } from './issues-list-board/issues-list-boards-page';
import { DashboardsPage } from './dashboard/dashboards-page';
import { DashboardPage } from './dashboard/dashboard-page';
export const router = createBrowserRouter([
{
path: "/",
element: (<StartPage/>),
path: '/',
element: <StartPage />,
},
{
path: "/kanban-board/:type/:name",
element: (<KanbanBoardsPage/>)
path: '/kanban-board/:type/:name',
element: <KanbanBoardsPage />,
},
{
path: "/issues-list-board/:type/:name",
element: (<IssuesListBoardPage/>)
path: '/issues-list-board/:type/:name',
element: <IssuesListBoardPage />,
},
{
path: "*",
element: (<UnknownPage/>)
}
path: '/dashboards',
element: <DashboardsPage />,
},
{
path: '/dashboard/:id',
element: <DashboardPage />,
},
{
path: '*',
element: <UnknownPage />,
},
]);