@camunda/camunda-composite-components 0.3.1-rc.13 → 0.3.1-rc.14
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/api/profile.d.ts +1 -2
- package/lib/esm/components/c3-help-center/c3-help-center-provider.d.ts +6 -0
- package/lib/esm/components/c3-help-center/c3-help-center-provider.js +20 -1
- package/lib/esm/components/c3-help-center/c3-help-center.js +4 -1
- package/lib/esm/components/c3-help-center/c3-help-center.types.d.ts +13 -0
- package/lib/esm/components/c3-help-center/help-center-hint.d.ts +3 -0
- package/lib/esm/components/c3-help-center/help-center-hint.js +17 -0
- package/lib/esm/components/c3-navigation/{c3-navigation-appbar/c3-navigation-appbar.d.ts → c3-navigation-appbar.d.ts} +1 -1
- package/lib/esm/components/c3-navigation/{c3-navigation-appbar/c3-navigation-appbar.js → c3-navigation-appbar.js} +20 -69
- package/lib/esm/components/c3-navigation/c3-navigation-sidebar/c3-navigation-sidebar.types.d.ts +0 -9
- package/lib/esm/components/c3-navigation/c3-navigation-sidebar/c3-notification-sidebar.js +1 -1
- package/lib/esm/components/c3-navigation/c3-navigation.js +7 -9
- package/lib/esm/components/c3-navigation/story-helpers.d.ts +0 -1
- package/lib/esm/components/c3-navigation/story-helpers.js +41 -64
- package/lib/esm/components/c3-onboarding-survey/onboardingSurvey.js +3 -0
- package/lib/esm/components/c3-user-configuration/c3-profile-provider/c3-profile-provider.d.ts +1 -1
- package/lib/esm/components/c3-user-configuration/c3-profile-provider/c3-profile-provider.js +0 -3
- package/lib/esm/components/c3-user-configuration/c3-user-configuration-provider.d.ts +0 -1
- package/lib/esm/index.d.ts +2 -4
- package/lib/esm/index.js +1 -3
- package/package.json +1 -1
- package/lib/esm/assets/appTeaserPreviews.d.ts +0 -3
- package/lib/esm/assets/appTeaserPreviews.js +0 -3
- package/lib/esm/components/c3-app-teaser/app-teaser-cards.d.ts +0 -17
- package/lib/esm/components/c3-app-teaser/app-teaser-cards.js +0 -25
- package/lib/esm/components/c3-app-teaser/app-teaster-card.d.ts +0 -14
- package/lib/esm/components/c3-app-teaser/app-teaster-card.js +0 -19
- package/lib/esm/components/c3-app-teaser/c3-app-teaser-page.d.ts +0 -6
- package/lib/esm/components/c3-app-teaser/c3-app-teaser-page.js +0 -20
- package/lib/esm/components/c3-app-teaser/c3-app-teaser.d.ts +0 -10
- package/lib/esm/components/c3-app-teaser/c3-app-teaser.js +0 -58
- package/lib/esm/components/c3-navigation/c3-navigation-appbar/components.d.ts +0 -277
- package/lib/esm/components/c3-navigation/c3-navigation-appbar/components.js +0 -15
- package/lib/esm/utils/camunda.d.ts +0 -7
- package/lib/esm/utils/camunda.js +0 -17
- package/lib/esm/utils/camunda.types.d.ts +0 -43
- package/lib/esm/utils/camunda.types.js +0 -1
- /package/lib/esm/{assets → icons}/c3-icons.d.ts +0 -0
- /package/lib/esm/{assets → icons}/c3-icons.js +0 -0
- /package/lib/esm/{assets → icons}/c3-icons.types.d.ts +0 -0
- /package/lib/esm/{assets → icons}/c3-icons.types.js +0 -0
package/lib/esm/api/profile.d.ts
CHANGED
|
@@ -1,7 +1,6 @@
|
|
|
1
1
|
import { C3NotificationsProps } from "../components/c3-navigation/c3-navigation.types";
|
|
2
2
|
import { Theme } from "../components/c3-user-configuration/c3-profile-provider/c3-profile-provider";
|
|
3
|
-
import { Organization } from "../
|
|
4
|
-
import { Cluster } from "../utils/camunda.types";
|
|
3
|
+
import { Cluster, Organization } from "../components/c3-help-center/c3-help-center.types";
|
|
5
4
|
export type Profile = {
|
|
6
5
|
theme: Theme;
|
|
7
6
|
};
|
|
@@ -1,9 +1,15 @@
|
|
|
1
1
|
import React, { FC, PropsWithChildren } from "react";
|
|
2
|
+
import { HelpCenterHintType } from "./help-center-hint";
|
|
2
3
|
export type C3HelpCenterContextValue = {
|
|
3
4
|
openHelpCenter: (showTabId?: string) => void;
|
|
4
5
|
setIsHelpCenterOpen: (isOpen: boolean) => void;
|
|
5
6
|
isHelpCenterOpen: boolean;
|
|
6
7
|
showTabId?: string | null;
|
|
8
|
+
showHint: boolean;
|
|
9
|
+
setShowHint: (showHint: boolean) => void;
|
|
10
|
+
setShowHintOnClose: (showHintOnClose: boolean) => void;
|
|
11
|
+
hintType: HelpCenterHintType;
|
|
12
|
+
setHintType: (hintType: HelpCenterHintType) => void;
|
|
7
13
|
};
|
|
8
14
|
export declare const C3HelpCenterContext: React.Context<C3HelpCenterContextValue>;
|
|
9
15
|
export declare const C3HelpCenterProvider: FC<PropsWithChildren>;
|
|
@@ -3,26 +3,45 @@ export const C3HelpCenterContext = React.createContext({
|
|
|
3
3
|
openHelpCenter: () => undefined,
|
|
4
4
|
setIsHelpCenterOpen: () => undefined,
|
|
5
5
|
isHelpCenterOpen: false,
|
|
6
|
+
showHint: false,
|
|
7
|
+
setShowHint: () => undefined,
|
|
8
|
+
setShowHintOnClose: () => undefined,
|
|
9
|
+
hintType: "onboarding",
|
|
10
|
+
setHintType: () => undefined,
|
|
6
11
|
});
|
|
7
12
|
export const C3HelpCenterProvider = ({ children }) => {
|
|
8
13
|
const [isHelpCenterOpen, setIsHelpCenterOpen] = useState(false);
|
|
9
14
|
const [activeTabId, setActiveTabId] = useState(null);
|
|
15
|
+
const [showHint, setShowHint] = useState(false);
|
|
16
|
+
const [showHintOnClose, setShowHintOnClose] = useState(false);
|
|
17
|
+
const [hintType, setHintType] = useState("onboarding");
|
|
10
18
|
const openHelpCenter = (showTabId) => {
|
|
11
19
|
if (!isHelpCenterOpen) {
|
|
12
20
|
setIsHelpCenterOpen(true);
|
|
21
|
+
setShowHint(false);
|
|
13
22
|
}
|
|
14
23
|
if (showTabId)
|
|
15
24
|
setActiveTabId(showTabId);
|
|
16
25
|
};
|
|
17
26
|
useEffect(() => {
|
|
18
|
-
if (!isHelpCenterOpen)
|
|
27
|
+
if (!isHelpCenterOpen) {
|
|
19
28
|
setActiveTabId(null);
|
|
29
|
+
if (showHintOnClose) {
|
|
30
|
+
setShowHintOnClose(false);
|
|
31
|
+
setTimeout(() => setShowHint(true), 240);
|
|
32
|
+
}
|
|
33
|
+
}
|
|
20
34
|
}, [isHelpCenterOpen]);
|
|
21
35
|
return (React.createElement(C3HelpCenterContext.Provider, { value: {
|
|
22
36
|
openHelpCenter,
|
|
23
37
|
setIsHelpCenterOpen,
|
|
24
38
|
isHelpCenterOpen,
|
|
25
39
|
showTabId: activeTabId,
|
|
40
|
+
showHint,
|
|
41
|
+
setShowHint,
|
|
42
|
+
setShowHintOnClose,
|
|
43
|
+
hintType,
|
|
44
|
+
setHintType,
|
|
26
45
|
} }, children));
|
|
27
46
|
};
|
|
28
47
|
export const useC3HelpCenter = () => React.useContext(C3HelpCenterContext);
|
|
@@ -9,7 +9,7 @@ import { defaultTheme, useC3Profile, } from "../c3-user-configuration/c3-profile
|
|
|
9
9
|
import { resolveTheme, } from "../c3-user-configuration/c3-profile-provider/carbon-theme-provider";
|
|
10
10
|
import { useC3HelpCenter } from "./c3-help-center-provider";
|
|
11
11
|
export const C3HelpCenter = ({ autoStartSurvey, origin, flags, onRequestClose, mixpanelTrack: customMixpanelTrack, onRequestOpen, theme, onPersonaChange, activeTab, }) => {
|
|
12
|
-
const { isHelpCenterOpen: isOpen, setIsHelpCenterOpen } = useC3HelpCenter();
|
|
12
|
+
const { isHelpCenterOpen: isOpen, setIsHelpCenterOpen, setShowHintOnClose, } = useC3HelpCenter();
|
|
13
13
|
const { userToken, decodedToken, activeOrganizationId, handleTheme, decodedAudience, analyticsTrack, } = useC3UserConfiguration() || {};
|
|
14
14
|
const { theme: themeConfig, isEnabled, reloadClusters } = useC3Profile();
|
|
15
15
|
const themeHandlingEnabled = isEnabled && !!handleTheme && !!themeConfig;
|
|
@@ -90,6 +90,9 @@ export const C3HelpCenter = ({ autoStartSurvey, origin, flags, onRequestClose, m
|
|
|
90
90
|
const tabs = helpCenterConfig.tabs;
|
|
91
91
|
const firstTab = tabs[0].id;
|
|
92
92
|
if (isOpen) {
|
|
93
|
+
if (autoStartSurvey && !persona?.wasShown) {
|
|
94
|
+
setShowHintOnClose(true);
|
|
95
|
+
}
|
|
93
96
|
if (persona && !persona.wasShown && decodedAudience) {
|
|
94
97
|
updatePersona({
|
|
95
98
|
newPersona: { ...persona, wasShown: true },
|
|
@@ -34,6 +34,12 @@ export interface TileConfig {
|
|
|
34
34
|
bool: string;
|
|
35
35
|
prerequestites: Prerequestite[] | boolean;
|
|
36
36
|
}
|
|
37
|
+
export type Cluster = {
|
|
38
|
+
uuid: string;
|
|
39
|
+
labels?: {
|
|
40
|
+
camunda: string[];
|
|
41
|
+
};
|
|
42
|
+
};
|
|
37
43
|
export type Tab = {
|
|
38
44
|
id: string;
|
|
39
45
|
label: string;
|
|
@@ -41,3 +47,10 @@ export type Tab = {
|
|
|
41
47
|
tiles: TileConfig[];
|
|
42
48
|
tiletype: TabType;
|
|
43
49
|
};
|
|
50
|
+
export type Organization = {
|
|
51
|
+
uuid: string;
|
|
52
|
+
name: string;
|
|
53
|
+
salesPlan?: {
|
|
54
|
+
type: string;
|
|
55
|
+
};
|
|
56
|
+
};
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import React from "react";
|
|
2
|
+
import { Button, Toggletip, ToggletipActions, ToggletipContent, } from "@carbon/react";
|
|
3
|
+
import { useC3HelpCenter } from "./c3-help-center-provider";
|
|
4
|
+
export const HelpCenterHint = ({ children }) => {
|
|
5
|
+
const { showHint, setShowHint, hintType } = useC3HelpCenter();
|
|
6
|
+
return showHint ? (React.createElement(Toggletip, { defaultOpen: true,
|
|
7
|
+
// eslint-disable-next-line
|
|
8
|
+
// @ts-ignore
|
|
9
|
+
align: "bottom-right" },
|
|
10
|
+
children,
|
|
11
|
+
React.createElement(ToggletipContent, null,
|
|
12
|
+
React.createElement("p", null, hintType === "help-center"
|
|
13
|
+
? "Access the Help Center at any time to see your recommendations, discover guides, tutorials, or to share feedback."
|
|
14
|
+
: "Access the onboarding survey from the Help Center to get personalized next steps and educational content."),
|
|
15
|
+
React.createElement(ToggletipActions, null,
|
|
16
|
+
React.createElement(Button, { size: "sm", onClick: () => setShowHint(false) }, "Got it"))))) : (children);
|
|
17
|
+
};
|
|
@@ -1,74 +1,25 @@
|
|
|
1
|
-
import React, {
|
|
1
|
+
import React, { useState } from "react";
|
|
2
2
|
import { Close } from "@carbon/react/icons";
|
|
3
|
-
import { useOnClickOutside } from "
|
|
4
|
-
import { HeaderGlobalAction, HeaderMenuItem, HeaderSideNavItems, SideNavItems, SideNavLink, SideNavMenu, SideNavMenuItem, } from "@carbon/react";
|
|
5
|
-
import { C3AppMenuIcon } from "
|
|
6
|
-
import
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
3
|
+
import { useOnClickOutside } from "./helpers";
|
|
4
|
+
import { HeaderGlobalAction, HeaderMenuItem, HeaderSideNavItems, SideNav as CarbonSideNav, SideNavItems, SideNavLink, SideNavMenu, SideNavMenuItem, } from "@carbon/react";
|
|
5
|
+
import { C3AppMenuIcon } from "../../icons/c3-icons";
|
|
6
|
+
import styled from "styled-components";
|
|
7
|
+
const NavWrapper = styled.div `
|
|
8
|
+
.cds--side-nav__overlay {
|
|
9
|
+
display: none;
|
|
10
|
+
}
|
|
11
|
+
`;
|
|
12
|
+
const SideNav = styled(CarbonSideNav) `
|
|
13
|
+
visibility: ${({ expanded }) => (expanded ? "visible" : "hidden")};
|
|
14
|
+
display: grid;
|
|
15
|
+
grid-auto-flow: row;
|
|
16
|
+
grid-auto-rows: max-content 1fr;
|
|
17
|
+
border-right: ${({ expanded }) => expanded ? "1px solid var(--cds-border-subtle)" : undefined};
|
|
18
|
+
overflow-y: auto;
|
|
19
|
+
`;
|
|
10
20
|
export const C3NavigationAppBar = ({ appBar, forwardRef, navbar, }) => {
|
|
11
|
-
const { currentApp, decodedAudience, analyticsTrack } = useC3UserConfiguration();
|
|
12
|
-
const { clusters, activeOrg } = useC3Profile();
|
|
13
21
|
const [appBarOpen, setAppBarOpen] = useState(appBar.isOpen);
|
|
14
22
|
const [panelRef, iconRef] = useOnClickOutside(() => setAppBarOpen(false));
|
|
15
|
-
const [appElements, setAppElements] = useState([]);
|
|
16
|
-
if ((!appBar.elements && !appBar.appTeaser) ||
|
|
17
|
-
(appBar.appTeaser && Object.keys(appBar.appTeaser).length === 0))
|
|
18
|
-
console.warn("No app elements or app teaser pages provided. Please provide at least one of them.");
|
|
19
|
-
useEffect(() => {
|
|
20
|
-
if (appBar.elements)
|
|
21
|
-
return;
|
|
22
|
-
const defaultElements = [];
|
|
23
|
-
APPS.forEach((app) => {
|
|
24
|
-
if (!decodedAudience || !currentApp)
|
|
25
|
-
return;
|
|
26
|
-
const element = {
|
|
27
|
-
key: app,
|
|
28
|
-
label: app.charAt(0).toUpperCase() + app.slice(1),
|
|
29
|
-
active: currentApp === app,
|
|
30
|
-
};
|
|
31
|
-
if (app === "console") {
|
|
32
|
-
element.href = `https://console.${decodedAudience}/${activeOrg?.uuid}`;
|
|
33
|
-
}
|
|
34
|
-
else if (app === "modeler") {
|
|
35
|
-
const hasPermission = activeOrg?.permissions.org.webide.read;
|
|
36
|
-
if (hasPermission) {
|
|
37
|
-
element.href =
|
|
38
|
-
currentApp === "modeler"
|
|
39
|
-
? ""
|
|
40
|
-
: `https://modeler.${decodedAudience}/login?returnUrl=/org/${activeOrg?.uuid}`;
|
|
41
|
-
}
|
|
42
|
-
}
|
|
43
|
-
else {
|
|
44
|
-
const hasAppReadPermission = activeOrg?.permissions.cluster[app]?.read;
|
|
45
|
-
const clustersToRender = clusters?.filter(({ status, urls }) => status[app] === "Healthy" && urls[app] && hasAppReadPermission);
|
|
46
|
-
if (clustersToRender?.length === 1) {
|
|
47
|
-
element.href = clustersToRender?.[0].urls[app];
|
|
48
|
-
}
|
|
49
|
-
else if (clustersToRender && clustersToRender.length > 1) {
|
|
50
|
-
element.subElements = clustersToRender.map((cluster, index) => ({
|
|
51
|
-
key: `${app}-${cluster.uuid}-${index}`,
|
|
52
|
-
label: cluster.name,
|
|
53
|
-
href: cluster.urls[app],
|
|
54
|
-
onClick: () => {
|
|
55
|
-
setAppBarOpen(false);
|
|
56
|
-
analyticsTrack?.(`${app}:open`, { currentApp: app });
|
|
57
|
-
},
|
|
58
|
-
}));
|
|
59
|
-
}
|
|
60
|
-
else if (hasAppReadPermission) {
|
|
61
|
-
if (appBar.appTeaser?.[app]?.routeProps) {
|
|
62
|
-
element.routeProps = appBar.appTeaser?.[app]?.routeProps;
|
|
63
|
-
}
|
|
64
|
-
}
|
|
65
|
-
}
|
|
66
|
-
if (element.href || element.routeProps || element.subElements)
|
|
67
|
-
defaultElements.push(element);
|
|
68
|
-
});
|
|
69
|
-
setAppElements(defaultElements);
|
|
70
|
-
}, [JSON.stringify(clusters)]);
|
|
71
|
-
const appBarElements = appBar.elements || (clusters ? appElements : null);
|
|
72
23
|
return (React.createElement(React.Fragment, null,
|
|
73
24
|
React.createElement(HeaderGlobalAction, { ref: iconRef, "aria-label": "Camunda components", isActive: appBarOpen, onClick: () => {
|
|
74
25
|
setAppBarOpen(!appBarOpen);
|
|
@@ -87,8 +38,8 @@ export const C3NavigationAppBar = ({ appBar, forwardRef, navbar, }) => {
|
|
|
87
38
|
setAppBarOpen(false);
|
|
88
39
|
}
|
|
89
40
|
} }, element.label)))))),
|
|
90
|
-
|
|
91
|
-
|
|
41
|
+
appBar.elements &&
|
|
42
|
+
appBar.elements.map((element) => {
|
|
92
43
|
if (element.subElements && element.subElements.length > 0) {
|
|
93
44
|
return (React.createElement(SideNavMenu, { large: true, title: element.label, key: element.key }, element.subElements.map((subElement) => (React.createElement(SideNavMenuItem, { as: subElement.routeProps && forwardRef, key: subElement.key, href: subElement.href, target: subElement.href ? subElement.target : undefined, ...subElement.routeProps, onClick: () => {
|
|
94
45
|
if (subElement.onClick) {
|
package/lib/esm/components/c3-navigation/c3-navigation-sidebar/c3-navigation-sidebar.types.d.ts
CHANGED
|
@@ -56,16 +56,8 @@ export type C3NavigationNotificationsSideBarProps = C3NavigationSideBarBaseProps
|
|
|
56
56
|
type: "notifications";
|
|
57
57
|
onLinkClick?: (meta: Notification["meta"]) => void;
|
|
58
58
|
};
|
|
59
|
-
type AppTeaserRoute = {
|
|
60
|
-
routeProps: any;
|
|
61
|
-
};
|
|
62
59
|
export type C3NavigationAppBarProps = C3NavigationSideBarBaseProps & {
|
|
63
60
|
type: "app";
|
|
64
|
-
appTeaser?: {
|
|
65
|
-
operate?: AppTeaserRoute;
|
|
66
|
-
tasklist?: AppTeaserRoute;
|
|
67
|
-
optimize?: AppTeaserRoute;
|
|
68
|
-
};
|
|
69
61
|
};
|
|
70
62
|
export type C3NavigationSideBarProps = {
|
|
71
63
|
callbacks?: {
|
|
@@ -73,4 +65,3 @@ export type C3NavigationSideBarProps = {
|
|
|
73
65
|
afterClosing?: () => void;
|
|
74
66
|
};
|
|
75
67
|
} & (C3NavigationOrgSideBarProps | C3NavigationInfoSideBarProps | C3NavigationUserSideBarProps | C3NavigationNotificationsSideBarProps);
|
|
76
|
-
export {};
|
|
@@ -2,7 +2,7 @@ import { Button } from "@carbon/react";
|
|
|
2
2
|
import { Notification as NotificationIcon } from "@carbon/react/icons";
|
|
3
3
|
import React, { useContext, useEffect, useRef, useState } from "react";
|
|
4
4
|
import styled from "styled-components";
|
|
5
|
-
import { C3BellIcon, C3NotificationsUnreadIcon } from "../../../
|
|
5
|
+
import { C3BellIcon, C3NotificationsUnreadIcon } from "../../../icons/c3-icons";
|
|
6
6
|
import C3NotificationContainer, { NotificationDescription, NotificationTitle, } from "../c3-notification-provider/c3-notification-container";
|
|
7
7
|
import { C3NotificationContext } from "../c3-notification-provider/c3-notification-provider";
|
|
8
8
|
import C3NavigationSideBar from "./c3-navigation-sidebar";
|
|
@@ -5,16 +5,17 @@ import { C3NotificationSidebar } from "./c3-navigation-sidebar/c3-notification-s
|
|
|
5
5
|
import C3OrgSidebar from "./c3-navigation-sidebar/c3-org-sidebar";
|
|
6
6
|
import C3UserSidebar from "./c3-navigation-sidebar/c3-user-sidebar";
|
|
7
7
|
import { useMediaQuery } from "./helpers";
|
|
8
|
-
import { C3NavigationAppBar } from "./c3-navigation-appbar
|
|
8
|
+
import { C3NavigationAppBar } from "./c3-navigation-appbar";
|
|
9
9
|
import styled from "styled-components";
|
|
10
10
|
import C3ActionButtons from "./c3-navigation-actions/c3-action-buttons";
|
|
11
|
-
import { CamundaLogo } from "../../
|
|
11
|
+
import { CamundaLogo } from "../../icons/c3-icons";
|
|
12
12
|
import { InfoButton } from "./c3-info-button";
|
|
13
13
|
import { C3SidebarStateProvider } from "./c3-navigation-sidebar/c3-sidebar-state-provider";
|
|
14
14
|
import { C3HelpCenter } from "../c3-help-center/c3-help-center";
|
|
15
15
|
import { C3ClusterTag } from "../c3-cluster-tag/c3-cluster-tag";
|
|
16
16
|
import { useC3HelpCenter } from "../c3-help-center/c3-help-center-provider";
|
|
17
17
|
import { useC3Profile } from "../c3-user-configuration/c3-profile-provider/c3-profile-provider";
|
|
18
|
+
import { HelpCenterHint } from "../c3-help-center/help-center-hint";
|
|
18
19
|
/**
|
|
19
20
|
* UI SHELL
|
|
20
21
|
* Docs: https://react.carbondesignsystem.com/?path=/story/components-ui-shell--fixed-side-nav
|
|
@@ -40,13 +41,11 @@ const ClusterTagWrapper = styled.div `
|
|
|
40
41
|
}
|
|
41
42
|
`;
|
|
42
43
|
export const C3Navigation = ({ app, appBar, forwardRef, navbar, orgSideBar, infoSideBar, infoButton, helpCenter, actionButtons, userSideBar, notificationSideBar, clusterUuid, options, }) => {
|
|
43
|
-
const {
|
|
44
|
+
const { openHelpCenter } = useC3HelpCenter();
|
|
44
45
|
const { activeOrg } = useC3Profile();
|
|
45
46
|
const isLargeScreen = useMediaQuery(`(min-width: ${BREAKPOINT_LG_WIDTH}`);
|
|
46
47
|
const appBarElementsLength = appBar.elements?.length ?? 0;
|
|
47
|
-
const displayAppBar = appBarElementsLength > 0 ||
|
|
48
|
-
appBar.appTeaser ||
|
|
49
|
-
(!isLargeScreen && navbar.elements.length > 0);
|
|
48
|
+
const displayAppBar = appBarElementsLength > 0 || (!isLargeScreen && navbar.elements.length > 0);
|
|
50
49
|
const orgName = activeOrg?.name || navbar.orgName;
|
|
51
50
|
if (app.prefix)
|
|
52
51
|
console.warn("The `prefix` prop is deprecated and will be removed in a future release. It has been replaced with a Camunda icon.");
|
|
@@ -112,9 +111,8 @@ export const C3Navigation = ({ app, appBar, forwardRef, navbar, orgSideBar, info
|
|
|
112
111
|
...orgSideBar,
|
|
113
112
|
type: "org",
|
|
114
113
|
} })),
|
|
115
|
-
infoButton || helpCenter ? (React.createElement(
|
|
116
|
-
|
|
117
|
-
: () => setIsHelpCenterOpen(!isHelpCenterOpen) })) : (infoSideBar && (React.createElement(C3InfoSidebar, { sideBar: { ...infoSideBar, type: "info" } }))),
|
|
114
|
+
infoButton || helpCenter ? (React.createElement(HelpCenterHint, null,
|
|
115
|
+
React.createElement(InfoButton, { onClick: infoButton ? infoButton.onClick : () => openHelpCenter() }))) : (infoSideBar && (React.createElement(C3InfoSidebar, { sideBar: { ...infoSideBar, type: "info" } }))),
|
|
118
116
|
userSideBar && (React.createElement(C3UserSidebar, { sideBar: {
|
|
119
117
|
...userSideBar,
|
|
120
118
|
type: "user",
|
|
@@ -5,7 +5,6 @@ export declare function createAppProps(): C3NavigationAppProps;
|
|
|
5
5
|
export declare function createAppBarProps(options?: {
|
|
6
6
|
isOpen?: boolean;
|
|
7
7
|
elements?: Array<C3NavigationElementProps>;
|
|
8
|
-
useElementsFromConfig?: boolean;
|
|
9
8
|
}): C3NavigationProps["appBar"];
|
|
10
9
|
export declare function createNavBarBarProps({ orgName, elements, }?: {
|
|
11
10
|
elements?: C3NavigationNavBarProps["elements"];
|
|
@@ -13,74 +13,51 @@ export function createAppProps() {
|
|
|
13
13
|
export function createAppBarProps(options = {}) {
|
|
14
14
|
return {
|
|
15
15
|
isOpen: Boolean(options?.isOpen),
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
16
|
+
elements: options?.elements ?? [
|
|
17
|
+
{
|
|
18
|
+
key: "console",
|
|
19
|
+
label: "Console",
|
|
20
|
+
active: true,
|
|
21
|
+
},
|
|
22
|
+
{
|
|
23
|
+
key: "modeler",
|
|
24
|
+
label: "Modeler",
|
|
25
|
+
active: false,
|
|
26
|
+
routeProps: { onClick: () => console.log("Redirecting to Modeler...") },
|
|
27
|
+
},
|
|
28
|
+
{
|
|
29
|
+
key: "operate",
|
|
30
|
+
label: "Operate",
|
|
31
|
+
active: false,
|
|
32
|
+
target: "_blank",
|
|
33
|
+
href: "https://camunda.com/",
|
|
34
|
+
},
|
|
35
|
+
{
|
|
36
|
+
key: "tasklist",
|
|
37
|
+
label: "Task List",
|
|
38
|
+
active: false,
|
|
39
|
+
subElements: [
|
|
40
|
+
{
|
|
41
|
+
key: "cluster-a",
|
|
42
|
+
label: "Cluster A",
|
|
43
|
+
href: "https://camunda.com/",
|
|
44
|
+
target: "_blank",
|
|
31
45
|
},
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
? undefined
|
|
37
|
-
: options?.elements ?? [
|
|
38
|
-
{
|
|
39
|
-
key: "console",
|
|
40
|
-
label: "Console",
|
|
41
|
-
active: true,
|
|
42
|
-
},
|
|
43
|
-
{
|
|
44
|
-
key: "modeler",
|
|
45
|
-
label: "Modeler",
|
|
46
|
-
active: false,
|
|
47
|
-
routeProps: {
|
|
48
|
-
onClick: () => console.log("Redirecting to Modeler..."),
|
|
46
|
+
{
|
|
47
|
+
key: "cluster-b",
|
|
48
|
+
label: "Cluster B",
|
|
49
|
+
onClick: () => console.log("Redirecting to Tasklist..."),
|
|
49
50
|
},
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
active: false,
|
|
55
|
-
target: "_blank",
|
|
56
|
-
href: "https://camunda.com/",
|
|
57
|
-
},
|
|
58
|
-
{
|
|
59
|
-
key: "tasklist",
|
|
60
|
-
label: "Task List",
|
|
61
|
-
active: false,
|
|
62
|
-
subElements: [
|
|
63
|
-
{
|
|
64
|
-
key: "cluster-a",
|
|
65
|
-
label: "Cluster A",
|
|
66
|
-
href: "https://camunda.com/",
|
|
67
|
-
target: "_blank",
|
|
68
|
-
},
|
|
69
|
-
{
|
|
70
|
-
key: "cluster-b",
|
|
71
|
-
label: "Cluster B",
|
|
51
|
+
{
|
|
52
|
+
key: "cluster-c",
|
|
53
|
+
label: "Cluster C",
|
|
54
|
+
routeProps: {
|
|
72
55
|
onClick: () => console.log("Redirecting to Tasklist..."),
|
|
73
56
|
},
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
onClick: () => console.log("Redirecting to Tasklist..."),
|
|
79
|
-
},
|
|
80
|
-
},
|
|
81
|
-
],
|
|
82
|
-
},
|
|
83
|
-
],
|
|
57
|
+
},
|
|
58
|
+
],
|
|
59
|
+
},
|
|
60
|
+
],
|
|
84
61
|
elementClicked: (element) => console.log(`event coming from the appBarProps: ${element} has been clicked`),
|
|
85
62
|
};
|
|
86
63
|
}
|
|
@@ -4,7 +4,9 @@ import { OnboardingModal } from "./onboardingModal";
|
|
|
4
4
|
import { OnboardingPage } from "./onboardingPage";
|
|
5
5
|
import { OnboardingStep } from "./step";
|
|
6
6
|
import { Body01 } from "../styles";
|
|
7
|
+
import { useC3HelpCenter } from "../c3-help-center/c3-help-center-provider";
|
|
7
8
|
export const OnboardingSurvey = ({ appTheme, persona, userFirstName, syncPersona, setPersona, mixpanelTrack, onRequestClose, onboardingConfiguration, isLoadingConfig, modal, origin, }) => {
|
|
9
|
+
const { setHintType } = useC3HelpCenter();
|
|
8
10
|
const [step, setStep] = useState(persona?.nextStep ?? 0);
|
|
9
11
|
const [isDoingAsyncWork, setIsDoingAsyncWork] = useState(false);
|
|
10
12
|
React.useEffect(() => {
|
|
@@ -20,6 +22,7 @@ export const OnboardingSurvey = ({ appTheme, persona, userFirstName, syncPersona
|
|
|
20
22
|
},
|
|
21
23
|
};
|
|
22
24
|
if (committedStep >= onboardingConfiguration.steps.length) {
|
|
25
|
+
setHintType("help-center");
|
|
23
26
|
newPersona.nextStep = 0;
|
|
24
27
|
newPersona.complete = true;
|
|
25
28
|
await syncPersona(newPersona, true);
|
package/lib/esm/components/c3-user-configuration/c3-profile-provider/c3-profile-provider.d.ts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import React, { FC, PropsWithChildren } from "react";
|
|
2
2
|
import { ResolvedTheme } from "./carbon-theme-provider";
|
|
3
|
-
import { Cluster, Organization } from "
|
|
3
|
+
import { Cluster, Organization } from "../../c3-help-center/c3-help-center.types";
|
|
4
4
|
export type Theme = "light" | "dark" | "system";
|
|
5
5
|
export declare const defaultTheme: "light";
|
|
6
6
|
export type C3ProfileContextValue = {
|
|
@@ -54,9 +54,6 @@ export const C3ProfileProvider = ({ children }) => {
|
|
|
54
54
|
JSON.stringify(decodedToken),
|
|
55
55
|
decodedAudience,
|
|
56
56
|
]);
|
|
57
|
-
useEffect(() => {
|
|
58
|
-
loadClusters();
|
|
59
|
-
}, [activeOrg]);
|
|
60
57
|
useEffect(() => {
|
|
61
58
|
const updateSystemTheme = ({ matches }) => {
|
|
62
59
|
if (themeRef.current === "system")
|
|
@@ -8,7 +8,6 @@ type C3UserConfigurationBase = {
|
|
|
8
8
|
userToken: string;
|
|
9
9
|
getNewUserToken: () => Promise<string>;
|
|
10
10
|
analyticsTrack?: MixPanelTrack;
|
|
11
|
-
currentApp?: "console" | "modeler" | "tasklist" | "operate" | "optimize";
|
|
12
11
|
};
|
|
13
12
|
type C3UserConfigurationWithEndpoints = C3UserConfigurationBase & {
|
|
14
13
|
endpoints: Endpoints;
|
package/lib/esm/index.d.ts
CHANGED
|
@@ -7,8 +7,6 @@ export { C3NavigationSideBarBaseProps } from "./components/c3-navigation/c3-navi
|
|
|
7
7
|
export { C3NavigationAppProps, C3NavigationElementProps, C3NavigationNavBarProps, C3NavigationProps, } from "./components/c3-navigation/c3-navigation.types";
|
|
8
8
|
export { useC3Profile } from "./components/c3-user-configuration/c3-profile-provider/c3-profile-provider";
|
|
9
9
|
export { C3UserConfiguration, default as C3UserConfigurationProvider, } from "./components/c3-user-configuration/c3-user-configuration-provider";
|
|
10
|
-
export { C3AppMenuIcon } from "./
|
|
11
|
-
export { C3IconProps } from "./
|
|
10
|
+
export { C3AppMenuIcon } from "./icons/c3-icons";
|
|
11
|
+
export { C3IconProps } from "./icons/c3-icons.types";
|
|
12
12
|
export { useC3HelpCenter } from "./components/c3-help-center/c3-help-center-provider";
|
|
13
|
-
export { C3AppTeaserPage, C3AppTeaserPageProps, } from "./components/c3-app-teaser/c3-app-teaser-page";
|
|
14
|
-
export * from "./assets/appTeaserPreviews";
|
package/lib/esm/index.js
CHANGED
|
@@ -4,7 +4,5 @@ export { C3EmptyState } from "./components/c3-empty-state/c3-empty-state";
|
|
|
4
4
|
export { default as C3Navigation } from "./components/c3-navigation";
|
|
5
5
|
export { useC3Profile } from "./components/c3-user-configuration/c3-profile-provider/c3-profile-provider";
|
|
6
6
|
export { default as C3UserConfigurationProvider, } from "./components/c3-user-configuration/c3-user-configuration-provider";
|
|
7
|
-
export { C3AppMenuIcon } from "./
|
|
7
|
+
export { C3AppMenuIcon } from "./icons/c3-icons";
|
|
8
8
|
export { useC3HelpCenter } from "./components/c3-help-center/c3-help-center-provider";
|
|
9
|
-
export { C3AppTeaserPage, } from "./components/c3-app-teaser/c3-app-teaser-page";
|
|
10
|
-
export * from "./assets/appTeaserPreviews";
|