From 0e28eba615e1fbb939290916a2809924a55687b2 Mon Sep 17 00:00:00 2001 From: Pavel Gnedov Date: Tue, 3 Oct 2023 07:34:56 +0700 Subject: [PATCH] =?UTF-8?q?=D0=94=D0=BE=D0=B1=D0=B0=D0=B2=D0=BB=D0=B5?= =?UTF-8?q?=D0=BD=D1=8B=20=D1=81=D1=82=D1=80=D0=B0=D0=BD=D0=B8=D1=86=D1=8B?= =?UTF-8?q?=20=D0=B4=D0=BB=D1=8F=20=D1=81=D0=BF=D0=B8=D1=81=D0=BA=D0=B0=20?= =?UTF-8?q?=D0=B4=D0=B0=D1=88=D0=B1=D0=BE=D1=80=D0=B4=D0=BE=D0=B2=20=D0=B8?= =?UTF-8?q?=20=D0=BE=D1=82=D0=BE=D0=B1=D1=80=D0=B0=D0=B6=D0=B5=D0=BD=D0=B8?= =?UTF-8?q?=D1=8F=20=D0=BE=D1=82=D0=B4=D0=B5=D0=BB=D1=8C=D0=BD=D0=BE=D0=B3?= =?UTF-8?q?=D0=BE=20=D0=B4=D0=B0=D1=88=D0=B1=D0=BE=D1=80=D0=B4=D0=B0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- frontend/src/.eslintrc.js | 24 +++++++++ frontend/src/dashboard/dashboard-page.tsx | 8 +++ frontend/src/dashboard/dashboards-page.tsx | 6 +++ .../src/kanban-board/kanban-boards-page.tsx | 37 +++++++------ frontend/src/router.tsx | 54 +++++++++++-------- 5 files changed, 91 insertions(+), 38 deletions(-) create mode 100644 frontend/src/.eslintrc.js create mode 100644 frontend/src/dashboard/dashboard-page.tsx create mode 100644 frontend/src/dashboard/dashboards-page.tsx diff --git a/frontend/src/.eslintrc.js b/frontend/src/.eslintrc.js new file mode 100644 index 0000000..f6c62be --- /dev/null +++ b/frontend/src/.eslintrc.js @@ -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', + }, +}; diff --git a/frontend/src/dashboard/dashboard-page.tsx b/frontend/src/dashboard/dashboard-page.tsx new file mode 100644 index 0000000..fe362e1 --- /dev/null +++ b/frontend/src/dashboard/dashboard-page.tsx @@ -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

Dashboard

; +}; diff --git a/frontend/src/dashboard/dashboards-page.tsx b/frontend/src/dashboard/dashboards-page.tsx new file mode 100644 index 0000000..49b0110 --- /dev/null +++ b/frontend/src/dashboard/dashboards-page.tsx @@ -0,0 +1,6 @@ +import React from 'react'; + +export const DashboardsPage = (): JSX.Element => { + // TODO: code for DashboardsPage + return

Dashboards

; +}; diff --git a/frontend/src/kanban-board/kanban-boards-page.tsx b/frontend/src/kanban-board/kanban-boards-page.tsx index f9ba580..ca716e0 100644 --- a/frontend/src/kanban-board/kanban-boards-page.tsx +++ b/frontend/src/kanban-board/kanban-boards-page.tsx @@ -4,19 +4,24 @@ import * as Stores from './store'; import * as KBS from './kanban-boards'; export const KanbanBoardsPage = (): JSX.Element => { - const params = useParams(); - const name = params.name as string; - const type = params.type as string; - - // DEBUG: begin - console.debug(`KanbanBoardsPage: type=${type}; name=${name}`); - useEffect(() => { - console.debug(`KanbanBoardsPage: type=${type}; name=${name}`); - }); - // DEBUG: end - - const store = Stores.PageStore.create({loaded: false, type: type, name: name, data: null}); - Stores.PageStoreLoadData(store); - - return ; -} \ No newline at end of file + const params = useParams(); + const name = params.name as string; + const type = params.type as string; + + // DEBUG: begin + console.debug(`KanbanBoardsPage: type=${type}; name=${name}`); + useEffect(() => { + console.debug(`KanbanBoardsPage: type=${type}; name=${name}`); + }); + // DEBUG: end + + const store = Stores.PageStore.create({ + loaded: false, + type: type, + name: name, + data: null, + }); + Stores.PageStoreLoadData(store); + + return ; +}; diff --git a/frontend/src/router.tsx b/frontend/src/router.tsx index 890097e..c9642c0 100644 --- a/frontend/src/router.tsx +++ b/frontend/src/router.tsx @@ -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: (), + { + path: '/', + element: , }, - { - path: "/kanban-board/:type/:name", - element: () - }, - { - path: "/issues-list-board/:type/:name", - element: () - }, - { - path: "*", - element: () - } -]); \ No newline at end of file + { + path: '/kanban-board/:type/:name', + element: , + }, + { + path: '/issues-list-board/:type/:name', + element: , + }, + { + path: '/dashboards', + element: , + }, + { + path: '/dashboard/:id', + element: , + }, + { + path: '*', + element: , + }, +]);