Add workbench tabs (#6788)

Signed-off-by: Kristina Fefelova <kristin.fefelova@gmail.com>
This commit is contained in:
Kristina
2024-10-03 01:49:49 +07:00
committed by GitHub
parent ce2621d472
commit b5fed4879f
36 changed files with 794 additions and 69 deletions
+19 -2
View File
@@ -30,6 +30,15 @@ import { ViewAction } from '@hcengineering/view'
/**
* @public
*/
export interface LocationData {
name?: string
nameIntl?: IntlString
icon?: Asset
iconComponent?: AnyComponent
iconProps?: Record<string, any>
}
export interface Application extends Doc {
label: IntlString
alias: string
@@ -42,6 +51,7 @@ export interface Application extends Doc {
aside?: AnyComponent
locationResolver?: Resource<(loc: Location) => Promise<ResolvedLocation | undefined>>
locationDataResolver?: Resource<(loc: Location) => Promise<LocationData>>
// Component will be displayed in case navigator model is not defined, or nothing is selected in navigator model
component?: AnyComponent
@@ -102,6 +112,11 @@ export interface TxSidebarEvent<T extends Record<string, any> = Record<string, a
params: T
}
export interface WorkbenchTab extends Preference {
location: string
isPinned: boolean
}
/**
* @public
*/
@@ -201,7 +216,8 @@ export default plugin(workbenchId, {
HiddenApplication: '' as Ref<Class<HiddenApplication>>,
Widget: '' as Ref<Class<Widget>>,
WidgetPreference: '' as Ref<Class<WidgetPreference>>,
TxSidebarEvent: '' as Ref<Class<TxSidebarEvent<Record<string, any>>>>
TxSidebarEvent: '' as Ref<Class<TxSidebarEvent<Record<string, any>>>>,
WorkbenchTab: '' as Ref<Class<WorkbenchTab>>
},
mixin: {
SpaceView: '' as Ref<Mixin<SpaceView>>
@@ -238,7 +254,8 @@ export default plugin(workbenchId, {
NavigationExpandedDefault: '' as Metadata<boolean>
},
extensions: {
WorkbenchExtensions: '' as ComponentExtensionId
WorkbenchExtensions: '' as ComponentExtensionId,
WorkbenchTabExtensions: '' as ComponentExtensionId
},
actionImpl: {
Navigate: '' as ViewAction<{