croodle icon indicating copy to clipboard operation
croodle copied to clipboard

Can delete all times

Open rugk opened this issue 8 years ago • 7 comments

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:

croodledelall

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

rugk avatar Jun 09 '16 20:06 rugk

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:

  1. Delete time but preserve day.
  2. 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?

jelhan avatar Jun 10 '16 08:06 jelhan

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)

xshadow avatar Jun 10 '16 09:06 xshadow

After a long talk with @xshadow I tend to following long term implementation of delete button:

  1. If there are other times for this day, the time is deleted.
  2. If it's the only time for this day, but a time is specified, the time is deleted but the day is preserved.
  3. If it's the only time for this day and no time is specified, the day got deleted after user is asked for confirmation.
  4. 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.

jelhan avatar Jun 10 '16 09:06 jelhan

Bug fix is implement. 3+4 described in https://github.com/jelhan/croodle/issues/99#issuecomment-225140574 are new features.

jelhan avatar Jun 12 '16 10:06 jelhan

As it is fixed, this issue can be closed.

rugk avatar Aug 20 '16 21:08 rugk

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.

jelhan avatar Aug 21 '16 00:08 jelhan

Ah, sorry for closing it.

rugk avatar Aug 21 '16 09:08 rugk