@camunda/camunda-composite-components 0.22.1 → 0.22.3

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.
Files changed (196) hide show
  1. package/package.json +16 -16
  2. package/lib/esm/package.json +0 -98
  3. package/lib/esm/src/api/api.d.ts +0 -29
  4. package/lib/esm/src/api/api.js +0 -92
  5. package/lib/esm/src/api/clusters.d.ts +0 -10
  6. package/lib/esm/src/api/clusters.js +0 -32
  7. package/lib/esm/src/api/endpoints.const.d.ts +0 -22
  8. package/lib/esm/src/api/endpoints.const.js +0 -70
  9. package/lib/esm/src/api/help-center.d.ts +0 -42
  10. package/lib/esm/src/api/help-center.js +0 -56
  11. package/lib/esm/src/api/jwt.utils.d.ts +0 -5
  12. package/lib/esm/src/api/jwt.utils.js +0 -26
  13. package/lib/esm/src/api/notifications.d.ts +0 -41
  14. package/lib/esm/src/api/notifications.js +0 -170
  15. package/lib/esm/src/api/organizations.d.ts +0 -15
  16. package/lib/esm/src/api/organizations.js +0 -16
  17. package/lib/esm/src/api/profile.d.ts +0 -20
  18. package/lib/esm/src/api/profile.js +0 -48
  19. package/lib/esm/src/api/status.d.ts +0 -7
  20. package/lib/esm/src/api/status.js +0 -46
  21. package/lib/esm/src/assets/c3-icons.d.ts +0 -5
  22. package/lib/esm/src/assets/c3-icons.js +0 -5
  23. package/lib/esm/src/assets/c3-icons.types.d.ts +0 -3
  24. package/lib/esm/src/assets/c3-icons.types.js +0 -6
  25. package/lib/esm/src/components/c3-app-teaser/app-teaser-cards-config.d.ts +0 -5
  26. package/lib/esm/src/components/c3-app-teaser/app-teaser-cards-config.js +0 -94
  27. package/lib/esm/src/components/c3-app-teaser/app-teaser-cards.d.ts +0 -17
  28. package/lib/esm/src/components/c3-app-teaser/app-teaser-cards.js +0 -31
  29. package/lib/esm/src/components/c3-app-teaser/app-teaster-card.d.ts +0 -14
  30. package/lib/esm/src/components/c3-app-teaser/app-teaster-card.js +0 -24
  31. package/lib/esm/src/components/c3-app-teaser/c3-app-teaser-page.d.ts +0 -9
  32. package/lib/esm/src/components/c3-app-teaser/c3-app-teaser-page.js +0 -48
  33. package/lib/esm/src/components/c3-app-teaser/c3-app-teaser-page.test.d.ts +0 -1
  34. package/lib/esm/src/components/c3-app-teaser/c3-app-teaser-page.test.js +0 -33
  35. package/lib/esm/src/components/c3-app-teaser/c3-app-teaser.d.ts +0 -14
  36. package/lib/esm/src/components/c3-app-teaser/c3-app-teaser.js +0 -53
  37. package/lib/esm/src/components/c3-cluster-tag/c3-cluster-tag.d.ts +0 -6
  38. package/lib/esm/src/components/c3-cluster-tag/c3-cluster-tag.js +0 -84
  39. package/lib/esm/src/components/c3-cluster-tag/c3-cluster-tag.test.d.ts +0 -1
  40. package/lib/esm/src/components/c3-cluster-tag/c3-cluster-tag.test.js +0 -13
  41. package/lib/esm/src/components/c3-cluster-tag/c3-cluster-tag.types.d.ts +0 -26
  42. package/lib/esm/src/components/c3-cluster-tag/c3-cluster-tag.types.js +0 -11
  43. package/lib/esm/src/components/c3-data-table/c3-data-table.d.ts +0 -3
  44. package/lib/esm/src/components/c3-data-table/c3-data-table.js +0 -509
  45. package/lib/esm/src/components/c3-data-table/c3-data-table.types.d.ts +0 -122
  46. package/lib/esm/src/components/c3-data-table/c3-data-table.types.js +0 -6
  47. package/lib/esm/src/components/c3-data-table/link-button/link-button.d.ts +0 -3
  48. package/lib/esm/src/components/c3-data-table/link-button/link-button.js +0 -15
  49. package/lib/esm/src/components/c3-data-table/link-button/link-button.types.d.ts +0 -8
  50. package/lib/esm/src/components/c3-data-table/link-button/link-button.types.js +0 -6
  51. package/lib/esm/src/components/c3-empty-state/c3-empty-state.d.ts +0 -3
  52. package/lib/esm/src/components/c3-empty-state/c3-empty-state.js +0 -15
  53. package/lib/esm/src/components/c3-empty-state/c3-empty-state.test.d.ts +0 -1
  54. package/lib/esm/src/components/c3-empty-state/c3-empty-state.test.js +0 -25
  55. package/lib/esm/src/components/c3-empty-state/c3-empty-state.types.d.ts +0 -29
  56. package/lib/esm/src/components/c3-empty-state/c3-empty-state.types.js +0 -6
  57. package/lib/esm/src/components/c3-help-center/c3-help-center-provider.d.ts +0 -19
  58. package/lib/esm/src/components/c3-help-center/c3-help-center-provider.js +0 -58
  59. package/lib/esm/src/components/c3-help-center/c3-help-center.d.ts +0 -16
  60. package/lib/esm/src/components/c3-help-center/c3-help-center.js +0 -218
  61. package/lib/esm/src/components/c3-help-center/c3-help-center.types.d.ts +0 -43
  62. package/lib/esm/src/components/c3-help-center/c3-help-center.types.js +0 -6
  63. package/lib/esm/src/components/c3-help-center/defaultHelpCenterConfig.d.ts +0 -10
  64. package/lib/esm/src/components/c3-help-center/defaultHelpCenterConfig.js +0 -17
  65. package/lib/esm/src/components/c3-help-center/help-center-hint.d.ts +0 -4
  66. package/lib/esm/src/components/c3-help-center/help-center-hint.js +0 -15
  67. package/lib/esm/src/components/c3-help-center/help-center.d.ts +0 -18
  68. package/lib/esm/src/components/c3-help-center/help-center.js +0 -189
  69. package/lib/esm/src/components/c3-help-center/recommendations.d.ts +0 -4
  70. package/lib/esm/src/components/c3-help-center/recommendations.js +0 -55
  71. package/lib/esm/src/components/c3-help-center/styles.d.ts +0 -4
  72. package/lib/esm/src/components/c3-help-center/styles.js +0 -48
  73. package/lib/esm/src/components/c3-help-center/tabs/feedback.d.ts +0 -9
  74. package/lib/esm/src/components/c3-help-center/tabs/feedback.js +0 -141
  75. package/lib/esm/src/components/c3-help-center/tabs/tabContent.d.ts +0 -20
  76. package/lib/esm/src/components/c3-help-center/tabs/tabContent.js +0 -22
  77. package/lib/esm/src/components/c3-help-center/tabs/tabContentSkeleton.d.ts +0 -2
  78. package/lib/esm/src/components/c3-help-center/tabs/tabContentSkeleton.js +0 -26
  79. package/lib/esm/src/components/c3-help-center/tile.d.ts +0 -10
  80. package/lib/esm/src/components/c3-help-center/tile.js +0 -61
  81. package/lib/esm/src/components/c3-navigation/c3-info-button.d.ts +0 -4
  82. package/lib/esm/src/components/c3-navigation/c3-info-button.js +0 -9
  83. package/lib/esm/src/components/c3-navigation/c3-navigation-actions/c3-action-buttons.d.ts +0 -6
  84. package/lib/esm/src/components/c3-navigation/c3-navigation-actions/c3-action-buttons.js +0 -18
  85. package/lib/esm/src/components/c3-navigation/c3-navigation-actions/c3-action-buttons.types.d.ts +0 -10
  86. package/lib/esm/src/components/c3-navigation/c3-navigation-actions/c3-action-buttons.types.js +0 -6
  87. package/lib/esm/src/components/c3-navigation/c3-navigation-appbar/c3-navigation-appbar.d.ts +0 -4
  88. package/lib/esm/src/components/c3-navigation/c3-navigation-appbar/c3-navigation-appbar.js +0 -364
  89. package/lib/esm/src/components/c3-navigation/c3-navigation-appbar/components.d.ts +0 -2
  90. package/lib/esm/src/components/c3-navigation/c3-navigation-appbar/components.js +0 -21
  91. package/lib/esm/src/components/c3-navigation/c3-navigation-sidebar/c3-info-sidebar.d.ts +0 -6
  92. package/lib/esm/src/components/c3-navigation/c3-navigation-sidebar/c3-info-sidebar.js +0 -38
  93. package/lib/esm/src/components/c3-navigation/c3-navigation-sidebar/c3-navigation-sidebar-element.d.ts +0 -12
  94. package/lib/esm/src/components/c3-navigation/c3-navigation-sidebar/c3-navigation-sidebar-element.js +0 -68
  95. package/lib/esm/src/components/c3-navigation/c3-navigation-sidebar/c3-navigation-sidebar.d.ts +0 -10
  96. package/lib/esm/src/components/c3-navigation/c3-navigation-sidebar/c3-navigation-sidebar.js +0 -89
  97. package/lib/esm/src/components/c3-navigation/c3-navigation-sidebar/c3-navigation-sidebar.types.d.ts +0 -81
  98. package/lib/esm/src/components/c3-navigation/c3-navigation-sidebar/c3-navigation-sidebar.types.js +0 -6
  99. package/lib/esm/src/components/c3-navigation/c3-navigation-sidebar/c3-notification-sidebar.d.ts +0 -5
  100. package/lib/esm/src/components/c3-navigation/c3-navigation-sidebar/c3-notification-sidebar.js +0 -107
  101. package/lib/esm/src/components/c3-navigation/c3-navigation-sidebar/c3-sidebar-state-provider.d.ts +0 -29
  102. package/lib/esm/src/components/c3-navigation/c3-navigation-sidebar/c3-sidebar-state-provider.js +0 -54
  103. package/lib/esm/src/components/c3-navigation/c3-navigation-sidebar/c3-user-sidebar.d.ts +0 -6
  104. package/lib/esm/src/components/c3-navigation/c3-navigation-sidebar/c3-user-sidebar.js +0 -57
  105. package/lib/esm/src/components/c3-navigation/c3-navigation-sidebar/components.d.ts +0 -2
  106. package/lib/esm/src/components/c3-navigation/c3-navigation-sidebar/components.js +0 -11
  107. package/lib/esm/src/components/c3-navigation/c3-navigation.d.ts +0 -7
  108. package/lib/esm/src/components/c3-navigation/c3-navigation.js +0 -262
  109. package/lib/esm/src/components/c3-navigation/c3-navigation.test.d.ts +0 -1
  110. package/lib/esm/src/components/c3-navigation/c3-navigation.test.js +0 -89
  111. package/lib/esm/src/components/c3-navigation/c3-navigation.types.d.ts +0 -97
  112. package/lib/esm/src/components/c3-navigation/c3-navigation.types.js +0 -6
  113. package/lib/esm/src/components/c3-navigation/c3-notification-provider/c3-notification-container.d.ts +0 -13
  114. package/lib/esm/src/components/c3-navigation/c3-notification-provider/c3-notification-container.js +0 -100
  115. package/lib/esm/src/components/c3-navigation/c3-notification-provider/c3-notification-provider.d.ts +0 -19
  116. package/lib/esm/src/components/c3-navigation/c3-notification-provider/c3-notification-provider.js +0 -110
  117. package/lib/esm/src/components/c3-navigation/c3-org-name.d.ts +0 -6
  118. package/lib/esm/src/components/c3-navigation/c3-org-name.js +0 -34
  119. package/lib/esm/src/components/c3-navigation/c3-org-sidebar/c3-org-sidebar.d.ts +0 -6
  120. package/lib/esm/src/components/c3-navigation/c3-org-sidebar/c3-org-sidebar.js +0 -188
  121. package/lib/esm/src/components/c3-navigation/c3-org-sidebar/components.d.ts +0 -29
  122. package/lib/esm/src/components/c3-navigation/c3-org-sidebar/components.js +0 -92
  123. package/lib/esm/src/components/c3-navigation/helpers.d.ts +0 -8
  124. package/lib/esm/src/components/c3-navigation/helpers.js +0 -58
  125. package/lib/esm/src/components/c3-navigation/index.d.ts +0 -2
  126. package/lib/esm/src/components/c3-navigation/index.js +0 -8
  127. package/lib/esm/src/components/c3-navigation/stories/story-helpers.d.ts +0 -35
  128. package/lib/esm/src/components/c3-navigation/stories/story-helpers.js +0 -264
  129. package/lib/esm/src/components/c3-navigation/stories/story-templates.d.ts +0 -9
  130. package/lib/esm/src/components/c3-navigation/stories/story-templates.js +0 -38
  131. package/lib/esm/src/components/c3-onboarding-survey/c3-onboarding-survey.d.ts +0 -14
  132. package/lib/esm/src/components/c3-onboarding-survey/c3-onboarding-survey.js +0 -94
  133. package/lib/esm/src/components/c3-onboarding-survey/defaultOnboardingConfig.d.ts +0 -16
  134. package/lib/esm/src/components/c3-onboarding-survey/defaultOnboardingConfig.js +0 -8
  135. package/lib/esm/src/components/c3-onboarding-survey/elements/dropdownSelect.d.ts +0 -15
  136. package/lib/esm/src/components/c3-onboarding-survey/elements/dropdownSelect.js +0 -58
  137. package/lib/esm/src/components/c3-onboarding-survey/elements/inlineNotification.d.ts +0 -3
  138. package/lib/esm/src/components/c3-onboarding-survey/elements/inlineNotification.js +0 -10
  139. package/lib/esm/src/components/c3-onboarding-survey/elements/radioGroupMulti.d.ts +0 -7
  140. package/lib/esm/src/components/c3-onboarding-survey/elements/radioGroupMulti.js +0 -53
  141. package/lib/esm/src/components/c3-onboarding-survey/elements/radioGroupSingle.d.ts +0 -7
  142. package/lib/esm/src/components/c3-onboarding-survey/elements/radioGroupSingle.js +0 -36
  143. package/lib/esm/src/components/c3-onboarding-survey/elements/textField.d.ts +0 -6
  144. package/lib/esm/src/components/c3-onboarding-survey/elements/textField.js +0 -14
  145. package/lib/esm/src/components/c3-onboarding-survey/helpers.d.ts +0 -1
  146. package/lib/esm/src/components/c3-onboarding-survey/helpers.js +0 -10
  147. package/lib/esm/src/components/c3-onboarding-survey/onboarding.types.d.ts +0 -30
  148. package/lib/esm/src/components/c3-onboarding-survey/onboarding.types.js +0 -13
  149. package/lib/esm/src/components/c3-onboarding-survey/onboardingModal.d.ts +0 -25
  150. package/lib/esm/src/components/c3-onboarding-survey/onboardingModal.js +0 -52
  151. package/lib/esm/src/components/c3-onboarding-survey/onboardingPage.d.ts +0 -21
  152. package/lib/esm/src/components/c3-onboarding-survey/onboardingPage.js +0 -35
  153. package/lib/esm/src/components/c3-onboarding-survey/onboardingSurvey.d.ts +0 -17
  154. package/lib/esm/src/components/c3-onboarding-survey/onboardingSurvey.js +0 -148
  155. package/lib/esm/src/components/c3-onboarding-survey/step.d.ts +0 -7
  156. package/lib/esm/src/components/c3-onboarding-survey/step.js +0 -44
  157. package/lib/esm/src/components/c3-page/c3-breadcrumb/c3-breadcrumb.d.ts +0 -3
  158. package/lib/esm/src/components/c3-page/c3-breadcrumb/c3-breadcrumb.js +0 -28
  159. package/lib/esm/src/components/c3-page/c3-breadcrumb/c3-breadcrumb.types.d.ts +0 -19
  160. package/lib/esm/src/components/c3-page/c3-breadcrumb/c3-breadcrumb.types.js +0 -6
  161. package/lib/esm/src/components/c3-page/c3-page.d.ts +0 -4
  162. package/lib/esm/src/components/c3-page/c3-page.js +0 -16
  163. package/lib/esm/src/components/c3-page/c3-page.test.d.ts +0 -1
  164. package/lib/esm/src/components/c3-page/c3-page.test.js +0 -25
  165. package/lib/esm/src/components/c3-page/c3-page.types.d.ts +0 -18
  166. package/lib/esm/src/components/c3-page/c3-page.types.js +0 -6
  167. package/lib/esm/src/components/c3-page/c3-tabs/c3-tabs.d.ts +0 -3
  168. package/lib/esm/src/components/c3-page/c3-tabs/c3-tabs.js +0 -37
  169. package/lib/esm/src/components/c3-page/c3-tabs/c3-tabs.types.d.ts +0 -14
  170. package/lib/esm/src/components/c3-page/c3-tabs/c3-tabs.types.js +0 -6
  171. package/lib/esm/src/components/c3-responsive-stack/c3-responsive-stack.d.ts +0 -2
  172. package/lib/esm/src/components/c3-responsive-stack/c3-responsive-stack.js +0 -18
  173. package/lib/esm/src/components/c3-user-configuration/authToken.d.ts +0 -30
  174. package/lib/esm/src/components/c3-user-configuration/authToken.js +0 -30
  175. package/lib/esm/src/components/c3-user-configuration/c3-profile-provider/c3-profile-provider.d.ts +0 -26
  176. package/lib/esm/src/components/c3-user-configuration/c3-profile-provider/c3-profile-provider.js +0 -117
  177. package/lib/esm/src/components/c3-user-configuration/c3-profile-provider/carbon-theme-provider.d.ts +0 -13
  178. package/lib/esm/src/components/c3-user-configuration/c3-profile-provider/carbon-theme-provider.js +0 -29
  179. package/lib/esm/src/components/c3-user-configuration/c3-user-configuration-provider.d.ts +0 -54
  180. package/lib/esm/src/components/c3-user-configuration/c3-user-configuration-provider.js +0 -43
  181. package/lib/esm/src/components/styles.d.ts +0 -13
  182. package/lib/esm/src/components/styles.js +0 -90
  183. package/lib/esm/src/components/test-utils.d.ts +0 -3
  184. package/lib/esm/src/components/test-utils.js +0 -32
  185. package/lib/esm/src/contexts/c3-cluster-update-manager.d.ts +0 -12
  186. package/lib/esm/src/contexts/c3-cluster-update-manager.js +0 -27
  187. package/lib/esm/src/hooks/useApi.d.ts +0 -20
  188. package/lib/esm/src/hooks/useApi.js +0 -54
  189. package/lib/esm/src/index.d.ts +0 -23
  190. package/lib/esm/src/index.js +0 -19
  191. package/lib/esm/src/utils/camunda.d.ts +0 -21
  192. package/lib/esm/src/utils/camunda.js +0 -59
  193. package/lib/esm/src/utils/camunda.types.d.ts +0 -63
  194. package/lib/esm/src/utils/camunda.types.js +0 -6
  195. package/lib/esm/src/utils/versionCheck.utils.d.ts +0 -15
  196. package/lib/esm/src/utils/versionCheck.utils.js +0 -79
