diff options
author | John Molakvoæ <skjnldsv@protonmail.com> | 2023-06-30 10:59:00 +0200 |
---|---|---|
committer | John Molakvoæ <skjnldsv@protonmail.com> | 2023-07-05 16:20:34 +0200 |
commit | 7929ad4a9303d4f184e56f95fc89347519a164e4 (patch) | |
tree | b84fb815e78f888bb4456b4def7ef66552bcf59a | |
parent | 047218b5b08089c8455a37f9983ccb7047a10d25 (diff) | |
download | nextcloud-server-7929ad4a9303d4f184e56f95fc89347519a164e4.tar.gz nextcloud-server-7929ad4a9303d4f184e56f95fc89347519a164e4.zip |
feat: add caption prop
Signed-off-by: John Molakvoæ <skjnldsv@protonmail.com>
-rw-r--r-- | apps/files/src/services/Navigation.ts | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/apps/files/src/services/Navigation.ts b/apps/files/src/services/Navigation.ts index b2ae3b0b973..e85bd39ed81 100644 --- a/apps/files/src/services/Navigation.ts +++ b/apps/files/src/services/Navigation.ts @@ -49,6 +49,8 @@ export interface Navigation { id: string /** Translated view name */ name: string + /** Translated view accessible description */ + caption?: string /** * Method return the content of the provided path * This ideally should be a cancellable promise. @@ -171,6 +173,11 @@ const isValidNavigation = function(view: Navigation): boolean { throw new Error('Navigation name is required and must be a string') } + if (view.columns && view.columns.length > 0 + && (!view.caption || typeof view.caption !== 'string')) { + throw new Error('Navigation caption is required for top-level views and must be a string') + } + /** * Legacy handle their content and icon differently * TODO: remove when support for legacy views is removed |