nextcloud / nextcloud/server

Files Sharing javascript cleanup

Open
#874 3 comments 2 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

1. to develop feature: sharing help wanted standardization technical debt
Dominant language
PHP
Stars
36.9k
Forks
5.2k
Avg merge
2d 3h
Merged PRs (30d)
713

Description

As a leftover of times long gone there is still a lot of sharing code all over te place. This issue focues on the javascript part.

  • Sidebar code is in the files_sharing app
  • ShareModel and views are in core
  • ShareModel depends on the OCS Sharing API which lives in files_sharing

We should define a proper separation between what is in core and what is not. Kind of like we do on the PHP side as well. The sharemanager is in core. But the share providers (should) live in the different apps. We could do the same with the javascript:

  • Have a kind of share manager where apps can register
    • This is just a collection of collections
  • Items models live in their own apps
  • Views don't live in core since each app might want to display different stuff.
  • We also need to split sharee loading then??

In short this makes the js part somewhat modular. If an other app wants to use sharing functionality it can use the 'manager' in OC.Share.ShareManager (or whatever). And trough that it will automagically get access to all the fancy stuff it can do.

CC: @oparoz as this is kind of your JS API you have been asking for

CC: @schiessle @nickvergessen @MorrisJobke @icewind1991 any input idea's?

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start by mapping the JavaScript in the files_sharing app and core, including ShareModel, its views, the OCS Sharing API, and the proposed OC.Share.ShareManager entry point. Review how sidebar code, sharee loading, models, and views currently depend on each other. Done means the sharing JavaScript is modular, with app-owned models and views and a core manager that apps can register with.

Written by the indexing model from the issue text.

Assessment

Tech stack
javascript
Domain
frontend
Issue type
Refactor
Difficulty
5/5
Estimated time
Over a week
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
20/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.