@camunda/camunda-composite-components 0.2.18-rc.6 → 0.2.18-rc.7

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -73,9 +73,6 @@ export const HelpCenter = ({ configuration, persona, email, audience, flags = []
73
73
  }, [showTabId]);
74
74
  if (activeTab === "feedback") {
75
75
  header = "Share your feedback";
76
- content = (React.createElement(Feedback, { audience: audience, theme: theme, mixpanelTrack: mixpanelTrack, setHeader: (head) => {
77
- header = head;
78
- }, salesPlanType: organization?.salesPlan?.type ?? "" }));
79
76
  }
80
77
  else if (activeTab === "recommendations" &&
81
78
  Object.keys(tabTiles).length === 0 &&
@@ -176,7 +173,11 @@ export const HelpCenter = ({ configuration, persona, email, audience, flags = []
176
173
  }))),
177
174
  React.createElement("div", { style: { position: "absolute", bottom: "20px" } }, configuration.links.map((link) => (React.createElement(SideNavMenuItem, { key: link.label.split(" ").join("-").toLowerCase(), href: link.link, target: "_blank" },
178
175
  React.createElement("span", { className: "cds--link" }, link.label))))))),
179
- content)),
176
+ content,
177
+ React.createElement("div", { style: { display: activeTab === "feedback" ? "block" : "none" } },
178
+ React.createElement(Feedback, { audience: audience, theme: theme, mixpanelTrack: mixpanelTrack, setHeader: (head) => {
179
+ header = head;
180
+ }, salesPlanType: organization?.salesPlan?.type ?? "" })))),
180
181
  persona.complete && activeTab === "recommendations" && (React.createElement(ModalFooter, { style: {
181
182
  height: "62px",
182
183
  paddingRight: "16px",
@@ -21,7 +21,7 @@ export const C3NavigationAppBar = ({ appBar, forwardRef, navbar, }) => {
21
21
  const [appBarOpen, setAppBarOpen] = useState(appBar.isOpen);
22
22
  const [panelRef, iconRef] = useOnClickOutside(() => setAppBarOpen(false));
23
23
  return (React.createElement(React.Fragment, null,
24
- React.createElement(HeaderGlobalAction, { ref: iconRef, "aria-label": "Camunda apps", isActive: appBarOpen, onClick: () => {
24
+ React.createElement(HeaderGlobalAction, { ref: iconRef, "aria-label": "Camunda components", isActive: appBarOpen, onClick: () => {
25
25
  setAppBarOpen(!appBarOpen);
26
26
  }, tooltipAlignment: "start",
27
27
  /* eslint-disable-next-line @typescript-eslint/ban-ts-comment */
@@ -9,8 +9,8 @@ import { useC3UserConfiguration } from "../../c3-user-configuration/c3-user-conf
9
9
  const C3OrgSidebar = ({ sideBar }) => {
10
10
  const { customElements, switchToOrg, elements, ...sideBarProps } = sideBar;
11
11
  const { isOpen, setIsOpen } = useOrgSidebarState();
12
- const { decodedAudience, analyticsTrack } = useC3UserConfiguration();
13
- const { activeOrg, orgs, setActiveOrg } = useC3Profile();
12
+ const { decodedAudience, analyticsTrack, setActiveOrgId } = useC3UserConfiguration();
13
+ const { activeOrg, orgs } = useC3Profile();
14
14
  const isCustomized = Boolean(customElements?.activeOrganization);
15
15
  const onManageOrg = () => {
16
16
  if (!isCustomized) {
@@ -29,7 +29,7 @@ const C3OrgSidebar = ({ sideBar }) => {
29
29
  otherLabel: "Other Organizations",
30
30
  };
31
31
  const switchOrg = (orgId) => {
32
- setActiveOrg(orgId);
32
+ setActiveOrgId(orgId);
33
33
  analyticsTrack?.("navBar:orgSwitch:click", { orgId });
34
34
  switchToOrg?.(orgId);
35
35
  setIsOpen(false);
@@ -8,7 +8,6 @@ export type C3ProfileContextValue = {
8
8
  theme: Theme;
9
9
  orgs: Organization[] | null;
10
10
  activeOrg: Organization | null;
11
- setActiveOrg: (orgId: string) => void;
12
11
  reloadOrgs: () => void;
13
12
  clusters: Cluster[] | null;
14
13
  reloadClusters: () => void;
@@ -8,7 +8,6 @@ export const C3ProfileContext = createContext({
8
8
  theme: defaultTheme,
9
9
  orgs: null,
10
10
  activeOrg: null,
11
- setActiveOrg: () => undefined,
12
11
  reloadOrgs: () => undefined,
13
12
  clusters: null,
14
13
  reloadClusters: () => undefined,
@@ -40,7 +39,15 @@ export const C3ProfileProvider = ({ children }) => {
40
39
  });
41
40
  };
42
41
  useEffect(() => {
43
- loadOrgs();
42
+ if (config?.activeOrganizationId) {
43
+ const org = orgs?.find((org) => org.uuid === config.activeOrganizationId);
44
+ if (org) {
45
+ setActiveOrg(org);
46
+ }
47
+ else {
48
+ loadOrgs();
49
+ }
50
+ }
44
51
  loadClusters();
45
52
  }, [
46
53
  config?.activeOrganizationId,
@@ -86,13 +93,6 @@ export const C3ProfileProvider = ({ children }) => {
86
93
  resolvedTheme,
87
94
  orgs,
88
95
  activeOrg,
89
- setActiveOrg: (orgId) => {
90
- if (orgs) {
91
- const org = orgs.find((org) => org.uuid === orgId);
92
- if (org)
93
- setActiveOrg(org);
94
- }
95
- },
96
96
  reloadOrgs: loadOrgs,
97
97
  clusters,
98
98
  reloadClusters: loadClusters,
@@ -21,6 +21,7 @@ export type C3UserConfiguration = C3UserConfigurationWithEndpoints | C3UserConfi
21
21
  export type C3UserConfigurationContextValue = C3UserConfiguration & {
22
22
  decodedToken: DecodedToken | null;
23
23
  decodedAudience: string | null;
24
+ setActiveOrgId: (id: string) => void;
24
25
  analyticsTrack?: MixPanelTrack;
25
26
  };
26
27
  export declare const C3UserConfigurationContext: React.Context<C3UserConfigurationContextValue>;
@@ -5,6 +5,7 @@ import { C3HelpCenterProvider } from "../c3-help-center/c3-help-center-provider"
5
5
  export const C3UserConfigurationContext = React.createContext({
6
6
  stage: "dev",
7
7
  activeOrganizationId: "",
8
+ setActiveOrgId: () => undefined,
8
9
  userToken: "",
9
10
  decodedToken: null,
10
11
  decodedAudience: null,
@@ -28,6 +29,7 @@ const C3UserConfigurationProvider = ({ children, activeOrganizationId, ...config
28
29
  return (React.createElement(C3UserConfigurationContext.Provider, { value: {
29
30
  ...config,
30
31
  activeOrganizationId: activeOrgId,
32
+ setActiveOrgId,
31
33
  decodedToken,
32
34
  decodedAudience,
33
35
  } },
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@camunda/camunda-composite-components",
3
- "version": "0.2.18-rc.6",
3
+ "version": "0.2.18-rc.7",
4
4
  "scripts": {
5
5
  "clean": "rimraf lib/",
6
6
  "build": "yarn clean && tsc",
@@ -33,16 +33,16 @@
33
33
  "@carbon/react": "1.37.0",
34
34
  "@mdx-js/react": "2.3.0",
35
35
  "@playwright/test": "1.37.1",
36
- "@storybook/addon-a11y": "7.5.1",
37
- "@storybook/addon-actions": "7.5.1",
38
- "@storybook/addon-docs": "7.5.1",
39
- "@storybook/addon-essentials": "7.5.1",
40
- "@storybook/addon-interactions": "7.5.1",
41
- "@storybook/addon-links": "7.5.1",
42
- "@storybook/blocks": "7.5.1",
36
+ "@storybook/addon-a11y": "7.5.2",
37
+ "@storybook/addon-actions": "7.5.2",
38
+ "@storybook/addon-docs": "7.5.2",
39
+ "@storybook/addon-essentials": "7.5.2",
40
+ "@storybook/addon-interactions": "7.5.2",
41
+ "@storybook/addon-links": "7.5.2",
42
+ "@storybook/blocks": "7.5.2",
43
43
  "@storybook/preset-scss": "1.0.3",
44
- "@storybook/react": "7.5.1",
45
- "@storybook/react-webpack5": "7.5.1",
44
+ "@storybook/react": "7.5.2",
45
+ "@storybook/react-webpack5": "7.5.2",
46
46
  "@storybook/test-runner": "0.13.0",
47
47
  "@storybook/testing-library": "0.2.2",
48
48
  "@types/carbon-components-react": "7.55.3",
@@ -76,7 +76,7 @@
76
76
  "sass": "1.66.1",
77
77
  "sass-loader": "13.3.2",
78
78
  "serve": "14.2.1",
79
- "storybook": "7.5.1",
79
+ "storybook": "7.5.2",
80
80
  "style-loader": "3.3.3",
81
81
  "styled-components": "6.0.7",
82
82
  "typescript": "5.2.2",