Skip to content

[F2V] Files views API + navigation + base structure #30070

Closed

Description

@skjnldsv

This ticket is part of the files to vue migration

Goal

Have the base files view and router

QA

  • No design changes (other than finally using existing vue components)
  • API for base: OCA.Files
  • API for views: OCA.Files.Views
  • Navigation
    • List registered views
    • Nested views
    • Use the same routes as before / redirect to the new routes
  • Main content should stay empty until the other FilesList module gets finalized

  • Settings [split: @skjnldsv]
    • In a Modal straight away like Talk
    • Hidden file toggle
    • Crop image preview toggle
    • API: Toggle settings (workspace, recommendations...)
    • Webdav + documentation link

Views API sample and discussion

  • Name and actions columns are hardcoded first ⚠️
  • Views can decide what columns to add/remove (after the actions column)
/**
 * Open a file on the files app (after init)
 *
 * @param {string} path the path to the file or folder
 * @param {string} [view = 'main'] the view to open the files into
 * @return {Promise}
 */
OCA.Files.open(path: string, view: string = 'main'): Promise

// Creates a new view, sanitize data, throw if invalid or missing prop
const view = new OCA.Files.View({...})

/**
 * Register a new view
 *
 * @param {View} view the view to register
 * @throw Exception if already registered under same id
 */
OCA.Files.Views.register(view)

/**
 * Return the list of registered valid views * @return {View[]}
 */
OCA.Files.Views.get(): View[]
{
	id: 'files',
	name: 'All files',
	getFiles([path = '/']): FileInfo[],
	icon: (VueComponent|string): 'icon-files',
	order: 1,
	columns: [
		{
			name: t('files', 'Size'),
			id: 'size',
			property: 'size',
			[sortFunction: (FileInfoA, FileInfoB) => integer],
			[summary: (FileInfo[]) => string],
			[tooltip: (FileInfo) => string],
		}
		// ... other columns
	],
	[emptyView: VueComponent], // Like an EmptyContent
	[parent: 'id'],
	[sticky: false],
}

Activity

  1. added this to the Nextcloud 24 milestone on Dec 3, 2021
  2. added and removed
    1. to developAccepted and waiting to be taken care of
    on Feb 5, 2023
  3. added
    4. to releaseReady to be released and/or waiting for tests to finish
    and removed on Apr 11, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Labels

4. to releaseReady to be released and/or waiting for tests to finishenhancement

Type

No type

Projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions