-
Notifications
You must be signed in to change notification settings - Fork 241
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
Augment the category menu by system tags and already used categories #5161
Augment the category menu by system tags and already used categories #5161
Conversation
Codecov ReportPatch coverage has no change and project coverage change:
Additional details and impacted files@@ Coverage Diff @@
## main #5161 +/- ##
============================================
+ Coverage 22.36% 22.76% +0.39%
- Complexity 359 368 +9
============================================
Files 236 237 +1
Lines 11554 11629 +75
Branches 2250 2255 +5
============================================
+ Hits 2584 2647 +63
- Misses 8970 8982 +12
Flags with carried forward coverage won't be shown. Click here to find out more.
☔ View full report in Codecov by Sentry. |
25cdc17
to
fc89c82
Compare
fc89c82
to
bc3e211
Compare
Hi, thanks so much for your PR! The system tags look great, that can stay as it is, but unfortunately, querying the oc_calendar_properties table from the calendar app is a big no no. The table, despite it's misleading name, doesn't belong to the calendar app but the dav app in server. If the dav app changes anything about the table, it could break the calendar app. So the custom tags need to be exposed via an API from the dav app to get them in the calendar app. If you need help with that, let me know! You can find any calendar related code in apps/dav/lib/CalDAV. |
So a clean implementation which lives without further modifications of the nextcloud/server and/or the dav-app would have to use possibility 1). |
7ae8560
to
93f13e5
Compare
The current state of the code uses the public API from lib/public/Calendar/IManager. It simply slurps in all events and extracts the categories. The result array returned by IManager->search('') is really quite complicated. I hope that the array layout is stable and will not change. |
93f13e5
to
f0b435d
Compare
ab10fc9
to
f4ec5c6
Compare
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.
Code looks good otherwise
e00bda8
to
70f9347
Compare
70f9347
to
50e44f3
Compare
50e44f3
to
82fad05
Compare
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.
Works
If it's in your skill set I would appreciate unit tests for the newly added classes |
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.
Tested a bit, seems to work 👍
* | ||
* @return CategoryGroup[] | ||
*/ | ||
public function getCategories(string $userId): array { |
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.
FYI I have moved the userId from an injectable to a parameter because that makes the service usable without a user context, e.g. if we make use of it in a background job or CLI task one day
This commit add all available "collaborative tags" and all already used categories into option groups of the tags-menu of the side-bar editor. This commit addresses and is a related to a couple of open issues: nextcloud#3735 Calendar Categories: Propose Categories already used - this should be fixed by this commit nextcloud#1644 Add own categories, delete default ones - this is partly fixed in the sense that collaboritive tags are now also proposed as calendar categories. - still default categories cannot be deleted - however, using option groups one at least has some sort of overview about the origin of the proposed category nextcloud/server#29950 Save VEVENT CATEGORIES as vcategory - this issue is totally "ignored" by this commit as the proposed solution there is not needed (the categories are already there in the oc_calendarobject_props table) - that would have to be discussed there: but my impression that the tables and classed mentioned there are obsolete and no longer used. Co-authored-by: Anna <anna@nextcloud.com> Signed-off-by: Claus-Justus Heine <himself@claus-justus-heine.de>
287342d
to
b3af4c3
Compare
@JohannesGGE @miaulalala please have a final test after my modifications |
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.
This commit add all available "collaborative tags" and all already used categories into option groups of the tags-menu of the side-bar editor.
Determining the set of already used categories is a little bit ugly: it used the oc_calendarobject_props table which might be considered "internal". However, this is the Nextcloud calendar app which only talks to the Nextcloud calendar server. So using this "internal ingredient" might be acceptable.
This commit addresses and is a related to a couple of open issues:
#3735 Calendar Categories: Propose Categories already used
#1644 Add own categories, delete default ones
nextcloud/server#29950 Save VEVENT CATEGORIES as vcategory