croodle
croodle copied to clipboard
Can delete all times
When creating an date/time poll (under #/create/options-datetime
) you can actually delete all items, including the first one, so you have no items there anymore:
Of course this causes an error (when clicking on "Next"):
TypeError: a is undefined
e.default<.actions.adoptTimesOfFirstDay()
croodle-3dd2b0496b94a83ac6f06cf9799fabf6.js:1
d<.send()
vendor-16255f242cfd5066597523892f5fbdd2.js:20
r()
vendor-16255f242cfd5066597523892f5fbdd2.js:14
u.registerAction/<.handler/<()
vendor-16255f242cfd5066597523892f5fbdd2.js:15
a.prototype.run()
vendor-16255f242cfd5066597523892f5fbdd2.js:8
l()
vendor-16255f242cfd5066597523892f5fbdd2.js:14
u.registerAction/<.handler()
vendor-16255f242cfd5066597523892f5fbdd2.js:15
e.default<.setupHandler/<()
vendor-16255f242cfd5066597523892f5fbdd2.js:20
fe.event.dispatch()
vendor-16255f242cfd5066597523892f5fbdd2.js:7
fe.event.add/v.handle()
vendor-16255f242cfd5066597523892f5fbdd2.js:6
croodle-3dd2b0496b94a83ac6f06cf9799fabf6.js:1:8819
tested with latest dev version
I'm not quite sure, what's the best behaviour is, if there is only one time for a day and delete button is clicked:
- Delete time but preserve day.
- Delete that day and transition to calendar if the last day get deleted.
First would be the same result as reseting input in browsers support input type time or insert an empty string.
Second one would allow to change days in time input form. It might be useful if you recognize you selected a wrong day but could also be confusing.
Any ideas?
If the last time for one day is deleted, the day should be deleted too.
If it's the last day which will be deleted, you should be redirected to the calendar.
In the future you should be able to add days afterwards ( by going back to the calendar and add additional days)
After a long talk with @xshadow I tend to following long term implementation of delete button:
- If there are other times for this day, the time is deleted.
- If it's the only time for this day, but a time is specified, the time is deleted but the day is preserved.
- If it's the only time for this day and no time is specified, the day got deleted after user is asked for confirmation.
- If all days are deleted, user is transitioned to day selection (calendar).
For now I will implement a bug fix only: Do not delete the day but reset the time if there isn't any other time for this day.
Bug fix is implement. 3+4 described in https://github.com/jelhan/croodle/issues/99#issuecomment-225140574 are new features.
As it is fixed, this issue can be closed.
I use this one to track not yet implemented features step 3 and 4 described in https://github.com/jelhan/croodle/issues/99#issuecomment-225140574.
Ah, sorry for closing it.