@@ -3,8 +3,9 @@ import { useParams, useSearchParams } from 'react-router-dom';
33import { ObjectGrid } from '@object-ui/plugin-grid' ;
44import { ObjectKanban } from '@object-ui/plugin-kanban' ;
55import { ObjectCalendar } from '@object-ui/plugin-calendar' ;
6+ import { ObjectGantt } from '@object-ui/plugin-gantt' ;
67import { Button , Tabs , TabsList , TabsTrigger } from '@object-ui/components' ;
7- import { Plus , Calendar as CalendarIcon , Kanban as KanbanIcon , Table as TableIcon } from 'lucide-react' ;
8+ import { Plus , Calendar as CalendarIcon , Kanban as KanbanIcon , Table as TableIcon , AlignLeft } from 'lucide-react' ;
89
910export function ObjectView ( { dataSource, objects, onEdit } : any ) {
1011 const { objectName } = useParams ( ) ;
@@ -110,10 +111,33 @@ export function ObjectView({ dataSource, objects, onEdit }: any) {
110111 dateField : activeView . dateField || 'due_date' ,
111112 endField : activeView . endField ,
112113 titleField : activeView . titleField || 'name' ,
114+ colorField : activeView . colorField ,
113115 } }
114116 { ...interactionProps }
115117 />
116118 ) ;
119+ case 'gantt' :
120+ return (
121+ < ObjectGantt
122+ key = { key }
123+ { ...commonProps }
124+ schema = { {
125+ type : 'gantt' ,
126+ objectName : objectDef . name ,
127+ filter : {
128+ gantt : {
129+ startDateField : activeView . startDateField || 'start_date' ,
130+ endDateField : activeView . endDateField || 'end_date' ,
131+ titleField : activeView . titleField || 'name' ,
132+ progressField : activeView . progressField || 'progress' ,
133+ dependenciesField : activeView . dependenciesField ,
134+ colorField : activeView . colorField ,
135+ }
136+ }
137+ } }
138+ { ...interactionProps }
139+ />
140+ ) ;
117141 case 'grid' :
118142 default :
119143 return (
@@ -160,6 +184,7 @@ export function ObjectView({ dataSource, objects, onEdit }: any) {
160184 { v . type === 'kanban' && < KanbanIcon className = "mr-2 h-3.5 w-3.5" /> }
161185 { v . type === 'calendar' && < CalendarIcon className = "mr-2 h-3.5 w-3.5" /> }
162186 { v . type === 'grid' && < TableIcon className = "mr-2 h-3.5 w-3.5" /> }
187+ { v . type === 'gantt' && < AlignLeft className = "mr-2 h-3.5 w-3.5" /> }
163188 { v . label }
164189 </ TabsTrigger >
165190 ) ) }
0 commit comments