Skip to content

Port FileList and other files app JS classes to Backbone #18211

Closed

Description

@PVince81

I am currently struggling a lot because it is close to impossible to cleanly synchronise model state between different views with the legacy files app JS code that mixes everything.

As of now we have not only the file list containing a representation of a file model but also the right sidebar. This is shouting for proper MV* and for that I'd like to port the FileList class to Backbone JS.

It would look like this:

  • FileInfoModel is a new model that contains file information (the format file info arrays)
  • FileInfoCollection contains an array of FileInfoModel
  • FileList class becomes FileListView and accepts a FileInfoCollection
  • any change / file action done from either the file list, controls bar or side bar will be done directly on FileInfoModel.
  • any view that displays the state of a file will listen to FileInfoModel.on('change', ...) events and update themselves to reflect the latest changes.
  • file actions are done directly on the model (and could be rewired later to use Webdav instead of the ajax/* endpoints) Move files app to use WebDAV instead of custom PHP endpoints #12353

This is what I am currently missing with the sidebar actions. One example is the star icon from the favorite file that needs to be displayed and actionable in both a file row and sidebar.

See #18178

Care needs to be taken to keep the subclasses of FileList compatible, like TrashbinFileList and the sharing overview lists.

CC @blizzz

Activity

  1. PVince81 commented on Aug 11, 2015

    @PVince81
    ContributorAuthor

    The FileActions class might need to be reworked too as it needs to work with FileInfoModel instances too in order to propagate the changes properly.

  2. added this to the backlog milestone on Mar 1, 2016
  3. PVince81 commented on Aug 18, 2016

    @PVince81
    ContributorAuthor

    posting more ideas I got today, slightly modified:

    • FileList becomes a View as the container of the whole table + header
    • FileInfoListView would be the table alone, with headers, etc ?
      • apps like tags, favorites, shares would provide their own
    • introduce FileInfoCollection and make FileList
      • FileInfoCollection.fetchNext would simply contain all files (for now) but only expose the current page ?
      • use filesClient for fetching or the backbone adapter ?
      • make it use REPORT later for pagination
    • rewire the views to react on collection events
    • rewire and deprecate methods like FileList.add() to call collection.add() directly
    • plugin system for FileInfoListView to provide more panels/views (gallery, tree, etc)
    • even further: provide a generic list view with selection, deletion, header support ? (for reuse with the users list)
    • file actions act directly on model, need multi-file selection; use command pattern ?
  4. PVince81 commented on Aug 22, 2016

    @PVince81
    ContributorAuthor

    WIP PR #25909

  5. PVince81 commented on Sep 15, 2016

    @PVince81
    ContributorAuthor

    Making good progress in the PR, decoupling FileList (the future FileListView) from the file actions and collection.

  6. PVince81 commented on Jun 7, 2018

    @PVince81
    ContributorAuthor

    Obsolete, will be rewritten (is already partly) in Phoenix: owncloud/web#150

  7. lock commented on Jul 30, 2019

    @lock

    This thread has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs.

  8. locked as resolved and limited conversation to collaborators on Jul 30, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions