Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: getNewFileMenuEntries usage #734

Merged
merged 2 commits into from Aug 22, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
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 @@
return this._view.icon
}

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

Check warning on line 130 in lib/navigation/view.ts

View check run for this annotation

Codecov / codecov/patch

lib/navigation/view.ts#L130

Added line #L130 was not covered by tests
}

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

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

Check warning on line 138 in lib/navigation/view.ts

View check run for this annotation

Codecov / codecov/patch

lib/navigation/view.ts#L138

Added line #L138 was not covered by tests
}

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

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

Check warning on line 146 in lib/navigation/view.ts

View check run for this annotation

Codecov / codecov/patch

lib/navigation/view.ts#L146

Added line #L146 was not covered by tests
}

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

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

Check warning on line 170 in lib/navigation/view.ts

View check run for this annotation

Codecov / codecov/patch

lib/navigation/view.ts#L170

Added line #L170 was not covered by tests
}

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