@camunda/camunda-composite-components 0.2.7-rc.1 → 0.2.9-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.
@@ -5,7 +5,7 @@ export const getOrg = async (stage, accessToken, orgId) => {
5
5
  headers.Authorization = `Bearer ${accessToken}`;
6
6
  headers["Content-Type"] = "application/json";
7
7
  try {
8
- const response = await fetch(`https://accounts.${stage}/api/organizations/my`, {
8
+ const response = await fetch(`https://accounts.${stage}/external/organizations/my`, {
9
9
  method: "GET",
10
10
  headers,
11
11
  });
@@ -22,7 +22,7 @@ export const getClusters = async (stage, accessToken, orgId) => {
22
22
  headers.Authorization = `Bearer ${accessToken}`;
23
23
  headers["Content-Type"] = "application/json";
24
24
  try {
25
- const response = await fetch(`https://console.${stage}/api/orgs/${orgId}/clusters`, {
25
+ const response = await fetch(`https://console.${stage}/external/organizations/${orgId}/clusters`, {
26
26
  method: "GET",
27
27
  headers,
28
28
  });
@@ -11,7 +11,8 @@ export const C3ClusterTag = (props) => {
11
11
  };
12
12
  function generateFromInput(props) {
13
13
  const foundCluster = props.allClusters?.find((cluster) => cluster.uuid === props.clusterUuid);
14
- if (foundCluster?.labels?.camunda && foundCluster.labels.camunda.length > 0) {
14
+ if (foundCluster?.labels?.camunda &&
15
+ foundCluster?.labels?.camunda?.length > 0) {
15
16
  const label = foundCluster.labels.camunda[0];
16
17
  return getColorForStage(label) &&
17
18
  props.conditionalRendering(label) ? (React.createElement(Tag, { type: getColorForStage(label) }, label)) : (React.createElement(React.Fragment, null));
@@ -49,9 +49,7 @@ export type Tab = {
49
49
  };
50
50
  export type Organization = {
51
51
  uuid: string;
52
- organizationToSalesPlan?: {
53
- salesPlan?: {
54
- salesPlanType: string;
55
- };
52
+ salesPlan?: {
53
+ type: string;
56
54
  };
57
55
  };
@@ -42,8 +42,7 @@ export const HelpCenter = ({ configuration, organization, persona, email, audien
42
42
  clusterIds: clusters.map((cluster) => cluster.uuid),
43
43
  email,
44
44
  currentOrgId: organization?.uuid ?? "",
45
- salesPlanType: organization?.organizationToSalesPlan?.salesPlan?.salesPlanType ??
46
- "",
45
+ salesPlanType: organization?.salesPlan?.type ?? "",
47
46
  flags,
48
47
  accessToken: token,
49
48
  });
@@ -60,7 +59,7 @@ export const HelpCenter = ({ configuration, organization, persona, email, audien
60
59
  header = "Share your feedback";
61
60
  content = (React.createElement(Feedback, { audience: audience, theme: theme, mixpanelTrack: mixpanelTrack, setHeader: (head) => {
62
61
  header = head;
63
- }, salesPlanType: organization?.organizationToSalesPlan?.salesPlan?.salesPlanType ?? "" }));
62
+ }, salesPlanType: organization?.salesPlan?.type ?? "" }));
64
63
  }
65
64
  else if (activeTab === "recommendations" &&
66
65
  Object.keys(tabTiles).length === 0 &&
@@ -107,8 +106,7 @@ export const HelpCenter = ({ configuration, organization, persona, email, audien
107
106
  else {
108
107
  return undefined;
109
108
  }
110
- })(), origin: origin, type: tab?.tiletype || "grid", tiles: tabTiles[activeTab], mixpanelTrack: mixpanelTrack, salesPlanType: organization?.organizationToSalesPlan?.salesPlan?.salesPlanType ??
111
- "" }));
109
+ })(), origin: origin, type: tab?.tiletype || "grid", tiles: tabTiles[activeTab], mixpanelTrack: mixpanelTrack, salesPlanType: organization?.salesPlan?.type ?? "" }));
112
110
  }
113
111
  }
114
112
  const tabBar = [
@@ -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, clusterUuid, tweaks, }: C3NavigationProps) => React.JSX.Element;
3
+ export declare const C3Navigation: ({ app, appBar, forwardRef, navbar, orgSideBar, infoSideBar, infoButton, helpCenter, actionButtons, userSideBar, notificationSideBar, clusterUuid, options, }: C3NavigationProps) => React.JSX.Element;
@@ -37,7 +37,7 @@ const ClusterTagWrapper = styled.div `
37
37
  padding: 0 1rem;
38
38
  }
39
39
  `;
40
- export const C3Navigation = ({ app, appBar, forwardRef, navbar, orgSideBar, infoSideBar, infoButton, helpCenter, actionButtons, userSideBar, notificationSideBar, clusterUuid, tweaks, }) => {
40
+ export const C3Navigation = ({ app, appBar, forwardRef, navbar, orgSideBar, infoSideBar, infoButton, helpCenter, actionButtons, userSideBar, notificationSideBar, clusterUuid, options, }) => {
41
41
  const isLargeScreen = useMediaQuery(`(min-width: ${BREAKPOINT_LG_WIDTH}`);
42
42
  const appBarElementsLength = appBar.elements?.length ?? 0;
43
43
  const displayAppBar = appBarElementsLength > 0 || (!isLargeScreen && navbar.elements.length > 0);
@@ -88,7 +88,7 @@ export const C3Navigation = ({ app, appBar, forwardRef, navbar, orgSideBar, info
88
88
  }, type: tag.color }, tag.label));
89
89
  }),
90
90
  clusterUuid && (React.createElement(ClusterTagWrapper, null,
91
- React.createElement(C3ClusterTag, { clusterUuid: clusterUuid, conditionalRendering: tweaks?.conditionalTagRendering }))),
91
+ React.createElement(C3ClusterTag, { clusterUuid: clusterUuid, conditionalRendering: options?.conditionalTagRendering }))),
92
92
  navbar.orgName && (React.createElement("div", { className: "bodyText", style: {
93
93
  fontSize: "14px",
94
94
  lineHeight: "3rem",
@@ -66,7 +66,7 @@ export interface C3NavigationProps {
66
66
  navbar: C3NavigationNavBarProps;
67
67
  forwardRef?: React.ForwardRefExoticComponent<any>;
68
68
  clusterUuid?: string;
69
- tweaks?: {
69
+ options?: {
70
70
  conditionalTagRendering?: (stage: CamundaClusterStage) => boolean;
71
71
  };
72
72
  }
@@ -18,8 +18,9 @@ export const C3ProfileProvider = ({ children }) => {
18
18
  const [resolvedTheme, setResolvedTheme] = useState(defaultTheme);
19
19
  const [clusters, setClusters] = useState(null);
20
20
  useEffect(() => {
21
- if (!decodedToken)
21
+ if (!decodedToken) {
22
22
  return;
23
+ }
23
24
  const { audience } = decodedToken;
24
25
  const decodedAudience = typeof audience === "string" ? audience : audience?.[0];
25
26
  if (decodedAudience) {
@@ -27,7 +28,7 @@ export const C3ProfileProvider = ({ children }) => {
27
28
  setClusters(res);
28
29
  });
29
30
  }
30
- }, [config?.userToken, config?.activeOrganizationId]);
31
+ }, [config?.userToken, config?.activeOrganizationId, decodedToken]);
31
32
  useEffect(() => {
32
33
  const updateSystemTheme = ({ matches }) => {
33
34
  if (themeRef.current === "system")
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@camunda/camunda-composite-components",
3
- "version": "0.2.7-rc.1",
3
+ "version": "0.2.9-rc.0",
4
4
  "scripts": {
5
5
  "clean": "rimraf lib/",
6
6
  "build": "yarn clean && tsc",
@@ -26,8 +26,8 @@
26
26
  "test": "yarn test:ts && yarn test:storybook && yarn test:visual-regression:docker"
27
27
  },
28
28
  "devDependencies": {
29
- "@babel/core": "7.22.19",
30
- "@babel/preset-env": "7.22.15",
29
+ "@babel/core": "7.22.20",
30
+ "@babel/preset-env": "7.22.20",
31
31
  "@babel/preset-react": "7.22.15",
32
32
  "@babel/preset-typescript": "7.22.15",
33
33
  "@carbon/react": "1.37.0",