-
-
Notifications
You must be signed in to change notification settings - Fork 4k
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
Provide links to calendar in event creation/update activities #19039
Conversation
71abc1c
to
4b908a4
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.
I'm blocking, to put this on hold for now. I'm worried I have to change the url format in order to fix nextcloud/calendar#1894. Will look into that issue today.
Never mind, it's yet again related to unencoded group names
@georgehrke yay or nay? |
@tcitworld can you remove the version check as suggested by @nickvergessen. Then this is good to go |
4b908a4
to
9ee897d
Compare
Removed the version check, properly injected dependencies, moved |
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
Activity PR is merged |
9ee897d
to
ef1b510
Compare
@@ -435,29 +435,41 @@ public function onTouchCalendarObject($action, array $calendarData, array $share | |||
$users = $this->getUsersForShares($shares); | |||
$users[] = $owner; | |||
|
|||
foreach ($users as $user) { | |||
// Users for share can return the owner itself if the calendar is published | |||
foreach (array_unique($users) as $user) { |
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.
getUsersForShares
potentially returning the owner itself because of public links for calendar should be fixed somewhere else, this is a temporary fix. We need a proper nc:
property to indicate that. cc @georgehrke
$link = [ | ||
'view' => 'dayGridMonth', | ||
'timeRange' => $timeRange->format('Y-m-d'), | ||
'mode' => 'sidebar', |
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 could get user's skipPopover
setting to know if we use the popover or the sidebar, do you want that?
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.
We actually have a special route for this, but it's also hardcoded to sidebar at the moment.
https://github.com/nextcloud/calendar/blob/master/src/router.js#L102
I would just keep it as is and improve later on :)
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.
If you use that route, we could actually get rid of firstoccurrence
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'm using /dayGridMonth/now/edit/sidebar/$objectId/next
then.
* @param array $eventData | ||
* @return array | ||
*/ | ||
protected function generateObjectParameter(array $eventData) { |
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 was in the base because it's also used in Todo.php and it makes it more obvious that it is shared.
But I guess it's fine eitherway.
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.
Yeah, my reasoning was that Calendar.php doesn't need it.
'objectId' => $objectId, | ||
'recurrenceId' => $linkData['firstoccurence'] | ||
]; | ||
$params['link'] = $this->url->linkToRouteAbsolute('calendar.view.indexview.timerange.edit', $link); |
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 will 💥 when calendar is disabled,
so maybe we return the params without the link (since it's optional anyway) in the exception catching?
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.
So just wrap in AppManager::isEnabledForUser
?
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.
Yes
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.
Not sure I follow here, we set the link inside the AppManager::isEnabledForUser
check already, and params without the link will be return at the end properly.
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.
Ah, didnt see it as it was all at the end of this long if
Signed-off-by: Thomas Citharel <tcit@tcit.fr>
ef1b510
to
deb2ea9
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.
Lets do this
Since Calendar 2.0 we have dedicated routes so we can link to events directly from the Activity app.
See also nextcloud/activity#420 for proper formatting in the Activity app.
(The last item has also a link to the event)