@camunda/camunda-composite-components 0.2.4-rc.2 → 0.2.4
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/components/c3-help-center/c3-help-center.js +5 -4
- package/lib/esm/components/c3-help-center/c3-help-center.types.d.ts +0 -3
- package/lib/esm/components/c3-help-center/help-center.js +12 -2
- package/lib/esm/components/c3-help-center/tabs/feedback.js +1 -2
- package/lib/esm/components/c3-help-center/tabs/tabContent.js +1 -1
- package/lib/esm/components/c3-navigation/c3-navigation.d.ts +1 -1
- package/lib/esm/components/c3-navigation/c3-navigation.js +1 -11
- package/lib/esm/components/c3-navigation/c3-navigation.types.d.ts +0 -1
- package/lib/esm/components/c3-navigation/c3-notification-provider/c3-notification-container.d.ts +72 -72
- package/lib/esm/components/c3-onboarding-survey/c3-onboarding-survey.js +7 -2
- package/lib/esm/components/c3-onboarding-survey/onboardingSurvey.d.ts +1 -0
- package/lib/esm/components/c3-onboarding-survey/onboardingSurvey.js +3 -7
- package/lib/esm/components/c3-user-configuration/authToken.d.ts +6 -7
- package/lib/esm/components/c3-user-configuration/c3-profile-provider/c3-profile-provider.d.ts +0 -2
- package/lib/esm/components/c3-user-configuration/c3-profile-provider/c3-profile-provider.js +1 -16
- package/lib/esm/components/c3-user-configuration/c3-user-configuration-provider.d.ts +2 -6
- package/lib/esm/components/c3-user-configuration/c3-user-configuration-provider.js +3 -12
- package/lib/esm/components/styles.d.ts +48 -48
- package/lib/esm/index.d.ts +4 -5
- package/lib/esm/index.js +2 -4
- package/package.json +1 -1
- package/lib/esm/components/c3-cluster-tag/c3-cluster-tag.d.ts +0 -3
- package/lib/esm/components/c3-cluster-tag/c3-cluster-tag.js +0 -29
- package/lib/esm/components/c3-cluster-tag/c3-cluster-tag.types.d.ts +0 -13
- package/lib/esm/components/c3-cluster-tag/c3-cluster-tag.types.js +0 -6
|
@@ -4,11 +4,12 @@ import { HelpCenter } from "./help-center";
|
|
|
4
4
|
import { defaultHelpCenterConfig } from "./defaultHelpCenterConfig";
|
|
5
5
|
import { C3OnboardingSurvey } from "../c3-onboarding-survey/c3-onboarding-survey";
|
|
6
6
|
import { getClusters, getConfig, getOrg, updatePersona, } from "../../api/help-center";
|
|
7
|
+
import { decodeJWT } from "../c3-user-configuration/authToken";
|
|
7
8
|
import { useC3UserConfiguration } from "../c3-user-configuration/c3-user-configuration-provider";
|
|
8
9
|
import { defaultTheme, useC3Profile, } from "../c3-user-configuration/c3-profile-provider/c3-profile-provider";
|
|
9
10
|
import { resolveTheme, } from "../c3-user-configuration/c3-profile-provider/carbon-theme-provider";
|
|
10
11
|
export const C3HelpCenter = ({ autoStartSurvey, origin, flags, isOpen, onRequestClose, mixpanelTrack, onRequestOpen, theme, onPersonaChange, activeTab, }) => {
|
|
11
|
-
const { userToken,
|
|
12
|
+
const { userToken, activeOrganizationId, handleTheme } = useC3UserConfiguration() || {};
|
|
12
13
|
const { theme: themeConfig, isEnabled } = useC3Profile();
|
|
13
14
|
const themeHandlingEnabled = isEnabled && !!handleTheme && !!themeConfig;
|
|
14
15
|
const themeRef = useRef();
|
|
@@ -44,6 +45,7 @@ export const C3HelpCenter = ({ autoStartSurvey, origin, flags, isOpen, onRequest
|
|
|
44
45
|
setResolvedTheme(resolveTheme(newTheme || "light"));
|
|
45
46
|
}, [theme, themeConfig, isOpen]);
|
|
46
47
|
const fetchData = async () => {
|
|
48
|
+
const decodedToken = decodeJWT(userToken);
|
|
47
49
|
if (!decodedToken)
|
|
48
50
|
return;
|
|
49
51
|
const { userId, meta, audience, persona } = decodedToken;
|
|
@@ -76,14 +78,13 @@ export const C3HelpCenter = ({ autoStartSurvey, origin, flags, isOpen, onRequest
|
|
|
76
78
|
React.useEffect(() => {
|
|
77
79
|
const tokenChanged = token !== userToken && !!userToken;
|
|
78
80
|
const orgChanged = organizationId !== activeOrganizationId && !!activeOrganizationId;
|
|
79
|
-
const decodedTokenChanged = !tokenChanged && !orgChanged;
|
|
80
81
|
if (tokenChanged)
|
|
81
82
|
setToken(userToken);
|
|
82
83
|
if (orgChanged)
|
|
83
84
|
setOrganizationId(activeOrganizationId);
|
|
84
|
-
if (tokenChanged ||
|
|
85
|
+
if (tokenChanged || orgChanged)
|
|
85
86
|
fetchData();
|
|
86
|
-
}, [userToken,
|
|
87
|
+
}, [userToken, activeOrganizationId]);
|
|
87
88
|
React.useEffect(() => {
|
|
88
89
|
const tabs = helpCenterConfig.tabs;
|
|
89
90
|
const firstTab = tabs[0].id;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { Button, Link, ModalBody, ModalFooter, ModalHeader, SideNav, SideNavItems, SideNavMenuItem, Stack, } from "@carbon/react";
|
|
1
|
+
import { Button, Link, Loading, ModalBody, ModalFooter, ModalHeader, SideNav, SideNavItems, SideNavMenuItem, Stack, } from "@carbon/react";
|
|
2
2
|
import { Undo } from "@carbon/react/icons";
|
|
3
3
|
import React, { useState } from "react";
|
|
4
4
|
import { Feedback } from "./tabs/feedback";
|
|
@@ -11,6 +11,8 @@ export const StyledModalHeader = styled(ModalHeader) `
|
|
|
11
11
|
${headings}
|
|
12
12
|
`;
|
|
13
13
|
export const StyledModalBody = styled(ModalBody) `
|
|
14
|
+
padding-left: 17rem;
|
|
15
|
+
|
|
14
16
|
${headings}
|
|
15
17
|
|
|
16
18
|
p {
|
|
@@ -23,12 +25,14 @@ export const HelpCenter = ({ configuration, organization, persona, email, audien
|
|
|
23
25
|
const { userToken: token } = useC3UserConfiguration() || {};
|
|
24
26
|
const [activeTab, setActiveTab] = useState(firstTab);
|
|
25
27
|
const [tabTiles, setTabTiles] = useState({});
|
|
28
|
+
const [isLoadingTiles, setIsLoadingTiles] = useState(false);
|
|
26
29
|
let header = "";
|
|
27
30
|
let content = React.createElement(React.Fragment, null);
|
|
28
31
|
React.useEffect(() => {
|
|
29
32
|
;
|
|
30
33
|
(async () => {
|
|
31
34
|
const tiles = {};
|
|
35
|
+
setIsLoadingTiles(true);
|
|
32
36
|
for (const singleTab of tabs) {
|
|
33
37
|
if (token) {
|
|
34
38
|
tiles[singleTab.id] = await getTiles({
|
|
@@ -46,6 +50,7 @@ export const HelpCenter = ({ configuration, organization, persona, email, audien
|
|
|
46
50
|
}
|
|
47
51
|
}
|
|
48
52
|
setTabTiles(tiles);
|
|
53
|
+
setIsLoadingTiles(false);
|
|
49
54
|
})();
|
|
50
55
|
}, [token, persona, audience, organization, clusters, tabs]);
|
|
51
56
|
React.useEffect(() => {
|
|
@@ -57,11 +62,16 @@ export const HelpCenter = ({ configuration, organization, persona, email, audien
|
|
|
57
62
|
header = head;
|
|
58
63
|
}, salesPlanType: organization?.organizationToSalesPlan?.salesPlan?.salesPlanType ?? "" }));
|
|
59
64
|
}
|
|
65
|
+
else if (activeTab === "recommendations" &&
|
|
66
|
+
Object.keys(tabTiles).length === 0 &&
|
|
67
|
+
isLoadingTiles) {
|
|
68
|
+
header = "Your recommendations";
|
|
69
|
+
content = React.createElement(Loading, { style: { marginLeft: "17rem" } });
|
|
70
|
+
}
|
|
60
71
|
else if (activeTab === "recommendations" &&
|
|
61
72
|
Object.keys(tabTiles).length === 0) {
|
|
62
73
|
header = "";
|
|
63
74
|
content = (React.createElement("div", { style: {
|
|
64
|
-
paddingLeft: "256px",
|
|
65
75
|
height: "100%",
|
|
66
76
|
display: "flex",
|
|
67
77
|
justifyContent: "center",
|
|
@@ -84,7 +84,6 @@ export const Feedback = (props) => {
|
|
|
84
84
|
if (submitted) {
|
|
85
85
|
props.setHeader("");
|
|
86
86
|
return (React.createElement("div", { style: {
|
|
87
|
-
paddingLeft: "256px",
|
|
88
87
|
height: "100%",
|
|
89
88
|
display: "flex",
|
|
90
89
|
justifyContent: "center",
|
|
@@ -113,7 +112,7 @@ export const Feedback = (props) => {
|
|
|
113
112
|
setSubmitted(false);
|
|
114
113
|
} }, "Share additional feedback"))))))));
|
|
115
114
|
}
|
|
116
|
-
return (React.createElement("div",
|
|
115
|
+
return (React.createElement("div", null,
|
|
117
116
|
React.createElement(Stack, { gap: 6 },
|
|
118
117
|
React.createElement("p", null, "We actively use this information to fix problems and improve your experience with our products."),
|
|
119
118
|
!orgIsEnterPriseOrPaidCC && (React.createElement("div", null,
|
|
@@ -6,7 +6,7 @@ export const TAB_TYPES = {
|
|
|
6
6
|
Column: "column",
|
|
7
7
|
};
|
|
8
8
|
export const TabContent = ({ onboarding, type, origin, tiles, mixpanelTrack }) => {
|
|
9
|
-
return (React.createElement("div",
|
|
9
|
+
return (React.createElement("div", null,
|
|
10
10
|
React.createElement(Stack, null,
|
|
11
11
|
onboarding && onboarding?.complete !== true && (React.createElement(ActionableNotification, { kind: "info", inline: true, lowContrast: false, hideCloseButton: true, style: { maxWidth: "100%" }, actionButtonLabel: "Resume Survey", onActionButtonClick: onboarding.resumeSurvey, title: "Complete the new user survey to see more recommendations", subtitle: "" })),
|
|
12
12
|
React.createElement("div", { style: {
|
|
@@ -1,3 +1,3 @@
|
|
|
1
1
|
import React from "react";
|
|
2
2
|
import { C3NavigationProps } from "./c3-navigation.types";
|
|
3
|
-
export declare const C3Navigation: ({ app, appBar, forwardRef, navbar, orgSideBar, infoSideBar, infoButton, helpCenter, actionButtons, userSideBar, notificationSideBar,
|
|
3
|
+
export declare const C3Navigation: ({ app, appBar, forwardRef, navbar, orgSideBar, infoSideBar, infoButton, helpCenter, actionButtons, userSideBar, notificationSideBar, }: C3NavigationProps) => React.JSX.Element;
|
|
@@ -12,7 +12,6 @@ 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
|
-
import { C3ClusterTag } from "../c3-cluster-tag/c3-cluster-tag";
|
|
16
15
|
/**
|
|
17
16
|
* UI SHELL
|
|
18
17
|
* Docs: https://react.carbondesignsystem.com/?path=/story/components-ui-shell--fixed-side-nav
|
|
@@ -30,14 +29,7 @@ const StyledToggletipContent = styled(ToggletipContent) `
|
|
|
30
29
|
color: var(--cds-link-hover-text-color);
|
|
31
30
|
}
|
|
32
31
|
`;
|
|
33
|
-
const
|
|
34
|
-
.cds--tag {
|
|
35
|
-
height: 1.5rem;
|
|
36
|
-
margin-top: 0.75rem;
|
|
37
|
-
padding: 0 1rem;
|
|
38
|
-
}
|
|
39
|
-
`;
|
|
40
|
-
export const C3Navigation = ({ app, appBar, forwardRef, navbar, orgSideBar, infoSideBar, infoButton, helpCenter, actionButtons, userSideBar, notificationSideBar, clusterUuid, }) => {
|
|
32
|
+
export const C3Navigation = ({ app, appBar, forwardRef, navbar, orgSideBar, infoSideBar, infoButton, helpCenter, actionButtons, userSideBar, notificationSideBar, }) => {
|
|
41
33
|
const isLargeScreen = useMediaQuery(`(min-width: ${BREAKPOINT_LG_WIDTH}`);
|
|
42
34
|
const appBarElementsLength = appBar.elements?.length ?? 0;
|
|
43
35
|
const displayAppBar = appBarElementsLength > 0 || (!isLargeScreen && navbar.elements.length > 0);
|
|
@@ -87,8 +79,6 @@ export const C3Navigation = ({ app, appBar, forwardRef, navbar, orgSideBar, info
|
|
|
87
79
|
padding: "0 1rem",
|
|
88
80
|
}, type: tag.color }, tag.label));
|
|
89
81
|
}),
|
|
90
|
-
clusterUuid && (React.createElement(ClusterTagWrapper, null,
|
|
91
|
-
React.createElement(C3ClusterTag, { clusterUuid: clusterUuid }))),
|
|
92
82
|
navbar.orgName && (React.createElement("div", { className: "bodyText", style: {
|
|
93
83
|
fontSize: "14px",
|
|
94
84
|
lineHeight: "3rem",
|
|
@@ -64,7 +64,6 @@ export interface C3NavigationProps {
|
|
|
64
64
|
notificationSideBar?: WithoutType<C3NavigationNotificationsSideBarProps>;
|
|
65
65
|
navbar: C3NavigationNavBarProps;
|
|
66
66
|
forwardRef?: React.ForwardRefExoticComponent<any>;
|
|
67
|
-
clusterUuid?: string;
|
|
68
67
|
}
|
|
69
68
|
export type LinkProps = {
|
|
70
69
|
element?: React.ElementType;
|
package/lib/esm/components/c3-navigation/c3-notification-provider/c3-notification-container.d.ts
CHANGED
|
@@ -10,17 +10,17 @@ export declare const NotificationTitle: import("styled-components").IStyledCompo
|
|
|
10
10
|
accessKey?: string | undefined;
|
|
11
11
|
autoFocus?: boolean | undefined;
|
|
12
12
|
className?: string | undefined;
|
|
13
|
-
contentEditable?: "inherit" | (boolean | "
|
|
13
|
+
contentEditable?: "inherit" | (boolean | "true" | "false") | undefined;
|
|
14
14
|
contextMenu?: string | undefined;
|
|
15
15
|
dir?: string | undefined;
|
|
16
|
-
draggable?: (boolean | "
|
|
16
|
+
draggable?: (boolean | "true" | "false") | undefined;
|
|
17
17
|
hidden?: boolean | undefined;
|
|
18
18
|
id?: string | undefined;
|
|
19
19
|
lang?: string | undefined;
|
|
20
20
|
nonce?: string | undefined;
|
|
21
21
|
placeholder?: string | undefined;
|
|
22
22
|
slot?: string | undefined;
|
|
23
|
-
spellCheck?: (boolean | "
|
|
23
|
+
spellCheck?: (boolean | "true" | "false") | undefined;
|
|
24
24
|
style?: React.CSSProperties | undefined;
|
|
25
25
|
tabIndex?: number | undefined;
|
|
26
26
|
title?: string | undefined;
|
|
@@ -50,55 +50,55 @@ export declare const NotificationTitle: import("styled-components").IStyledCompo
|
|
|
50
50
|
results?: number | undefined;
|
|
51
51
|
security?: string | undefined;
|
|
52
52
|
unselectable?: "on" | "off" | undefined;
|
|
53
|
-
inputMode?: "search" | "text" | "none" | "
|
|
53
|
+
inputMode?: "search" | "text" | "none" | "tel" | "url" | "email" | "numeric" | "decimal" | undefined;
|
|
54
54
|
is?: string | undefined;
|
|
55
55
|
'aria-activedescendant'?: string | undefined;
|
|
56
|
-
'aria-atomic'?: (boolean | "
|
|
57
|
-
'aria-autocomplete'?: "none" | "
|
|
56
|
+
'aria-atomic'?: (boolean | "true" | "false") | undefined;
|
|
57
|
+
'aria-autocomplete'?: "none" | "inline" | "list" | "both" | undefined;
|
|
58
58
|
'aria-braillelabel'?: string | undefined;
|
|
59
59
|
'aria-brailleroledescription'?: string | undefined;
|
|
60
|
-
'aria-busy'?: (boolean | "
|
|
61
|
-
'aria-checked'?: boolean | "
|
|
60
|
+
'aria-busy'?: (boolean | "true" | "false") | undefined;
|
|
61
|
+
'aria-checked'?: boolean | "true" | "false" | "mixed" | undefined;
|
|
62
62
|
'aria-colcount'?: number | undefined;
|
|
63
63
|
'aria-colindex'?: number | undefined;
|
|
64
64
|
'aria-colindextext'?: string | undefined;
|
|
65
65
|
'aria-colspan'?: number | undefined;
|
|
66
66
|
'aria-controls'?: string | undefined;
|
|
67
|
-
'aria-current'?: boolean | "time" | "
|
|
67
|
+
'aria-current'?: boolean | "time" | "true" | "false" | "page" | "step" | "location" | "date" | undefined;
|
|
68
68
|
'aria-describedby'?: string | undefined;
|
|
69
69
|
'aria-description'?: string | undefined;
|
|
70
70
|
'aria-details'?: string | undefined;
|
|
71
|
-
'aria-disabled'?: (boolean | "
|
|
72
|
-
'aria-dropeffect'?: "link" | "none" | "copy" | "
|
|
71
|
+
'aria-disabled'?: (boolean | "true" | "false") | undefined;
|
|
72
|
+
'aria-dropeffect'?: "link" | "none" | "copy" | "execute" | "move" | "popup" | undefined;
|
|
73
73
|
'aria-errormessage'?: string | undefined;
|
|
74
|
-
'aria-expanded'?: (boolean | "
|
|
74
|
+
'aria-expanded'?: (boolean | "true" | "false") | undefined;
|
|
75
75
|
'aria-flowto'?: string | undefined;
|
|
76
|
-
'aria-grabbed'?: (boolean | "
|
|
77
|
-
'aria-haspopup'?: boolean | "dialog" | "menu" | "
|
|
78
|
-
'aria-hidden'?: (boolean | "
|
|
79
|
-
'aria-invalid'?: boolean | "
|
|
76
|
+
'aria-grabbed'?: (boolean | "true" | "false") | undefined;
|
|
77
|
+
'aria-haspopup'?: boolean | "dialog" | "menu" | "true" | "false" | "grid" | "listbox" | "tree" | undefined;
|
|
78
|
+
'aria-hidden'?: (boolean | "true" | "false") | undefined;
|
|
79
|
+
'aria-invalid'?: boolean | "true" | "false" | "grammar" | "spelling" | undefined;
|
|
80
80
|
'aria-keyshortcuts'?: string | undefined;
|
|
81
81
|
'aria-label'?: string | undefined;
|
|
82
82
|
'aria-labelledby'?: string | undefined;
|
|
83
83
|
'aria-level'?: number | undefined;
|
|
84
84
|
'aria-live'?: "off" | "assertive" | "polite" | undefined;
|
|
85
|
-
'aria-modal'?: (boolean | "
|
|
86
|
-
'aria-multiline'?: (boolean | "
|
|
87
|
-
'aria-multiselectable'?: (boolean | "
|
|
85
|
+
'aria-modal'?: (boolean | "true" | "false") | undefined;
|
|
86
|
+
'aria-multiline'?: (boolean | "true" | "false") | undefined;
|
|
87
|
+
'aria-multiselectable'?: (boolean | "true" | "false") | undefined;
|
|
88
88
|
'aria-orientation'?: "horizontal" | "vertical" | undefined;
|
|
89
89
|
'aria-owns'?: string | undefined;
|
|
90
90
|
'aria-placeholder'?: string | undefined;
|
|
91
91
|
'aria-posinset'?: number | undefined;
|
|
92
|
-
'aria-pressed'?: boolean | "
|
|
93
|
-
'aria-readonly'?: (boolean | "
|
|
94
|
-
'aria-relevant'?: "text" | "
|
|
95
|
-
'aria-required'?: (boolean | "
|
|
92
|
+
'aria-pressed'?: boolean | "true" | "false" | "mixed" | undefined;
|
|
93
|
+
'aria-readonly'?: (boolean | "true" | "false") | undefined;
|
|
94
|
+
'aria-relevant'?: "text" | "additions" | "additions removals" | "additions text" | "all" | "removals" | "removals additions" | "removals text" | "text additions" | "text removals" | undefined;
|
|
95
|
+
'aria-required'?: (boolean | "true" | "false") | undefined;
|
|
96
96
|
'aria-roledescription'?: string | undefined;
|
|
97
97
|
'aria-rowcount'?: number | undefined;
|
|
98
98
|
'aria-rowindex'?: number | undefined;
|
|
99
99
|
'aria-rowindextext'?: string | undefined;
|
|
100
100
|
'aria-rowspan'?: number | undefined;
|
|
101
|
-
'aria-selected'?: (boolean | "
|
|
101
|
+
'aria-selected'?: (boolean | "true" | "false") | undefined;
|
|
102
102
|
'aria-setsize'?: number | undefined;
|
|
103
103
|
'aria-sort'?: "none" | "ascending" | "descending" | "other" | undefined;
|
|
104
104
|
'aria-valuemax'?: number | undefined;
|
|
@@ -282,17 +282,17 @@ export declare const NotificationDescription: import("styled-components").IStyle
|
|
|
282
282
|
accessKey?: string | undefined;
|
|
283
283
|
autoFocus?: boolean | undefined;
|
|
284
284
|
className?: string | undefined;
|
|
285
|
-
contentEditable?: "inherit" | (boolean | "
|
|
285
|
+
contentEditable?: "inherit" | (boolean | "true" | "false") | undefined;
|
|
286
286
|
contextMenu?: string | undefined;
|
|
287
287
|
dir?: string | undefined;
|
|
288
|
-
draggable?: (boolean | "
|
|
288
|
+
draggable?: (boolean | "true" | "false") | undefined;
|
|
289
289
|
hidden?: boolean | undefined;
|
|
290
290
|
id?: string | undefined;
|
|
291
291
|
lang?: string | undefined;
|
|
292
292
|
nonce?: string | undefined;
|
|
293
293
|
placeholder?: string | undefined;
|
|
294
294
|
slot?: string | undefined;
|
|
295
|
-
spellCheck?: (boolean | "
|
|
295
|
+
spellCheck?: (boolean | "true" | "false") | undefined;
|
|
296
296
|
style?: React.CSSProperties | undefined;
|
|
297
297
|
tabIndex?: number | undefined;
|
|
298
298
|
title?: string | undefined;
|
|
@@ -322,55 +322,55 @@ export declare const NotificationDescription: import("styled-components").IStyle
|
|
|
322
322
|
results?: number | undefined;
|
|
323
323
|
security?: string | undefined;
|
|
324
324
|
unselectable?: "on" | "off" | undefined;
|
|
325
|
-
inputMode?: "search" | "text" | "none" | "
|
|
325
|
+
inputMode?: "search" | "text" | "none" | "tel" | "url" | "email" | "numeric" | "decimal" | undefined;
|
|
326
326
|
is?: string | undefined;
|
|
327
327
|
'aria-activedescendant'?: string | undefined;
|
|
328
|
-
'aria-atomic'?: (boolean | "
|
|
329
|
-
'aria-autocomplete'?: "none" | "
|
|
328
|
+
'aria-atomic'?: (boolean | "true" | "false") | undefined;
|
|
329
|
+
'aria-autocomplete'?: "none" | "inline" | "list" | "both" | undefined;
|
|
330
330
|
'aria-braillelabel'?: string | undefined;
|
|
331
331
|
'aria-brailleroledescription'?: string | undefined;
|
|
332
|
-
'aria-busy'?: (boolean | "
|
|
333
|
-
'aria-checked'?: boolean | "
|
|
332
|
+
'aria-busy'?: (boolean | "true" | "false") | undefined;
|
|
333
|
+
'aria-checked'?: boolean | "true" | "false" | "mixed" | undefined;
|
|
334
334
|
'aria-colcount'?: number | undefined;
|
|
335
335
|
'aria-colindex'?: number | undefined;
|
|
336
336
|
'aria-colindextext'?: string | undefined;
|
|
337
337
|
'aria-colspan'?: number | undefined;
|
|
338
338
|
'aria-controls'?: string | undefined;
|
|
339
|
-
'aria-current'?: boolean | "time" | "
|
|
339
|
+
'aria-current'?: boolean | "time" | "true" | "false" | "page" | "step" | "location" | "date" | undefined;
|
|
340
340
|
'aria-describedby'?: string | undefined;
|
|
341
341
|
'aria-description'?: string | undefined;
|
|
342
342
|
'aria-details'?: string | undefined;
|
|
343
|
-
'aria-disabled'?: (boolean | "
|
|
344
|
-
'aria-dropeffect'?: "link" | "none" | "copy" | "
|
|
343
|
+
'aria-disabled'?: (boolean | "true" | "false") | undefined;
|
|
344
|
+
'aria-dropeffect'?: "link" | "none" | "copy" | "execute" | "move" | "popup" | undefined;
|
|
345
345
|
'aria-errormessage'?: string | undefined;
|
|
346
|
-
'aria-expanded'?: (boolean | "
|
|
346
|
+
'aria-expanded'?: (boolean | "true" | "false") | undefined;
|
|
347
347
|
'aria-flowto'?: string | undefined;
|
|
348
|
-
'aria-grabbed'?: (boolean | "
|
|
349
|
-
'aria-haspopup'?: boolean | "dialog" | "menu" | "
|
|
350
|
-
'aria-hidden'?: (boolean | "
|
|
351
|
-
'aria-invalid'?: boolean | "
|
|
348
|
+
'aria-grabbed'?: (boolean | "true" | "false") | undefined;
|
|
349
|
+
'aria-haspopup'?: boolean | "dialog" | "menu" | "true" | "false" | "grid" | "listbox" | "tree" | undefined;
|
|
350
|
+
'aria-hidden'?: (boolean | "true" | "false") | undefined;
|
|
351
|
+
'aria-invalid'?: boolean | "true" | "false" | "grammar" | "spelling" | undefined;
|
|
352
352
|
'aria-keyshortcuts'?: string | undefined;
|
|
353
353
|
'aria-label'?: string | undefined;
|
|
354
354
|
'aria-labelledby'?: string | undefined;
|
|
355
355
|
'aria-level'?: number | undefined;
|
|
356
356
|
'aria-live'?: "off" | "assertive" | "polite" | undefined;
|
|
357
|
-
'aria-modal'?: (boolean | "
|
|
358
|
-
'aria-multiline'?: (boolean | "
|
|
359
|
-
'aria-multiselectable'?: (boolean | "
|
|
357
|
+
'aria-modal'?: (boolean | "true" | "false") | undefined;
|
|
358
|
+
'aria-multiline'?: (boolean | "true" | "false") | undefined;
|
|
359
|
+
'aria-multiselectable'?: (boolean | "true" | "false") | undefined;
|
|
360
360
|
'aria-orientation'?: "horizontal" | "vertical" | undefined;
|
|
361
361
|
'aria-owns'?: string | undefined;
|
|
362
362
|
'aria-placeholder'?: string | undefined;
|
|
363
363
|
'aria-posinset'?: number | undefined;
|
|
364
|
-
'aria-pressed'?: boolean | "
|
|
365
|
-
'aria-readonly'?: (boolean | "
|
|
366
|
-
'aria-relevant'?: "text" | "
|
|
367
|
-
'aria-required'?: (boolean | "
|
|
364
|
+
'aria-pressed'?: boolean | "true" | "false" | "mixed" | undefined;
|
|
365
|
+
'aria-readonly'?: (boolean | "true" | "false") | undefined;
|
|
366
|
+
'aria-relevant'?: "text" | "additions" | "additions removals" | "additions text" | "all" | "removals" | "removals additions" | "removals text" | "text additions" | "text removals" | undefined;
|
|
367
|
+
'aria-required'?: (boolean | "true" | "false") | undefined;
|
|
368
368
|
'aria-roledescription'?: string | undefined;
|
|
369
369
|
'aria-rowcount'?: number | undefined;
|
|
370
370
|
'aria-rowindex'?: number | undefined;
|
|
371
371
|
'aria-rowindextext'?: string | undefined;
|
|
372
372
|
'aria-rowspan'?: number | undefined;
|
|
373
|
-
'aria-selected'?: (boolean | "
|
|
373
|
+
'aria-selected'?: (boolean | "true" | "false") | undefined;
|
|
374
374
|
'aria-setsize'?: number | undefined;
|
|
375
375
|
'aria-sort'?: "none" | "ascending" | "descending" | "other" | undefined;
|
|
376
376
|
'aria-valuemax'?: number | undefined;
|
|
@@ -554,17 +554,17 @@ export declare const LinkContainer: import("styled-components").IStyledComponent
|
|
|
554
554
|
accessKey?: string | undefined;
|
|
555
555
|
autoFocus?: boolean | undefined;
|
|
556
556
|
className?: string | undefined;
|
|
557
|
-
contentEditable?: "inherit" | (boolean | "
|
|
557
|
+
contentEditable?: "inherit" | (boolean | "true" | "false") | undefined;
|
|
558
558
|
contextMenu?: string | undefined;
|
|
559
559
|
dir?: string | undefined;
|
|
560
|
-
draggable?: (boolean | "
|
|
560
|
+
draggable?: (boolean | "true" | "false") | undefined;
|
|
561
561
|
hidden?: boolean | undefined;
|
|
562
562
|
id?: string | undefined;
|
|
563
563
|
lang?: string | undefined;
|
|
564
564
|
nonce?: string | undefined;
|
|
565
565
|
placeholder?: string | undefined;
|
|
566
566
|
slot?: string | undefined;
|
|
567
|
-
spellCheck?: (boolean | "
|
|
567
|
+
spellCheck?: (boolean | "true" | "false") | undefined;
|
|
568
568
|
style?: React.CSSProperties | undefined;
|
|
569
569
|
tabIndex?: number | undefined;
|
|
570
570
|
title?: string | undefined;
|
|
@@ -594,55 +594,55 @@ export declare const LinkContainer: import("styled-components").IStyledComponent
|
|
|
594
594
|
results?: number | undefined;
|
|
595
595
|
security?: string | undefined;
|
|
596
596
|
unselectable?: "on" | "off" | undefined;
|
|
597
|
-
inputMode?: "search" | "text" | "none" | "
|
|
597
|
+
inputMode?: "search" | "text" | "none" | "tel" | "url" | "email" | "numeric" | "decimal" | undefined;
|
|
598
598
|
is?: string | undefined;
|
|
599
599
|
'aria-activedescendant'?: string | undefined;
|
|
600
|
-
'aria-atomic'?: (boolean | "
|
|
601
|
-
'aria-autocomplete'?: "none" | "
|
|
600
|
+
'aria-atomic'?: (boolean | "true" | "false") | undefined;
|
|
601
|
+
'aria-autocomplete'?: "none" | "inline" | "list" | "both" | undefined;
|
|
602
602
|
'aria-braillelabel'?: string | undefined;
|
|
603
603
|
'aria-brailleroledescription'?: string | undefined;
|
|
604
|
-
'aria-busy'?: (boolean | "
|
|
605
|
-
'aria-checked'?: boolean | "
|
|
604
|
+
'aria-busy'?: (boolean | "true" | "false") | undefined;
|
|
605
|
+
'aria-checked'?: boolean | "true" | "false" | "mixed" | undefined;
|
|
606
606
|
'aria-colcount'?: number | undefined;
|
|
607
607
|
'aria-colindex'?: number | undefined;
|
|
608
608
|
'aria-colindextext'?: string | undefined;
|
|
609
609
|
'aria-colspan'?: number | undefined;
|
|
610
610
|
'aria-controls'?: string | undefined;
|
|
611
|
-
'aria-current'?: boolean | "time" | "
|
|
611
|
+
'aria-current'?: boolean | "time" | "true" | "false" | "page" | "step" | "location" | "date" | undefined;
|
|
612
612
|
'aria-describedby'?: string | undefined;
|
|
613
613
|
'aria-description'?: string | undefined;
|
|
614
614
|
'aria-details'?: string | undefined;
|
|
615
|
-
'aria-disabled'?: (boolean | "
|
|
616
|
-
'aria-dropeffect'?: "link" | "none" | "copy" | "
|
|
615
|
+
'aria-disabled'?: (boolean | "true" | "false") | undefined;
|
|
616
|
+
'aria-dropeffect'?: "link" | "none" | "copy" | "execute" | "move" | "popup" | undefined;
|
|
617
617
|
'aria-errormessage'?: string | undefined;
|
|
618
|
-
'aria-expanded'?: (boolean | "
|
|
618
|
+
'aria-expanded'?: (boolean | "true" | "false") | undefined;
|
|
619
619
|
'aria-flowto'?: string | undefined;
|
|
620
|
-
'aria-grabbed'?: (boolean | "
|
|
621
|
-
'aria-haspopup'?: boolean | "dialog" | "menu" | "
|
|
622
|
-
'aria-hidden'?: (boolean | "
|
|
623
|
-
'aria-invalid'?: boolean | "
|
|
620
|
+
'aria-grabbed'?: (boolean | "true" | "false") | undefined;
|
|
621
|
+
'aria-haspopup'?: boolean | "dialog" | "menu" | "true" | "false" | "grid" | "listbox" | "tree" | undefined;
|
|
622
|
+
'aria-hidden'?: (boolean | "true" | "false") | undefined;
|
|
623
|
+
'aria-invalid'?: boolean | "true" | "false" | "grammar" | "spelling" | undefined;
|
|
624
624
|
'aria-keyshortcuts'?: string | undefined;
|
|
625
625
|
'aria-label'?: string | undefined;
|
|
626
626
|
'aria-labelledby'?: string | undefined;
|
|
627
627
|
'aria-level'?: number | undefined;
|
|
628
628
|
'aria-live'?: "off" | "assertive" | "polite" | undefined;
|
|
629
|
-
'aria-modal'?: (boolean | "
|
|
630
|
-
'aria-multiline'?: (boolean | "
|
|
631
|
-
'aria-multiselectable'?: (boolean | "
|
|
629
|
+
'aria-modal'?: (boolean | "true" | "false") | undefined;
|
|
630
|
+
'aria-multiline'?: (boolean | "true" | "false") | undefined;
|
|
631
|
+
'aria-multiselectable'?: (boolean | "true" | "false") | undefined;
|
|
632
632
|
'aria-orientation'?: "horizontal" | "vertical" | undefined;
|
|
633
633
|
'aria-owns'?: string | undefined;
|
|
634
634
|
'aria-placeholder'?: string | undefined;
|
|
635
635
|
'aria-posinset'?: number | undefined;
|
|
636
|
-
'aria-pressed'?: boolean | "
|
|
637
|
-
'aria-readonly'?: (boolean | "
|
|
638
|
-
'aria-relevant'?: "text" | "
|
|
639
|
-
'aria-required'?: (boolean | "
|
|
636
|
+
'aria-pressed'?: boolean | "true" | "false" | "mixed" | undefined;
|
|
637
|
+
'aria-readonly'?: (boolean | "true" | "false") | undefined;
|
|
638
|
+
'aria-relevant'?: "text" | "additions" | "additions removals" | "additions text" | "all" | "removals" | "removals additions" | "removals text" | "text additions" | "text removals" | undefined;
|
|
639
|
+
'aria-required'?: (boolean | "true" | "false") | undefined;
|
|
640
640
|
'aria-roledescription'?: string | undefined;
|
|
641
641
|
'aria-rowcount'?: number | undefined;
|
|
642
642
|
'aria-rowindex'?: number | undefined;
|
|
643
643
|
'aria-rowindextext'?: string | undefined;
|
|
644
644
|
'aria-rowspan'?: number | undefined;
|
|
645
|
-
'aria-selected'?: (boolean | "
|
|
645
|
+
'aria-selected'?: (boolean | "true" | "false") | undefined;
|
|
646
646
|
'aria-setsize'?: number | undefined;
|
|
647
647
|
'aria-sort'?: "none" | "ascending" | "descending" | "other" | undefined;
|
|
648
648
|
'aria-valuemax'?: number | undefined;
|
|
@@ -2,14 +2,16 @@ import React, { useState } from "react";
|
|
|
2
2
|
import { OnboardingSurvey } from "./onboardingSurvey";
|
|
3
3
|
import { defaultOnboardingConfig } from "./defaultOnboardingConfig";
|
|
4
4
|
import { getOnboardingConfig, submitSurvey, updatePersona, } from "../../api/help-center";
|
|
5
|
+
import { decodeJWT } from "../c3-user-configuration/authToken";
|
|
5
6
|
import { useC3UserConfiguration } from "../c3-user-configuration/c3-user-configuration-provider";
|
|
6
7
|
export const C3OnboardingSurvey = (props) => {
|
|
7
|
-
const { userToken,
|
|
8
|
+
const { userToken, activeOrganizationId } = useC3UserConfiguration() || {};
|
|
8
9
|
const [persona, setPersona] = useState(props.persona);
|
|
9
10
|
const [userId, setUserId] = useState("");
|
|
10
11
|
const [token, setToken] = useState("");
|
|
11
12
|
const [audience, setAudience] = useState("");
|
|
12
13
|
const [onboardConfig, setOnboardConfig] = useState(defaultOnboardingConfig);
|
|
14
|
+
const [isLoadingConfig, setIsLoadingConfig] = useState(false);
|
|
13
15
|
const [givenName, setGivenName] = useState("");
|
|
14
16
|
const [email, setEmail] = useState("");
|
|
15
17
|
React.useEffect(() => {
|
|
@@ -17,6 +19,7 @@ export const C3OnboardingSurvey = (props) => {
|
|
|
17
19
|
return;
|
|
18
20
|
setToken(userToken);
|
|
19
21
|
(async () => {
|
|
22
|
+
const decodedToken = decodeJWT(userToken);
|
|
20
23
|
if (!decodedToken)
|
|
21
24
|
return;
|
|
22
25
|
const { userId, meta, audience, persona } = decodedToken;
|
|
@@ -34,11 +37,13 @@ export const C3OnboardingSurvey = (props) => {
|
|
|
34
37
|
setUserId(userId);
|
|
35
38
|
setOnboardConfig(defaultOnboardingConfig);
|
|
36
39
|
if (decodedAudience) {
|
|
40
|
+
setIsLoadingConfig(true);
|
|
37
41
|
const config = await getOnboardingConfig({
|
|
38
42
|
audience: decodedAudience,
|
|
39
43
|
camundaAuth: { token: userToken },
|
|
40
44
|
});
|
|
41
45
|
setOnboardConfig(config);
|
|
46
|
+
setIsLoadingConfig(false);
|
|
42
47
|
}
|
|
43
48
|
})();
|
|
44
49
|
}, [userToken]);
|
|
@@ -90,5 +95,5 @@ export const C3OnboardingSurvey = (props) => {
|
|
|
90
95
|
setPersona(newPersona);
|
|
91
96
|
props.personaCallback(newPersona);
|
|
92
97
|
};
|
|
93
|
-
return (React.createElement(OnboardingSurvey, { appTheme: props.theme, userFirstName: givenName, persona: persona, syncPersona: syncPersona, setPersona: setPersona, mixpanelTrack: props.mixpanelTrack, onRequestClose: closeFn, onboardingConfiguration: onboardConfig, modal: props.modal, origin: props.origin }));
|
|
98
|
+
return (React.createElement(OnboardingSurvey, { appTheme: props.theme, userFirstName: givenName, persona: persona, syncPersona: syncPersona, setPersona: setPersona, mixpanelTrack: props.mixpanelTrack, onRequestClose: closeFn, onboardingConfiguration: onboardConfig, isLoadingConfig: isLoadingConfig, modal: props.modal, origin: props.origin }));
|
|
94
99
|
};
|
|
@@ -10,6 +10,7 @@ export declare const OnboardingSurvey: FC<{
|
|
|
10
10
|
setPersona: (persona: Persona) => void;
|
|
11
11
|
onRequestClose: (skip: boolean) => Promise<void>;
|
|
12
12
|
onboardingConfiguration: OnboardingConfig;
|
|
13
|
+
isLoadingConfig: boolean;
|
|
13
14
|
modal: boolean;
|
|
14
15
|
origin: string;
|
|
15
16
|
mixpanelTrack?: (event: string, data: Dict | undefined) => void;
|
|
@@ -1,10 +1,10 @@
|
|
|
1
|
-
import { ProgressIndicator, ProgressStep, Stack } from "@carbon/react";
|
|
1
|
+
import { Loading, ProgressIndicator, ProgressStep, Stack } from "@carbon/react";
|
|
2
2
|
import React, { useState } from "react";
|
|
3
3
|
import { OnboardingModal } from "./onboardingModal";
|
|
4
4
|
import { OnboardingPage } from "./onboardingPage";
|
|
5
5
|
import { OnboardingStep } from "./step";
|
|
6
6
|
import { Body01 } from "../styles";
|
|
7
|
-
export const OnboardingSurvey = ({ appTheme, persona, userFirstName, syncPersona, setPersona, mixpanelTrack, onRequestClose, onboardingConfiguration, modal, origin, }) => {
|
|
7
|
+
export const OnboardingSurvey = ({ appTheme, persona, userFirstName, syncPersona, setPersona, mixpanelTrack, onRequestClose, onboardingConfiguration, isLoadingConfig, modal, origin, }) => {
|
|
8
8
|
const [step, setStep] = useState(persona?.nextStep ?? 0);
|
|
9
9
|
const [isDoingAsyncWork, setIsDoingAsyncWork] = useState(false);
|
|
10
10
|
React.useEffect(() => {
|
|
@@ -119,11 +119,7 @@ export const OnboardingSurvey = ({ appTheme, persona, userFirstName, syncPersona
|
|
|
119
119
|
const content = (React.createElement(React.Fragment, null,
|
|
120
120
|
React.createElement(Body01, null, "Get personalized next steps and educational content by answering this 1-minute survey."),
|
|
121
121
|
React.createElement(Stack, { gap: 8 },
|
|
122
|
-
React.createElement(ProgressIndicator, { currentIndex: step, spaceEqually: true, onChange: tryStepTo }, (() => {
|
|
123
|
-
return onboardingConfiguration.steps.map((currentStep, index) => {
|
|
124
|
-
return (React.createElement(ProgressStep, { label: `Step ${index + 1}`, secondaryLabel: currentStep.title, key: `onboarding-step-${index}`, disabled: step !== index }));
|
|
125
|
-
});
|
|
126
|
-
})()),
|
|
122
|
+
React.createElement(ProgressIndicator, { currentIndex: step, spaceEqually: true, onChange: tryStepTo }, isLoadingConfig ? (React.createElement(Loading, null)) : (onboardingConfiguration.steps.map((currentStep, index) => (React.createElement(ProgressStep, { label: `Step ${index + 1}`, secondaryLabel: currentStep.title, key: `onboarding-step-${index}`, disabled: step !== index }))))),
|
|
127
123
|
React.createElement(OnboardingStep, { theme: theme, generic: generic, setGeneric: setGeneric, config: onboardingConfiguration.steps[step] }))));
|
|
128
124
|
if (modal) {
|
|
129
125
|
return (React.createElement(OnboardingModal, { isDoingAsyncWork: isDoingAsyncWork, heading: `Welcome to Camunda 8, ${userFirstName}!`, headingLabel: "", primaryButtonText: "Next", primaryButtonDisabled: !nextEnabled(step), secondaryButtonText: step === 0 ? undefined : "Previous", tertiaryButtonText: step === 0 ? "Skip customization" : undefined, loadingText: "Loading", theme: theme, onPrimary: stepForward, onRequestClose: onRequestClose, onSecondary: secondaryButtonAction, onTertiary: step === 0 ? secondaryButtonAction : undefined }, content));
|
|
@@ -19,12 +19,11 @@ export type Meta = {
|
|
|
19
19
|
email: string;
|
|
20
20
|
};
|
|
21
21
|
export declare const getMeta: (token: Token) => Meta | undefined;
|
|
22
|
-
export
|
|
23
|
-
audience?: string | string[];
|
|
24
|
-
persona?: Persona;
|
|
22
|
+
export declare const decodeJWT: (userToken: string) => {
|
|
23
|
+
audience?: string | string[] | undefined;
|
|
24
|
+
persona?: Persona | undefined;
|
|
25
25
|
decodedToken: Token;
|
|
26
|
-
userId?: string;
|
|
27
|
-
meta?: Meta;
|
|
28
|
-
};
|
|
29
|
-
export declare const decodeJWT: (userToken: string) => null | DecodedToken;
|
|
26
|
+
userId?: string | undefined;
|
|
27
|
+
meta?: Meta | undefined;
|
|
28
|
+
} | null;
|
|
30
29
|
export {};
|
package/lib/esm/components/c3-user-configuration/c3-profile-provider/c3-profile-provider.d.ts
CHANGED
|
@@ -1,12 +1,10 @@
|
|
|
1
1
|
import React, { FC, PropsWithChildren } from "react";
|
|
2
2
|
import { ResolvedTheme } from "./carbon-theme-provider";
|
|
3
|
-
import { Cluster } from "../../c3-help-center/c3-help-center.types";
|
|
4
3
|
export type Theme = "light" | "dark" | "system";
|
|
5
4
|
export declare const defaultTheme: "light";
|
|
6
5
|
export type C3ProfileContextValue = {
|
|
7
6
|
isEnabled: boolean;
|
|
8
7
|
theme: Theme;
|
|
9
|
-
clusters: Cluster[] | null;
|
|
10
8
|
resolvedTheme: ResolvedTheme;
|
|
11
9
|
onThemeChange: (newTheme: Theme) => void;
|
|
12
10
|
};
|
|
@@ -2,32 +2,18 @@ import React, { createContext, useContext, useEffect, useRef, useState, } from "
|
|
|
2
2
|
import { C3UserConfigurationContext } from "../c3-user-configuration-provider";
|
|
3
3
|
import { getUserTheme, updateTheme } from "../../../api/profile";
|
|
4
4
|
import { CarbonThemeProvider, resolveTheme, } from "./carbon-theme-provider";
|
|
5
|
-
import { getClusters } from "../../../api/help-center";
|
|
6
5
|
export const defaultTheme = "light";
|
|
7
6
|
export const C3ProfileContext = createContext({
|
|
8
7
|
isEnabled: false,
|
|
9
8
|
theme: defaultTheme,
|
|
10
|
-
clusters: null,
|
|
11
9
|
resolvedTheme: defaultTheme,
|
|
12
10
|
onThemeChange: () => undefined,
|
|
13
11
|
});
|
|
14
12
|
export const C3ProfileProvider = ({ children }) => {
|
|
15
|
-
const
|
|
13
|
+
const config = useContext(C3UserConfigurationContext);
|
|
16
14
|
const isEnabled = !!config;
|
|
17
15
|
const themeRef = useRef(getUserTheme(config.userToken) || defaultTheme);
|
|
18
16
|
const [resolvedTheme, setResolvedTheme] = useState(defaultTheme);
|
|
19
|
-
const [clusters, setClusters] = useState(null);
|
|
20
|
-
useEffect(() => {
|
|
21
|
-
if (!decodedToken)
|
|
22
|
-
return;
|
|
23
|
-
const { audience } = decodedToken;
|
|
24
|
-
const decodedAudience = typeof audience === "string" ? audience : audience?.[0];
|
|
25
|
-
if (decodedAudience) {
|
|
26
|
-
getClusters(decodedAudience, config.userToken, config.activeOrganizationId).then((res) => {
|
|
27
|
-
setClusters(res);
|
|
28
|
-
});
|
|
29
|
-
}
|
|
30
|
-
}, [config?.userToken, config?.activeOrganizationId]);
|
|
31
17
|
useEffect(() => {
|
|
32
18
|
const updateSystemTheme = ({ matches }) => {
|
|
33
19
|
if (themeRef.current === "system")
|
|
@@ -64,7 +50,6 @@ export const C3ProfileProvider = ({ children }) => {
|
|
|
64
50
|
isEnabled,
|
|
65
51
|
theme: themeRef.current,
|
|
66
52
|
resolvedTheme,
|
|
67
|
-
clusters,
|
|
68
53
|
onThemeChange,
|
|
69
54
|
} },
|
|
70
55
|
React.createElement(CarbonThemeProvider, null, children))) : (children);
|
|
@@ -1,6 +1,5 @@
|
|
|
1
1
|
import React, { FC, ReactNode } from "react";
|
|
2
2
|
import { Endpoints, Stage } from "../../api/endpoints.const";
|
|
3
|
-
import { DecodedToken } from "./authToken";
|
|
4
3
|
type C3UserConfigurationBase = {
|
|
5
4
|
activeOrganizationId: string;
|
|
6
5
|
userToken: string;
|
|
@@ -15,12 +14,9 @@ type C3UserConfigurationWithStage = C3UserConfigurationBase & {
|
|
|
15
14
|
handleTheme?: boolean;
|
|
16
15
|
};
|
|
17
16
|
export type C3UserConfiguration = C3UserConfigurationWithEndpoints | C3UserConfigurationWithStage;
|
|
18
|
-
export
|
|
19
|
-
decodedToken: DecodedToken | null;
|
|
20
|
-
};
|
|
21
|
-
export declare const C3UserConfigurationContext: React.Context<C3UserConfigurationContextValue>;
|
|
17
|
+
export declare const C3UserConfigurationContext: React.Context<C3UserConfiguration>;
|
|
22
18
|
declare const C3UserConfigurationProvider: FC<C3UserConfiguration & {
|
|
23
19
|
children?: ReactNode;
|
|
24
20
|
}>;
|
|
25
|
-
export declare const useC3UserConfiguration: () =>
|
|
21
|
+
export declare const useC3UserConfiguration: () => C3UserConfiguration;
|
|
26
22
|
export default C3UserConfigurationProvider;
|
|
@@ -1,21 +1,12 @@
|
|
|
1
|
-
import React, { useContext
|
|
1
|
+
import React, { useContext } from "react";
|
|
2
2
|
import { C3ProfileProvider } from "./c3-profile-provider/c3-profile-provider";
|
|
3
|
-
import { decodeJWT } from "./authToken";
|
|
4
3
|
export const C3UserConfigurationContext = React.createContext({
|
|
5
4
|
stage: "dev",
|
|
6
5
|
activeOrganizationId: "",
|
|
7
6
|
userToken: "",
|
|
8
|
-
decodedToken: null,
|
|
9
7
|
getNewUserToken: () => Promise.resolve(""),
|
|
10
8
|
});
|
|
11
|
-
const C3UserConfigurationProvider = ({ children, ...config }) => {
|
|
12
|
-
|
|
13
|
-
useEffect(() => {
|
|
14
|
-
if (config.userToken)
|
|
15
|
-
setDecodedToken(decodeJWT(config.userToken));
|
|
16
|
-
}, [config.userToken]);
|
|
17
|
-
return (React.createElement(C3UserConfigurationContext.Provider, { value: { ...config, decodedToken } },
|
|
18
|
-
React.createElement(C3ProfileProvider, null, children)));
|
|
19
|
-
};
|
|
9
|
+
const C3UserConfigurationProvider = ({ children, ...config }) => (React.createElement(C3UserConfigurationContext.Provider, { value: config },
|
|
10
|
+
React.createElement(C3ProfileProvider, null, children)));
|
|
20
11
|
export const useC3UserConfiguration = () => useContext(C3UserConfigurationContext);
|
|
21
12
|
export default C3UserConfigurationProvider;
|
|
@@ -11,17 +11,17 @@ export declare const Body02: import("styled-components").IStyledComponent<"web",
|
|
|
11
11
|
accessKey?: string | undefined;
|
|
12
12
|
autoFocus?: boolean | undefined;
|
|
13
13
|
className?: string | undefined;
|
|
14
|
-
contentEditable?: "inherit" | (boolean | "
|
|
14
|
+
contentEditable?: "inherit" | (boolean | "true" | "false") | undefined;
|
|
15
15
|
contextMenu?: string | undefined;
|
|
16
16
|
dir?: string | undefined;
|
|
17
|
-
draggable?: (boolean | "
|
|
17
|
+
draggable?: (boolean | "true" | "false") | undefined;
|
|
18
18
|
hidden?: boolean | undefined;
|
|
19
19
|
id?: string | undefined;
|
|
20
20
|
lang?: string | undefined;
|
|
21
21
|
nonce?: string | undefined;
|
|
22
22
|
placeholder?: string | undefined;
|
|
23
23
|
slot?: string | undefined;
|
|
24
|
-
spellCheck?: (boolean | "
|
|
24
|
+
spellCheck?: (boolean | "true" | "false") | undefined;
|
|
25
25
|
style?: import("react").CSSProperties | undefined;
|
|
26
26
|
tabIndex?: number | undefined;
|
|
27
27
|
title?: string | undefined;
|
|
@@ -51,55 +51,55 @@ export declare const Body02: import("styled-components").IStyledComponent<"web",
|
|
|
51
51
|
results?: number | undefined;
|
|
52
52
|
security?: string | undefined;
|
|
53
53
|
unselectable?: "on" | "off" | undefined;
|
|
54
|
-
inputMode?: "search" | "text" | "none" | "
|
|
54
|
+
inputMode?: "search" | "text" | "none" | "tel" | "url" | "email" | "numeric" | "decimal" | undefined;
|
|
55
55
|
is?: string | undefined;
|
|
56
56
|
'aria-activedescendant'?: string | undefined;
|
|
57
|
-
'aria-atomic'?: (boolean | "
|
|
58
|
-
'aria-autocomplete'?: "none" | "
|
|
57
|
+
'aria-atomic'?: (boolean | "true" | "false") | undefined;
|
|
58
|
+
'aria-autocomplete'?: "none" | "inline" | "list" | "both" | undefined;
|
|
59
59
|
'aria-braillelabel'?: string | undefined;
|
|
60
60
|
'aria-brailleroledescription'?: string | undefined;
|
|
61
|
-
'aria-busy'?: (boolean | "
|
|
62
|
-
'aria-checked'?: boolean | "
|
|
61
|
+
'aria-busy'?: (boolean | "true" | "false") | undefined;
|
|
62
|
+
'aria-checked'?: boolean | "true" | "false" | "mixed" | undefined;
|
|
63
63
|
'aria-colcount'?: number | undefined;
|
|
64
64
|
'aria-colindex'?: number | undefined;
|
|
65
65
|
'aria-colindextext'?: string | undefined;
|
|
66
66
|
'aria-colspan'?: number | undefined;
|
|
67
67
|
'aria-controls'?: string | undefined;
|
|
68
|
-
'aria-current'?: boolean | "time" | "
|
|
68
|
+
'aria-current'?: boolean | "time" | "true" | "false" | "page" | "step" | "location" | "date" | undefined;
|
|
69
69
|
'aria-describedby'?: string | undefined;
|
|
70
70
|
'aria-description'?: string | undefined;
|
|
71
71
|
'aria-details'?: string | undefined;
|
|
72
|
-
'aria-disabled'?: (boolean | "
|
|
73
|
-
'aria-dropeffect'?: "link" | "none" | "copy" | "
|
|
72
|
+
'aria-disabled'?: (boolean | "true" | "false") | undefined;
|
|
73
|
+
'aria-dropeffect'?: "link" | "none" | "copy" | "execute" | "move" | "popup" | undefined;
|
|
74
74
|
'aria-errormessage'?: string | undefined;
|
|
75
|
-
'aria-expanded'?: (boolean | "
|
|
75
|
+
'aria-expanded'?: (boolean | "true" | "false") | undefined;
|
|
76
76
|
'aria-flowto'?: string | undefined;
|
|
77
|
-
'aria-grabbed'?: (boolean | "
|
|
78
|
-
'aria-haspopup'?: boolean | "dialog" | "menu" | "
|
|
79
|
-
'aria-hidden'?: (boolean | "
|
|
80
|
-
'aria-invalid'?: boolean | "
|
|
77
|
+
'aria-grabbed'?: (boolean | "true" | "false") | undefined;
|
|
78
|
+
'aria-haspopup'?: boolean | "dialog" | "menu" | "true" | "false" | "grid" | "listbox" | "tree" | undefined;
|
|
79
|
+
'aria-hidden'?: (boolean | "true" | "false") | undefined;
|
|
80
|
+
'aria-invalid'?: boolean | "true" | "false" | "grammar" | "spelling" | undefined;
|
|
81
81
|
'aria-keyshortcuts'?: string | undefined;
|
|
82
82
|
'aria-label'?: string | undefined;
|
|
83
83
|
'aria-labelledby'?: string | undefined;
|
|
84
84
|
'aria-level'?: number | undefined;
|
|
85
85
|
'aria-live'?: "off" | "assertive" | "polite" | undefined;
|
|
86
|
-
'aria-modal'?: (boolean | "
|
|
87
|
-
'aria-multiline'?: (boolean | "
|
|
88
|
-
'aria-multiselectable'?: (boolean | "
|
|
86
|
+
'aria-modal'?: (boolean | "true" | "false") | undefined;
|
|
87
|
+
'aria-multiline'?: (boolean | "true" | "false") | undefined;
|
|
88
|
+
'aria-multiselectable'?: (boolean | "true" | "false") | undefined;
|
|
89
89
|
'aria-orientation'?: "horizontal" | "vertical" | undefined;
|
|
90
90
|
'aria-owns'?: string | undefined;
|
|
91
91
|
'aria-placeholder'?: string | undefined;
|
|
92
92
|
'aria-posinset'?: number | undefined;
|
|
93
|
-
'aria-pressed'?: boolean | "
|
|
94
|
-
'aria-readonly'?: (boolean | "
|
|
95
|
-
'aria-relevant'?: "text" | "
|
|
96
|
-
'aria-required'?: (boolean | "
|
|
93
|
+
'aria-pressed'?: boolean | "true" | "false" | "mixed" | undefined;
|
|
94
|
+
'aria-readonly'?: (boolean | "true" | "false") | undefined;
|
|
95
|
+
'aria-relevant'?: "text" | "additions" | "additions removals" | "additions text" | "all" | "removals" | "removals additions" | "removals text" | "text additions" | "text removals" | undefined;
|
|
96
|
+
'aria-required'?: (boolean | "true" | "false") | undefined;
|
|
97
97
|
'aria-roledescription'?: string | undefined;
|
|
98
98
|
'aria-rowcount'?: number | undefined;
|
|
99
99
|
'aria-rowindex'?: number | undefined;
|
|
100
100
|
'aria-rowindextext'?: string | undefined;
|
|
101
101
|
'aria-rowspan'?: number | undefined;
|
|
102
|
-
'aria-selected'?: (boolean | "
|
|
102
|
+
'aria-selected'?: (boolean | "true" | "false") | undefined;
|
|
103
103
|
'aria-setsize'?: number | undefined;
|
|
104
104
|
'aria-sort'?: "none" | "ascending" | "descending" | "other" | undefined;
|
|
105
105
|
'aria-valuemax'?: number | undefined;
|
|
@@ -284,17 +284,17 @@ export declare const Body01: import("styled-components").IStyledComponent<"web",
|
|
|
284
284
|
accessKey?: string | undefined;
|
|
285
285
|
autoFocus?: boolean | undefined;
|
|
286
286
|
className?: string | undefined;
|
|
287
|
-
contentEditable?: "inherit" | (boolean | "
|
|
287
|
+
contentEditable?: "inherit" | (boolean | "true" | "false") | undefined;
|
|
288
288
|
contextMenu?: string | undefined;
|
|
289
289
|
dir?: string | undefined;
|
|
290
|
-
draggable?: (boolean | "
|
|
290
|
+
draggable?: (boolean | "true" | "false") | undefined;
|
|
291
291
|
hidden?: boolean | undefined;
|
|
292
292
|
id?: string | undefined;
|
|
293
293
|
lang?: string | undefined;
|
|
294
294
|
nonce?: string | undefined;
|
|
295
295
|
placeholder?: string | undefined;
|
|
296
296
|
slot?: string | undefined;
|
|
297
|
-
spellCheck?: (boolean | "
|
|
297
|
+
spellCheck?: (boolean | "true" | "false") | undefined;
|
|
298
298
|
style?: import("react").CSSProperties | undefined;
|
|
299
299
|
tabIndex?: number | undefined;
|
|
300
300
|
title?: string | undefined;
|
|
@@ -324,55 +324,55 @@ export declare const Body01: import("styled-components").IStyledComponent<"web",
|
|
|
324
324
|
results?: number | undefined;
|
|
325
325
|
security?: string | undefined;
|
|
326
326
|
unselectable?: "on" | "off" | undefined;
|
|
327
|
-
inputMode?: "search" | "text" | "none" | "
|
|
327
|
+
inputMode?: "search" | "text" | "none" | "tel" | "url" | "email" | "numeric" | "decimal" | undefined;
|
|
328
328
|
is?: string | undefined;
|
|
329
329
|
'aria-activedescendant'?: string | undefined;
|
|
330
|
-
'aria-atomic'?: (boolean | "
|
|
331
|
-
'aria-autocomplete'?: "none" | "
|
|
330
|
+
'aria-atomic'?: (boolean | "true" | "false") | undefined;
|
|
331
|
+
'aria-autocomplete'?: "none" | "inline" | "list" | "both" | undefined;
|
|
332
332
|
'aria-braillelabel'?: string | undefined;
|
|
333
333
|
'aria-brailleroledescription'?: string | undefined;
|
|
334
|
-
'aria-busy'?: (boolean | "
|
|
335
|
-
'aria-checked'?: boolean | "
|
|
334
|
+
'aria-busy'?: (boolean | "true" | "false") | undefined;
|
|
335
|
+
'aria-checked'?: boolean | "true" | "false" | "mixed" | undefined;
|
|
336
336
|
'aria-colcount'?: number | undefined;
|
|
337
337
|
'aria-colindex'?: number | undefined;
|
|
338
338
|
'aria-colindextext'?: string | undefined;
|
|
339
339
|
'aria-colspan'?: number | undefined;
|
|
340
340
|
'aria-controls'?: string | undefined;
|
|
341
|
-
'aria-current'?: boolean | "time" | "
|
|
341
|
+
'aria-current'?: boolean | "time" | "true" | "false" | "page" | "step" | "location" | "date" | undefined;
|
|
342
342
|
'aria-describedby'?: string | undefined;
|
|
343
343
|
'aria-description'?: string | undefined;
|
|
344
344
|
'aria-details'?: string | undefined;
|
|
345
|
-
'aria-disabled'?: (boolean | "
|
|
346
|
-
'aria-dropeffect'?: "link" | "none" | "copy" | "
|
|
345
|
+
'aria-disabled'?: (boolean | "true" | "false") | undefined;
|
|
346
|
+
'aria-dropeffect'?: "link" | "none" | "copy" | "execute" | "move" | "popup" | undefined;
|
|
347
347
|
'aria-errormessage'?: string | undefined;
|
|
348
|
-
'aria-expanded'?: (boolean | "
|
|
348
|
+
'aria-expanded'?: (boolean | "true" | "false") | undefined;
|
|
349
349
|
'aria-flowto'?: string | undefined;
|
|
350
|
-
'aria-grabbed'?: (boolean | "
|
|
351
|
-
'aria-haspopup'?: boolean | "dialog" | "menu" | "
|
|
352
|
-
'aria-hidden'?: (boolean | "
|
|
353
|
-
'aria-invalid'?: boolean | "
|
|
350
|
+
'aria-grabbed'?: (boolean | "true" | "false") | undefined;
|
|
351
|
+
'aria-haspopup'?: boolean | "dialog" | "menu" | "true" | "false" | "grid" | "listbox" | "tree" | undefined;
|
|
352
|
+
'aria-hidden'?: (boolean | "true" | "false") | undefined;
|
|
353
|
+
'aria-invalid'?: boolean | "true" | "false" | "grammar" | "spelling" | undefined;
|
|
354
354
|
'aria-keyshortcuts'?: string | undefined;
|
|
355
355
|
'aria-label'?: string | undefined;
|
|
356
356
|
'aria-labelledby'?: string | undefined;
|
|
357
357
|
'aria-level'?: number | undefined;
|
|
358
358
|
'aria-live'?: "off" | "assertive" | "polite" | undefined;
|
|
359
|
-
'aria-modal'?: (boolean | "
|
|
360
|
-
'aria-multiline'?: (boolean | "
|
|
361
|
-
'aria-multiselectable'?: (boolean | "
|
|
359
|
+
'aria-modal'?: (boolean | "true" | "false") | undefined;
|
|
360
|
+
'aria-multiline'?: (boolean | "true" | "false") | undefined;
|
|
361
|
+
'aria-multiselectable'?: (boolean | "true" | "false") | undefined;
|
|
362
362
|
'aria-orientation'?: "horizontal" | "vertical" | undefined;
|
|
363
363
|
'aria-owns'?: string | undefined;
|
|
364
364
|
'aria-placeholder'?: string | undefined;
|
|
365
365
|
'aria-posinset'?: number | undefined;
|
|
366
|
-
'aria-pressed'?: boolean | "
|
|
367
|
-
'aria-readonly'?: (boolean | "
|
|
368
|
-
'aria-relevant'?: "text" | "
|
|
369
|
-
'aria-required'?: (boolean | "
|
|
366
|
+
'aria-pressed'?: boolean | "true" | "false" | "mixed" | undefined;
|
|
367
|
+
'aria-readonly'?: (boolean | "true" | "false") | undefined;
|
|
368
|
+
'aria-relevant'?: "text" | "additions" | "additions removals" | "additions text" | "all" | "removals" | "removals additions" | "removals text" | "text additions" | "text removals" | undefined;
|
|
369
|
+
'aria-required'?: (boolean | "true" | "false") | undefined;
|
|
370
370
|
'aria-roledescription'?: string | undefined;
|
|
371
371
|
'aria-rowcount'?: number | undefined;
|
|
372
372
|
'aria-rowindex'?: number | undefined;
|
|
373
373
|
'aria-rowindextext'?: string | undefined;
|
|
374
374
|
'aria-rowspan'?: number | undefined;
|
|
375
|
-
'aria-selected'?: (boolean | "
|
|
375
|
+
'aria-selected'?: (boolean | "true" | "false") | undefined;
|
|
376
376
|
'aria-setsize'?: number | undefined;
|
|
377
377
|
'aria-sort'?: "none" | "ascending" | "descending" | "other" | undefined;
|
|
378
378
|
'aria-valuemax'?: number | undefined;
|
package/lib/esm/index.d.ts
CHANGED
|
@@ -1,11 +1,10 @@
|
|
|
1
|
-
export { C3ClusterTag } from "./components/c3-cluster-tag/c3-cluster-tag";
|
|
2
|
-
export { C3ClusterTagProps, CamundaClusterStage, CamundaClusterStageLabel, StageClusterLabels, } from "./components/c3-cluster-tag/c3-cluster-tag.types";
|
|
3
1
|
export { C3EmptyState } from "./components/c3-empty-state/c3-empty-state";
|
|
4
2
|
export { C3EmptyStateProps } from "./components/c3-empty-state/c3-empty-state.types";
|
|
5
3
|
export { default as C3Navigation } from "./components/c3-navigation";
|
|
6
|
-
export { C3NavigationSideBarBaseProps } from "./components/c3-navigation/c3-navigation-sidebar/c3-navigation-sidebar.types";
|
|
7
4
|
export { C3NavigationAppProps, C3NavigationElementProps, C3NavigationNavBarProps, C3NavigationProps, } from "./components/c3-navigation/c3-navigation.types";
|
|
8
|
-
export {
|
|
9
|
-
export { C3UserConfiguration, default as C3UserConfigurationProvider, } from "./components/c3-user-configuration/c3-user-configuration-provider";
|
|
5
|
+
export { C3NavigationSideBarBaseProps } from "./components/c3-navigation/c3-navigation-sidebar/c3-navigation-sidebar.types";
|
|
10
6
|
export { C3AppMenuIcon } from "./icons/c3-icons";
|
|
11
7
|
export { C3IconProps } from "./icons/c3-icons.types";
|
|
8
|
+
export { default as C3UserConfigurationProvider } from "./components/c3-user-configuration/c3-user-configuration-provider";
|
|
9
|
+
export { C3UserConfiguration } from "./components/c3-user-configuration/c3-user-configuration-provider";
|
|
10
|
+
export { useC3Profile } from "./components/c3-user-configuration/c3-profile-provider/c3-profile-provider";
|
package/lib/esm/index.js
CHANGED
|
@@ -1,7 +1,5 @@
|
|
|
1
|
-
export { C3ClusterTag } from "./components/c3-cluster-tag/c3-cluster-tag";
|
|
2
|
-
export { StageClusterLabels, } from "./components/c3-cluster-tag/c3-cluster-tag.types";
|
|
3
1
|
export { C3EmptyState } from "./components/c3-empty-state/c3-empty-state";
|
|
4
2
|
export { default as C3Navigation } from "./components/c3-navigation";
|
|
5
|
-
export { useC3Profile } from "./components/c3-user-configuration/c3-profile-provider/c3-profile-provider";
|
|
6
|
-
export { default as C3UserConfigurationProvider, } from "./components/c3-user-configuration/c3-user-configuration-provider";
|
|
7
3
|
export { C3AppMenuIcon } from "./icons/c3-icons";
|
|
4
|
+
export { default as C3UserConfigurationProvider } from "./components/c3-user-configuration/c3-user-configuration-provider";
|
|
5
|
+
export { useC3Profile } from "./components/c3-user-configuration/c3-profile-provider/c3-profile-provider";
|
package/package.json
CHANGED
|
@@ -1,29 +0,0 @@
|
|
|
1
|
-
import React from "react";
|
|
2
|
-
import { Tag } from "@carbon/react";
|
|
3
|
-
import { useC3Profile } from "../c3-user-configuration/c3-profile-provider/c3-profile-provider";
|
|
4
|
-
export const C3ClusterTag = (props) => {
|
|
5
|
-
const { clusters } = useC3Profile();
|
|
6
|
-
return "stage" in props ? (React.createElement(Tag, { type: getColorForStage(props.stage) }, props.stage)) : "clusterUuid" in props ? (generateFromInput(props.clusterUuid, clusters)) : (React.createElement(React.Fragment, null));
|
|
7
|
-
};
|
|
8
|
-
function generateFromInput(clusterUuid, allClusters) {
|
|
9
|
-
const foundCluster = allClusters?.find((cluster) => cluster.uuid === clusterUuid);
|
|
10
|
-
if (foundCluster?.labels?.camunda && foundCluster.labels.camunda.length > 0) {
|
|
11
|
-
const label = foundCluster.labels.camunda[0];
|
|
12
|
-
return getColorForStage(label) ? (React.createElement(Tag, { type: getColorForStage(label) }, label)) : (React.createElement(React.Fragment, null));
|
|
13
|
-
}
|
|
14
|
-
return React.createElement(React.Fragment, null);
|
|
15
|
-
}
|
|
16
|
-
function getColorForStage(stage) {
|
|
17
|
-
switch (stage) {
|
|
18
|
-
case "dev":
|
|
19
|
-
return "green";
|
|
20
|
-
case "test":
|
|
21
|
-
return "blue";
|
|
22
|
-
case "stage":
|
|
23
|
-
return "purple";
|
|
24
|
-
case "prod":
|
|
25
|
-
return "red";
|
|
26
|
-
default:
|
|
27
|
-
return undefined;
|
|
28
|
-
}
|
|
29
|
-
}
|
|
@@ -1,13 +0,0 @@
|
|
|
1
|
-
export declare const StageClusterLabels: {
|
|
2
|
-
readonly dev: "dev";
|
|
3
|
-
readonly test: "test";
|
|
4
|
-
readonly stage: "stage";
|
|
5
|
-
readonly prod: "prod";
|
|
6
|
-
};
|
|
7
|
-
export type CamundaClusterStage = keyof typeof StageClusterLabels;
|
|
8
|
-
export type CamundaClusterStageLabel = (typeof StageClusterLabels)[CamundaClusterStage];
|
|
9
|
-
export type C3ClusterTagProps = {
|
|
10
|
-
clusterUuid: string;
|
|
11
|
-
} | {
|
|
12
|
-
stage: CamundaClusterStage;
|
|
13
|
-
};
|