-
Notifications
You must be signed in to change notification settings - Fork 285
feat: show supported component types in calendar settings #7875
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
feat: show supported component types in calendar settings #7875
Conversation
92a1d93 to
ee612ba
Compare
|
Hi @odzhychko Thank you for the PR... These kind of changes do require designer approval... |
|
This is a rather technical detail so I'm not sure if this just wouldn't be crowding the UI in many cases. At most we can show a simplified version of this in a tooltip next to the name, since it cannot be edited anyway. So next to the name there can be an |
Oh, I see now how this is an issue 😅
This is already being done. For example, when importing, creating, or editing events, only calendars that support events can be selected. Same for tasks. But being able to check supported types directly might still be useful and was suggested in #2572 (comment)
I'm not sure about this regarding discoverability and touch-friendliness. @nimishavijay What are your thoughts on providing this information more compactly in one line (e.g. "Supports events, tasks and journal entries") but still always visible? I initially went with the unmodifiable checkboxes to be consistent with the rest of the editing elements of this edit modal and also have some visual structuring. Perhaps eventually this modal could become a properties modal where you can edit some properties (e.g., name, color, sharability) and inspect other properties (e.g., supported entries, creating time, source (e.g., owned, shared, built-in, read-only, subscribed from URL)). |
|
I would also like to see this as a simple one-liner like This calendar supports events and tasks. This doesn't take a lot of space, is not too technical. |
Codecov Report✅ All modified and coverable lines are covered by tests. 📢 Thoughts on this report? Let us know! |
Let's go for this :) |
470f91f to
6023521
Compare
|
This is ready for review again :D The screenshot in the description was updated appropriately. |
|
@ChristophWurst any things else to add? |
Implements suggestion from nextcloud#2572 (comment) Refs: nextcloud#2572 Signed-off-by: Oleksandr Dzhychko <hey@oleks.dev>
6023521 to
b0471c6
Compare
|
Rebased to head prep to merge |
| if (this.calendar.supportsEvents && this.calendar.supportsTasks && this.calendar.supportsJournals) { | ||
| return this.$t('calendar', 'This calendar supports events, tasks and journal entries.') | ||
| } | ||
| if (this.calendar.supportsEvents && this.calendar.supportsTasks && !this.calendar.supportsJournals) { | ||
| return this.$t('calendar', 'This calendar supports events and tasks.') | ||
| } | ||
| if (this.calendar.supportsEvents && !this.calendar.supportsTasks && this.calendar.supportsJournals) { | ||
| return this.$t('calendar', 'This calendar supports events and journal entries.') | ||
| } | ||
| if (this.calendar.supportsEvents && !this.calendar.supportsTasks && !this.calendar.supportsJournals) { | ||
| return this.$t('calendar', 'This calendar supports only events.') | ||
| } | ||
| if (!this.calendar.supportsEvents && this.calendar.supportsTasks && this.calendar.supportsJournals) { | ||
| return this.$t('calendar', 'This calendar supports tasks and journal entries.') | ||
| } | ||
| if (!this.calendar.supportsEvents && this.calendar.supportsTasks && !this.calendar.supportsJournals) { | ||
| return this.$t('calendar', 'This calendar supports only tasks.') | ||
| } | ||
| if (!this.calendar.supportsEvents && !this.calendar.supportsTasks && this.calendar.supportsJournals) { | ||
| return this.$t('calendar', 'This calendar supports only journal entries.') | ||
| } | ||
| return this.$t('calendar', 'This calendar supports neither events, tasks nor journal entries.') |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You can use Intl for the list. Here's an example: https://github.com/nextcloud/mail/blob/f699d91eae959b9045c9bb4cabbf5f35f0fdd62f/src/components/OutboxMessageListItem.vue#L113-L114
Build an array with the supported types as translated strings and run it through the conjunction formatter.
$ const formatter = new Intl.ListFormat('de', { type: 'conjunction' })
$ formatter.format(['events', 'tasks'])
"events und tasks" Then use $n and singular/plural string like This calendar supports only {types} entries./This calendar supports {types}
Keep a separate handler for when none of the three components are supported
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I noticed that some languages that are well supported in Nextcloud are not yet supported by Intl.ListFormat even by the recent Chrome version 144 (tested on Fedora 43). This includes, for example, Irish ga and Galician gl.
I'm not sure how relevant this is. Let me know if I still can use can Intl.ListFormat here.
|
Looks much better! :) thank you @odzhychko ! |

Implements the suggestion to show supported component type from #2572 (comment)
Refs: #2572
Before
After (current)
After (previous iterations)
First iteration