@camunda/camunda-composite-components 0.2.4-rc.2 → 0.2.5-rc.0

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.
@@ -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", { style: { paddingLeft: "256px" } },
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", { style: { paddingLeft: "256px" } },
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: {
@@ -10,6 +10,7 @@ export const C3OnboardingSurvey = (props) => {
10
10
  const [token, setToken] = useState("");
11
11
  const [audience, setAudience] = useState("");
12
12
  const [onboardConfig, setOnboardConfig] = useState(defaultOnboardingConfig);
13
+ const [isLoadingConfig, setIsLoadingConfig] = useState(false);
13
14
  const [givenName, setGivenName] = useState("");
14
15
  const [email, setEmail] = useState("");
15
16
  React.useEffect(() => {
@@ -34,11 +35,13 @@ export const C3OnboardingSurvey = (props) => {
34
35
  setUserId(userId);
35
36
  setOnboardConfig(defaultOnboardingConfig);
36
37
  if (decodedAudience) {
38
+ setIsLoadingConfig(true);
37
39
  const config = await getOnboardingConfig({
38
40
  audience: decodedAudience,
39
41
  camundaAuth: { token: userToken },
40
42
  });
41
43
  setOnboardConfig(config);
44
+ setIsLoadingConfig(false);
42
45
  }
43
46
  })();
44
47
  }, [userToken]);
@@ -90,5 +93,5 @@ export const C3OnboardingSurvey = (props) => {
90
93
  setPersona(newPersona);
91
94
  props.personaCallback(newPersona);
92
95
  };
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 }));
96
+ 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
97
  };
@@ -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));
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@camunda/camunda-composite-components",
3
- "version": "0.2.4-rc.2",
3
+ "version": "0.2.5-rc.0",
4
4
  "scripts": {
5
5
  "clean": "rimraf lib/",
6
6
  "build": "yarn clean && tsc",
@@ -26,10 +26,10 @@
26
26
  "test": "yarn test:ts && yarn test:storybook && yarn test:visual-regression:docker"
27
27
  },
28
28
  "devDependencies": {
29
- "@babel/core": "7.22.11",
30
- "@babel/preset-env": "7.22.14",
31
- "@babel/preset-react": "7.22.5",
32
- "@babel/preset-typescript": "7.22.11",
29
+ "@babel/core": "7.22.15",
30
+ "@babel/preset-env": "7.22.15",
31
+ "@babel/preset-react": "7.22.15",
32
+ "@babel/preset-typescript": "7.22.15",
33
33
  "@carbon/react": "1.37.0",
34
34
  "@mdx-js/react": "2.3.0",
35
35
  "@playwright/test": "1.37.1",