Hide reminder dropdown in event summary dialog when the event is not an invitation
Categories
(Calendar :: Dialogs, defect)
Tracking
(thunderbird_esr78 wontfix)
| Tracking | Status | |
|---|---|---|
| thunderbird_esr78 | --- | wontfix |
People
(Reporter: lasana, Assigned: lasana)
References
Details
Attachments
(2 files, 3 obsolete files)
|
31.80 KB,
image/png
|
Details | |
|
11.48 KB,
patch
|
pmorris
:
review+
|
Details | Diff | Splinter Review |
This will come up once bug 1575195 lands. Except from that bug:
For regular non-read-only events, reminders seems to be editable because there is a drop down menu for them, but there is no way to save a change. We should either make editing and saving reminders possible from the summary dialog, or don't offer the menu.
| Assignee | ||
Comment 1•5 years ago
|
||
What would be the desired behavior here? Personally, I like being able to quickly set a reminder from the summary view.
Comment 2•5 years ago
|
||
Since it's editing the event, I'd lean towards having it only in the edit dialog. Being able to do this and that edit quickly will just give the full editing dialog in the end...
| Assignee | ||
Updated•5 years ago
|
| Assignee | ||
Updated•5 years ago
|
| Assignee | ||
Comment 3•5 years ago
|
||
Made the event-summary widget only display the reminder dropdown if the event is not read-only and is an invitation. Updated a previous test to also ensure it remains hidden.
Comment 4•5 years ago
•
|
||
| Assignee | ||
Comment 5•5 years ago
|
||
Includes feedback from previous patch. Reminder details will show as read-only or a dropdown depending on the event.
Comment 6•5 years ago
|
||
| Assignee | ||
Comment 7•5 years ago
|
||
This works mostly as expected when I tried it, except I think we should just not show the reminders row if there are no reminders.
I did the patch like that to be consistent with the "No reminder" default in the dropdown. My reasoning was, it explicitly tells the user no reminder is set rather than nothing at all while the "No reminder" value shows in the editing dialog.
Seems like we should also have a check somewhere here to see if the item even has any reminders set.
loadReminders exits early if no reminders are set. See here:
https://searchfox.org/comm-central/source/calendar/base/content/dialogs/calendar-dialog-utils.js#303
Comment 8•5 years ago
|
||
(In reply to Lasana Murray from comment #7)
This works mostly as expected when I tried it, except I think we should just not show the reminders row if there are no reminders.
I did the patch like that to be consistent with the "No reminder" default in the dropdown. My reasoning was, it explicitly tells the user no reminder is set rather than nothing at all while the "No reminder" value shows in the editing dialog.
I see. I think it would be better to keep it consistent with the way the rest of the event properties are handled, where if no value is set, the row is not shown at all. (That also allows us to improve efficiency in the import dialog which may have many events by not rendering the menu at all when there are no reminders.)
Seems like we should also have a check somewhere here to see if the item even has any reminders set.
loadRemindersexits early if no reminders are set. See here:
https://searchfox.org/comm-central/source/calendar/base/content/dialogs/calendar-dialog-utils.js#303
Ah, that's true, but my thought was to avoid rendering the menu at all if there are no reminders, and I think that would involve an earlier check for whether reminders exist. In that case we wouldn't need the check in loadReminders anymore.
| Assignee | ||
Comment 9•5 years ago
•
|
||
Alright.
The current code puts this text in the
reminder-detailselement, so we can just get it from there
You mean this? I notice it displays Multiple Reminders... if there are more than one. Is that ok? (Edited)
https://searchfox.org/comm-central/source/calendar/base/content/widgets/calendar-item-summary.js#201
Comment 10•5 years ago
•
|
||
(In reply to Lasana Murray from comment #9)
The current code puts this text in the
reminder-detailselement, so we can just get it from thereYou mean this? I notice it displays
Multiple Reminders...if there are more than one. Is that ok? (Edited)https://searchfox.org/comm-central/source/calendar/base/content/widgets/calendar-item-summary.js#201
Yeah, that's it, and "Multiple Reminders..." is fine. Let's remove the "..." part though, since it won't be a link to open the reminders dialog. (We might be able to show details for more than one reminder in the future at some point, but that seems like a separate thing, since we'd want to do the same kind of thing in the edit dialog too.)
| Assignee | ||
Comment 11•5 years ago
|
||
One other thing:
show something like "Custom: First Thursday of the Month".
Also, currently we see the "..." like "Custom...". It would be better without the "...".
won't this break when localized?
Comment 12•5 years ago
|
||
Hm, good point. I see the "..." is part of the localized strings, which makes sense. So let's leave it as-is for now, i.e. just use the localized string with the "..." in it. Eventually it would be good to add localized strings without the "..." since it seems out of place in this plain text use (as opposed to a link).
| Assignee | ||
Comment 13•5 years ago
|
||
It may be more legible without prefixing the "Custom..." part. See attached.
Comment 14•5 years ago
|
||
(In reply to Lasana Murray from comment #13)
It may be more legible without prefixing the "Custom..." part. See attached.
Yeah, good call, let's just drop the "Custom..." part. It's not really needed in this context.
| Assignee | ||
Comment 15•5 years ago
|
||
Tests for browser_import.js fail with the changes I've made. Looks like the calendar property of calIItemBase is not set during the parsing phase.
I'm going to add a check to avoid causing the error. The idl file for iCalItemBase does not indicate the calendar attribute is nullable/optional though, so it's a bit misleading.
Here is the start of the code path for reference:
https://searchfox.org/comm-central/source/calendar/base/content/dialogs/calendar-ics-file-dialog.js#36
I also noticed that making a calendar read-only that already has reminders will hide the reminder details, I'm going to update the logic so it always shows once there are reminders.
| Assignee | ||
Comment 16•5 years ago
|
||
Changes made. browse_import test no longer fails.
| Assignee | ||
Comment 17•5 years ago
|
||
Comment 18•5 years ago
|
||
| Assignee | ||
Comment 19•5 years ago
|
||
Up to you, but here you could use the new
?.operator:
Is this valid syntax? I have not seen this operator before.
Here you could use template strings with
dedent
dedent does not appear to be in scope , I see a definition in head_const.js but that's not a jsm module.
Comment 20•5 years ago
|
||
(In reply to Lasana Murray from comment #19)
Up to you, but here you could use the new
?.operator:Is this valid syntax? I have not seen this operator before.
It's new, and very handy, see: https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Operators/Optional_chaining
Here you could use template strings with
dedent
dedentdoes not appear to be in scope , I see a definition inhead_const.jsbut that's not a jsm module.
Hm, looks like dedent has only been used in unit/xpcshell tests so far and not browser/mochitests. I think it would need to move into calendar/test/modules/CalendarUtils.jsm and then imported from there. Better to do that in a separate patch or separate bug though.
| Assignee | ||
Comment 21•5 years ago
|
||
Better to do that in a separate patch or separate bug though.
There are one or two things I see in head* files that would be useful in CalendarUtils.jsm. What prompts functions to be added there instead of in CalendarUtils?
I think the calendar testing utilities could do with some refactoring and new helpers so that writing calendar tests is a faster experience. Maybe create an actual CalendarTestUtils object and export it in BrowserTestUtils fashion?
Comment 22•5 years ago
|
||
(In reply to Lasana Murray from comment #21)
There are one or two things I see in
head*files that would be useful inCalendarUtils.jsm. What prompts functions to be added there instead of in CalendarUtils?
I'm not sure, but maybe because they couldn't be used in mozmill tests? And now they can be used in mochitests. Makes sense to put any useful utility functions where they can be used by both xpcshell and mochitests.
I think the calendar testing utilities could do with some refactoring and new helpers so that writing calendar tests is a faster experience. Maybe create an actual
CalendarTestUtilsobject and export it inBrowserTestUtilsfashion?
Sounds good to me, especially as part of migrating away from mozmill to standardize on mochitest style. Might be worth checking in with Geoff about it, see if he has any thoughts.
| Assignee | ||
Comment 23•5 years ago
|
||
I made the change for the optional chaining operator. The other changes should probably be handled in separate bugs as you mentioned. The priority here was really to hide the broken dropdown from users.
Comment 24•5 years ago
|
||
| Assignee | ||
Updated•5 years ago
|
Updated•5 years ago
|
Comment 25•5 years ago
|
||
Pushed by mkmelin@iki.fi:
https://hg.mozilla.org/comm-central/rev/28456bd23dfd
Show the reminder as read-only text when event is not an invitation. r=pmorris
Updated•5 years ago
|
Description
•