From 410f58e43e8db767eaf0b272ab6ffde1841cd6a2 Mon Sep 17 00:00:00 2001 From: John Molakvoæ Date: Wed, 9 Aug 2023 14:59:35 +0200 Subject: chore(files): add Headers, remove legacy methods and cleanup MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: John Molakvoæ --- apps/files/src/services/Navigation.ts | 39 ++++++----------------------------- 1 file changed, 6 insertions(+), 33 deletions(-) (limited to 'apps/files/src/services') 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') { -- cgit v1.2.3