nwfsc-fram / boatnet

At-Sea Field Data Collection Software Components for Scientific Surveys and Observers
8 stars 5 forks source link

Successfully build gantt-elastic as component #192

Open ghost opened 5 years ago

ghost commented 5 years ago

Investigate using the gantt-elastic Vue component as the primary calendaring component for the Observer Activity Tracking effort. For this ticket, just get the component to compile and render in a web browser.

Mak-NOAA commented 5 years ago

Ongoing discussion with the gantt-elastic folks https://github.com/neuronetio/gantt-elastic/issues/32

ghost commented 5 years ago

I have it somewhat working now, I'll check in the code here in a minute

partially working

ghost commented 5 years ago

I'm still getting the following error however which I think is the problem with the calendar portion not showing:

ERROR in C:/Users/Todd Hay/Documents/code/boatnet/apps/obs-web/src/views/Chart.vue 73:39 Parameter 'task' implicitly has an 'any' type. 71 | { id: 2, label: 'Description', value: 'label', width: 200, expander: true }, 72 | { id: 3, label: 'Assigned to', value: 'user', width: 130, html: true },

73 | { id: 3, label: 'Start', value: task => dayjs(task.start).format('YYYY-MM-DD'), width: 78 }, | ^ 74 | { id: 4, label: 'Type', value: 'type', width: 68 },

ghost commented 5 years ago

I would note that the error is occurring on line 73, with task.

ghost commented 5 years ago

Branch where we're exploring this: gantt-elastic

ghost commented 5 years ago

tracking the commentary on the original gantt-elastic site as well: https://github.com/neuronetio/gantt-elastic/issues/32

ghost commented 5 years ago

The gantt chart is now showing:

image

ghost commented 5 years ago

I was able to get rid of the task any error by modifying the tsconfig.json file in the obs-web directory as follows:

// "strict": true,
"noImplicitAny": false,

reference: https://stackoverflow.com/questions/47848778/parameter-implicitly-has-an-any-type

not thinking that this is the correct solution however.

ghost commented 5 years ago

With regards to the parameter implicitly has an any type error, the way to correct this is to modify the Chart.vue file where the error is occurring from:

{ id: 3, label: 'Start', value: task => dayjs(task.start).format('YYYY-MM-DD'), width: 78 },

to:

{ id: 3, label: 'Start', value: (task: any) => dayjs(task.start).format('YYYY-MM-DD'), width: 78 },

Reference: https://stackoverflow.com/questions/43064221/typescript-ts7006-parameter-xxx-implicitly-has-an-any-type

Mak-NOAA commented 5 years ago

@toddhay-NOAA good find!

SaOgaz-NOAA commented 4 years ago

@sethgerou-noaa, @Mak-NOAA, @melinashak-noaa do we still want to try and use this lib for calendaring? I know Seth already has some calendaring stuff implemented for the Trips stuff...

sethgerou-noaa commented 4 years ago

@SaOgaz-NOAA Let's hang on to this ticket - might be useful for observer trip assignment when we get around to it.