diff options
author | John Molakvoæ <skjnldsv@protonmail.com> | 2023-08-09 14:59:35 +0200 |
---|---|---|
committer | John Molakvoæ <skjnldsv@protonmail.com> | 2023-08-17 18:56:37 +0200 |
commit | 410f58e43e8db767eaf0b272ab6ffde1841cd6a2 (patch) | |
tree | 5f0d2812ce7cce75b6b72c3652c81f7ae3c26bfd /apps/files/src/services | |
parent | 998b3a2581fb873b03bcf4dc02eafb19390b3cd6 (diff) | |
download | nextcloud-server-410f58e43e8db767eaf0b272ab6ffde1841cd6a2.tar.gz nextcloud-server-410f58e43e8db767eaf0b272ab6ffde1841cd6a2.zip |
chore(files): add Headers, remove legacy methods and cleanup
Signed-off-by: John Molakvoæ <skjnldsv@protonmail.com>
Diffstat (limited to 'apps/files/src/services')
-rw-r--r-- | apps/files/src/services/Navigation.ts | 39 |
1 files changed, 6 insertions, 33 deletions
diff --git a/apps/files/src/services/Navigation.ts b/apps/files/src/services/Navigation.ts index 56d3ba0b97d..8f8212783ca 100644 --- a/apps/files/src/services/Navigation.ts +++ b/apps/files/src/services/Navigation.ts @@ -96,22 +96,9 @@ export interface Navigation { * haven't customized their sorting column */ defaultSortKey?: string - - /** - * This view is sticky a legacy view. - * Here until all the views are migrated to Vue. - * @deprecated It will be removed in a near future - */ - legacy?: boolean - - /** - * An icon class. - * @deprecated It will be removed in a near future - */ - iconClass?: string } -export default class { +export class NavigationService { private _views: Navigation[] = [] private _currentView: Navigation | null = null @@ -131,14 +118,6 @@ export default class { throw e } - if (view.legacy) { - logger.warn('Legacy view detected, please migrate to Vue') - } - - if (view.iconClass) { - view.legacy = true - } - this._views.push(view) } @@ -192,18 +171,12 @@ const isValidNavigation = function(view: Navigation): boolean { 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 - */ - if (!view.legacy) { - if (!view.getContents || typeof view.getContents !== 'function') { - throw new Error('Navigation getContents is required and must be a function') - } + if (!view.getContents || typeof view.getContents !== 'function') { + throw new Error('Navigation getContents is required and must be a function') + } - if (!view.icon || typeof view.icon !== 'string' || !isSvg(view.icon)) { - throw new Error('Navigation icon is required and must be a valid svg string') - } + if (!view.icon || typeof view.icon !== 'string' || !isSvg(view.icon)) { + throw new Error('Navigation icon is required and must be a valid svg string') } if (!('order' in view) || typeof view.order !== 'number') { |