Рефакторинг - тип стора для issues-list берётся от kanban доски
This commit is contained in:
parent
f02d13e3dc
commit
6925fde0e9
4 changed files with 11 additions and 11 deletions
|
|
@ -2,7 +2,7 @@ import { observer } from 'mobx-react-lite';
|
|||
import React from 'react';
|
||||
import * as DashboardStoreNs from '../dashboard-store';
|
||||
import * as IssuesListBoardsNs from '../../issues-list-board/issues-list-boards';
|
||||
import * as IssuesListBoardsStoreNs from '../../issues-list-board/store';
|
||||
import * as KanbanBoardStoreNs from '../../kanban-board/store';
|
||||
import { onSnapshot } from 'mobx-state-tree';
|
||||
|
||||
export type Props = {
|
||||
|
|
@ -10,7 +10,7 @@ export type Props = {
|
|||
};
|
||||
|
||||
export const IssuesList = observer((props: Props): JSX.Element => {
|
||||
const store = IssuesListBoardsStoreNs.PageStore.create({ loaded: false });
|
||||
const store = KanbanBoardStoreNs.PageStore.create({ loaded: false });
|
||||
onSnapshot(props.store, (state) => {
|
||||
if (state?.data) store.setData(state?.data);
|
||||
});
|
||||
|
|
|
|||
|
|
@ -1,16 +1,16 @@
|
|||
import { observer } from 'mobx-react-lite';
|
||||
import React from 'react';
|
||||
import { IBoardStore } from './store';
|
||||
import * as KanbanBoardStoreNs from '../kanban-board/store';
|
||||
import Css from './issues-list-board.module.css';
|
||||
import * as IssuesListCardNs from './issues-list-card';
|
||||
|
||||
export type Props = {
|
||||
store: IBoardStore;
|
||||
store: KanbanBoardStoreNs.IBoardStore;
|
||||
};
|
||||
|
||||
export const IssuesListBoard = observer((props: Props): JSX.Element => {
|
||||
const list: JSX.Element[] = [];
|
||||
const data: any = props.store.data;
|
||||
const data = props.store.data;
|
||||
for (let i = 0; i < data.length; i++) {
|
||||
const column = data[i];
|
||||
const issues: any[] = column.issues;
|
||||
|
|
|
|||
|
|
@ -1,6 +1,6 @@
|
|||
import React, { useEffect } from 'react';
|
||||
import { useParams } from 'react-router-dom';
|
||||
import * as IssuesListStoreNs from './store';
|
||||
import * as KanbanBoardStoreNs from '../kanban-board/store';
|
||||
import * as IssuesListBoardsNs from './issues-list-boards';
|
||||
|
||||
export const IssuesListBoardPage = (): JSX.Element => {
|
||||
|
|
@ -15,12 +15,12 @@ export const IssuesListBoardPage = (): JSX.Element => {
|
|||
});
|
||||
// DEBUG: end
|
||||
|
||||
const store = IssuesListStoreNs.PageStore.create({
|
||||
const store = KanbanBoardStoreNs.PageStore.create({
|
||||
loaded: false,
|
||||
type: type,
|
||||
name: name,
|
||||
});
|
||||
IssuesListStoreNs.PageStoreLoadData(store);
|
||||
KanbanBoardStoreNs.PageStoreLoadData(store);
|
||||
|
||||
return <IssuesListBoardsNs.IssuesListBoards store={store} />;
|
||||
};
|
||||
|
|
|
|||
|
|
@ -1,13 +1,13 @@
|
|||
import { observer } from 'mobx-react-lite';
|
||||
import React from 'react';
|
||||
import * as IssuesListBoardStore from './store';
|
||||
import * as KanbanBoardStoreNs from '../kanban-board/store';
|
||||
import * as IssuesListBoardNs from './issues-list-board';
|
||||
import * as TopRightMenuNs from '../misc-components/top-right-menu';
|
||||
import { SetIssuesReadingTimestamp } from '../utils/unreaded-provider';
|
||||
import * as ServiceActionsButtons from '../utils/service-actions-buttons';
|
||||
|
||||
export type Props = {
|
||||
store: IssuesListBoardStore.IPageStore;
|
||||
store: KanbanBoardStoreNs.IPageStore;
|
||||
};
|
||||
|
||||
export const IssuesListBoards = observer((props: Props): JSX.Element => {
|
||||
|
|
@ -28,7 +28,7 @@ export const IssuesListBoards = observer((props: Props): JSX.Element => {
|
|||
const onAllReadItemClick = (e: React.MouseEvent) => {
|
||||
e.stopPropagation();
|
||||
SetIssuesReadingTimestamp(props.store.issueIds);
|
||||
IssuesListBoardStore.PageStoreLoadData(props.store);
|
||||
KanbanBoardStoreNs.PageStoreLoadData(props.store);
|
||||
};
|
||||
return (
|
||||
<>
|
||||
|
|
|
|||
Loading…
Reference in a new issue