diff --git a/CHANGELOG.adoc b/CHANGELOG.adoc new file mode 100644 index 000000000..4d2111223 --- /dev/null +++ b/CHANGELOG.adoc @@ -0,0 +1,16 @@ += Changelog + +== v0.6.6 + +=== Breaking changes +- Renamed Gantt prop `onClick` to `onTaskClick` +- Added `onTaskContextMenu` prop + +=== Dependency update + +=== New features + +=== Improvements + +=== Bug fixes +- Fixed an issue introduced in v0.6.5 where left-clicking a task did not work diff --git a/README.md b/README.md index 773aa2b5e..46c07c853 100644 --- a/README.md +++ b/README.md @@ -42,7 +42,8 @@ You may handle actions onTaskDelete={onTaskDelete} onProgressChange={onProgressChange} onDoubleClick={onDblClick} - onClick={onClick} + onTaskClick={onTaskClick} + onTaskContextMenu={onTaskContextMenu} /> ``` @@ -67,58 +68,59 @@ npm start ### EventOption -| Parameter Name | Type | Description | -| :----------------- | :---------------------------------------------------------------------------- | :-------------------------------------------------------------------------------------- | -| onSelect | (task: Task, isSelected: boolean) => void | Specifies the function to be executed on the taskbar select or unselect event. | -| onDoubleClick | (task: Task) => void | Specifies the function to be executed on the taskbar onDoubleClick event. | -| onClick | (task: Task) => void | Specifies the function to be executed on the taskbar onClick event. | -| onDelete\* | (task: Task) => void/boolean/Promise/Promise | Specifies the function to be executed on the taskbar on Delete button press event. | -| onDateChange\* | (task: Task, children: Task[]) => void/boolean/Promise/Promise | Specifies the function to be executed when drag taskbar event on timeline has finished. | -| onProgressChange\* | (task: Task, children: Task[]) => void/boolean/Promise/Promise | Specifies the function to be executed when drag taskbar progress event has finished. | -| onExpanderClick\* | onExpanderClick: (task: Task) => void; | Specifies the function to be executed on the table expander click | -| onWheel\* | onWheel: (wheelEvent: WheelEvent) => void; | Specifies the function to be executed when the mouse wheel is used | -| timeStep | number | A time step value for onDateChange. Specify in milliseconds. | +| Parameter Name | Type | Description | +| :----------------- | :---------------------------------------------------------------------------------- | :-------------------------------------------------------------------------------------- | +| onSelect | (task: Task, isSelected: boolean) => void | Specifies the function to be executed on the taskbar select or unselect event. | +| onDoubleClick | (task: Task) => void | Specifies the function to be executed on the taskbar onDoubleClick event. | +| onTaskClick | (task: Task) => void | Specifies the function to be executed on the taskbar on click event. | +| onTaskContextMenu | (task: Task) => void | Specifies the function to be executed on the taskbar on right click event. | +| onDelete\* | (task: Task) => void/boolean/Promise ``/Promise `` | Specifies the function to be executed on the taskbar on Delete button press event. | +| onDateChange\* | (task: Task, children: Task[]) => void/boolean/Promise ``/Promise `` | Specifies the function to be executed when drag taskbar event on timeline has finished. | +| onProgressChange\* | (task: Task, children: Task[]) => void/boolean/Promise ``/Promise `` | Specifies the function to be executed when drag taskbar progress event has finished. | +| onExpanderClick\* | onExpanderClick: (task: Task) => void; | Specifies the function to be executed on the table expander click | +| onWheel\* | onWheel: (wheelEvent: WheelEvent) => void; | Specifies the function to be executed when the mouse wheel is used | +| timeStep | number | A time step value for onDateChange. Specify in milliseconds. | \* Chart undoes operation if method return false or error. Parameter children returns one level deep records. ### DisplayOption -| Parameter Name | Type | Description | -| :------------------ | :------ | :---------------------------------------------------------------------------------------------------------- | -| viewMode | enum | Specifies the time scale. Hour, Quarter Day, Half Day, Day, Week(ISO-8601, 1st day is Monday), Month, Year. | -| viewDate | date | Specifies display date and time for display. | -| preStepsCount | number | Specifies empty space before the fist task | -| locale | string | Specifies the month name language. Able formats: ISO 639-2, Java Locale. | -| monthCalendarFormat | string | Specifies the month display on calendar | -| monthTaskListFormat | string | Specifies the month display on list. | -| rtl | boolean | Sets rtl mode. | -| roundDate | | Allow to customize the way the date start/end are rounded | -| checkIsHoliday | | Tells if a date is a holday. It impacts the style of the day and the way the date is adjusted to working days| +| Parameter Name | Type | Description | +| :------------------ | :------ | :-------------------------------------------------------------------------------------------------------------------------------------- | +| viewMode | enum | Specifies the time scale. Hour, Quarter Day, Half Day, Day, Week(ISO-8601, 1st day is Monday), Month, Year. | +| viewDate | date | Specifies display date and time for display. | +| preStepsCount | number | Specifies empty space before the fist task | +| locale | string | Specifies the month name language. Able formats: ISO 639-2, Java Locale. | +| monthCalendarFormat | string | Specifies the month display on calendar | +| monthTaskListFormat | string | Specifies the month display on list. | +| rtl | boolean | Sets rtl mode. | +| roundDate | | Allow to customize the way the date start/end are rounded | +| checkIsHoliday | | Tells if a date is a holday. It impacts the style of the day and the way the date is adjusted to working days | | dateMoveStep | | An object that corresponds to a duration. It gives the step to ajust to the working day when moving the date allowing a smooth feedback | ### StylingOption -| Parameter Name | Type | Description | -| :------------------------- | :----- | :--------------------------------------------------------------------------------------------- | -| headerHeight | number | Specifies the header height. | -| columnWidth | number | Specifies the time period width. | -| listCellWidth | string | Specifies the task list cell width. Empty string is mean "no display". | -| rowHeight | number | Specifies the task row height. | -| barCornerRadius | number | Specifies the taskbar corner rounding. | -| barFill | number | Specifies the taskbar occupation. Sets in percent from 0 to 100. | -| handleWidth | number | Specifies width the taskbar drag event control for start and end dates. | -| fontFamily | string | Specifies the application font. | -| fontSize | string | Specifies the application font size. | -| barProgressColor | string | Specifies the taskbar progress fill color globally. | -| barProgressSelectedColor | string | Specifies the taskbar progress fill color globally on select. | -| barBackgroundColor | string | Specifies the taskbar background fill color globally. | -| barBackgroundSelectedColor | string | Specifies the taskbar background fill color globally on select. | -| arrowColor | string | Specifies the relationship arrow fill color. | -| arrowIndent | number | Specifies the relationship arrow right indent. Sets in px | -| todayColor | string | Specifies the current period column fill color. | -| TooltipContent | | Specifies the Tooltip view for selected taskbar. | -| TaskListHeader | | Specifies the task list Header view | -| TaskListTable | | Specifies the task list Table view | +| Parameter Name | Type | Description | +| :------------------------- | :----- | :---------------------------------------------------------------------- | +| headerHeight | number | Specifies the header height. | +| columnWidth | number | Specifies the time period width. | +| listCellWidth | string | Specifies the task list cell width. Empty string is mean "no display". | +| rowHeight | number | Specifies the task row height. | +| barCornerRadius | number | Specifies the taskbar corner rounding. | +| barFill | number | Specifies the taskbar occupation. Sets in percent from 0 to 100. | +| handleWidth | number | Specifies width the taskbar drag event control for start and end dates. | +| fontFamily | string | Specifies the application font. | +| fontSize | string | Specifies the application font size. | +| barProgressColor | string | Specifies the taskbar progress fill color globally. | +| barProgressSelectedColor | string | Specifies the taskbar progress fill color globally on select. | +| barBackgroundColor | string | Specifies the taskbar background fill color globally. | +| barBackgroundSelectedColor | string | Specifies the taskbar background fill color globally on select. | +| arrowColor | string | Specifies the relationship arrow fill color. | +| arrowIndent | number | Specifies the relationship arrow right indent. Sets in px | +| todayColor | string | Specifies the current period column fill color. | +| TooltipContent | | Specifies the Tooltip view for selected taskbar. | +| TaskListHeader | | Specifies the task list Header view | +| TaskListTable | | Specifies the task list Table view | - TooltipContent: [`React.FC<{ task: Task; fontSize: string; fontFamily: string; }>;`](https://github.com/MaTeMaTuK/gantt-task-react/blob/main/src/components/other/tooltip.tsx#L56) - TaskListHeader: `React.FC<{ headerHeight: number; rowWidth: string; fontFamily: string; fontSize: string;}>;` @@ -126,25 +128,25 @@ npm start ### Task -| Parameter Name | Type | Description | -| :------------- | :------- | :---------------------------------------------------------------------------------------------------- | -| id\* | string | Task id. | -| name\* | string | Task display name. | -| type\* | string | Task display type: **task**, **milestone**, **project** | -| start\* | Date | Task start date. | -| end\* | Date | Task end date. | -| progress\* | number | Task progress. Sets in percent from 0 to 100. | -| assignees\* | string[] | List of people assigned to the task | -| dependencies | string[] | Specifies the parent dependencies ids. | -| styles | object | Specifies the taskbar styling settings locally. Object is passed with the following attributes: | -| | | - **backgroundColor**: String. Specifies the taskbar background fill color locally. | -| | | - **backgroundSelectedColor**: String. Specifies the taskbar background fill color locally on select. | -| | | - **progressColor**: String. Specifies the taskbar progress fill color locally. | -| | | - **progressSelectedColor**: String. Specifies the taskbar progress fill color globally on select. | -| isDisabled | bool | Disables all action for current task. | -| fontSize | string | Specifies the taskbar font size locally. | -| project | string | Task project name | -| hideChildren | bool | Hide children items. Parameter works with project type only | +| Parameter Name | Type | Description | +| :------------- | :------- | :--------------------------------------------------------------------------------------------------- | +| id\* | string | Task id. | +| name\* | string | Task display name. | +| type\* | string | Task display type:**task**, **milestone**, **project** | +| start\* | Date | Task start date. | +| end\* | Date | Task end date. | +| progress\* | number | Task progress. Sets in percent from 0 to 100. | +| assignees\* | string[] | List of people assigned to the task | +| dependencies | string[] | Specifies the parent dependencies ids. | +| styles | object | Specifies the taskbar styling settings locally. Object is passed with the following attributes: | +| | | -**backgroundColor**: String. Specifies the taskbar background fill color locally. | +| | | -**backgroundSelectedColor**: String. Specifies the taskbar background fill color locally on select. | +| | | -**progressColor**: String. Specifies the taskbar progress fill color locally. | +| | | -**progressSelectedColor**: String. Specifies the taskbar progress fill color globally on select. | +| isDisabled | bool | Disables all action for current task. | +| fontSize | string | Specifies the taskbar font size locally. | +| project | string | Task project name | +| hideChildren | bool | Hide children items. Parameter works with project type only | \*Required diff --git a/package-lock.json b/package-lock.json index 8189f1e55..c8c4e9fba 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,12 +1,12 @@ { "name": "@ObeoNetwork/gantt-task-react", - "version": "0.6.5", + "version": "0.6.6", "lockfileVersion": 3, "requires": true, "packages": { "": { "name": "@ObeoNetwork/gantt-task-react", - "version": "0.6.5", + "version": "0.6.6", "license": "MIT", "dependencies": { "@floating-ui/dom": "1.1.1", diff --git a/package.json b/package.json index 5119a6690..432941a7e 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "@ObeoNetwork/gantt-task-react", - "version": "0.6.5", + "version": "0.6.6", "description": "Interactive Gantt Chart for React with TypeScript.", "author": "MaTeMaTuK ", "homepage": "https://github.com/ObeoNetwork/gantt-task-react", diff --git a/src/components/gantt/gantt.tsx b/src/components/gantt/gantt.tsx index 9db37df9c..8a4625a6c 100644 --- a/src/components/gantt/gantt.tsx +++ b/src/components/gantt/gantt.tsx @@ -208,7 +208,8 @@ export const Gantt: React.FC = ({ onArrowDoubleClick: onArrowDoubleClickProp = undefined, onChangeExpandState = undefined, onChangeTasks = undefined, - onContextMenu = undefined, + onTaskClick = undefined, + onTaskContextMenu = undefined, onDateChange: onDateChangeProp = undefined, onDelete = undefined, onDoubleClick = undefined, @@ -1751,9 +1752,15 @@ export const Gantt: React.FC = ({ ] ); - const onTaskContextMenu = (task: TaskOrEmpty) => { - if (onContextMenu) { - onContextMenu(task); + const handleTaskContextMenu = (task: TaskOrEmpty) => { + if (onTaskContextMenu) { + onTaskContextMenu(task); + } + }; + + const handleTaskClick = (task: TaskOrEmpty) => { + if (onTaskClick) { + onTaskClick(task); } }; @@ -1785,7 +1792,8 @@ export const Gantt: React.FC = ({ isShowDependencyWarnings, mapGlobalRowIndexToTask, onArrowDoubleClick, - onContextMenu: onTaskContextMenu, + onTaskClick: handleTaskClick, + onTaskContextMenu: handleTaskContextMenu, onDoubleClick, onFixDependencyPosition, onProgressChange, @@ -1835,7 +1843,8 @@ export const Gantt: React.FC = ({ mapTaskToCoordinates, onArrowDoubleClick, onChangeTooltipTask, - onContextMenu, + onTaskClick, + onTaskContextMenu, onDoubleClick, onFixDependencyPosition, onProgressChange, @@ -1883,7 +1892,8 @@ export const Gantt: React.FC = ({ icons, isShowTaskNumbers, mapTaskToNestedIndex, - onContextMenu: onTaskContextMenu, + onTaskClick: onTaskClick, + onTaskContextMenu: onTaskContextMenu, onExpanderClick: handleExpanderClick, selectTaskOnMouseDown, selectedIdsMirror, diff --git a/src/components/gantt/task-gantt-content.tsx b/src/components/gantt/task-gantt-content.tsx index bf100cee9..bba963f09 100644 --- a/src/components/gantt/task-gantt-content.tsx +++ b/src/components/gantt/task-gantt-content.tsx @@ -68,6 +68,7 @@ export type TaskGanttContentProps = { event: React.MouseEvent ) => void; onArrowDoubleClick: (taskFrom: Task, taskTo: Task) => void; + onTaskClick?: (task: Task, event: React.MouseEvent) => void; onTaskContextMenu?: (task: Task, event: React.MouseEvent) => void; onDoubleClick?: (task: Task) => void; renderedRowIndexes: OptimizedListParams | null; @@ -113,6 +114,7 @@ export const TaskGanttContent: React.FC = ({ onArrowDoubleClick, onDependencyContextMenu, onDoubleClick, + onTaskClick, onTaskContextMenu, renderedRowIndexes, rtl, @@ -240,6 +242,7 @@ export const TaskGanttContent: React.FC = ({ ganttRelationEvent={ganttRelationEvent} isDelete={!task.isDisabled} onDoubleClick={onDoubleClick} + onClick={onTaskClick} onTaskContextMenu={onTaskContextMenu} onEventStart={handleTaskDragStart} setTooltipTask={setTooltipTask} diff --git a/src/components/gantt/task-gantt.tsx b/src/components/gantt/task-gantt.tsx index 971d5915a..092879a13 100644 --- a/src/components/gantt/task-gantt.tsx +++ b/src/components/gantt/task-gantt.tsx @@ -145,6 +145,18 @@ const TaskGanttInner: React.FC = ({ const [selectedTask, setSelectedTask] = React.useState(null); const open = Boolean(anchorEl); + const onTaskClick: ( + task: Task, + event: React.MouseEvent + ) => void = (task, event) => { + + setArrowAnchorEl(null); + setSelectedDependency(null); + setAnchorEl(null); + setSelectedTask(task); + barProps.onTaskClick(task, event); + }; + const onRightClickTask: ( task: Task, event: React.MouseEvent @@ -155,7 +167,7 @@ const TaskGanttInner: React.FC = ({ setSelectedDependency(null); setAnchorEl(event.currentTarget); setSelectedTask(task); - barProps.onTaskContextMenu(task, event); + barProps.onTaskClick(task, event); }; const onClose = () => { @@ -213,6 +225,7 @@ const TaskGanttInner: React.FC = ({ diff --git a/src/components/task-item/task-item.tsx b/src/components/task-item/task-item.tsx index 34a5e7b14..b2a6436aa 100644 --- a/src/components/task-item/task-item.tsx +++ b/src/components/task-item/task-item.tsx @@ -55,6 +55,7 @@ export type TaskItemProps = { isCritical: boolean; rtl: boolean; onDoubleClick?: (task: Task) => void; + onClick?: (task: Task, event: React.MouseEvent) => void; onTaskContextMenu?: (task: Task, event: React.MouseEvent) => void; setTooltipTask: (task: Task | null, element: Element | null) => void; onEventStart: ( @@ -90,6 +91,7 @@ const TaskItemInner: React.FC = props => { isDateChangeable, isDelete, isSelected, + onClick = undefined, onTaskContextMenu = undefined, onDoubleClick = undefined, onEventStart, @@ -174,6 +176,16 @@ const TaskItemInner: React.FC = props => { }, [task, fixEndPosition, outOfParentWarnings, getTaskGlobalIndexByRef]); const handleClick = useCallback( + (event: React.MouseEvent) => { + if (onClick) { + onClick(task, event); + } + }, + [onClick, task] + ); + + + const handleRightClick = useCallback( (event: React.MouseEvent) => { if (onTaskContextMenu) { onTaskContextMenu(task, event); @@ -377,7 +389,8 @@ const TaskItemInner: React.FC = props => { onMouseDown={onMouseDown} onMouseEnter={onMouseEnter} onMouseLeave={onMouseLeave} - onContextMenu={handleClick} + onClick={handleClick} + onContextMenu={handleRightClick} onDoubleClick={handleDoubleClick} ref={taskRootRef} > diff --git a/src/components/task-list/task-list-table-row.tsx b/src/components/task-list/task-list-table-row.tsx index 52fb1cc0f..6f81858c1 100644 --- a/src/components/task-list/task-list-table-row.tsx +++ b/src/components/task-list/task-list-table-row.tsx @@ -44,7 +44,8 @@ type TaskListTableRowProps = { isEven: boolean; isSelected: boolean; isShowTaskNumbers: boolean; - onRightClick: (task: TaskOrEmpty) => void; + onTaskClick: (task: TaskOrEmpty) => void; + onTaskContextMenu: (task: TaskOrEmpty) => void; onExpanderClick: (task: Task) => void; scrollToTask: (task: Task) => void; selectTaskOnMouseDown: (taskId: string, event: MouseEvent) => void; @@ -80,7 +81,8 @@ const TaskListTableRowInner: React.FC = ({ isEven, isSelected, isShowTaskNumbers, - onRightClick, + onTaskClick, + onTaskContextMenu, onExpanderClick, scrollToTask, selectTaskOnMouseDown, @@ -103,7 +105,8 @@ const TaskListTableRowInner: React.FC = ({ } selectTaskOnMouseDown(task.id, event); - onRightClick(task); + onTaskClick(task); + onTaskContextMenu(task); }, [scrollToTask, selectTaskOnMouseDown, task] ); diff --git a/src/components/task-list/task-list-table.tsx b/src/components/task-list/task-list-table.tsx index b20d1fcfe..0183b2dc7 100644 --- a/src/components/task-list/task-list-table.tsx +++ b/src/components/task-list/task-list-table.tsx @@ -30,7 +30,8 @@ const TaskListTableDefaultInner: React.FC = ({ icons, isShowTaskNumbers, mapTaskToNestedIndex, - onContextMenu, + onTaskClick, + onTaskContextMenu, onExpanderClick, renderedIndexes, scrollToTask, @@ -107,7 +108,8 @@ const TaskListTableDefaultInner: React.FC = ({ isEven={index % 2 === 1} isSelected={selectedIdsMirror[id]} isShowTaskNumbers={isShowTaskNumbers} - onRightClick={onContextMenu} + onTaskClick={onTaskClick} + onTaskContextMenu={onTaskContextMenu} onExpanderClick={onExpanderClick} scrollToTask={scrollToTask} selectTaskOnMouseDown={selectTaskOnMouseDown} diff --git a/src/components/task-list/task-list.tsx b/src/components/task-list/task-list.tsx index 409df8c4a..cad4617a5 100644 --- a/src/components/task-list/task-list.tsx +++ b/src/components/task-list/task-list.tsx @@ -58,7 +58,8 @@ export type TaskListProps = { icons?: Partial; isShowTaskNumbers: boolean; mapTaskToNestedIndex: MapTaskToNestedIndex; - onContextMenu?: (task: TaskOrEmpty) => void; + onTaskClick?: (task: TaskOrEmpty) => void; + onTaskContextMenu?: (task: TaskOrEmpty) => void; onExpanderClick: (task: Task) => void; scrollToTask: (task: Task) => void; selectTaskOnMouseDown: (taskId: string, event: MouseEvent) => void; @@ -100,7 +101,8 @@ const TaskListInner: React.FC = ({ isShowTaskNumbers, mapTaskToNestedIndex, onExpanderClick, - onContextMenu, + onTaskClick, + onTaskContextMenu, scrollToTask, selectTaskOnMouseDown, selectedIdsMirror, @@ -184,7 +186,8 @@ const TaskListInner: React.FC = ({ icons={icons} isShowTaskNumbers={isShowTaskNumbers} mapTaskToNestedIndex={mapTaskToNestedIndex} - onContextMenu={onContextMenu} + onTaskClick={onTaskClick} + onTaskContextMenu={onTaskContextMenu} onExpanderClick={onExpanderClick} renderedIndexes={renderedIndexes} scrollToTask={scrollToTask} diff --git a/src/types/public-types.ts b/src/types/public-types.ts index d92ac665f..1230b02fc 100644 --- a/src/types/public-types.ts +++ b/src/types/public-types.ts @@ -364,11 +364,11 @@ export interface EventOption { /** * Invokes on bar click. */ - onClick?: (task: TaskOrEmpty) => void; + onTaskClick?: (task: TaskOrEmpty) => void; /** * Invokes on bar right click. */ - onContextMenu?: (task: TaskOrEmpty) => void; + onTaskContextMenu?: (task: TaskOrEmpty) => void; /** * Recount descedents of a group task when moving */ @@ -641,7 +641,8 @@ export interface TaskListTableProps { icons?: Partial; isShowTaskNumbers: boolean; mapTaskToNestedIndex: MapTaskToNestedIndex; - onContextMenu: (task: TaskOrEmpty) => void; + onTaskClick: (task: TaskOrEmpty) => void; + onTaskContextMenu: (task: TaskOrEmpty) => void; onExpanderClick: (task: Task) => void; renderedIndexes: OptimizedListParams | null; scrollToTask: (task: Task) => void; diff --git a/stories/Comparison.tsx b/stories/Comparison.tsx index 02b6e4158..8c603d06d 100644 --- a/stories/Comparison.tsx +++ b/stories/Comparison.tsx @@ -58,7 +58,7 @@ export const Comparison: React.FC = props => { onChangeTasks={onChangeTasks} onDoubleClick={handleDblClick} onEditTask={onEditTask} - onClick={handleClick} + onTaskClick={handleClick} tasks={tasks} /> ); diff --git a/stories/CriticalPath.tsx b/stories/CriticalPath.tsx index e1fa2e6be..d06267bec 100644 --- a/stories/CriticalPath.tsx +++ b/stories/CriticalPath.tsx @@ -123,7 +123,7 @@ export const CriticalPath: React.FC = props => { onChangeTasks={onChangeTasks} onDoubleClick={handleDblClick} onEditTask={onEditTask} - onClick={handleClick} + onTaskClick={handleClick} tasks={tasks} /> ); diff --git a/stories/CustomColumns_VerticalScroll.tsx b/stories/CustomColumns_VerticalScroll.tsx index 539912d7c..b7f2c6e29 100644 --- a/stories/CustomColumns_VerticalScroll.tsx +++ b/stories/CustomColumns_VerticalScroll.tsx @@ -208,7 +208,7 @@ export const CustomColumns_VerticalScroll: React.FC = props => { onChangeTasks={onChangeTasks} onDoubleClick={handleDblClick} onEditTask={onEditTask} - onClick={handleClick} + onTaskClick={handleClick} tasks={tasks} onResizeColumn={onResizeColumn} /> diff --git a/stories/CustomIcons.tsx b/stories/CustomIcons.tsx index 51c111159..638c95214 100644 --- a/stories/CustomIcons.tsx +++ b/stories/CustomIcons.tsx @@ -70,7 +70,7 @@ export const CustomIcons: React.FC = props => { onChangeTasks={onChangeTasks} onDoubleClick={handleDblClick} onEditTask={onEditTask} - onClick={handleClick} + onTaskClick={handleClick} tasks={tasks} /> ); diff --git a/stories/CustomPalette_Zoom.tsx b/stories/CustomPalette_Zoom.tsx index 82e6e158b..edfa6ed69 100644 --- a/stories/CustomPalette_Zoom.tsx +++ b/stories/CustomPalette_Zoom.tsx @@ -485,7 +485,8 @@ export const CustomPalette_Zoom: React.FC = props => { onChangeTasks={onChangeTasks} onDoubleClick={handleDblClick} onEditTask={onEditTask} - onClick={handleClick} + onTaskClick={handleClick} + onTaskContextMenu={handleClick} tasks={tasks} viewMode={viewMode} roundDate={roundDate} diff --git a/stories/CustomRelationKind.tsx b/stories/CustomRelationKind.tsx index c3f5f4be9..7457c6e32 100644 --- a/stories/CustomRelationKind.tsx +++ b/stories/CustomRelationKind.tsx @@ -68,7 +68,7 @@ export const CustomRelationKind: React.FC = props => { onChangeTasks={onChangeTasks} onDoubleClick={handleDblClick} onEditTask={onEditTask} - onClick={handleClick} + onTaskClick={handleClick} tasks={tasks} onRelationChange={handleRelationChange} /> diff --git a/stories/StressTest.tsx b/stories/StressTest.tsx index 3c57cb0f9..aa41cef9f 100644 --- a/stories/StressTest.tsx +++ b/stories/StressTest.tsx @@ -169,7 +169,7 @@ export const StressTest: React.FC = ({ onChangeTasks={onChangeTasks} onDoubleClick={handleDblClick} onEditTask={onEditTask} - onClick={handleClick} + onTaskClick={handleClick} tasks={tasks} /> ); diff --git a/stories/Warnings.tsx b/stories/Warnings.tsx index 8c8898e38..bf81c750c 100644 --- a/stories/Warnings.tsx +++ b/stories/Warnings.tsx @@ -50,7 +50,7 @@ export const Warnings: React.FC = props => { onChangeTasks={onChangeTasks} onDoubleClick={handleDblClick} onEditTask={onEditTask} - onClick={handleClick} + onTaskClick={handleClick} tasks={tasks} /> );