Skip to content

Use favorites from graph api#2171

Merged
AlexAndBear merged 10 commits intoopencloud-eu:mainfrom
pascalwengerter:favorites-graph-api
Mar 24, 2026
Merged

Use favorites from graph api#2171
AlexAndBear merged 10 commits intoopencloud-eu:mainfrom
pascalwengerter:favorites-graph-api

Conversation

@pascalwengerter
Copy link
Copy Markdown
Contributor

@pascalwengerter pascalwengerter commented Mar 18, 2026

Related Issue

Types of changes

  • Enhancement (a change that doesn't break existing code or deployments)
  • Breaking change (a modification that affects current functionality), if you consider removing the legacy favorite option "supported" (@kulmann)
  • Technical debt (addressing code that needs refactoring or improvements)

@pascalwengerter pascalwengerter force-pushed the favorites-graph-api branch 3 times, most recently from c90aca7 to 82e3529 Compare March 18, 2026 16:51
@AlexAndBear
Copy link
Copy Markdown
Member

@pascalwengerter started the ci. Type check and linter are complaining

@pascalwengerter
Copy link
Copy Markdown
Contributor Author

@pascalwengerter started the ci. Type check and linter are complaining

Thx, will rebase & address

@AlexAndBear
Copy link
Copy Markdown
Member

AlexAndBear commented Mar 20, 2026

@pascalwengerter works very good at first glance!

But there is something off with the search, every item is marked as favorite even if they ain't marked as such.

image

can you also check if its possible to add project spaces as favorites ? I am not sure if there is a backend limitation, but would be great.

@AlexAndBear
Copy link
Copy Markdown
Member

I had a chat with the team. Can you please set the fill type to line in the status indicators, so it machtes the other ones and looks a little more subtle ? 🙏

@pascalwengerter
Copy link
Copy Markdown
Contributor Author

Thx for the feedback, will investigate (& adapt the icon). I'm kinda surprised there's no test changes needed/expected failures to update?

@AlexAndBear
Copy link
Copy Markdown
Member

Thx for the feedback, will investigate (& adapt the icon). I'm kinda surprised there's no test changes needed/expected failures to update?

Same, I was expecting there were some disabled e2e tests, but couldn't find any

},
"engines": {
"node": ">=18"
"node": ">=22"
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

is this necessary?

@AlexAndBear
Copy link
Copy Markdown
Member

AlexAndBear commented Mar 20, 2026

The reason why the search is showing false positive starred items is in packages/web-client/src/helpers/resource/functions.ts

the check

starred: resource.props[DavProperty.IsFavorite] !== 0

should be changed to

starred:resource.props[DavProperty.IsFavorite] === 1

Unfortunately, the search is not yet compatible with favorites :sigh:

@AlexAndBear
Copy link
Copy Markdown
Member

@pascalwengerter I am baffled. I checked if we can add spaces to favorites and it's supported by the backend. You can add it to space actions if you want to, or I'll do it in a follow-up 👍

@kulmann
Copy link
Copy Markdown
Member

kulmann commented Mar 21, 2026

@pascalwengerter I am baffled. I checked if we can add spaces to favorites and it's supported by the backend. You can add it to space actions if you want to, or I'll do it in a follow-up 👍

Ahaha nice, that's a nice addition to the plate ❤️ I wonder if it was by accident. 😅 @aduffeck

@AlexAndBear
Copy link
Copy Markdown
Member

AlexAndBear commented Mar 21, 2026

@aduffeck @kulmann

Unfortunately, the /drive(s) endpoint doesn't expose this information; we need to add the flag to unleash the full power of favourites in conjuction with spaces.

I was hoping that we can add the following relation prop and reference the item itself:
https://learn.microsoft.com/en-us/graph/api/resources/drive?view=graph-rest-1.0

"following": [{"@odata.type": "microsoft.graph.driveItem"}]

Otherwise we would need a custom prop.

The REPORT endpoint also doesn't expose if a file is a favourite, which is a blocker

But so far we are making big progress.

Special thanks to @pascalwengerter ⭐️

@AlexAndBear AlexAndBear self-assigned this Mar 21, 2026
@pascalwengerter
Copy link
Copy Markdown
Contributor Author

@aduffeck @kulmann

Unfortunately, the /drive(s) endpoint doesn't expose this information; we need to add the flag to unleash the full power of favourites in conjuction with spaces.

I was hoping that we can add the following relation prop and reference the item itself: https://learn.microsoft.com/en-us/graph/api/resources/drive?view=graph-rest-1.0

"following": [{"@odata.type": "microsoft.graph.driveItem"}]

Otherwise we would need a custom prop.

The REPORT endpoint also doesn't expose if a file is a favourite, which is a blocker

But so far we are making big progress.

Special thanks to @pascalwengerter ⭐️

Does this warrant an issue in the opencloud repo? And do we need to revert opencloud-eu/opencloud#2494 because favorites aren't fully implemented? 🤔

@AlexAndBear
Copy link
Copy Markdown
Member

AlexAndBear commented Mar 21, 2026

@aduffeck @kulmann
Unfortunately, the /drive(s) endpoint doesn't expose this information; we need to add the flag to unleash the full power of favourites in conjuction with spaces.
I was hoping that we can add the following relation prop and reference the item itself: https://learn.microsoft.com/en-us/graph/api/resources/drive?view=graph-rest-1.0
"following": [{"@odata.type": "microsoft.graph.driveItem"}]
Otherwise we would need a custom prop.
The REPORT endpoint also doesn't expose if a file is a favourite, which is a blocker
But so far we are making big progress.
Special thanks to @pascalwengerter ⭐️

Does this warrant an issue in the opencloud repo? And do we need to revert opencloud-eu/opencloud#2494 because favorites aren't fully implemented? 🤔

Depends on how fast the backend moves, the sprint ends this upcoming Friday.
If the blocker is not resolved, a revert is recommended

But @aduffeck is informed, and I think he will handle this just in time (:

@AlexAndBear
Copy link
Copy Markdown
Member

AlexAndBear commented Mar 21, 2026

I made the following changes upon yours:

  • Fix the favorite false positive state in search
  • Changed the icon fill type to line
  • Adjusted the no content message
  • Added the action to spaces disabled for now
  • Added to batch actions
  • Added batch actions to favorites page

@pascalwengerter
Copy link
Copy Markdown
Contributor Author

@AlexAndBear can/will you take over? Backend update seems to have landed, and not sure how much time I can dedicate to this the following days

@AlexAndBear
Copy link
Copy Markdown
Member

@pascalwengerter Yes 🙌

I asked the team to do the review. Spaces will not yet be supported but later in the upcoming sprint.

Thank you so much 😊

Copy link
Copy Markdown
Member

@kulmann kulmann left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Wow, nice! 🤩 Thank you @pascalwengerter for contributing this and @AlexAndBear for all your work that went into this PR! ❤️

The only thing I found a bit weird is that the context actions don't close the context menu. I know that we did that on purpose back in the days, but it doesn't feel good (anymore?)... could you please remove that behaviour and just let the context menu close itself when the favorite toggle in the context menu was clicked?

<span v-text="$gettext('Nothing marked as favorite, yet')" />
</template>
<template #callToAction>
<span v-text="$gettext('All your favorites will show up here')" />
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

tempted to propose All your base are belong to us 🙈

@AlexAndBear AlexAndBear merged commit 8d259d8 into opencloud-eu:main Mar 24, 2026
28 checks passed
@openclouders openclouders mentioned this pull request Mar 24, 2026
1 task
@pascalwengerter pascalwengerter deleted the favorites-graph-api branch March 24, 2026 15:46
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Toggle favorites Tiles view: Favorites Favorites status indicator

3 participants