From 9f271c99af21d7c57da6ab2d7af021d2618af210 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?John=20Molakvo=C3=A6?= Date: Fri, 18 Aug 2023 19:05:13 +0200 Subject: [PATCH 1/2] fix: getNewFileMenuEntries usage MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: John Molakvoæ --- lib/index.ts | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/lib/index.ts b/lib/index.ts index 73389834..425eccb9 100644 --- a/lib/index.ts +++ b/lib/index.ts @@ -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' @@ -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) } From e7cd5e3dec8f78c7f71a45778a757034e92038f1 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?John=20Molakvo=C3=A6?= Date: Fri, 18 Aug 2023 19:57:38 +0200 Subject: [PATCH 2/2] fix: View read-only props MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: John Molakvoæ --- lib/navigation/view.ts | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) diff --git a/lib/navigation/view.ts b/lib/navigation/view.ts index 8ea50d21..fe43aa98 100644 --- a/lib/navigation/view.ts +++ b/lib/navigation/view.ts @@ -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 } @@ -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 }