@camunda/camunda-composite-components 0.14.0 → 0.14.1-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": "git+https://github.com/camunda-cloud/camunda-composite-components.git"
6
6
  },
7
- "version": "0.13.1-rc.7",
7
+ "version": "0.14.1-rc.1",
8
8
  "scripts": {
9
9
  "clean": "rimraf lib/",
10
10
  "build": "yarn clean && tsc",
@@ -117,6 +117,7 @@ export const C3NavigationAppBar = ({ app: appProps, appBar, forwardRef, navbar,
117
117
  if (appBar.elements)
118
118
  return;
119
119
  const defaultElements = [];
120
+ const enforceDropDown = !APPS.filter((app) => app !== "console" && app !== "modeler").every((app) => getClustersToRender(clusters ?? [], activeOrg, app).length < 2);
120
121
  for (const app of APPS) {
121
122
  if (!domain || !currentApp || !activeOrg?.uuid)
122
123
  return;
@@ -144,11 +145,12 @@ export const C3NavigationAppBar = ({ app: appProps, appBar, forwardRef, navbar,
144
145
  else {
145
146
  const hasAppReadPermission = activeOrg?.permissions?.cluster?.[app]?.read;
146
147
  const clustersToRender = getClustersToRender(clusters ?? [], activeOrg, app);
147
- if (clustersToRender?.length === 1) {
148
+ if (clustersToRender?.length === 1 && !enforceDropDown) {
148
149
  if (currentApp !== app)
149
150
  element.href = clustersToRender?.[0].endpoints[app];
150
151
  }
151
- else if (clustersToRender && clustersToRender.length > 1) {
152
+ else if (clustersToRender?.length > 1 ||
153
+ (enforceDropDown && clustersToRender?.length > 0)) {
152
154
  element.onClick = undefined;
153
155
  element.subElements = clustersToRender.map((cluster, index) => ({
154
156
  key: `${app}-${cluster.uuid}-${index}`,
package/package.json CHANGED
@@ -4,7 +4,7 @@
4
4
  "type": "git",
5
5
  "url": "git+https://github.com/camunda-cloud/camunda-composite-components.git"
6
6
  },
7
- "version": "0.14.0",
7
+ "version": "0.14.1-rc.2",
8
8
  "scripts": {
9
9
  "clean": "rimraf lib/",
10
10
  "build": "yarn clean && tsc",