Добавлена кнопка принудительной перезагрузки дерева задач для доски построенной по дереву
This commit is contained in:
parent
b6b9b30cce
commit
b9ee0ad380
2 changed files with 14 additions and 0 deletions
|
|
@ -4,6 +4,7 @@ import { IPageStore, PageStoreLoadData } from './store';
|
||||||
import { observer } from 'mobx-react-lite';
|
import { observer } from 'mobx-react-lite';
|
||||||
import * as TopRightMenuNs from '../misc-components/top-right-menu';
|
import * as TopRightMenuNs from '../misc-components/top-right-menu';
|
||||||
import { SetIssuesReadingTimestamp } from '../utils/unreaded-provider';
|
import { SetIssuesReadingTimestamp } from '../utils/unreaded-provider';
|
||||||
|
import axios from 'axios';
|
||||||
|
|
||||||
export type Props = {
|
export type Props = {
|
||||||
store: IPageStore
|
store: IPageStore
|
||||||
|
|
@ -27,10 +28,20 @@ export const KanbanBoards = observer((props: Props) => {
|
||||||
SetIssuesReadingTimestamp(props.store.issueIds);
|
SetIssuesReadingTimestamp(props.store.issueIds);
|
||||||
PageStoreLoadData(props.store);
|
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 = <button onClick={onTreeRefreshClick}>Force tree refresh</button>;
|
||||||
|
}
|
||||||
return (
|
return (
|
||||||
<>
|
<>
|
||||||
<TopRightMenuNs.TopRightMenu store={topRightMenuStore}>
|
<TopRightMenuNs.TopRightMenu store={topRightMenuStore}>
|
||||||
<button onClick={onAllReadClick}>Всё прочитано</button>
|
<button onClick={onAllReadClick}>Всё прочитано</button>
|
||||||
|
{treeRefreshMenuItem}
|
||||||
</TopRightMenuNs.TopRightMenu>
|
</TopRightMenuNs.TopRightMenu>
|
||||||
{list}
|
{list}
|
||||||
</>
|
</>
|
||||||
|
|
|
||||||
|
|
@ -78,6 +78,9 @@ export const PageStore = types.model({
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
return res;
|
return res;
|
||||||
|
},
|
||||||
|
get canTreeRefresh(): boolean {
|
||||||
|
return (self.type === 'tree');
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
});
|
});
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue