Skip to content

Commit

Permalink
Merge pull request #734 from nextcloud-libraries/fix/getNewFileMenuEn…
Browse files Browse the repository at this point in the history
…tries
  • Loading branch information
skjnldsv committed Aug 22, 2023
2 parents c1a8c8e + e7cd5e3 commit 856a665
Show file tree
Hide file tree
Showing 2 changed files with 21 additions and 3 deletions.
8 changes: 5 additions & 3 deletions lib/index.ts
Expand Up @@ -22,7 +22,8 @@
*/

import { type Entry, getNewFileMenu } from './newFileMenu'
import { Folder } from './files/folder'
import { type Folder } from './files/folder'
import { type View } from './navigation/view'

export { formatFileSize } from './humanfilesize'
export { FileAction, getFileActions, registerFileAction, DefaultType } from './fileAction'
Expand Down Expand Up @@ -67,8 +68,9 @@ export const removeNewFileMenuEntry = function(entry: Entry | string) {
* Get the list of registered entries from the upload menu
*
* @param {Folder} context the creation context. Usually the current folder FileInfo
* @param {View} view the current view
*/
export const getNewFileMenuEntries = function(context?: Folder) {
export const getNewFileMenuEntries = function(context?: Folder, view?: View) {
const newFileMenu = getNewFileMenu()
return newFileMenu.getEntries(context)
return newFileMenu.getEntries(context, view)
}
16 changes: 16 additions & 0 deletions lib/navigation/view.ts
Expand Up @@ -126,14 +126,26 @@ export class View implements ViewData {
return this._view.icon
}

set icon(icon) {
this._view.icon = icon
}

get order() {
return this._view.order
}

set order(order) {
this._view.order = order
}

get params() {
return this._view.params
}

set params(params) {
this._view.params = params
}

get columns() {
return this._view.columns
}
Expand All @@ -154,6 +166,10 @@ export class View implements ViewData {
return this._view.expanded
}

set expanded(expanded: boolean | undefined) {
this._view.expanded = expanded
}

get defaultSortKey() {
return this._view.defaultSortKey
}
Expand Down

0 comments on commit 856a665

Please sign in to comment.