@camunda/camunda-composite-components 0.22.6 → 0.22.7
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/lib/esm/package.json +1 -1
- package/lib/esm/src/components/c3-navigation/c3-navigation-appbar/c3-navigation-appbar.js +8 -1
- package/lib/esm/src/components/c3-navigation/c3-navigation-sidebar/c3-navigation-sidebar.types.d.ts +1 -0
- package/lib/esm/src/components/c3-navigation/c3-navigation.js +4 -1
- package/lib/esm/src/components/c3-navigation/c3-navigation.test.js +4 -0
- package/lib/esm/src/components/c3-navigation/stories/story-helpers.d.ts +1 -0
- package/lib/esm/src/components/c3-navigation/stories/story-helpers.js +1 -0
- package/package.json +1 -1
package/lib/esm/package.json
CHANGED
|
@@ -334,7 +334,14 @@ export const C3NavigationAppBar = ({ app: appProps, appBar, forwardRef, navbar,
|
|
|
334
334
|
}
|
|
335
335
|
setAppElements(defaultElements);
|
|
336
336
|
}, [clusters, currentApp, domain, handleSuperOrg]);
|
|
337
|
-
const
|
|
337
|
+
const hasExtraAppBarElements = (appBar.extraElements?.length ?? 0) > 0;
|
|
338
|
+
const appBarElements = appBar.elements
|
|
339
|
+
? appBar.elements
|
|
340
|
+
: clusters || clustersByOrgId
|
|
341
|
+
? [...appElements, ...(appBar.extraElements ?? [])]
|
|
342
|
+
: hasExtraAppBarElements
|
|
343
|
+
? appBar.extraElements
|
|
344
|
+
: null;
|
|
338
345
|
const [isOrgPickerModalOpen, setIsOrgPickerModalOpen] = useState(false);
|
|
339
346
|
const orgName = activeOrg?.name || navbar.orgName;
|
|
340
347
|
return (_jsxs(_Fragment, { children: [_jsx(HeaderGlobalAction, { ref: iconRef, "aria-label": 'Camunda components', isActive: appBar.isOpen, onClick: () => {
|
package/lib/esm/src/components/c3-navigation/c3-navigation-sidebar/c3-navigation-sidebar.types.d.ts
CHANGED
|
@@ -64,6 +64,7 @@ export type C3NavigationNotificationsSideBarProps = C3NavigationSideBarBaseProps
|
|
|
64
64
|
type AppTeaserRouteProps = any;
|
|
65
65
|
export type C3NavigationAppBarProps = Omit<C3NavigationSideBarBaseProps, 'tooltip'> & {
|
|
66
66
|
type: 'app';
|
|
67
|
+
extraElements?: C3NavigationElementProps[];
|
|
67
68
|
appTeaserRouteProps?: {
|
|
68
69
|
operate?: AppTeaserRouteProps;
|
|
69
70
|
tasklist?: AppTeaserRouteProps;
|
|
@@ -70,10 +70,13 @@ const LICENSE_EXPIRY = DAY * 30;
|
|
|
70
70
|
export const C3Navigation = ({ app, appBar, forwardRef, navbar, orgSideBar, infoSideBar, infoButton, helpCenter, actionButtons, userSideBar, notificationSideBar, clusterUuid, options, }) => {
|
|
71
71
|
const { openHelpCenter } = useC3HelpCenter();
|
|
72
72
|
const { currentClusterUuid, decodedAudience } = useC3UserConfiguration();
|
|
73
|
-
const { activeOrg } = useC3Profile();
|
|
73
|
+
const { activeOrg, isEnabled } = useC3Profile();
|
|
74
74
|
const isLargeScreen = useMediaQuery(`(min-width: ${BREAKPOINT_LG_WIDTH}`);
|
|
75
75
|
const appBarElementsLength = appBar.elements?.length ?? 0;
|
|
76
|
+
const appBarExtraElementsLength = appBar.extraElements?.length ?? 0;
|
|
76
77
|
const displayAppBar = !!(appBarElementsLength > 0 ||
|
|
78
|
+
appBarExtraElementsLength > 0 ||
|
|
79
|
+
isEnabled ||
|
|
77
80
|
appBar.appTeaserRouteProps ||
|
|
78
81
|
(!isLargeScreen && navbar.elements.length > 0));
|
|
79
82
|
const [appBarOpen, setAppBarOpen] = useState(appBar.isOpen || false);
|
|
@@ -14,6 +14,10 @@ test.describe('Navigation', () => {
|
|
|
14
14
|
await getStory(page, 'uishell-c3navigation--app-bar-opened');
|
|
15
15
|
await expect(page).toHaveScreenshot();
|
|
16
16
|
});
|
|
17
|
+
test('App bar opened with extra elements', async ({ page }) => {
|
|
18
|
+
await getStory(page, 'uishell-c3navigation--app-bar-opened-with-extra-elements');
|
|
19
|
+
await expect(page).toHaveScreenshot();
|
|
20
|
+
});
|
|
17
21
|
test('Org bar open', async ({ page }) => {
|
|
18
22
|
await getStory(page, 'uishell-c3navigation--org-side-bar-opened');
|
|
19
23
|
await expect(page).toHaveScreenshot();
|
|
@@ -5,6 +5,7 @@ export declare function createAppProps(): C3NavigationAppProps;
|
|
|
5
5
|
export declare function createAppBarProps(options?: {
|
|
6
6
|
isOpen?: boolean;
|
|
7
7
|
elements?: Array<C3NavigationElementProps>;
|
|
8
|
+
extraElements?: Array<C3NavigationElementProps>;
|
|
8
9
|
useElementsFromConfig?: boolean;
|
|
9
10
|
}): C3NavigationProps['appBar'];
|
|
10
11
|
export declare function createNavBarBarProps({ orgName, elements, showLicenseTag, showProductionLicense, isCommercial, expiresAt, }?: {
|