-
-
Notifications
You must be signed in to change notification settings - Fork 4.1k
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
feature: added new FavouriteWidget to display favorite files in dashboard widget #49534
base: master
Are you sure you want to change the base?
feature: added new FavouriteWidget to display favorite files in dashboard widget #49534
Conversation
…d widget Signed-off-by: yemkareems <[email protected]>
09e1e7c
to
341e377
Compare
Looping in @jancborchardt for
This seems unintuitive since "no favorites" implies Or I misunderstand the description @yemkareems 😄 |
Following Andy's comment, I would actually say we show the last xx updated favorites (like 20 🤷 ) |
I agree that this would be a good approach. cc @jancborchardt |
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.
Following Andy's comment, I would actually say we show the last xx updated favorites (like 20 🤷 )
Sounds good to me as well!
Also 2 smaller things:
- The title should be "Favorite files" so it's clearer what it is. (Just like we say "Recommended files")
- The icon can be a favorite star to show a little difference
cc @yemkareems |
…unwanted IWidget and usersession, renamed id, renamed class to FavoriteWidget, removed limit logic Signed-off-by: yemkareems <[email protected]>
Signed-off-by: yemkareems <[email protected]>
Irrespective of the limit the ui is showing only the latest 6. Hence removed the limit logic here and after 6 items, More favorites button is displayed which takes the user to file listing. |
Changed the title and icon. The icon star loads with a grey color color initially and then it changes to black. The SVG is black however. |
I think @nickvergessen fixed this a while ago for all icons until then, maybe you remember the PR @nickvergessen ? |
@yemkareems I would remove the circular masking, we don't have it in the files interface nor any other list in the dashboard except for avatars - see for reference in your screenshots: recommended files |
Yep agree, missed this somehow. Circular masking is only for avatars. File previews get a little border-radius and filetype icons should be displayed as is. |
} | ||
|
||
public function getUrl(): ?string { | ||
return $this->urlGenerator->getAbsoluteURL('index.php/apps/files/favorites'); |
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.
return $this->urlGenerator->getAbsoluteURL('index.php/apps/files/favorites'); | |
return $this->urlGenerator->linkToRouteAbsolute('files.View.indexView', ['view' => 'favorites']); |
$node = $userFolder->getFirstNodeById($favorite); | ||
if ($node) { | ||
$url = $this->urlGenerator->linkToRouteAbsolute( | ||
'files.viewcontroller.showFile', ['fileid' => $node->getId()] |
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.
'files.viewcontroller.showFile', ['fileid' => $node->getId()] | |
'files.view.showFile', ['fileid' => $node->getId()] |
return [ | ||
new WidgetButton( | ||
WidgetButton::TYPE_MORE, | ||
$this->urlGenerator->getAbsoluteURL('index.php/apps/files/favorites'), |
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.
same here as above
@@ -10,5 +10,6 @@ | |||
'OC\\' => array($baseDir . '/lib/private'), | |||
'OCP\\' => array($baseDir . '/lib/public'), | |||
'NCU\\' => array($baseDir . '/lib/unstable'), | |||
'Bamarni\\Composer\\Bin\\' => array($vendorDir . '/bamarni/composer-bin-plugin/src'), |
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.
composer i --no-dev
and re-commit
return; | ||
} | ||
|
||
public function getItems(string $userId, ?string $since = null, int $limit = 7): 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.
Where is $limit
applied?
feature: added new FavouriteWidget to display favorite files in dashboard widget
added a new widget to display favorite files in dashboard and to show a link to more favorites to apps/files/favorites. if max count of favorites of 50 is reached then also 'No favorites' is displayed
fixes: #23308
Summary
TODO
Checklist