YaleSTC / shifts

Application to easily track shifts, reports, and payforms for employees.
MIT License
23 stars 18 forks source link

Schedule box broken on Calendar views #461

Closed njlxyaoxinwei closed 9 years ago

njlxyaoxinwei commented 9 years ago

In the shift scheduling process, the students need to create preferences on a public yet inactive calendar. The interface to interact with shifts in these calendar views is very broken. Ajax responses written for shifts view page are called, which results in strange behaviors. To debug this issue, the ability to see error messages are more crucial. But that is not fixed yet either, see #383 Possible solutions: Significant modification to the controller code for shifts/time_slots and js.erb views for each action to take into account the case of calendar views. Tooltip.js may need to be changed too to pass additional params such as calendar id etc., if it is not doing so already. This is the issue stalling #444 right now, and hopefully the last major obstacle.

njlxyaoxinwei commented 9 years ago

Initial investigation shows that shifts are being created on the correct calendar, which suggests that tooltip.js is already handling the calendar_id param correctly. It is just the wrong ajax response is used. Users also need the ability to delete their own shifts, and only in this context.

njlxyaoxinwei commented 9 years ago

Although calendar_id is set correctly, tooltip.js fails to send any indication of which schedule box view is being used. The old code expect a "calendar" key in the params.

It turns out the indicator key "calendar" is passed in a deprecated way in the submit tag. It should be moved upwards as an argument to the form method, and all shifts forms need to be changed.

njlxyaoxinwei commented 9 years ago

fixed at 10059ab7a66ad2ffd19ae44849ea62cd6b3c5521