@camunda/camunda-composite-components 0.4.2-rc.1 → 0.4.2-rc.2

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.
@@ -4,7 +4,7 @@
4
4
  "type": "git",
5
5
  "url": "https://github.com/camunda-cloud/camunda-composite-components.git"
6
6
  },
7
- "version": "0.4.2-rc.0",
7
+ "version": "0.4.2-rc.1",
8
8
  "scripts": {
9
9
  "clean": "rimraf lib/",
10
10
  "build": "yarn clean && tsc",
@@ -20,29 +20,34 @@ export const C3NavigationAppBar = ({ appBar, forwardRef, navbar, }) => {
20
20
  return;
21
21
  const defaultElements = [];
22
22
  APPS.forEach((app) => {
23
- if (!decodedAudience || !currentApp)
23
+ if (!decodedAudience || !currentApp || !activeOrg?.uuid)
24
24
  return;
25
25
  const element = {
26
26
  key: app,
27
27
  label: app.charAt(0).toUpperCase() + app.slice(1),
28
28
  active: currentApp === app,
29
+ href: currentApp === app ? "#" : undefined,
30
+ onClick: currentApp === app ? () => false : undefined,
29
31
  };
30
32
  if (app === "console") {
31
- element.href = `https://console.${decodedAudience}/${activeOrg?.uuid}`;
33
+ if (currentApp !== "console")
34
+ element.href = `https://console.${decodedAudience}/org/${activeOrg?.uuid}`;
32
35
  }
33
36
  else if (app === "modeler") {
34
- const hasPermission = activeOrg?.permissions.org.webide.read;
35
- if (hasPermission) {
36
- element.href = `https://modeler.${decodedAudience}/org/${activeOrg?.uuid}`;
37
+ const hasPermission = activeOrg?.permissions?.org?.webide?.read;
38
+ if (hasPermission && currentApp !== "modeler") {
39
+ element.href = `https://modeler.${decodedAudience}/login?returnUrl=/org/${activeOrg?.uuid}`;
37
40
  }
38
41
  }
39
42
  else {
40
- const hasAppReadPermission = activeOrg?.permissions.cluster[app]?.read;
43
+ const hasAppReadPermission = activeOrg?.permissions?.cluster?.[app]?.read;
41
44
  const clustersToRender = clusters?.filter(({ status, urls }) => status[app] === "Healthy" && urls[app] && hasAppReadPermission);
42
45
  if (clustersToRender?.length === 1) {
43
- element.href = clustersToRender?.[0].urls[app];
46
+ if (currentApp !== app)
47
+ element.href = clustersToRender?.[0].urls[app];
44
48
  }
45
49
  else if (clustersToRender && clustersToRender.length > 1) {
50
+ element.onClick = undefined;
46
51
  element.subElements = clustersToRender.map((cluster, index) => ({
47
52
  key: `${app}-${cluster.uuid}-${index}`,
48
53
  label: cluster.name,
package/package.json CHANGED
@@ -4,7 +4,7 @@
4
4
  "type": "git",
5
5
  "url": "https://github.com/camunda-cloud/camunda-composite-components.git"
6
6
  },
7
- "version": "0.4.2-rc.1",
7
+ "version": "0.4.2-rc.2",
8
8
  "scripts": {
9
9
  "clean": "rimraf lib/",
10
10
  "build": "yarn clean && tsc",