yarn update

This commit is contained in:
unknown 2020-07-22 23:50:25 +03:00
parent b284ed6808
commit 260bbac368
6 changed files with 1021 additions and 28 deletions

View File

@ -1,9 +1,9 @@
import React from "react";
import { GridBody, GridBodyProps } from "./grid-body";
import { GridHeader, GridHeaderProps } from "./grid-header";
import React from 'react';
import { GridBody, GridBodyProps } from './grid-body';
import { GridHeader, GridHeaderProps } from './grid-header';
export type GridProps = GridBodyProps & GridHeaderProps;
export const Grid: React.FC<GridProps> = (props) => {
export const Grid: React.FC<GridProps> = props => {
return (
<g className="grid">
<GridHeader {...props} />

View File

@ -1,5 +1,5 @@
import React from "react";
import { BarTask } from "../../types/bar-task";
import React from 'react';
import { BarTask } from '../../types/bar-task';
type ArrowProps = {
taskFrom: BarTask;

View File

@ -1,5 +1,5 @@
import { Task } from "../types/public-types";
import { BarTask } from "../types/bar-task";
import { Task } from '../types/public-types';
import { BarTask } from '../types/bar-task';
export const convertToBarTasks = (
tasks: Task[],
@ -31,7 +31,7 @@ export const convertToBarTasks = (
const dependencies = task.dependencies || [];
for (let j = 0; j < dependencies.length; j++) {
const dependence = barTasks.findIndex(
(value) => value.id === dependencies[j]
value => value.id === dependencies[j]
);
if (dependence !== -1) barTasks[dependence].barChildren.push(i);
}
@ -148,7 +148,7 @@ export const getProgressPoint = (
progressX,
taskY + taskHeight - 8.66,
];
return point.join(",");
return point.join(',');
};
export const startByX = (x: number, xStep: number, task: BarTask) => {

View File

@ -1,11 +1,11 @@
import { Task } from "../types/public-types";
import { Task } from '../types/public-types';
type GanttReduceState = {
ganttTasks: Task[];
};
export type GanttReduceAction = {
type: "update" | "delete";
type: 'update' | 'delete';
changedTask?: Task;
};
@ -14,17 +14,17 @@ export function ganttReducer(
action: GanttReduceAction
): GanttReduceState {
switch (action.type) {
case "update": {
case 'update': {
return {
ganttTasks: state.ganttTasks.map((t) =>
ganttTasks: state.ganttTasks.map(t =>
t.id === action.changedTask?.id ? action.changedTask : t
),
};
}
case "delete": {
case 'delete': {
return {
ganttTasks: state.ganttTasks.filter(
(t) => t.id !== action.changedTask?.id
t => t.id !== action.changedTask?.id
),
};
}

View File

@ -1,4 +1,4 @@
import { Task } from "./public-types";
import { Task } from './public-types';
export interface BarTask extends Task {
index: number;

1015
yarn.lock

File diff suppressed because it is too large Load Diff