Readonly
allAll the locales available to use.
const store = useAppRootStore()
console.log(`All the supported locales are ${store.allLocales}`)
Readonly
appThe current main application being rendered by the shell or undefined if there is no application view loaded.
Readonly
appsThe currently installed applications.
Optional
Readonly
currentThe record for for the currently logged in user.
Readonly
historyThe shell's history for the main view.
const store = useAppRootStore()
store.history.pushState({ query: 'site and geoCity == "Brighton and Hove"' })
Readonly
historyThe shell's history for the sidebar view.
const store = useAppRootStore()
store.history.pushState({ query: 'site and geoCity == "Brighton and Hove"' })
Readonly
localeThe current locale being used.
const store = useAppRootStore()
console.log(`The current user's locale is ${store.locale}`)
The current loaded project.
Setting this will change the project currently being used.
const store = useAppRootStore()
console.log(`The project name is ${store.project}`)
// Select a different project...
store.project = 'foo'
Readonly
sidebarThe current sidebar application being rendered by the shell or undefined if there is no sidebar application view loaded.
A boolean flag used to toggle whether the sidebar is open or not.
Changing this will toggle whether the sidebar is showing or not.
const store = useAppRootStore()
if (store.sidebarOpen) {
...
}
// Close the sidebar...
store.sidebarOpen = false
The current context's target. An empty string means no target is currently selected.
Changing this will also change the target.
const store = useAppRootStore()
console.log(`The current target is ${store.target}`)
// Change the target...
const ref = HRef.make('p:foo:sometarget')
store.target = ref.value
The current context's target for the sidebar. An empty string means the sidebar's target will fallback to the main target.
Changing this will also change the target for the sidebar.
console.log(The current target is ${store.targetSidebar}
)
// Change the target for the sidebar... const ref = HRef.make('p:foo:sometarget') store.targetSidebar = ref.value
Return true if the current user has the specified access to an application.
The application's id.
The application's access level.
Opens an application's view in the main view.
const store = useAppRootStore()
// Open an app's main view
store.open('finUi.myApp.main', { param: 'some param' })
The id of the application view to open.
This is the application's full id i.e. myApp.myView
.
Optional
state: Record<string, unknown>The state to load for the application.
Opens an application in the sidebar view.
const store = useAppRootStore()
// Open an app's main view
store.open('finUi.myApp.main', { param: 'some param' })
The id of the application view to open.
This is the application's full id i.e. myApp.mySidebarView
.
Optional
state: Record<string, unknown>The state to load for the application.
Post a message to the system. The message will be received via an application's onMessage callback. Please note, an application also needs to declare the messages its interested in via messages.
const store = useAppRootStore()
store.postAppMessage('newMessage', { data: 'some data' })
The message to dispatch.
Optional
params: Record<string, unknown>The parameters for the message.
Register quicklinks for the current application view.
This is typically called in the main application's first render call...
...
render(props: AppProps) {
const store = useAppRootStore()
useEffect(() => {
store.registerQuicklinks({
foo: {
icon(): JSX.Element { return <MyIcon /> },
invoke() { console.log('Invoked quicklink') }
}
})
}, [])
...
}
The quicklinks to add.
Register dynamic sidebar application views. This is used to dynamically add temporary sidebar application views at runtime. These sidebar views are registered from a main application view. They are only available whilst the the current main application view is open.
...
render(props: AppProps) {
const store = useAppRootStore()
useEffect(() => {
store.registerSidebars({
myDynamicSidebar: {
icon(): JSX.Element { return <MyIcon /> },
render(): JSXElement { return <Foo /> }
}
})
}, [])
...
}
The sidebar views to add.
Unregister quicklinks for the current application view.
Please note, quicklinks are automatically unregistered when the current application view unloads.
```
...
const quicklinks = {
foo: {
icon(): JSX.Element { return
@param quicklinks The quicklinks to remove.
Unregister sidebars for an application. Only dynamic sidebars that were previously added via registerSidebars will be unregistered.
Please note, all dynamic sidebars are automatically unregistered when the current application view unloads.
...
const sidebars = {
myDynamicSidebar: {
icon(): JSX.Element { return <MyIcon /> },
render(): JSXElement { return <Foo /> }
}
}
...
render(props: AppProps) {
const store = useAppRootStore()
useEffect(() => {
store.registerSidebars(sidebars)
}, [])
...
<Button onClick={() => store.unregisterSidebars(sidebars)}>Remove sidebars</Button>
}
The sidebars to remove.
Generated using TypeDoc
The interface for the application's root store.
Use the
useAppRootStore()
hook to access the application's root store.