@camunda/ccma-saas-frontend 0.11.0 → 0.12.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.
Files changed (87) hide show
  1. package/lib/esm/components/c4-cluster-list/c4-cluster-list.d.ts +1 -1
  2. package/lib/esm/components/c4-cluster-list/c4-cluster-list.js +24 -2
  3. package/lib/esm/components/c4-cluster-list/c4-cluster-list.types.d.ts +9 -0
  4. package/lib/esm/components/c4-cluster-settings/elements/danger-zone.js +9 -1
  5. package/lib/esm/components/c4-cluster-tag-selector/c4-cluster-tag-selector.js +5 -5
  6. package/lib/esm/components/c4-clusters-empty-state/c4-clusters-empty-state.js +3 -3
  7. package/lib/esm/components/c4-convert-trial-organization-modal/c4-convert-trial-organization-modal.js +1 -11
  8. package/lib/esm/components/c4-create-alert-modal/c4-create-alert-modal.js +1 -14
  9. package/lib/esm/components/c4-create-cluster/c4-create-cluster.d.ts +1 -1
  10. package/lib/esm/components/c4-create-cluster/c4-create-cluster.js +188 -71
  11. package/lib/esm/components/c4-create-cluster/c4-create-cluster.types.d.ts +52 -0
  12. package/lib/esm/components/c4-create-cluster-api-client-modal/c4-create-cluster-api-client-modal.js +1 -11
  13. package/lib/esm/components/c4-create-connector-secret-modal/c4-create-connector-secret-modal.js +6 -13
  14. package/lib/esm/components/c4-create-console-api-client-modal/c4-create-console-api-client-modal.js +1 -11
  15. package/lib/esm/components/c4-create-ip-whitelist-modal/c4-create-ip-whitelist-modal.js +1 -18
  16. package/lib/esm/components/c4-create-trial-organization-modal/c4-create-trial-organization-modal.js +1 -11
  17. package/lib/esm/components/c4-delete-account-modal/c4-delete-account-modal.d.ts +0 -7
  18. package/lib/esm/components/c4-delete-account-modal/c4-delete-account-modal.js +1 -24
  19. package/lib/esm/components/c4-delete-organization-modal/c4-delete-organization-modal.js +1 -18
  20. package/lib/esm/components/c4-divider/c4-divider.js +12 -0
  21. package/lib/esm/components/c4-empty-state/c4-empty-state.d.ts +8 -0
  22. package/lib/esm/components/c4-empty-state/c4-empty-state.js +32 -8
  23. package/lib/esm/components/c4-file-uploader/c4-file-uploader.d.ts +36 -0
  24. package/lib/esm/components/c4-file-uploader/c4-file-uploader.js +43 -0
  25. package/lib/esm/components/c4-invite-user-to-organization-modal/c4-invite-user-to-organization-modal.js +1 -11
  26. package/lib/esm/components/c4-leave-organization-modal/c4-leave-organization-modal.js +1 -11
  27. package/lib/esm/components/c4-rename-organization-modal/c4-rename-organization-modal.js +1 -11
  28. package/lib/esm/components/c4-segmented-control/c4-segmented-control.d.ts +46 -0
  29. package/lib/esm/components/c4-segmented-control/c4-segmented-control.js +117 -0
  30. package/lib/esm/externalUrls.const.d.ts +7 -0
  31. package/lib/esm/externalUrls.const.js +11 -1
  32. package/lib/esm/i18n/c4-console-i18n.js +3 -0
  33. package/lib/esm/i18n/en/modals/apiclients.json +2 -1
  34. package/lib/esm/i18n/en/modals/clusterclients.json +2 -1
  35. package/lib/esm/i18n/en/pages/clusterdetails.json +11 -1
  36. package/lib/esm/i18n/en/pages/createcluster.json +43 -0
  37. package/lib/esm/i18n/en/pages/orgmanagement.json +3 -0
  38. package/lib/esm/index.d.ts +2 -0
  39. package/lib/esm/index.js +2 -0
  40. package/lib/esm/runtime/cluster-duplication.d.ts +10 -0
  41. package/lib/esm/runtime/cluster-duplication.js +15 -0
  42. package/lib/esm/ui/c4-password-input.js +1 -1
  43. package/lib/esm/ui/index.d.ts +1 -0
  44. package/lib/esm/ui/index.js +16 -2
  45. package/lib/esm/utils/role-labels.d.ts +1 -2
  46. package/lib/esm/utils/role-labels.js +1 -13
  47. package/lib/esm/utils/safe-translate.d.ts +4 -2
  48. package/lib/esm/utils/safe-translate.js +9 -2
  49. package/lib/esm/widgets/cluster-client-details/c4-cluster-client-details-app.js +2 -12
  50. package/lib/esm/widgets/cluster-details/c4-cluster-details-app.js +34 -23
  51. package/lib/esm/widgets/cluster-details/c4-cluster-details-app.types.d.ts +6 -0
  52. package/lib/esm/widgets/cluster-details/c4-cluster-details-page.js +7 -0
  53. package/lib/esm/widgets/cluster-details/c4-cluster-details-page.types.d.ts +3 -0
  54. package/lib/esm/widgets/cluster-details/tabs/c4-cluster-details-activity-tab.js +1 -19
  55. package/lib/esm/widgets/cluster-details/tabs/c4-cluster-details-alerts-tab.js +1 -14
  56. package/lib/esm/widgets/cluster-details/tabs/c4-cluster-details-byom-clients-tab.js +1 -18
  57. package/lib/esm/widgets/cluster-details/tabs/c4-cluster-details-clients-tab.js +1 -1
  58. package/lib/esm/widgets/cluster-details/tabs/c4-cluster-details-connector-secrets-tab.d.ts +1 -0
  59. package/lib/esm/widgets/cluster-details/tabs/c4-cluster-details-connector-secrets-tab.js +77 -28
  60. package/lib/esm/widgets/cluster-details/tabs/c4-cluster-details-hot-backups-tab.js +1 -6
  61. package/lib/esm/widgets/cluster-details/tabs/c4-cluster-details-ip-whitelist-tab.js +1 -18
  62. package/lib/esm/widgets/cluster-details/tabs/c4-cluster-details-overview-tab.js +1 -19
  63. package/lib/esm/widgets/cluster-details/tabs/c4-cluster-details-secure-connectivity-tab.js +1 -6
  64. package/lib/esm/widgets/cluster-details/tabs/c4-cluster-details-settings-tab.js +1 -16
  65. package/lib/esm/widgets/clusters/c4-clusters-page.js +72 -100
  66. package/lib/esm/widgets/clusters/c4-clusters-page.types.d.ts +7 -0
  67. package/lib/esm/widgets/connector-management/c4-connector-management-page.js +1 -9
  68. package/lib/esm/widgets/connector-management/c4-connector-management.shared.js +1 -9
  69. package/lib/esm/widgets/create-cluster/c4-create-cluster-page.d.ts +88 -1
  70. package/lib/esm/widgets/create-cluster/c4-create-cluster-page.js +285 -45
  71. package/lib/esm/widgets/create-cluster/c4-create-cluster-page.types.d.ts +9 -0
  72. package/lib/esm/widgets/dashboard/c4-dashboard-app.js +1 -18
  73. package/lib/esm/widgets/environment/c4-cluster-connector-secrets-widget.js +1 -1
  74. package/lib/esm/widgets/group-details/c4-group-details-page.js +1 -9
  75. package/lib/esm/widgets/job-worker/c4-job-worker.helpers.d.ts +1 -0
  76. package/lib/esm/widgets/job-worker/c4-job-worker.helpers.js +4 -34
  77. package/lib/esm/widgets/management/c4-management-app.js +1 -20
  78. package/lib/esm/widgets/management/c4-management-page.js +1 -9
  79. package/lib/esm/widgets/management/tabs/c4-management-api-tab.js +1 -13
  80. package/lib/esm/widgets/management/tabs/c4-management-billing-tab.js +1 -9
  81. package/lib/esm/widgets/management/tabs/c4-management-overview-tab.js +1 -13
  82. package/lib/esm/widgets/management/tabs/c4-management-pricing-tab.js +1 -8
  83. package/lib/esm/widgets/management/tabs/c4-management-settings-tab.js +1 -24
  84. package/lib/esm/widgets/management/tabs/c4-management-users-tab.js +1 -13
  85. package/lib/esm/widgets/user-account/c4-delete-account-widget.js +2 -1
  86. package/lib/esm/widgets/user-details/c4-user-details-page.js +1 -9
  87. package/package.json +3 -3
