Skip to main content
Brand and assets
Build
Monitor and contribute
/
Front-end platform
  • Overview
  • Technical architecture
  • Core framework
  • Application
  • global-shell
  • modular-arch
  • Product shells
  • Modules & apps
  • Module directory
  • Apps
  • Bundles
  • Bundle explorer
  • Guides
  • Install Murray
  • Universal components
  • Build a universal component
  • Responsive styles
  • RTL support
  • Translations & i18n
  • When to use Form
  • Positioning elements
  • Add a new icon
  • Utilities
  • Overview
  • Layouts
  • Product shells

Product shells

A product shell provides an out-of-the-box user experience tailored to a persona (admins, members, care ops). It supplies layouts, navigation, and enforces a cohesive UX so that domain features integrate seamlessly.

A shell is a module factory: it takes the persona's modules and configuration, and returns one standard Module the app registers like any other.

global-customer-dashboard​

The admin dashboard shell is the first product shell built on the Core framework.

Source: frontend/shared/global-customer-dashboard/

customerDashboardShell​

The exported shell factory. It takes the dashboard modules and the app's menu, and returns the dashboard module: the modules' screens under the dashboard layout, the sidebar as declared by menu.

import { customerDashboardShell } from "@alan-eu/global-customer-dashboard/module";

const dashboardModule = customerDashboardShell({
modules: [myDashboardModule, customerAdminManagementModule],
menu: {
main: {
order: 1,
label: () => tString("app:menu.main"),
items: ["employees", { item: "retirees", checkCapabilities: (c) => c.hasRetireeContracts }],
},
administrative: { order: 2, label: () => tString("app:menu.administrative"), items: ["admins"] },
},
OverlaySlot: MyOverlay,
useMenuCapabilities: useMyMenuCapabilities,
});

Each section lists its links in order, by the modules' menu item keys — checked at compile time against the modules' menuItems. An item can be gated with checkCapabilities.

CustomerDashboardModule​

Extends ShellModule<"admindashboard"> with an optional menuItems record. Modules declare their own menu items — the shell collects them and the app places them.

import type { CustomerDashboardModule } from "@alan-eu/global-customer-dashboard/module";

type CustomerDashboardModule = ShellModule<"admindashboard"> & {
menuItems?: Record<string, DashboardMenuItem>;
};

Options​

Other customerDashboardShell(config) fields:

FieldTypeDescription
OverlaySlotComponentTypeRendered on the menu'd dashboard pages, e.g. a floating help button
useActiveLanguagesActiveLanguagesHookHook returning the language options for the top nav (runs at render time, after i18n init)
useMenuCapabilities() => CapabilitiesMapMenu-only capability facts merged on top of the app's useCapabilitiesHook for checkCapabilities

Provided layouts​

The shell provides several layouts that features reference via ScreenWithLayout:

LayoutUse case
CustomerDashboardLayoutStandard two-column layout with sidebar, top nav, and content area
CustomerDashboardFullPageLayoutFull-page modal overlay
CustomerDashboardAdHocPageLayoutMinimal wrapper for custom layouts

rootPath​

The shell's base path is exported as rootPath ("dashboard/company"). Use it to build the homePage of your application:

<GlobalApp homePage={`/${rootPath}/admins`} api={api} modules={myModules} />

Writing a dashboard feature​

A dashboard feature is a CustomerDashboardModule. Its screens reference shell layouts, and it declares its own menu items.

import type { CustomerDashboardModule } from "@alan-eu/global-customer-dashboard/module";
import { CustomerDashboardPageLayout } from "@alan-eu/global-customer-dashboard/shared-layout/CustomerDashboardPageLayout";

export const myDashboardFeature: CustomerDashboardModule = {
__moduleType: "admindashboard",
name: "my-feature",
translations: {
namespace: "myFeature",
resources: {
fr: require("./translations/fr.json"),
en: require("./translations/en.json"),
},
},
screens: {
"my-page": {
path: "my-page",
screen: {
layout: CustomerDashboardPageLayout,
props: {
children: <MyPage />,
title: tString("myFeature:pageTitle"),
},
},
},
},
menuItems: {
myPage: {
relativePath: "my-page",
iconVisual: "MyIcon",
label: () => tString("myFeature:menuLabel"),
},
},
};

customerDashboardShell automatically:

  1. Collects screens from the given CustomerDashboardModules
  2. Builds the sidebar from menu, resolving each item key against the modules' menuItems
  3. Routes screens under the correct layout based on the layout component reference
  4. Sets up the sidebar, top navigation, and entity context
Edit this page
Previous
modular-arch
Next
Apps
  • global-customer-dashboard
    • customerDashboardShell
    • CustomerDashboardModule
    • Options
    • Provided layouts
    • rootPath
  • Writing a dashboard feature