@@ -1,18 +0,0 @@
1
- import { jsx as _jsx, Fragment as _Fragment } from "react/jsx-runtime";
2
- /*
3
- * Copyright Camunda Services GmbH and/or licensed to Camunda Services GmbH
4
- * under one or more contributor license agreements. Licensed under a commercial license.
5
- * You may not use this file except in compliance with the commercial license.
6
- */
7
- import { HeaderGlobalAction } from '@carbon/react';
8
- const C3ActionButtons = ({ elements, }) => {
9
- return (_jsx(_Fragment, { children: elements.map((actionButton) => {
10
- if ('element' in actionButton) {
11
- return actionButton.element;
12
- }
13
- else {
14
- return (_jsx(HeaderGlobalAction, { "aria-label": `Open ${actionButton.label}`, onClick: actionButton.action, isActive: false, children: actionButton.icon }, `${actionButton.label}-key`));
15
- }
16
- }) }));
17
- };
18
- export default C3ActionButtons;
@@ -1,10 +0,0 @@
1
- import type { JSX, ReactElement } from 'react';
2
- export interface C3ActionButtonElement {
3
- element: JSX.Element;
4
- }
5
- export interface C3ActionButtonSimple {
6
- label: string;
7
- icon: ReactElement;
8
- action: () => void;
9
- }
10
- export type C3ActionButtonsProps = Array<C3ActionButtonElement | C3ActionButtonSimple>;
@@ -1,6 +0,0 @@
1
- /*
2
- * Copyright Camunda Services GmbH and/or licensed to Camunda Services GmbH
3
- * under one or more contributor license agreements. Licensed under a commercial license.
4
- * You may not use this file except in compliance with the commercial license.
5
- */
6
- export {};
@@ -1,4 +0,0 @@
1
- import type React from 'react';
2
- import type { C3NavigationProps } from '../c3-navigation.types';
3
- export type LoadingStatus = 'inactive' | 'active' | 'finished' | 'error';
4
- export declare const C3NavigationAppBar: React.FC<C3NavigationProps>;
@@ -1,364 +0,0 @@
1
- import { jsx as _jsx, jsxs as _jsxs, Fragment as _Fragment } from "react/jsx-runtime";
2
- /*
3
- * Copyright Camunda Services GmbH and/or licensed to Camunda Services GmbH
4
- * under one or more contributor license agreements. Licensed under a commercial license.
5
- * You may not use this file except in compliance with the commercial license.
6
- */
7
- import { FormLabel, HeaderGlobalAction, HeaderMenuItem, HeaderSideNavItems, Modal, SideNavItems, SideNavLink, SideNavMenu, SideNavMenuItem, } from '@carbon/react';
8
- import { Close } from '@carbon/react/icons/index.esm.js';
9
- import { useCallback, useEffect, useState } from 'react';
10
- import { styled } from 'styled-components';
11
- import { C3AppMenuIcon } from '../../../assets/c3-icons.js';
12
- import { useClusterUpdate } from '../../../contexts/c3-cluster-update-manager.js';
13
- import { APPS, getEndpointForApp, getReadableAppName, hasReadPermissionForApp, isAdminApp, } from '../../../utils/camunda.js';
14
- import { checkVersion, VersionCheckOperator, } from '../../../utils/versionCheck.utils.js';
15
- import { useC3Profile } from '../../c3-user-configuration/c3-profile-provider/c3-profile-provider.js';
16
- import { useC3UserConfiguration } from '../../c3-user-configuration/c3-user-configuration-provider.js';
17
- import { ActiveOrgName } from '../c3-org-sidebar/components.js';
18
- import { useOnClickOutside } from '../helpers.js';
19
- import { NavWrapper, SideNav } from './components.js';
20
- const getOrgLink = (app, orgId, domain) => {
21
- switch (app) {
22
- case 'console': {
23
- return `https://console.${domain}/org/${orgId}`;
24
- }
25
- case 'modeler': {
26
- return `https://modeler.${domain}/login?returnUrl=/org/${orgId}`;
27
- }
28
- default: {
29
- return '#';
30
- }
31
- }
32
- };
33
- const getClustersToRender = (clusters, activeOrg, appToNavigateTo) => {
34
- return clusters?.filter(({ status, endpoints, generation }) => status[isAdminApp(appToNavigateTo) ? 'zeebe' : appToNavigateTo] ===
35
- 'Healthy' &&
36
- getEndpointForApp(appToNavigateTo, endpoints) &&
37
- // either the user has appreadpermissions on this app
38
- (hasReadPermissionForApp(appToNavigateTo, activeOrg?.permissions) ||
39
- // OR this is a 8.8+ cluster - in this case we also allow rendering this item
40
- checkVersion({
41
- possiblyVersionOrDockerPath: generation.versions?.zeebe,
42
- trueForSnapshot: true,
43
- operator: VersionCheckOperator.GreaterThanOrEqual,
44
- versionToCompareTo: '8.8.0',
45
- trueOnInvalidVersion: false,
46
- })));
47
- };
48
- const OrgNameWrapper = styled.div `
49
- margin-bottom: 1rem;
50
- padding: 0px 16px;
51
- @media (min-width: 768px) {
52
- display: none;
53
- }
54
- `;
55
- const OrgPickerModal = ({ isOpen, onCancel, orgs, activeOrg, loadingStatus, appToNavigateTo, domain, }) => {
56
- const hasNoTeams = Object.values(orgs ?? {})?.every(({ org }) => {
57
- return !org?.name;
58
- });
59
- const hasNoTeamsWithClusters = Object.values(orgs ?? {})?.every(({ clusters }) => {
60
- const isConsoleOrModeler = [APPS[0], APPS[1]].includes(appToNavigateTo);
61
- return (!isConsoleOrModeler &&
62
- getClustersToRender(clusters, activeOrg, appToNavigateTo).length === 0);
63
- });
64
- return (_jsx(Modal, { danger: true, open: isOpen, modalHeading: 'Select a team', onRequestClose: onCancel, passiveModal: true, loadingStatus: loadingStatus, size: 'sm', children: _jsxs("div", { style: { marginLeft: '-1rem' }, children: [_jsx(FormLabel, { style: {
65
- paddingTop: '15px',
66
- paddingLeft: '1rem',
67
- }, children: hasNoTeams
68
- ? 'No teams found'
69
- : hasNoTeamsWithClusters
70
- ? 'No teams with clusters found'
71
- : 'Teams' }), _jsx("div", { style: {
72
- marginTop: '-1rem',
73
- }, children: _jsx(SideNavItems, { children: Object.values(orgs ?? {})?.map(({ org, clusters }) => {
74
- const isConsoleOrModeler = [APPS[0], APPS[1]].includes(appToNavigateTo);
75
- const toOrg = getOrgLink(appToNavigateTo, org.uuid, domain ?? '');
76
- if (isConsoleOrModeler) {
77
- return (_jsx(SideNavLink, { href: toOrg, children: org?.name }, org?.uuid));
78
- }
79
- const clustersToRender = getClustersToRender(clusters, activeOrg, appToNavigateTo);
80
- if (clustersToRender.length === 0) {
81
- return null;
82
- }
83
- return (_jsx(SideNavMenu, { title: org?.name, children: clustersToRender?.map((cluster) => {
84
- return (_jsx(SideNavMenuItem, { href: cluster.endpoints[appToNavigateTo], children: cluster.name }, cluster.uuid));
85
- }) }, org?.uuid));
86
- }) }) })] }) }));
87
- };
88
- const SubElementWrapper = styled.ul `
89
- .cds--side-nav__submenu[aria-expanded='true'] + .cds--side-nav__menu {
90
- max-block-size: 456px;
91
- overflow-y: auto;
92
- visibility: inherit;
93
- }
94
- `;
95
- export const C3NavigationAppBar = ({ app: appProps, appBar, forwardRef, navbar, toggleAppbar, }) => {
96
- const { currentApp, domain, analyticsTrack, currentClusterUuid } = useC3UserConfiguration();
97
- const { orgs, clusters, setClusters, activeOrg, isEnabled, loadClustersById, } = useC3Profile();
98
- const { setPanelRef: panelRef, setIconRef: iconRef } = useOnClickOutside(() => toggleAppbar(false));
99
- const [appElements, setAppElements] = useState([]);
100
- const [loadingStatus, setLoadingStatus] = useState('inactive');
101
- const [clustersByOrgId, setClustersByOrgId] = useState(null);
102
- const [appToNavigateTo, setAppToNavigateTo] = useState(APPS[0]);
103
- useClusterUpdate({
104
- onUpdate: (data) => {
105
- if (data && data.org && data.org === activeOrg?.uuid) {
106
- switch (data.entity) {
107
- case 'cluster': {
108
- if (data.payload.uuid) {
109
- const clusterDto = data.payload;
110
- const status = clusterDto.status;
111
- const endpoints = {
112
- tasklist: status?.tasklistUrl,
113
- operate: status?.operateUrl,
114
- optimize: status?.optimizeUrl,
115
- console: '',
116
- modeler: '',
117
- identity: '',
118
- admin: '',
119
- };
120
- const expectedStatus = {
121
- tasklist: status?.tasklistStatus,
122
- operate: status?.operateStatus,
123
- optimize: status?.optimizeStatus,
124
- console: '',
125
- modeler: '',
126
- identity: '',
127
- admin: '',
128
- zeebe: '',
129
- };
130
- const affectedCluster = {
131
- uuid: clusterDto.uuid,
132
- name: clusterDto.name,
133
- status: expectedStatus,
134
- generation: clusterDto.generation,
135
- endpoints,
136
- };
137
- switch (data.type) {
138
- case 'deleted': {
139
- setClusters((clusters) => clusters?.filter((cluster) => cluster.uuid !== affectedCluster.uuid) ?? []);
140
- break;
141
- }
142
- case 'updated': {
143
- setClusters((clusters) => {
144
- if (!clusters) {
145
- return [];
146
- }
147
- const clustersClone = [...clusters];
148
- const clusterToUpdateIndex = clustersClone?.findIndex((cluster) => cluster.uuid === affectedCluster.uuid);
149
- if (clusterToUpdateIndex > -1) {
150
- clustersClone[clusterToUpdateIndex] = affectedCluster;
151
- return clustersClone;
152
- }
153
- return clusters;
154
- });
155
- break;
156
- }
157
- case 'created': {
158
- setClusters((clusters) => {
159
- if (!clusters) {
160
- return [];
161
- }
162
- const clustersClone = [...clusters];
163
- const clusterToUpdateIndex = clustersClone?.findIndex((cluster) => cluster.uuid === affectedCluster.uuid);
164
- if (clusterToUpdateIndex > -1) {
165
- clustersClone[clusterToUpdateIndex] = affectedCluster;
166
- }
167
- else {
168
- clustersClone.push(affectedCluster);
169
- }
170
- return clustersClone;
171
- });
172
- break;
173
- }
174
- default:
175
- break;
176
- }
177
- }
178
- break;
179
- }
180
- default: {
181
- break;
182
- }
183
- }
184
- }
185
- },
186
- });
187
- if (!appBar.elements && !isEnabled)
188
- console.warn('No app elements and user config provided. Please provide at least one of them.');
189
- const isMemberOfTeam = useCallback((orgUuid) => orgs?.some(({ uuid }) => uuid === orgUuid) || false, [orgs]);
190
- const getClustersForSuperOrg = useCallback(async () => {
191
- const updatedClusterByOrgId = {};
192
- await Promise.all(activeOrg?.childOrganizations
193
- ?.filter((team) => isMemberOfTeam(team.uuid))
194
- .map((org) => loadClustersById(org.uuid)?.then(({ result }) => {
195
- updatedClusterByOrgId[org.uuid] = {
196
- org,
197
- clusters: result ?? [],
198
- };
199
- })) ?? []);
200
- setClustersByOrgId(updatedClusterByOrgId);
201
- }, [activeOrg, isMemberOfTeam]);
202
- const handleSuperOrg = useCallback(() => {
203
- if (!activeOrg?.uuid) {
204
- return;
205
- }
206
- setIsOrgPickerModalOpen(true);
207
- if (clustersByOrgId) {
208
- return;
209
- }
210
- setLoadingStatus('active');
211
- getClustersForSuperOrg()
212
- .catch((error) => console.error(error))
213
- .finally(() => {
214
- setLoadingStatus('finished');
215
- });
216
- }, [clustersByOrgId, activeOrg, getClustersForSuperOrg]);
217
- useEffect(() => {
218
- if (activeOrg?.isSuperOrg) {
219
- getClustersForSuperOrg()
220
- .catch((error) => console.error(error))
221
- .finally(() => {
222
- setLoadingStatus('finished');
223
- });
224
- }
225
- }, [activeOrg, getClustersForSuperOrg]);
226
- useEffect(() => {
227
- if (appBar.elements)
228
- return;
229
- const defaultElements = [];
230
- const enforceDropDown = !APPS.filter((app) => app !== 'console' && app !== 'modeler').every((app) => getClustersToRender(clusters ?? [], activeOrg, app).length < 2);
231
- for (const app of APPS) {
232
- if (!domain || !currentApp || !activeOrg?.uuid)
233
- return;
234
- const element = {
235
- key: app,
236
- label: getReadableAppName(app),
237
- active: isAdminApp(app) ? isAdminApp(currentApp) : currentApp === app,
238
- href: currentApp === app || (isAdminApp(app) && isAdminApp(currentApp))
239
- ? '#'
240
- : undefined,
241
- onClick: currentApp === app || (isAdminApp(app) && isAdminApp(currentApp))
242
- ? () => false
243
- : undefined,
244
- };
245
- if (app === currentApp &&
246
- ['console', 'modeler'].includes(app) &&
247
- appProps.routeProps) {
248
- element.routeProps = appProps.routeProps;
249
- }
250
- else if (app === 'console') {
251
- element.href = `https://console.${domain}/org/${activeOrg?.uuid}`;
252
- }
253
- else if (app === 'modeler') {
254
- const hasPermission = activeOrg?.permissions?.org?.webide?.read;
255
- if (hasPermission) {
256
- element.href = `https://modeler.${domain}/login?returnUrl=/org/${activeOrg?.uuid}`;
257
- }
258
- }
259
- else {
260
- const appHasReadPermission = hasReadPermissionForApp(app, activeOrg?.permissions);
261
- const clustersToRender = getClustersToRender(clusters ?? [], activeOrg, app);
262
- if (clustersToRender?.length === 1 && !enforceDropDown) {
263
- element.href = getEndpointForApp(app, clustersToRender[0].endpoints);
264
- }
265
- else if (clustersToRender?.length > 1 ||
266
- (enforceDropDown && clustersToRender?.length > 0)) {
267
- element.onClick = undefined;
268
- element.subElements = clustersToRender.map((cluster, index) => ({
269
- key: `${app}-${cluster.uuid}-${index}`,
270
- label: cluster.name,
271
- href: getEndpointForApp(app, cluster.endpoints),
272
- onClick: () => {
273
- toggleAppbar(false);
274
- analyticsTrack?.(`${app}:open`, { currentApp: app });
275
- },
276
- isActive: (currentApp === app && currentClusterUuid === cluster.uuid) ||
277
- (isAdminApp(app) &&
278
- isAdminApp(currentApp) &&
279
- currentClusterUuid === cluster.uuid),
280
- }));
281
- }
282
- else if (isAdminApp(app)) {
283
- // no app-teaser for admin/identity for now
284
- continue;
285
- }
286
- else if (appHasReadPermission) {
287
- if (appBar.appTeaserRouteProps?.[app]) {
288
- element.routeProps = appBar.appTeaserRouteProps?.[app];
289
- }
290
- else {
291
- element.href = `https://${currentApp}.${domain}/org/${activeOrg?.uuid}/appTeaser/${app}`;
292
- }
293
- }
294
- }
295
- if (element.href || element.routeProps || element.subElements) {
296
- if (activeOrg.isSuperOrg) {
297
- element.href = '#';
298
- element.routeProps = null;
299
- element.onClick = () => {
300
- setAppToNavigateTo(app);
301
- handleSuperOrg();
302
- // probs want to track?
303
- // analyticsTrack?.(`${app}:open`, { currentApp: app })
304
- };
305
- }
306
- defaultElements.push(element);
307
- }
308
- }
309
- setAppElements(defaultElements);
310
- }, [clusters, currentApp, domain, handleSuperOrg]);
311
- const appBarElements = appBar.elements || (clusters || clustersByOrgId ? appElements : null);
312
- const [isOrgPickerModalOpen, setIsOrgPickerModalOpen] = useState(false);
313
- const orgName = activeOrg?.name || navbar.orgName;
314
- return (_jsxs(_Fragment, { children: [_jsx(HeaderGlobalAction
315
- // @ts-expect-error
316
- , {
317
- // @ts-expect-error
318
- ref: iconRef, "aria-label": 'Camunda components', isActive: appBar.isOpen, onClick: () => {
319
- toggleAppbar(!appBar.isOpen);
320
- }, tooltipAlignment: 'start', leaveDelayMs: 100, children: appBar.isOpen ? _jsx(Close, { size: 20 }) : _jsx(C3AppMenuIcon, { size: 20 }) }), _jsx(OrgPickerModal, { activeOrg: activeOrg, appToNavigateTo: appToNavigateTo, isOpen: isOrgPickerModalOpen, orgs: clustersByOrgId, onCancel: () => {
321
- setIsOrgPickerModalOpen(false);
322
- }, loadingStatus: loadingStatus, domain: domain }), _jsx(NavWrapper, { children: _jsx(SideNav, { ref: panelRef, "aria-label": appBar.ariaLabel || 'Side Navigation', expanded: appBar.isOpen, isPersistent: false, children: _jsxs(SideNavItems, { children: [orgName && (_jsx("li", { children: _jsxs(OrgNameWrapper, { children: [_jsx(FormLabel, { children: "Organization" }), _jsx(ActiveOrgName, { className: 'textPrimary', title: orgName, children: orgName })] }) })), _jsx("li", { children: navbar.elements.length > 0 && (_jsx(HeaderSideNavItems, { hasDivider: true, children: navbar.elements.map((element) => (_jsx(HeaderMenuItem, { as: element.routeProps && forwardRef, isActive: element.isCurrentPage, ...element.routeProps, onClick: () => {
323
- if (element.routeProps.onClick) {
324
- element.routeProps.onClick();
325
- }
326
- if (appBar.closeOnClick !== false) {
327
- toggleAppbar(false);
328
- }
329
- }, children: element.label }, element.key))) })) }), _jsx("li", { children: _jsx(SubElementWrapper, { "$expanded": appBar.isOpen, children: appBarElements &&
330
- appBarElements.map((element) => {
331
- if (element.subElements && element.subElements.length > 0) {
332
- return (_jsx(SideNavMenu, { large: true, title: element.label, children: element.subElements.map((subElement) => (_jsx(SideNavMenuItem, { as: subElement.routeProps && forwardRef, href: subElement.href, target: subElement.href ? subElement.target : undefined, isActive: subElement.isActive || subElement.active, ...subElement.routeProps, onClick: () => {
333
- if (subElement.onClick) {
334
- subElement.onClick();
335
- }
336
- if (subElement.routeProps?.onClick) {
337
- subElement.routeProps.onClick();
338
- }
339
- if (appBar.closeOnClick !== false) {
340
- toggleAppbar(false);
341
- }
342
- if (appBar.elementClicked) {
343
- appBar.elementClicked(subElement.key);
344
- }
345
- }, children: subElement.label }, subElement.key))) }, element.key));
346
- }
347
- else {
348
- return (_jsx(SideNavLink, { as: element.routeProps && forwardRef, large: true, isActive: element.active, ...element.routeProps, onClick: () => {
349
- if (element.onClick) {
350
- element.onClick();
351
- }
352
- if (element.routeProps?.onClick) {
353
- element.routeProps.onClick();
354
- }
355
- if (appBar.closeOnClick !== false) {
356
- toggleAppbar(false);
357
- }
358
- if (appBar.elementClicked) {
359
- appBar.elementClicked(element.key);
360
- }
361
- }, href: element.href, target: element.href ? element.target : undefined, children: element.label }, element.key));
362
- }
363
- }) }) })] }) }) })] }));
364
- };
@@ -1,2 +0,0 @@
1
- export declare const NavWrapper: any;
2
- export declare const SideNav: any;
@@ -1,21 +0,0 @@
1
- /*
2
- * Copyright Camunda Services GmbH and/or licensed to Camunda Services GmbH
3
- * under one or more contributor license agreements. Licensed under a commercial license.
4
- * You may not use this file except in compliance with the commercial license.
5
- */
6
- import { SideNav as CarbonSideNav } from '@carbon/react';
7
- import styled from 'styled-components';
8
- export const NavWrapper = styled.div `
9
- .cds--side-nav__overlay {
10
- display: none;
11
- }
12
- `;
13
- // Use a minimal prop typing to wrap Carbon's SideNav without relying on legacy carbon-components-react types
14
- export const SideNav = styled(CarbonSideNav) `
15
- visibility: ${({ expanded }) => (expanded ? 'visible' : 'hidden')};
16
- display: grid;
17
- grid-auto-flow: row;
18
- grid-auto-rows: max-content 1fr;
19
- border-right: ${({ expanded }) => expanded ? '1px solid var(--cds-border-subtle)' : undefined};
20
- overflow-y: auto;
21
- `;
@@ -1,6 +0,0 @@
1
- import type { FC } from 'react';
2
- import type { C3NavigationInfoSideBarProps } from './c3-navigation-sidebar.types';
3
- declare const C3InfoSidebar: FC<{
4
- sideBar: C3NavigationInfoSideBarProps;
5
- }>;
6
- export default C3InfoSidebar;
@@ -1,38 +0,0 @@
1
- import { jsx as _jsx, jsxs as _jsxs, Fragment as _Fragment } from "react/jsx-runtime";
2
- /*
3
- * Copyright Camunda Services GmbH and/or licensed to Camunda Services GmbH
4
- * under one or more contributor license agreements. Licensed under a commercial license.
5
- * You may not use this file except in compliance with the commercial license.
6
- */
7
- import { Help } from '@carbon/react/icons/index.esm.js';
8
- import { useC3UserConfiguration } from '../../c3-user-configuration/c3-user-configuration-provider.js';
9
- import C3NavigationSideBar from './c3-navigation-sidebar.js';
10
- import { SwitcherDivider } from './components.js';
11
- const C3InfoSidebar = ({ sideBar, }) => {
12
- const { version, ...sideBarProps } = sideBar;
13
- const { enableLogs } = useC3UserConfiguration();
14
- if (version && enableLogs)
15
- console.warn('The `version` prop in the info sidebar is deprecated and will be removed in a future release. Please set `version` in the `userSideBar` prop instead.');
16
- return (_jsx(C3NavigationSideBar, { sideBar: {
17
- ...sideBarProps,
18
- ariaLabel: sideBarProps.ariaLabel || 'Info Sidebar',
19
- }, icon: _jsx(Help, { size: 20 }), bottomChildren: version !== undefined && (_jsxs(_Fragment, { children: [_jsx(SwitcherDivider, {}), _jsxs("span", { className: 'cds--switcher__item', style: {
20
- padding: 'var(--cds-spacing-05)',
21
- paddingTop: 'var(--cds-spacing-03)',
22
- paddingBottom: 0,
23
- color: 'var(--cds-text-primary)',
24
- fontSize: 'var(--cds-body-01-font-size)',
25
- fontWeight: 'var(--cds-body-01-font-weight)',
26
- lineHeight: 'var(--cds-body-01-line-height)',
27
- letterSpacing: 'var(--cds-body-01-letter-spacing)',
28
- }, children: ["Version ", version] }), _jsxs("span", { className: 'cds--switcher__item', style: {
29
- paddingRight: 'var(--cds-spacing-05)',
30
- paddingLeft: 'var(--cds-spacing-05)',
31
- color: 'var(--cds-text-secondary)',
32
- fontSize: 'var(--cds-label-01-font-size)',
33
- fontWeight: 'var(--cds-label-01-font-weight)',
34
- lineHeight: 'var(--cds-label-01-line-height)',
35
- letterSpacing: 'var(--cds-label-01-letter-spacing)',
36
- }, children: [`© Camunda Services GmbH ${new Date().getFullYear()}`, _jsx("br", {}), " All rights reserved."] })] })) }));
37
- };
38
- export default C3InfoSidebar;
@@ -1,12 +0,0 @@
1
- import { type JSX } from 'react';
2
- import type { C3NavigationElementProps } from '../c3-navigation.types';
3
- import type { C3NavigationSideBarProps } from './c3-navigation-sidebar.types';
4
- declare const C3NavigationSidebarElement: (props: {
5
- element: C3NavigationElementProps;
6
- index: number;
7
- itemTabIndex?: number;
8
- sideBar: C3NavigationSideBarProps;
9
- setSideBarOpen: (open: boolean) => void;
10
- scrollBarWidth: number;
11
- }) => JSX.Element;
12
- export default C3NavigationSidebarElement;
@@ -1,68 +0,0 @@
1
- import { jsx as _jsx, jsxs as _jsxs, Fragment as _Fragment } from "react/jsx-runtime";
2
- /*
3
- * Copyright Camunda Services GmbH and/or licensed to Camunda Services GmbH
4
- * under one or more contributor license agreements. Licensed under a commercial license.
5
- * You may not use this file except in compliance with the commercial license.
6
- */
7
- import { Button, SideNavLink } from '@carbon/react';
8
- import { useEffect, useRef, useState } from 'react';
9
- import styled from 'styled-components';
10
- import { SwitcherDivider } from './components.js';
11
- const Row = styled.div `
12
- display: flex;
13
- justify-content: start;
14
- align-items: center;
15
-
16
- li {
17
- list-style-type: none;
18
- }
19
-
20
- .cds--switcher__item:nth-child(1) {
21
- margin-block-start: 0;
22
- }
23
-
24
- &:nth-child(1) {
25
- margin-block-start: 1rem;
26
- }
27
-
28
- .cds--overflow-menu-options {
29
- z-index: 9000 !important;
30
- }
31
- `;
32
- const C3NavigationSidebarElement = (props) => {
33
- const sideBarElementRef = useRef(null);
34
- const [isOverflown, setIsOverflown] = useState(false);
35
- const { overflowMenu, isActive, isNavLink } = props.element;
36
- const Element = isNavLink ? SideNavLink : Button;
37
- const handleSetIsOverflown = () => {
38
- const element = sideBarElementRef.current;
39
- setIsOverflown(element ? element.offsetWidth < element.scrollWidth : false);
40
- };
41
- useEffect(() => {
42
- window.addEventListener('resize', handleSetIsOverflown);
43
- handleSetIsOverflown();
44
- return () => window.removeEventListener('resize', handleSetIsOverflown);
45
- }, []);
46
- return (_jsxs(_Fragment, { children: [props.element.preceedingDivider && _jsx(SwitcherDivider, {}), _jsxs(Row, { children: [_jsx(Element, { style: {
47
- width: overflowMenu
48
- ? `calc(14rem - ${props.scrollBarWidth}px)`
49
- : `calc(16rem - ${props.scrollBarWidth}px)`,
50
- ...(props.index === 0 &&
51
- (!('elements' in props.sideBar) || !props.sideBar.elements)
52
- ? { marginTop: '1.5rem' }
53
- : {}),
54
- }, size: 'sm', kind: props.element.kind ?? 'ghost', className: `cds--switcher__item ${isActive ? 'cds--side-nav__item--active' : ''}`, onClick: () => {
55
- if (props.element.onClick) {
56
- props.element.onClick();
57
- }
58
- if (props.sideBar.closeOnClick !== false) {
59
- props.setSideBarOpen(false);
60
- }
61
- }, tabIndex: props.itemTabIndex, renderIcon: props.element.renderIcon, ...(isNavLink ? { isActive } : {}), children: _jsx("span", { ref: sideBarElementRef, title: isOverflown ? props.element.label : '', style: {
62
- overflow: 'hidden',
63
- textOverflow: 'ellipsis',
64
- whiteSpace: 'nowrap',
65
- width: '100%',
66
- }, children: props.element.label }) }), overflowMenu] })] }));
67
- };
68
- export default C3NavigationSidebarElement;
@@ -1,10 +0,0 @@
1
- import { type JSX, type ReactElement, type ReactNode } from 'react';
2
- import type { C3NavigationSideBarProps } from './c3-navigation-sidebar.types';
3
- declare const C3NavigationSideBar: (props: {
4
- sideBar: C3NavigationSideBarProps;
5
- icon: ReactElement;
6
- children?: ReactNode;
7
- version?: ReactNode;
8
- bottomChildren?: ReactNode;
9
- }) => JSX.Element;
10
- export default C3NavigationSideBar;