@@ -1,3 +1,3 @@
1
1
  import { type JSX } from 'react';
2
2
  import type { C4ClusterListProps } from './c4-cluster-list.types.js';
3
- export declare const C4ClusterList: ({ clusters, loading, urls, permissions, onNavigate, onDeleteCluster, onAssignTag, onWakeCluster, onFailoverCluster, trialNotification, encryptionNotification, clusterCapMessage, emptyStateContent, translations, isClusterPaused, isMultiRegionCluster, isFailoverSyncPending, isFailoverSource, isOnRetiredAlphaGeneration, isRunningOnUnsupportedGeneration, scope, }: C4ClusterListProps) => JSX.Element;
3
+ export declare const C4ClusterList: ({ clusters, loading, urls, permissions, onNavigate, onDeleteCluster, onAssignTag, onWakeCluster, onFailoverCluster, onDuplicateCluster, trialNotification, encryptionNotification, clusterCapMessage, emptyStateContent, translations, isClusterPaused, isMultiRegionCluster, isFailoverSyncPending, isFailoverSource, isOnRetiredAlphaGeneration, isRunningOnUnsupportedGeneration, scope, }: C4ClusterListProps) => JSX.Element;
@@ -37,7 +37,7 @@ function isPlainLeftClick(event) {
37
37
  !event.ctrlKey &&
38
38
  !event.shiftKey);
