Skip to content

Commit

Permalink
feat(new-menu): Allow to set the category for entries
Browse files Browse the repository at this point in the history
Signed-off-by: Ferdinand Thiessen <opensource@fthiessen.de>
  • Loading branch information
susnux committed May 16, 2024
1 parent 4b8160f commit 9d59fc5
Showing 1 changed file with 23 additions and 0 deletions.
23 changes: 23 additions & 0 deletions lib/newFileMenu.ts
Original file line number Diff line number Diff line change
Expand Up @@ -23,10 +23,33 @@
import type { Folder, Node } from './index'
import logger from './utils/logger'

export enum NewMenuEntryCategory {
/**
* For actions where the user is intended to upload from their device
*/
UploadFromDevice = 0,
/**
* For actions that create new nodes on the server without uploading
*/
CreateNew = 1,
/**
* For everything not matching the other categories
*/
Other = 2,
}

export interface Entry {
/** Unique ID */
id: string

/**
* Category to put this entry in
* (supported since Nextcloud 30)
* @since 3.3.0
* @default EntryCategory.CreateNew
*/
category?: NewMenuEntryCategory

/** Translatable string displayed in the menu */
displayName: string

Expand Down

0 comments on commit 9d59fc5

Please sign in to comment.