diff --git a/lib/navigation/view.ts b/lib/navigation/view.ts index 911aab327..bb0ebfe18 100644 --- a/lib/navigation/view.ts +++ b/lib/navigation/view.ts @@ -37,8 +37,12 @@ interface ViewData { getContents: (path: string) => Promise /** The view icon as an inline svg */ icon: string - /** The view order */ - order: number + + /** + * The view order. + * If not set will be natural sorted by view name. + */ + order?: number /** * Custom params to give to the router on click @@ -199,8 +203,8 @@ const isValidView = function(view: ViewData): boolean { throw new Error('View icon is required and must be a valid svg string') } - if (!('order' in view) || typeof view.order !== 'number') { - throw new Error('View order is required and must be a number') + if ('order' in view && typeof view.order !== 'number') { + throw new Error('View order must be a number') } // Optional properties