Skip to content
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

NcRelatedResourcesPanel click on resourse within one provider reloads a page #4537

Closed
Antreesy opened this issue Sep 18, 2023 · 8 comments
Closed
Labels
0. to triage enhancement New feature or request feature: related resources panel Related to the NcRelatedResourcesPanel component

Comments

@Antreesy
Copy link
Contributor

Issue description

<NcResource/> renders as a <NcButton/> component with a following prop:

which transforms it to a <a/> link. Thus, if you click on a <conversation_name> button inside of Talk app (Shared items tab), it reloads page, instead of switching conversation

Possible solution

<NcButton/> has a support of using <RouterLink/> with to prop, so could be done with a check, that global prop providerId matches with resource field providerId (and matches 'talk', if it's the only case for Talk app)

@Antreesy Antreesy added enhancement New feature or request 0. to triage feature: related resources panel Related to the NcRelatedResourcesPanel component labels Sep 18, 2023
@Pytal
Copy link
Contributor

Pytal commented Sep 27, 2023

Proposed solutions sounds good :)

Would this implementation be useful in files @skjnldsv and deck @juliushaertl as well?

@skjnldsv
Copy link
Contributor

Not sure I get the context? 🤔

@Antreesy
Copy link
Contributor Author

Antreesy commented Sep 27, 2023

So, in two words, this component shouldn't reload a page, when click on different conversation:
image

It is used also only in Deck atm, if I get it correct:
https://github.com/nextcloud/deck/blob/e8dd28752867acde15944e4d00c53caeb6570e3f/src/components/board/SharingTabSidebar.vue#L79

@skjnldsv
Copy link
Contributor

The only thing I could think of is creating a global router that plugs into various apps to see if a clicked link does have a router match somewhere and if so, catch the page refresh. 🤔

@Pytal
Copy link
Contributor

Pytal commented Sep 27, 2023

The only thing I could think of is creating a global router that plugs into various apps to see if a clicked link does have a router match somewhere and if so, catch the page refresh. 🤔

The intention was to scope this per app I believe

It is used also only in Deck atm, if I get it correct: nextcloud/deck@e8dd287/src/components/board/SharingTabSidebar.vue#L79

The files panel is registered in the related_resources app itself https://github.com/search?type=code&q=org%3Anextcloud+%22NcRelatedResourcesPanel%22 fyi @Antreesy

@skjnldsv
Copy link
Contributor

The intention was to scope this per app I believe

But the NcResource.vue is standalone, no?
Might be worth thinking about this 🤷

@Antreesy
Copy link
Contributor Author

The only thing I could think of is creating a global router

If that also helps to cover such app parts and cases, as UnifiedSearch / internal links in Talk messages, I'd like to try it out

Otherwise, and for that particular case, I think, 5 lines of changes locally would be sufficient

@Antreesy
Copy link
Contributor Author

Fixed by #5282

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
0. to triage enhancement New feature or request feature: related resources panel Related to the NcRelatedResourcesPanel component
Projects
None yet
Development

No branches or pull requests

3 participants