39
39
  }
40
- export const C4ClusterList = ({ clusters, loading, urls, permissions, onNavigate, onDeleteCluster, onAssignTag, onWakeCluster, onFailoverCluster, trialNotification, encryptionNotification, clusterCapMessage, emptyStateContent, translations, isClusterPaused, isMultiRegionCluster, isFailoverSyncPending, isFailoverSource, isOnRetiredAlphaGeneration, isRunningOnUnsupportedGeneration, scope = 'cluster', }) => {
40
+ export const C4ClusterList = ({ clusters, loading, urls, permissions, onNavigate, onDeleteCluster, onAssignTag, onWakeCluster, onFailoverCluster, onDuplicateCluster, trialNotification, encryptionNotification, clusterCapMessage, emptyStateContent, translations, isClusterPaused, isMultiRegionCluster, isFailoverSyncPending, isFailoverSource, isOnRetiredAlphaGeneration, isRunningOnUnsupportedGeneration, scope = 'cluster', }) => {
41
41
  const designSystem = useC4DesignSystem();
42
42
  const isDsMode = designSystem === 'ds';
43
43
  const tableContainerRef = useRef(null);
@@ -406,6 +406,25 @@ export const C4ClusterList = ({ clusters, loading, urls, permissions, onNavigate
406
406
  },
407
407
  ]
408
408
  : []),
409
+ ...(onDuplicateCluster
410
+ ? [
411
+ {
412
+ id: 'duplicate-cluster',
413
+ // Stays visible but disabled for a cluster that was failed over,
414
+ // with the reason in the label — as the failover action above
415
+ // does. console-backend rejects that cluster too.
416
+ label: (row) => isFailoverSource?.(row.id)
417
+ ? (translations.overflowMenu
418
+ .duplicateUnavailableFailoverSource ??
419
+ 'Duplicate (unavailable — this cluster was failed over)')
420
+ : (translations.overflowMenu.duplicate ?? 'Duplicate'),
421
+ kind: 'ghost',
422
+ onClick: (row) => onDuplicateCluster(row.id),
423
+ disabled: (row) => isFailoverSource?.(row.id) ?? false,
424
+ visible: () => permissions.canDuplicateCluster ?? false,
425
+ },
426
+ ]
427
+ : []),
409
428
  {
410
429
  id: 'delete-cluster',
411
430
  label: translations.overflowMenu.delete,
@@ -418,7 +437,10 @@ export const C4ClusterList = ({ clusters, loading, urls, permissions, onNavigate
418
437
  if (clusterCapMessage) {
419
438
  return _jsx("p", { children: clusterCapMessage });
420
439
  }
421
- if (clusters.length === 0) {
440
+ // An empty list while loading means "not known yet", not "no clusters".
441
+ // Fall through to the table, which shows its loading skeleton. An empty
442
+ // state here invites the user to create a cluster that already exists.
443
+ if (clusters.length === 0 && !loading) {
422
444
  return (emptyStateContent ?? (_jsxs("div", { style: {
423
445
  paddingBlockStart: 'var(--cds-spacing-07)',
424
446
  paddingBlockEnd: 'var(--cds-spacing-07)',
@@ -23,6 +23,11 @@ export interface ClusterListPermissions {
23
23
  canSeeClusterLoad: boolean;
24
24
  canWakeCluster: boolean;
25
25
  canFailoverCluster?: boolean;
26
+ /**
27
+ * Gated by the `console.clusterDuplication` flag as well as by the create
28
+ * permission: a duplicate makes a cluster.
29
+ */
30
+ canDuplicateCluster?: boolean;
26
31
  createClusterButtonDisabled: boolean;
27
32
  }
28
33
  export interface ClusterListNotification {
@@ -49,6 +54,7 @@ export interface C4ClusterListProps {
49
54
  onAssignTag: (clusterId: string) => void;
50
55
  onWakeCluster: (clusterId: string) => void;
51
56
  onFailoverCluster?: (clusterId: string) => void;
57
+ onDuplicateCluster?: (clusterId: string) => void;
52
58
  trialNotification?: React.ReactNode;
53
59
  encryptionNotification?: ClusterListNotification;
54
60
  clusterCapMessage?: string;
@@ -81,6 +87,9 @@ export interface C4ClusterListProps {
81
87
  failoverSyncPending?: string;
82
88
  /** Shown as the action label for a cluster that was already failed over. */
83
89
  failoverAlreadyFailedOver?: string;
90
+ duplicate?: string;
91
+ /** Shown as the action label for a cluster that was failed over, which cannot be duplicated. */
92
+ duplicateUnavailableFailoverSource?: string;
84
93
  };
85
94
  tags: {
86
95
  addLabel: string;
@@ -1,8 +1,16 @@
1
1
  import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
2
+ import { useC4DesignSystem } from '../../../runtime/c4-console-runtime-context.js';
2
3
  import { Button, Stack } from '../../../ui/index.js';
3
4
  import { SECTION_SUBHEADING_STYLE } from '../../../utils/section-heading-style.js';
4
5
  import { SettingsTile } from './settings-tile.js';
5
6
  export const DangerZone = ({ deleteCluster, title, permissions, }) => {
6
- const component = (_jsx(SettingsTile, { title: title, children: _jsx("div", { children: _jsxs(Stack, { gap: 6, children: [_jsxs(Stack, { gap: 4, children: [_jsx("h4", { style: SECTION_SUBHEADING_STYLE, children: deleteCluster.title }), _jsx("p", { children: deleteCluster.description })] }), _jsx(Button, { onClick: deleteCluster.action.onClick, kind: 'danger', disabled: !permissions.mayDeleteCluster, size: 'md', children: deleteCluster.action.label })] }) }) }));
7
+ const designSystem = useC4DesignSystem();
8
+ // The DS Stack adapter is a `flex flex-col` div, and a flex column stretches
9
+ // its items across the full width. That made the delete button as wide as the
10
+ // card, which reads as a page-wide destructive area and not as one button.
11
+ // `align-self` keeps the button at its own width. Carbon gets no style, thus
12
+ // carbon mode does not change.
13
+ const deleteButtonStyle = designSystem === 'ds' ? { alignSelf: 'flex-start' } : undefined;
14
+ const component = (_jsx(SettingsTile, { title: title, children: _jsx("div", { children: _jsxs(Stack, { gap: 6, children: [_jsxs(Stack, { gap: 4, children: [_jsx("h4", { style: SECTION_SUBHEADING_STYLE, children: deleteCluster.title }), _jsx("p", { children: deleteCluster.description })] }), _jsx(Button, { onClick: deleteCluster.action.onClick, kind: 'danger', disabled: !permissions.mayDeleteCluster, size: 'md', style: deleteButtonStyle, children: deleteCluster.action.label })] }) }) }));
7
15
  return component;
8
16
  };
@@ -4,13 +4,13 @@ import { jsx as _jsx, jsxs as _jsxs, Fragment as _Fragment } from "react/jsx-run
4
4
  * under one or more contributor license agreements. Licensed under a commercial license.
5
5
  * You may not use this file except in compliance with the commercial license.
6
6
  */
7
- import { C3ClusterTag, StageClusterLabels, } from '@camunda/camunda-composite-components';
7
+ import { StageClusterLabels, } from '@camunda/camunda-composite-components';
8
8
  import { ChoiceCard, ChoiceCardGroup } from '@camunda/design-system';
9
9
  import { Column, Grid } from '@carbon/react';
10
10
  import { Information } from '@carbon/react/icons/index.esm.js';
11
11
  import { useEffect, useState } from 'react';
12
12
  import { useC4DesignSystem } from '../../runtime/c4-console-runtime-context.js';
13
- import { Stack } from '../../ui/index.js';
13
+ import { ClusterTag, Stack } from '../../ui/index.js';
14
14
  import { STYLES } from '../c4-billing-page/c4-billing-page.js';
15
15
  import { mediaSizeByWidth } from '../c4-billing-page/elements/current-usage-metrics.js';
16
16
  import { C4SelectableTile } from '../c4-selectable-tile/c4-selectable-tile.js';
@@ -43,9 +43,9 @@ export const C4ClusterTagSelector = (props) => {
43
43
  const stage = item;
44
44
  const { text, info } = props.boxes[stage];
45
45
  return (_jsx(ChoiceCard, { value: item,
46
- // ChoiceCard renders `title` as node children; pass the C3 stage
46
+ // ChoiceCard renders `title` as node children; pass the stage
47
47
  // chip so the colored badge itself serves as the card title.
48
- title: (_jsx(C3ClusterTag, { stage: stage })), description: info ? `${text} ${info}` : text, disabled: isTagDisabled(item) }, `tag-option-${item}`));
48
+ title: (_jsx(ClusterTag, { stage: stage })), description: info ? `${text} ${info}` : text, disabled: isTagDisabled(item) }, `tag-option-${item}`));
49
49
  }) }));
50
50
  }
51
51
  const buildSingleTile = (item) => (_jsxs(C4SelectableTile, { value: item, checked: item === props.currentStage, onChange: () => {
@@ -54,7 +54,7 @@ export const C4ClusterTagSelector = (props) => {
54
54
  (props.allowedTags && !props.allowedTags?.includes(item)), style: { height: '100%' }, children: [_jsxs("div", { style: {
55
55
  marginBottom: props.boxes[item].info ? '24px' : '0px',
56
56
  paddingBottom: props.boxes[item].info ? '24px' : '0px',
57
- }, children: [_jsx(C3ClusterTag, { stage: item }, `tag-options-name-${item}`), _jsx("p", { children: props.boxes[item].text }, `tag-options-description-${item}`)] }), (() => {
57
+ }, children: [_jsx(ClusterTag, { stage: item }, `tag-options-name-${item}`), _jsx("p", { children: props.boxes[item].text }, `tag-options-description-${item}`)] }), (() => {
58
58
  if (props.boxes[item].info) {
59
59
  return (_jsx("div", { children: _jsxs("div", { style: {
60
60
  display: 'grid',
@@ -19,7 +19,7 @@ export const C4ClustersEmptyState = (props) => {
19
19
  onClick: onDocsClick,
20
20
  }
21
21
  : undefined;
22
- return (_jsx(C4EmptyState, { icon: {
22
+ return (_jsx(C4EmptyState, { align: 'start', icon: {
23
23
  path: C4_ASSET_URLS.clusterIcon,
24
24
  altText: 'clusterIcon',
25
25
  }, heading: texts.noClusters.heading, description: texts.noClusters.description, button: button, link: link }));
@@ -29,7 +29,7 @@ export const C4ClustersEmptyState = (props) => {
29
29
  onClick: onUpgrade ?? (() => undefined),
30
30
  label: texts.trialExpired.upgradeButtonLabel,
31
31
  };
32
- return (_jsx(C4EmptyState, { icon: {
32
+ return (_jsx(C4EmptyState, { align: 'start', icon: {
33
33
  path: C4_ASSET_URLS.upgradeIcon,
34
34
  altText: 'upgradeIcon',
35
35
  }, heading: texts.trialExpired.heading, description: texts.trialExpired.adminDescription, button: onExtendTrial ? undefined : upgradeButton, buttons: onExtendTrial
@@ -42,7 +42,7 @@ export const C4ClustersEmptyState = (props) => {
42
42
  ]
43
43
  : undefined }));
44
44
  }
45
- return (_jsx(C4EmptyState, { icon: {
45
+ return (_jsx(C4EmptyState, { align: 'start', icon: {
46
46
  path: C4_ASSET_URLS.upgradeIcon,
47
47
  altText: 'upgradeIcon',
48
48
  }, heading: texts.trialExpired.heading, description: texts.trialExpired.memberDescription }));
@@ -1,17 +1,7 @@
1
1
  import { jsx as _jsx, Fragment as _Fragment } from "react/jsx-runtime";
2
2
  import { useCallback, useMemo } from 'react';
3
+ import { safeTranslate } from '../../utils/safe-translate.js';
3
4
  import { C4AsyncModal } from '../c4-async-modal/c4-async-modal.js';
4
- function safeTranslate(t, key, defaultValue, options) {
5
- if (!t)
6
- return defaultValue;
7
- try {
8
- const translated = t(key, options);
9
- return typeof translated === 'string' ? translated : defaultValue;
10
- }
11
- catch {
12
- return defaultValue;
13
- }
14
- }
15
5
  function renderStrongTaggedText(text) {
16
6
  // Supports a minimal subset of HTML used by translations (e.g. <strong>…</strong>).
17
7
  const tokens = text.split(/(<\/?strong>)/g);
@@ -7,22 +7,9 @@ import { jsx as _jsx, jsxs as _jsxs, Fragment as _Fragment } from "react/jsx-run
7
7
  import { forwardRef, useCallback, useImperativeHandle, useState, } from 'react';
8
8
  import { Checkbox, Form, Modal, PasswordInput, Stack, TextInput, } from '../../ui/index.js';
9
9
  import { useRadioFamily } from '../../ui/families.js';
10
+ import { safeTranslate } from '../../utils/safe-translate.js';
10
11
  import { C4ActionableNotification } from '../c4-actionable-notification/c4-actionable-notification.js';
11
12
  import { C4InlineNotification } from '../c4-inline-notification/c4-inline-notification.js';
12
- // Helper to translate with fallback
13
- function safeTranslate(translateFn, key, fallback, options) {
14
- try {
15
- const result = translateFn(key, options);
16
- // If i18next returns the key unchanged, use fallback
17
- if (result === key) {
18
- return fallback;
19
- }
20
- return result;
21
- }
22
- catch {
23
- return fallback;
24
- }
25
- }
26
13
  export const C4CreateAlertModal = forwardRef(({ t, userEmail, docsAlertsUrl, onNavigate, onCreateAlert, onCancel, onSubmitStart, onSubmitError, }, ref) => {
27
14
  const { RadioButton, RadioButtonGroup } = useRadioFamily();
28
15
  const [isOpen, setIsOpen] = useState(false);
@@ -1,3 +1,3 @@
1
1
  import { type JSX } from 'react';
2
2
  import type { C4CreateClusterProps } from './c4-create-cluster.types.js';
3
- export declare const C4CreateCluster: ({ loading, cta, formElements, autoUpdate, tasklistModeToggle, authorizationToggle, banner: { noSlotsLeft }, }: C4CreateClusterProps) => JSX.Element;
3
+ export declare const C4CreateCluster: ({ loading, cta, formElements, autoUpdate, tasklistModeToggle, authorizationToggle, banner: { noSlotsLeft }, initialValues, duplicate, }: C4CreateClusterProps) => JSX.Element;