From b9ee0ad380c50fb47e79961b0f4e69189944c2b7 Mon Sep 17 00:00:00 2001 From: Pavel Gnedov Date: Wed, 21 Jun 2023 17:09:09 +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=D0=B0=20=D0=BA=D0=BD=D0=BE=D0=BF=D0=BA=D0=B0=20=D0=BF?= =?UTF-8?q?=D1=80=D0=B8=D0=BD=D1=83=D0=B4=D0=B8=D1=82=D0=B5=D0=BB=D1=8C?= =?UTF-8?q?=D0=BD=D0=BE=D0=B9=20=D0=BF=D0=B5=D1=80=D0=B5=D0=B7=D0=B0=D0=B3?= =?UTF-8?q?=D1=80=D1=83=D0=B7=D0=BA=D0=B8=20=D0=B4=D0=B5=D1=80=D0=B5=D0=B2?= =?UTF-8?q?=D0=B0=20=D0=B7=D0=B0=D0=B4=D0=B0=D1=87=20=D0=B4=D0=BB=D1=8F=20?= =?UTF-8?q?=D0=B4=D0=BE=D1=81=D0=BA=D0=B8=20=D0=BF=D0=BE=D1=81=D1=82=D1=80?= =?UTF-8?q?=D0=BE=D0=B5=D0=BD=D0=BD=D0=BE=D0=B9=20=D0=BF=D0=BE=20=D0=B4?= =?UTF-8?q?=D0=B5=D1=80=D0=B5=D0=B2=D1=83?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- frontend/src/kanban-board/kanban-boards.tsx | 11 +++++++++++ frontend/src/kanban-board/store.ts | 3 +++ 2 files changed, 14 insertions(+) diff --git a/frontend/src/kanban-board/kanban-boards.tsx b/frontend/src/kanban-board/kanban-boards.tsx index 0e6593f..d7aa795 100644 --- a/frontend/src/kanban-board/kanban-boards.tsx +++ b/frontend/src/kanban-board/kanban-boards.tsx @@ -4,6 +4,7 @@ import { IPageStore, PageStoreLoadData } from './store'; import { observer } from 'mobx-react-lite'; import * as TopRightMenuNs from '../misc-components/top-right-menu'; import { SetIssuesReadingTimestamp } from '../utils/unreaded-provider'; +import axios from 'axios'; export type Props = { store: IPageStore @@ -27,10 +28,20 @@ export const KanbanBoards = observer((props: Props) => { SetIssuesReadingTimestamp(props.store.issueIds); PageStoreLoadData(props.store); }; + let treeRefreshMenuItem: JSX.Element = <>; + if (props.store.canTreeRefresh) { + const onTreeRefreshClick = (e: React.MouseEvent) => { + if (e.target !== e.currentTarget) return; + e.stopPropagation(); + axios.get(`/simple-kanban-board/tree/${props.store.name}/refresh`); + } + treeRefreshMenuItem = ; + } return ( <> + {treeRefreshMenuItem} {list} diff --git a/frontend/src/kanban-board/store.ts b/frontend/src/kanban-board/store.ts index 148b3f0..2152511 100644 --- a/frontend/src/kanban-board/store.ts +++ b/frontend/src/kanban-board/store.ts @@ -78,6 +78,9 @@ export const PageStore = types.model({ } } return res; + }, + get canTreeRefresh(): boolean { + return (self.type === 'tree'); } }; });