Registering Home Page options
// base interface with some common properties
interface HomePageBase {
key: string
label: string
existsOnMenu: boolean
permissions?: string[]
}
// renders custom component provided in the Page property
interface CustomComponentPage extends HomePageBase {
existsOnMenu: false
Page: React.ComponentType
}
// redirects to page that already exists on Live's menu
interface ExistingPage extends HomePageBase {
existsOnMenu: true
url: string
}
// redirects to the existing page of a specific instance of an entity
interface EntityPage extends HomePageBase {
existsOnMenu: true
entityData: {
endpoint: string
idToEndpoint: (id: string) => string
resultsToLabelAndValue: (
endpointResults: unknown
) => {
label: string
value: string
}[]
idToUrl: (id: string) => string
hasPermission: (
entity: unknown,
successFetching: boolean,
userPermissions: string[],
userPerspectiveIds: string[] | 'all',
error?: unknown
) => boolean
}
}
// final union type
type HomePage = CustomComponentPage | ExistingPage | EntityPageParameter
Description
Parameter
Description
Examples

Last updated