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