@camunda/ccma-saas-frontend 0.5.0 → 0.7.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 (77) hide show
  1. package/lib/esm/components/c4-charts-dashboard/elements/bar-chart.js +2 -2
  2. package/lib/esm/components/c4-cluster-client-credentials/c4-cluster-client-credentials.js +1 -1
  3. package/lib/esm/components/c4-cluster-client-credentials-identity/c4-cluster-client-credentials-identity.js +1 -1
  4. package/lib/esm/components/c4-cluster-details-encryption/c4-cluster-details-encryption.d.ts +1 -1
  5. package/lib/esm/components/c4-cluster-details-encryption/c4-cluster-details-encryption.js +24 -1
  6. package/lib/esm/components/c4-cluster-details-encryption/c4-cluster-details-encryption.types.d.ts +14 -1
  7. package/lib/esm/components/c4-cluster-list/c4-cluster-list.d.ts +1 -1
  8. package/lib/esm/components/c4-cluster-list/c4-cluster-list.js +24 -9
  9. package/lib/esm/components/c4-cluster-list/c4-cluster-list.types.d.ts +6 -0
  10. package/lib/esm/components/c4-cluster-overview/cluster-details.d.ts +2 -0
  11. package/lib/esm/components/c4-cluster-overview/cluster-details.js +10 -1
  12. package/lib/esm/components/c4-cluster-settings/c4-cluster-settings.d.ts +1 -1
  13. package/lib/esm/components/c4-cluster-settings/c4-cluster-settings.js +4 -2
  14. package/lib/esm/components/c4-cluster-settings/c4-cluster-settings.mocks.js +1 -1
  15. package/lib/esm/components/c4-cluster-settings/c4-cluster-settings.types.d.ts +4 -0
  16. package/lib/esm/components/c4-cluster-settings/elements/external-identity-provider-modal.js +15 -5
  17. package/lib/esm/components/c4-cluster-settings/elements/external-identity-provider.d.ts +12 -1
  18. package/lib/esm/components/c4-cluster-settings/elements/external-identity-provider.js +9 -3
  19. package/lib/esm/components/c4-cluster-settings/elements/session-settings.d.ts +13 -0
  20. package/lib/esm/components/c4-cluster-settings/elements/session-settings.js +69 -0
  21. package/lib/esm/components/c4-create-alert-modal/c4-create-alert-modal.js +19 -1
  22. package/lib/esm/components/c4-create-alert-modal/c4-create-alert-modal.mocks.js +2 -1
  23. package/lib/esm/components/c4-create-alert-modal/c4-create-alert-modal.types.d.ts +1 -0
  24. package/lib/esm/components/c4-create-console-api-client-modal/c4-create-console-api-client-modal.js +12 -0
  25. package/lib/esm/components/c4-create-ip-whitelist-modal/c4-create-ip-whitelist-modal.js +7 -2
  26. package/lib/esm/components/c4-delete-organization-modal/c4-delete-organization-modal.d.ts +1 -1
  27. package/lib/esm/components/c4-delete-organization-modal/c4-delete-organization-modal.js +3 -3
  28. package/lib/esm/components/c4-delete-organization-modal/c4-delete-organization-modal.types.d.ts +7 -0
  29. package/lib/esm/components/c4-invite-user-to-organization-modal/c4-invite-user-to-organization-modal.js +15 -8
  30. package/lib/esm/components/c4-invite-user-to-organization-modal/c4-invite-user-to-organization-modal.types.d.ts +1 -0
  31. package/lib/esm/components/c4-navigation/c4-navigation.js +17 -9
  32. package/lib/esm/components/c4-structured-list/c4-structured-list.js +15 -1
  33. package/lib/esm/components/c4-usage-history/elements/usage-history-charts.d.ts +7 -1
  34. package/lib/esm/components/c4-usage-history/elements/usage-history-charts.js +2 -2
  35. package/lib/esm/components/shared-charts/ds-line-chart.js +2 -2
  36. package/lib/esm/components/shared-charts/recharts-tokens.d.ts +24 -9
  37. package/lib/esm/components/shared-charts/recharts-tokens.js +40 -13
  38. package/lib/esm/i18n/en/entities/orgroles.json +26 -0
  39. package/lib/esm/i18n/en/modals/apiclients.json +4 -1
  40. package/lib/esm/i18n/en/modals/backups.json +2 -0
  41. package/lib/esm/i18n/en/pages/clusterdetails.json +3 -2
  42. package/lib/esm/i18n/en/pages/clusters.json +4 -1
  43. package/lib/esm/i18n/en/pages/orgmanagement.json +9 -1
  44. package/lib/esm/runtime/nav/use-webapp-nav-data.d.ts +18 -0
  45. package/lib/esm/runtime/nav/use-webapp-nav-data.js +39 -15
  46. package/lib/esm/utils/http-error-message.d.ts +14 -0
  47. package/lib/esm/utils/http-error-message.js +35 -0
  48. package/lib/esm/utils/role-labels.d.ts +25 -7
  49. package/lib/esm/utils/role-labels.js +94 -13
  50. package/lib/esm/widgets/cluster-details/c4-cluster-details-app.d.ts +3 -0
  51. package/lib/esm/widgets/cluster-details/c4-cluster-details-app.js +159 -34
  52. package/lib/esm/widgets/cluster-details/c4-cluster-details-app.types.d.ts +3 -0
  53. package/lib/esm/widgets/cluster-details/c4-cluster-details-page.js +18 -0
  54. package/lib/esm/widgets/cluster-details/c4-cluster-details-page.types.d.ts +5 -0
  55. package/lib/esm/widgets/cluster-details/tabs/c4-cluster-details-alerts-tab.d.ts +1 -0
  56. package/lib/esm/widgets/cluster-details/tabs/c4-cluster-details-encryption-tab.d.ts +2 -0
  57. package/lib/esm/widgets/cluster-details/tabs/c4-cluster-details-encryption-tab.js +16 -3
  58. package/lib/esm/widgets/cluster-details/tabs/c4-cluster-details-hot-backups-tab.d.ts +19 -0
  59. package/lib/esm/widgets/cluster-details/tabs/c4-cluster-details-hot-backups-tab.js +108 -58
  60. package/lib/esm/widgets/cluster-details/tabs/c4-cluster-details-ip-whitelist-tab.d.ts +1 -1
  61. package/lib/esm/widgets/cluster-details/tabs/c4-cluster-details-ip-whitelist-tab.js +15 -3
  62. package/lib/esm/widgets/cluster-details/tabs/c4-cluster-details-overview-tab.js +3 -0
  63. package/lib/esm/widgets/cluster-details/tabs/c4-cluster-details-settings-tab.js +109 -26
  64. package/lib/esm/widgets/clusters/c4-clusters-page.js +18 -1
  65. package/lib/esm/widgets/clusters/c4-clusters-page.types.d.ts +4 -0
  66. package/lib/esm/widgets/management/c4-management-app.d.ts +1 -1
  67. package/lib/esm/widgets/management/c4-management-app.js +404 -98
  68. package/lib/esm/widgets/management/c4-management-app.types.d.ts +2 -0
  69. package/lib/esm/widgets/management/tabs/c4-management-api-tab.js +21 -0
  70. package/lib/esm/widgets/management/tabs/c4-management-usage-tab.d.ts +30 -1
  71. package/lib/esm/widgets/management/tabs/c4-management-usage-tab.js +34 -14
  72. package/lib/esm/widgets/management/tabs/c4-management-users-tab.d.ts +2 -1
  73. package/lib/esm/widgets/management/tabs/c4-management-users-tab.js +46 -17
  74. package/lib/esm/widgets/user-details/c4-user-details-page.d.ts +1 -1
  75. package/lib/esm/widgets/user-details/c4-user-details-page.js +22 -8
  76. package/lib/esm/widgets/user-details/c4-user-details-page.types.d.ts +2 -0
  77. package/package.json +11 -11
@@ -76,6 +76,8 @@ export interface C4ManagementAppProps {
76
76
  * gated behind the feature flag.
77
77
  */
78
78
  hdpValueMetricsFor2025Enabled?: boolean;
79
+ /** Aligned org-role model active (camunda-hub#25467). */
80
+ permissionsReworkEnabled?: boolean;
79
81
  urls?: C4ManagementUrls;
80
82
  /**
81
83
  * Called when the component needs the host to reload org data (e.g. after a
@@ -187,6 +187,15 @@ function mapPermissionsToScopeStrings(permissions, t) {
187
187
  case 'DeleteHotBackup':
188
188
  hotBackupScopes.push(safeTranslate(t, 'orgmanagement:tabs.api.scopes.delete', 'Delete'));
189
189
  break;
190
+ case 'GetHotBackupSchedule':
191
+ hotBackupScopes.push(safeTranslate(t, 'orgmanagement:tabs.api.scopes.getSchedule', 'Get schedule'));
192
+ break;
193
+ case 'UpdateHotBackupSchedule':
194
+ hotBackupScopes.push(safeTranslate(t, 'orgmanagement:tabs.api.scopes.updateSchedule', 'Create + update schedule'));
195
+ break;
196
+ case 'DeleteHotBackupSchedule':
197
+ hotBackupScopes.push(safeTranslate(t, 'orgmanagement:tabs.api.scopes.deleteSchedule', 'Delete schedule'));
198
+ break;
190
199
  case 'DownloadActivity':
191
200
  activityScopes.push(safeTranslate(t, 'orgmanagement:tabs.api.scopes.download', 'Download'));
192
201
  break;
@@ -395,6 +404,18 @@ export const C4ManagementApiTab = (props) => {
395
404
  label: safeTranslate(t, 'apiclients:create.fields.scopes.hotBackups.delete', 'Delete'),
396
405
  value: 'DeleteHotBackups',
397
406
  },
407
+ {
408
+ label: safeTranslate(t, 'apiclients:create.fields.scopes.hotBackups.getSchedule', 'Get schedule'),
409
+ value: 'GetHotBackupSchedule',
410
+ },
411
+ {
412
+ label: safeTranslate(t, 'apiclients:create.fields.scopes.hotBackups.updateSchedule', 'Create + update schedule'),
413
+ value: 'UpdateHotBackupSchedule',
414
+ },
415
+ {
416
+ label: safeTranslate(t, 'apiclients:create.fields.scopes.hotBackups.deleteSchedule', 'Delete schedule'),
417
+ value: 'DeleteHotBackupSchedule',
418
+ },
398
419
  ],
399
420
  },
400
421
  {
@@ -5,6 +5,13 @@ export interface UsageHistoryEntryPerCluster {
5
5
  processInstances: number;
6
6
  decisionInstances: number;
7
7
  taskUsers: number;
8
+ /**
9
+ * This cluster's peak active tenants in the period, or `undefined` when HDP
10
+ * has no reading for it. The clusters of a period do not add up to the
11
+ * period's org figure: each is its own peak, and two clusters can peak on
12
+ * different days.
13
+ */
14
+ tenants?: number;
8
15
  clusterId: string;
9
16
  clusterName: string;
10
17
  }
@@ -13,6 +20,13 @@ export interface UsageHistoryEntry extends RowBaseProps {
13
20
  decisionInstances: number;
14
21
  taskUsers: number;
15
22
  generalUsers: number;
23
+ /**
24
+ * Peak active tenants inside the period — a gauge, so a peak rather than the
25
+ * sum the neighbouring metrics are. `undefined` when HDP holds no reading for
26
+ * the period at all (tenant history is capped at ~1 year, so older periods
27
+ * have none); rendered as "-" so an unknown period isn't read as "no tenants".
28
+ */
29
+ tenants?: number;
16
30
  period: string;
17
31
  perCluster: UsageHistoryEntryPerCluster[];
18
32
  }
@@ -24,6 +38,7 @@ export interface C4ManagementUsageTabText {
24
38
  processInstances: string;
25
39
  decisionInstances: string;
26
40
  taskUsers: string;
41
+ tenants: string;
27
42
  };
28
43
  groupBy: {
29
44
  heading: string;
@@ -35,6 +50,7 @@ export interface C4ManagementUsageTabText {
35
50
  processInstances: string;
36
51
  decisionInstances: string;
37
52
  taskUsers: string;
53
+ tenants: string;
38
54
  };
39
55
  }
40
56
  export interface C4ManagementUsageTabProps {
@@ -46,5 +62,18 @@ export interface C4ManagementUsageTabProps {
46
62
  charts?: UsageHistoryChartsProps;
47
63
  text: C4ManagementUsageTabText;
48
64
  isLicensingModel2025?: boolean;
65
+ /**
66
+ * Show the tenants column. Tenants is a 2025-licensing value metric sourced
67
+ * from HDP, so the host gates it on the feature flag plus the licensing model
68
+ * — the same gate the billing tab's tenants card uses.
69
+ */
70
+ showTenants?: boolean;
71
+ /**
72
+ * Why the tab has no data, when a read failed. Without it an empty table and a
73
+ * column of "-" claim the org used nothing, which is a different statement
74
+ * from "we could not find out" — and the most common cause is a permission
75
+ * the viewer does not have rather than an outage.
76
+ */
77
+ error?: string;
49
78
  }
50
- export declare const C4ManagementUsageTab: ({ loading, groupBy, onGroupByChange, perClusterAvailable, history, charts, text, isLicensingModel2025, }: C4ManagementUsageTabProps) => JSX.Element;
79
+ export declare const C4ManagementUsageTab: ({ loading, groupBy, onGroupByChange, perClusterAvailable, history, charts, text, isLicensingModel2025, showTenants, error, }: C4ManagementUsageTabProps) => JSX.Element;
@@ -1,15 +1,15 @@
1
- import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
1
+ import { jsx as _jsx, jsxs as _jsxs, Fragment as _Fragment } from "react/jsx-runtime";
2
2
  import { C4DataTable } from '../../../components/c4-data-table/c4-data-table.js';
3
3
  import { C4DataTableSkeleton } from '../../../components/c4-data-table/c4-data-table-skeleton.js';
4
4
  import { C4StructuredListBody, C4StructuredListCell, C4StructuredListHead, C4StructuredListRow, C4StructuredListWrapper, } from '../../../components/c4-structured-list/c4-structured-list.js';
5
5
  import { C4UsageHistory } from '../../../components/c4-usage-history/c4-usage-history.js';
6
6
  import { useC4DesignSystem } from '../../../runtime/c4-console-runtime-context.js';
7
7
  import { Stack } from '../../../ui/index.js';
8
- function ExpandedRow({ clusters, text, isLicensingModel2025, }) {
9
- const headerRow = (_jsxs(C4StructuredListRow, { head: true, children: [_jsx(C4StructuredListCell, { head: true, children: text.perCluster.clusterName }), _jsx(C4StructuredListCell, { head: true, children: text.perCluster.processInstances }), !isLicensingModel2025 && (_jsx(C4StructuredListCell, { head: true, children: text.perCluster.decisionInstances })), !isLicensingModel2025 && (_jsx(C4StructuredListCell, { head: true, children: text.perCluster.taskUsers }))] }));
10
- return (_jsxs(C4StructuredListWrapper, { children: [_jsx(C4StructuredListHead, { children: headerRow }), _jsx(C4StructuredListBody, { children: clusters.map((cluster) => (_jsxs(C4StructuredListRow, { children: [_jsx(C4StructuredListCell, { noWrap: true, children: cluster.clusterName }), _jsx(C4StructuredListCell, { children: cluster.processInstances }), !isLicensingModel2025 && (_jsx(C4StructuredListCell, { children: cluster.decisionInstances })), !isLicensingModel2025 && (_jsx(C4StructuredListCell, { children: cluster.taskUsers }))] }, cluster.clusterId))) })] }));
8
+ function ExpandedRow({ clusters, text, isLicensingModel2025, showTenants, }) {
9
+ const headerRow = (_jsxs(C4StructuredListRow, { head: true, children: [_jsx(C4StructuredListCell, { head: true, children: text.perCluster.clusterName }), _jsx(C4StructuredListCell, { head: true, children: text.perCluster.processInstances }), showTenants && (_jsx(C4StructuredListCell, { head: true, children: text.perCluster.tenants })), !isLicensingModel2025 && (_jsx(C4StructuredListCell, { head: true, children: text.perCluster.decisionInstances })), !isLicensingModel2025 && (_jsx(C4StructuredListCell, { head: true, children: text.perCluster.taskUsers }))] }));
10
+ return (_jsxs(C4StructuredListWrapper, { children: [_jsx(C4StructuredListHead, { children: headerRow }), _jsx(C4StructuredListBody, { children: clusters.map((cluster) => (_jsxs(C4StructuredListRow, { children: [_jsx(C4StructuredListCell, { noWrap: true, children: cluster.clusterName }), _jsx(C4StructuredListCell, { children: cluster.processInstances }), showTenants && (_jsx(C4StructuredListCell, { children: cluster.tenants ?? '-' })), !isLicensingModel2025 && (_jsx(C4StructuredListCell, { children: cluster.decisionInstances })), !isLicensingModel2025 && (_jsx(C4StructuredListCell, { children: cluster.taskUsers }))] }, cluster.clusterId))) })] }));
11
11
  }
12
- export const C4ManagementUsageTab = ({ loading, groupBy, onGroupByChange, perClusterAvailable, history, charts, text, isLicensingModel2025 = false, }) => {
12
+ export const C4ManagementUsageTab = ({ loading, groupBy, onGroupByChange, perClusterAvailable, history, charts, text, isLicensingModel2025 = false, showTenants = false, error, }) => {
13
13
  const designSystem = useC4DesignSystem();
14
14
  const headers = [
15
15
  {
@@ -22,6 +22,26 @@ export const C4ManagementUsageTab = ({ loading, groupBy, onGroupByChange, perClu
22
22
  key: 'processInstances',
23
23
  sorting: (a, b) => a.processInstances - b.processInstances,
24
24
  },
25
+ // Tenants is org-scoped, so it is a table column but never a per-cluster
26
+ // one (see ExpandedRow). A period HDP has no reading for sorts below 0 so
27
+ // the "-" rows group together instead of mixing in with real zeroes.
28
+ ...(showTenants
29
+ ? [
30
+ {
31
+ label: text.headers.tenants,
32
+ key: 'tenants',
33
+ sorting: (a, b) => (a.tenants ?? -1) - (b.tenants ?? -1),
34
+ type: {
35
+ type: 'wrapper',
36
+ options: {
37
+ wrapperOptions: {
38
+ wrapper: (row) => (_jsx(_Fragment, { children: row.tenants ?? '-' })),
39
+ },
40
+ },
41
+ },
42
+ },
43
+ ]
44
+ : []),
25
45
  ...(isLicensingModel2025
26
46
  ? []
27
47
  : [
@@ -60,18 +80,18 @@ export const C4ManagementUsageTab = ({ loading, groupBy, onGroupByChange, perClu
60
80
  const hasPerCluster = perClusterAvailable && (item.perCluster?.length ?? 0) > 0;
61
81
  return {
62
82
  ...item,
63
- expansion: hasPerCluster ? (_jsx(ExpandedRow, { clusters: item.perCluster, text: text, isLicensingModel2025: isLicensingModel2025 })) : null,
83
+ expansion: hasPerCluster ? (_jsx(ExpandedRow, { clusters: item.perCluster, text: text, isLicensingModel2025: isLicensingModel2025, showTenants: showTenants })) : null,
64
84
  };
65
85
  }), toolbar: toolbar, title: undefined }, `usage-history-${groupBy}`) }));
66
86
  return (_jsx("div", { style: {
67
87
  width: '100%',
68
88
  overflowX: designSystem === 'ds' ? 'visible' : 'auto',
69
- }, children: _jsx(Stack, { gap: 8, children: _jsx(C4UsageHistory, { title: '', description: '', descriptionTooltip: '', loading: loading, data: {
70
- titles: {
71
- table: text.tableTabTitle,
72
- charts: text.chartsTabTitle,
73
- },
74
- component: tableComponent,
75
- charts,
76
- } }) }) }));
89
+ }, children: _jsxs(Stack, { gap: 8, children: [error ? (_jsx("p", { style: { color: 'var(--cds-text-error)' }, children: error })) : null, _jsx(C4UsageHistory, { title: '', description: '', descriptionTooltip: '', loading: loading, data: {
90
+ titles: {
91
+ table: text.tableTabTitle,
92
+ charts: text.chartsTabTitle,
93
+ },
94
+ component: tableComponent,
95
+ charts,
96
+ } })] }) }));
77
97
  };
@@ -10,6 +10,7 @@ export interface C4ManagementUsersTabProps {
10
10
  mayInviteUsers: boolean;
11
11
  mayAssignNewOwner: boolean;
12
12
  showLegacyClusterRoles?: boolean;
13
+ permissionsReworkEnabled?: boolean;
13
14
  inviteModal?: {
14
15
  showAdminRole?: boolean;
15
16
  learnMoreUrl?: string;
@@ -34,4 +35,4 @@ export interface C4ManagementUsersTabProps {
34
35
  onAssignNewOwner: (newOwnerUserId: string, oldOwnerNewRoles: string[]) => Promise<void>;
35
36
  onUpdateUserRoles: (userId: string, roles: string[]) => Promise<void>;
36
37
  }
37
- export declare const C4ManagementUsersTab: ({ orgId, members, loading, mayManageUsersActions, mayInviteUsers, mayAssignNewOwner, showLegacyClusterRoles, inviteModal, changeRolesModal, currentUserEmail, onNavigateToUser, t, telemetry, onRemoveUser, onInviteUser, onResendInvite, onCancelInvite, onAssignNewOwner, onUpdateUserRoles, }: C4ManagementUsersTabProps) => JSX.Element;
38
+ export declare const C4ManagementUsersTab: ({ orgId, members, loading, mayManageUsersActions, mayInviteUsers, mayAssignNewOwner, showLegacyClusterRoles, permissionsReworkEnabled, inviteModal, changeRolesModal, currentUserEmail, onNavigateToUser, t, telemetry, onRemoveUser, onInviteUser, onResendInvite, onCancelInvite, onAssignNewOwner, onUpdateUserRoles, }: C4ManagementUsersTabProps) => JSX.Element;
@@ -10,7 +10,7 @@ import { C4InlineNotification } from '../../../components/c4-inline-notification
10
10
  import { C4InviteUserToOrganizationModal } from '../../../components/c4-invite-user-to-organization-modal/c4-invite-user-to-organization-modal.js';
11
11
  import { C4ManagementUsers } from '../../../components/c4-management-users/c4-management-users.js';
12
12
  import { Checkbox, Link, Modal, Stack, TextInput } from '../../../ui/index.js';
13
- import { isLegacyLabeledRole, isRoleAssignable, LEGACY_SECTION_ROLES, moreRolesHeadingText, roleLabelDescription, } from '../../../utils/role-labels.js';
13
+ import { isLegacyLabeledRole, isRoleAssignable, legacySectionRoles, moreRolesHeadingText, orderPrimaryRoles, roleLabelDescription, } from '../../../utils/role-labels.js';
14
14
  function safeTranslate(t, key, defaultValue, opts) {
15
15
  if (!t)
16
16
  return defaultValue;
@@ -24,7 +24,7 @@ function safeTranslate(t, key, defaultValue, opts) {
24
24
  return defaultValue;
25
25
  }
26
26
  }
27
- export const C4ManagementUsersTab = ({ orgId, members, loading, mayManageUsersActions, mayInviteUsers, mayAssignNewOwner, showLegacyClusterRoles = false, inviteModal, changeRolesModal, currentUserEmail, onNavigateToUser, t, telemetry, onRemoveUser, onInviteUser, onResendInvite, onCancelInvite, onAssignNewOwner, onUpdateUserRoles, }) => {
27
+ export const C4ManagementUsersTab = ({ orgId, members, loading, mayManageUsersActions, mayInviteUsers, mayAssignNewOwner, showLegacyClusterRoles = false, permissionsReworkEnabled = false, inviteModal, changeRolesModal, currentUserEmail, onNavigateToUser, t, telemetry, onRemoveUser, onInviteUser, onResendInvite, onCancelInvite, onAssignNewOwner, onUpdateUserRoles, }) => {
28
28
  const trackEvent = (eventName, message, meta) => {
29
29
  telemetry?.track?.(eventName, {
30
30
  message,
@@ -53,12 +53,16 @@ export const C4ManagementUsersTab = ({ orgId, members, loading, mayManageUsersAc
53
53
  const [changeRolesError, setChangeRolesError] = useState(undefined);
54
54
  const [selectedRoles, setSelectedRoles] = useState(() => new Set());
55
55
  const assignOwnerPrimaryRoles = useMemo(() => {
56
- return [
56
+ const roles = [
57
57
  OrganizationRole.ADMIN,
58
58
  OrganizationRole.MODELER,
59
59
  OrganizationRole.ANALYST,
60
60
  ];
61
- }, []);
61
+ if (permissionsReworkEnabled) {
62
+ roles.push(OrganizationRole.OPERATIONS_ENGINEER);
63
+ }
64
+ return orderPrimaryRoles(roles, permissionsReworkEnabled);
65
+ }, [permissionsReworkEnabled]);
62
66
  const currentUserHeldRoles = useMemo(() => {
63
67
  const normalizedCurrentEmail = currentUserEmail?.trim().toLowerCase();
64
68
  if (!normalizedCurrentEmail) {
@@ -68,16 +72,30 @@ export const C4ManagementUsersTab = ({ orgId, members, loading, mayManageUsersAc
68
72
  return new Set(currentUserRow?.rolesArray ?? []);
69
73
  }, [members, currentUserEmail]);
70
74
  const assignOwnerLegacyRoles = useMemo(() => {
71
- return [...LEGACY_SECTION_ROLES, OrganizationRole.MEMBER].filter((role) => isRoleAssignable(role, showLegacyClusterRoles, currentUserHeldRoles));
72
- }, [showLegacyClusterRoles, currentUserHeldRoles]);
75
+ return [
76
+ ...legacySectionRoles(permissionsReworkEnabled),
77
+ OrganizationRole.MEMBER,
78
+ ].filter((role) => isRoleAssignable(role, showLegacyClusterRoles, currentUserHeldRoles, permissionsReworkEnabled));
79
+ }, [showLegacyClusterRoles, currentUserHeldRoles, permissionsReworkEnabled]);
73
80
  // Candidate roles filtered per member, so held legacy roles stay removable.
74
81
  const changeRolesVisibleMore = useMemo(() => {
75
82
  if (!changeRolesModal || !changeRolesTarget) {
76
83
  return [];
77
84
  }
78
85
  const held = new Set(changeRolesTarget.rolesArray);
79
- return changeRolesModal.editableRoles.more.filter((role) => isRoleAssignable(role, showLegacyClusterRoles, held));
80
- }, [changeRolesModal, changeRolesTarget, showLegacyClusterRoles]);
86
+ return changeRolesModal.editableRoles.more.filter((role) => isRoleAssignable(role, showLegacyClusterRoles, held, permissionsReworkEnabled));
87
+ }, [
88
+ changeRolesModal,
89
+ changeRolesTarget,
90
+ showLegacyClusterRoles,
91
+ permissionsReworkEnabled,
92
+ ]);
93
+ const changeRolesVisiblePrimary = useMemo(() => {
94
+ if (!changeRolesModal) {
95
+ return [];
96
+ }
97
+ return orderPrimaryRoles(changeRolesModal.editableRoles.primary, permissionsReworkEnabled);
98
+ }, [changeRolesModal, permissionsReworkEnabled]);
81
99
  const inviteModalRef = useRef(undefined);
82
100
  // Re-derive the roles column so legacy roles carry the "(Legacy)" suffix.
83
101
  const displayMembers = useMemo(() => {
@@ -85,11 +103,12 @@ export const C4ManagementUsersTab = ({ orgId, members, loading, mayManageUsersAc
85
103
  ...row,
86
104
  roles: row.rolesArray
87
105
  .map((role) => roleLabelDescription(t, role, {
88
- legacy: isLegacyLabeledRole(role, showLegacyClusterRoles),
106
+ legacy: isLegacyLabeledRole(role, showLegacyClusterRoles, permissionsReworkEnabled),
107
+ permissionsReworkEnabled,
89
108
  }).label)
90
109
  .join(', '),
91
110
  }));
92
- }, [members, showLegacyClusterRoles, t]);
111
+ }, [members, showLegacyClusterRoles, permissionsReworkEnabled, t]);
93
112
  const usersProps = useMemo(() => {
94
113
  const normalizedCurrentEmail = currentUserEmail?.trim().toLowerCase();
95
114
  const isCurrentUserRow = (row) => {
@@ -262,7 +281,8 @@ export const C4ManagementUsersTab = ({ orgId, members, loading, mayManageUsersAc
262
281
  items: presentRoles.map((role) => ({
263
282
  id: role,
264
283
  label: roleLabelDescription(t, role, {
265
- legacy: isLegacyLabeledRole(role, showLegacyClusterRoles),
284
+ legacy: isLegacyLabeledRole(role, showLegacyClusterRoles, permissionsReworkEnabled),
285
+ permissionsReworkEnabled,
266
286
  }).label,
267
287
  })),
268
288
  filter: (filter) => !filter.selectedItems?.length ||
@@ -310,6 +330,7 @@ export const C4ManagementUsersTab = ({ orgId, members, loading, mayManageUsersAc
310
330
  onCancelInvite,
311
331
  telemetry,
312
332
  t,
333
+ permissionsReworkEnabled,
313
334
  ]);
314
335
  const closeRemoveModal = () => {
315
336
  trackEvent('orgMembers:delete:close', 'Close Remove User Modal', { orgId });
@@ -445,7 +466,9 @@ export const C4ManagementUsersTab = ({ orgId, members, loading, mayManageUsersAc
445
466
  }
446
467
  })();
447
468
  }, size: 'sm', children: _jsxs(Stack, { gap: 5, children: [assignOwnerError && (_jsx(C4InlineNotification, { lowContrast: true, kind: 'error', title: '', subtitle: assignOwnerError })), _jsx(C4InlineNotification, { lowContrast: true, kind: 'warning', hideCloseButton: true, title: '', subtitle: safeTranslate(t, 'users:assignNewOwner.warning', 'By assigning a new owner, you will no longer be the owner of this organization.') }), _jsx(TextInput, { id: 'c4-assign-new-owner-email', labelText: safeTranslate(t, 'users:assignNewOwner.form.email', 'New owner'), value: assignOwnerTarget.email, readOnly: true }), _jsxs("fieldset", { className: 'cds--fieldset', children: [_jsx("legend", { className: 'cds--label', children: safeTranslate(t, 'users:assignNewOwner.form.rolesDescription', 'Select your new role(s) for this organization:') }), assignOwnerPrimaryRoles.map((role) => {
448
- const enriched = roleLabelDescription(t, role);
469
+ const enriched = roleLabelDescription(t, role, {
470
+ permissionsReworkEnabled,
471
+ });
449
472
  return (_jsxs("span", { children: [_jsx(Checkbox, { labelText: enriched.label, id: `c4-assign-new-owner-role-${role}`, checked: oldOwnerNewRoles.has(role), disabled: assignOwnerSaving, onChange: (_, { checked }) => {
450
473
  setOldOwnerNewRoles((current) => {
451
474
  const next = new Set(current);
@@ -462,7 +485,9 @@ export const C4ManagementUsersTab = ({ orgId, members, loading, mayManageUsersAc
462
485
  fontSize: 'var(--cds-label-01-font-size, 0.75rem)',
463
486
  marginBlockEnd: '0.5rem',
464
487
  }, children: moreRolesHeadingText(t, showLegacyClusterRoles) }), assignOwnerLegacyRoles.map((role) => {
465
- const enriched = roleLabelDescription(t, role);
488
+ const enriched = roleLabelDescription(t, role, {
489
+ permissionsReworkEnabled,
490
+ });
466
491
  return (_jsxs("span", { children: [_jsx(Checkbox, { labelText: enriched.label, id: `c4-assign-new-owner-role-${role}`, checked: oldOwnerNewRoles.has(role), disabled: assignOwnerSaving, onChange: (_, { checked }) => {
467
492
  setOldOwnerNewRoles((current) => {
468
493
  const next = new Set(current);
@@ -506,8 +531,10 @@ export const C4ManagementUsersTab = ({ orgId, members, loading, mayManageUsersAc
506
531
  setChangeRolesSaving(false);
507
532
  }
508
533
  })();
509
- }, size: 'sm', children: _jsxs(Stack, { gap: 5, children: [_jsx(TextInput, { id: 'c4-management-change-org-roles-email', labelText: safeTranslate(t, 'users:changeOrgRoles.form.email', 'Email'), value: changeRolesTarget.email, readOnly: true }), changeRolesError && (_jsx(C4InlineNotification, { lowContrast: true, kind: 'error', title: '', subtitle: changeRolesError })), _jsxs("fieldset", { className: 'cds--fieldset', children: [_jsx("legend", { className: 'cds--label', children: safeTranslate(t, 'users:changeOrgRoles.form.roles', 'Roles') }), changeRolesModal.editableRoles.primary.map((role) => {
510
- const enriched = roleLabelDescription(t, role);
534
+ }, size: 'sm', children: _jsxs(Stack, { gap: 5, children: [_jsx(TextInput, { id: 'c4-management-change-org-roles-email', labelText: safeTranslate(t, 'users:changeOrgRoles.form.email', 'Email'), value: changeRolesTarget.email, readOnly: true }), changeRolesError && (_jsx(C4InlineNotification, { lowContrast: true, kind: 'error', title: '', subtitle: changeRolesError })), _jsxs("fieldset", { className: 'cds--fieldset', children: [_jsx("legend", { className: 'cds--label', children: safeTranslate(t, 'users:changeOrgRoles.form.roles', 'Roles') }), changeRolesVisiblePrimary.map((role) => {
535
+ const enriched = roleLabelDescription(t, role, {
536
+ permissionsReworkEnabled,
537
+ });
511
538
  return (_jsxs("span", { children: [_jsx(Checkbox, { labelText: enriched.label, id: `c4-management-change-org-roles-${role}`, checked: selectedRoles.has(role), disabled: changeRolesSaving, onChange: (_, data) => {
512
539
  setSelectedRoles((current) => {
513
540
  const next = new Set(current);
@@ -526,7 +553,9 @@ export const C4ManagementUsersTab = ({ orgId, members, loading, mayManageUsersAc
526
553
  fontSize: 'var(--cds-label-01-font-size, 0.75rem)',
527
554
  marginBlockEnd: '0.5rem',
528
555
  }, children: moreRolesHeadingText(t, showLegacyClusterRoles) })), changeRolesVisibleMore.map((role) => {
529
- const enriched = roleLabelDescription(t, role);
556
+ const enriched = roleLabelDescription(t, role, {
557
+ permissionsReworkEnabled,
558
+ });
530
559
  return (_jsxs("span", { children: [_jsx(Checkbox, { labelText: enriched.label, id: `c4-management-change-org-roles-more-${role}`, checked: selectedRoles.has(role), disabled: changeRolesSaving, onChange: (_, data) => {
531
560
  setSelectedRoles((current) => {
532
561
  const next = new Set(current);
@@ -539,7 +568,7 @@ export const C4ManagementUsersTab = ({ orgId, members, loading, mayManageUsersAc
539
568
  return next;
540
569
  });
541
570
  } }), _jsx("span", { className: 'cds--label', style: { marginLeft: '27px' }, children: enriched.description })] }, `management-role-more-${role}`));
542
- })] })] }) })), _jsx(C4InviteUserToOrganizationModal, { t: t, showAdminRole: inviteModal?.showAdminRole, showLegacyClusterRoles: showLegacyClusterRoles, learnMoreUrl: inviteModal?.learnMoreUrl, onInviteUser: async ({ email, roles }) => {
571
+ })] })] }) })), _jsx(C4InviteUserToOrganizationModal, { t: t, showAdminRole: inviteModal?.showAdminRole, showLegacyClusterRoles: showLegacyClusterRoles, permissionsReworkEnabled: permissionsReworkEnabled, learnMoreUrl: inviteModal?.learnMoreUrl, onInviteUser: async ({ email, roles }) => {
543
572
  await onInviteUser(email, roles);
544
573
  }, ref: (instance) => {
545
574
  inviteModalRef.current = instance ?? undefined;
@@ -1,5 +1,5 @@
1
1
  import type React from 'react';
2
2
  import type { C4UserDetailsPageProps } from './c4-user-details-page.types.js';
3
- export declare const C4UserDetailsPage: (({ orgId, userEmail, externalLinks, onNavigate, }: C4UserDetailsPageProps) => React.ReactElement) & {
3
+ export declare const C4UserDetailsPage: (({ orgId, userEmail, externalLinks, onNavigate, permissionsReworkEnabled, }: C4UserDetailsPageProps) => React.ReactElement) & {
4
4
  displayName: string;
5
5
  };
@@ -18,7 +18,7 @@ import { useC4ConsoleRuntime } from '../../runtime/c4-console-runtime-context.js
18
18
  import { toApiConfig } from '../../runtime/to-api-config.js';
19
19
  import { toIdentityApiBaseUrl } from '../../runtime/to-identity-api-base-url.js';
20
20
  import { Checkbox, Link, Modal, Stack, TextInput } from '../../ui/index.js';
21
- import { isLegacyLabeledRole, isRoleAssignable, LEGACY_SECTION_ROLES, moreRolesHeadingText, roleLabelDescription, } from '../../utils/role-labels.js';
21
+ import { isLegacyLabeledRole, isRoleAssignable, legacySectionRoles, moreRolesHeadingText, orderPrimaryRoles, roleLabelDescription, } from '../../utils/role-labels.js';
22
22
  function isRecord(value) {
23
23
  return Boolean(value) && typeof value === 'object';
24
24
  }
@@ -37,7 +37,7 @@ function sendNavigate(onNavigate, event) {
37
37
  function resolveLinks(links) {
38
38
  return getC4UserDetailsExternalLinks(links);
39
39
  }
40
- export const C4UserDetailsPage = observer(({ orgId, userEmail, externalLinks, onNavigate, }) => {
40
+ export const C4UserDetailsPage = observer(({ orgId, userEmail, externalLinks, onNavigate, permissionsReworkEnabled = false, }) => {
41
41
  const runtime = useC4ConsoleRuntime();
42
42
  const data = useC4ConsoleData();
43
43
  const authz = useC4ConsoleAuthz({ orgId });
@@ -198,23 +198,30 @@ export const C4UserDetailsPage = observer(({ orgId, userEmail, externalLinks, on
198
198
  const more = [];
199
199
  if (mayUpdateGeneralVisible) {
200
200
  primary.push(OrganizationRole.MODELER, OrganizationRole.ANALYST);
201
+ if (permissionsReworkEnabled) {
202
+ primary.push(OrganizationRole.OPERATIONS_ENGINEER);
203
+ }
201
204
  }
202
205
  if (mayUpdateAdminVisible) {
203
206
  primary.push(OrganizationRole.ADMIN);
204
207
  }
205
208
  const held = new Set(roles);
206
209
  if (mayUpdateGeneralVisible) {
207
- more.push(...LEGACY_SECTION_ROLES.filter((role) => isRoleAssignable(role, !showOnly8_8Roles, held)));
210
+ more.push(...legacySectionRoles(permissionsReworkEnabled).filter((role) => isRoleAssignable(role, !showOnly8_8Roles, held, permissionsReworkEnabled)));
208
211
  }
209
212
  if (roles.includes(OrganizationRole.MEMBER)) {
210
213
  more.push(OrganizationRole.MEMBER);
211
214
  }
212
- return { primary, more };
215
+ return {
216
+ primary: orderPrimaryRoles(primary, permissionsReworkEnabled),
217
+ more,
218
+ };
213
219
  }, [
214
220
  mayUpdateAdminVisible,
215
221
  mayUpdateGeneralVisible,
216
222
  roles,
217
223
  showOnly8_8Roles,
224
+ permissionsReworkEnabled,
218
225
  ]);
219
226
  const openChangeOrgRolesModal = useCallback(() => {
220
227
  setChangeOrgRolesError(undefined);
@@ -278,7 +285,8 @@ export const C4UserDetailsPage = observer(({ orgId, userEmail, externalLinks, on
278
285
  },
279
286
  data: roles.map((role) => {
280
287
  const enriched = roleLabelDescription(t, role, {
281
- legacy: isLegacyLabeledRole(role, !showOnly8_8Roles),
288
+ legacy: isLegacyLabeledRole(role, !showOnly8_8Roles, permissionsReworkEnabled),
289
+ permissionsReworkEnabled,
282
290
  });
283
291
  return {
284
292
  key: role,
@@ -382,7 +390,9 @@ export const C4UserDetailsPage = observer(({ orgId, userEmail, externalLinks, on
382
390
  }
383
391
  })();
384
392
  }, size: 'sm', children: _jsxs(Stack, { gap: 5, children: [_jsx(TextInput, { id: 'c4-change-org-roles-email', labelText: safeTranslate(t, 'users:changeOrgRoles.form.email', 'Email'), value: userEmailAddress, readOnly: true }), changeOrgRolesError && (_jsx(C4InlineNotification, { lowContrast: true, kind: 'error', title: '', subtitle: changeOrgRolesError })), _jsxs("fieldset", { className: 'cds--fieldset', children: [_jsx("legend", { className: 'cds--label', children: safeTranslate(t, 'users:changeOrgRoles.form.roles', 'Roles') }), editableRoles.primary.map((role) => {
385
- const enriched = roleLabelDescription(t, role);
393
+ const enriched = roleLabelDescription(t, role, {
394
+ permissionsReworkEnabled,
395
+ });
386
396
  return (_jsxs("span", { children: [_jsx(Checkbox, { labelText: enriched.label, id: `c4-change-org-roles-${role}`, checked: selectedRoles.has(role), disabled: changeOrgRolesSaving, onChange: (_, data) => {
387
397
  setSelectedRoles((current) => {
388
398
  const next = new Set(current);
@@ -410,7 +420,9 @@ export const C4UserDetailsPage = observer(({ orgId, userEmail, externalLinks, on
410
420
  fontSize: 'var(--cds-label-01-font-size, 0.75rem)',
411
421
  marginBlockEnd: '0.5rem',
412
422
  }, children: moreRolesHeadingText(t, !showOnly8_8Roles) })), editableRoles.more.map((role) => {
413
- const enriched = roleLabelDescription(t, role);
423
+ const enriched = roleLabelDescription(t, role, {
424
+ permissionsReworkEnabled,
425
+ });
414
426
  return (_jsxs("span", { children: [_jsx(Checkbox, { labelText: enriched.label, id: `c4-change-org-roles-${role}`, checked: selectedRoles.has(role), disabled: changeOrgRolesSaving, onChange: (_, data) => {
415
427
  setSelectedRoles((current) => {
416
428
  const next = new Set(current);
@@ -463,7 +475,8 @@ export const C4UserDetailsPage = observer(({ orgId, userEmail, externalLinks, on
463
475
  }
464
476
  })();
465
477
  }, size: 'sm', children: _jsxs(Stack, { gap: 4, children: [removeOrgRoleError && (_jsx(C4InlineNotification, { lowContrast: true, kind: 'error', title: '', subtitle: removeOrgRoleError })), _jsx("p", { children: safeTranslate(t, 'users:removeOrgRole.description', 'Remove this role from the user?') }), roleToRemove && (_jsx("p", { children: _jsx("strong", { children: roleLabelDescription(t, roleToRemove, {
466
- legacy: isLegacyLabeledRole(roleToRemove, !showOnly8_8Roles),
478
+ legacy: isLegacyLabeledRole(roleToRemove, !showOnly8_8Roles, permissionsReworkEnabled),
479
+ permissionsReworkEnabled,
467
480
  }).label }) }))] }) })] }));
468
481
  }, [
469
482
  authorizedResourcesConfig,
@@ -485,6 +498,7 @@ export const C4UserDetailsPage = observer(({ orgId, userEmail, externalLinks, on
485
498
  openChangeOrgRolesModal,
486
499
  openRemoveOrgRoleModal,
487
500
  orgId,
501
+ permissionsReworkEnabled,
488
502
  removeOrgRoleError,
489
503
  removeOrgRoleOpen,
490
504
  removeOrgRoleSaving,
@@ -25,4 +25,6 @@ export interface C4UserDetailsPageProps {
25
25
  userEmail: string;
26
26
  externalLinks?: C4UserDetailsExternalLinks;
27
27
  onNavigate?: (event: C4UserDetailsNavigateEvent) => void;
28
+ /** See `C4ManagementAppProps.permissionsReworkEnabled` (camunda-hub#25467). */
29
+ permissionsReworkEnabled?: boolean;
28
30
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@camunda/ccma-saas-frontend",
3
- "version": "0.5.0",
3
+ "version": "0.7.0",
4
4
  "description": "Camunda Composite Components",
5
5
  "bugs": {
6
6
  "url": "https://github.com/camunda/camunda-cloud-management-apps/issues"
@@ -46,7 +46,7 @@
46
46
  "@camunda/c4-connectors": "1.10.3",
47
47
  "@playwright/test": "1.62.0",
48
48
  "@camunda/c4-identity": "0.0.45",
49
- "@camunda/design-system": "0.36.0",
49
+ "@camunda/design-system": "0.46.1",
50
50
  "@carbon/charts": "1.27.17",
51
51
  "@carbon/charts-react": "1.27.16",
52
52
  "@carbon/layout": "11.55.0",
@@ -58,24 +58,24 @@
58
58
  "recharts": "3.10.1",
59
59
  "@chromatic-com/storybook": "5.2.1",
60
60
  "@mdx-js/react": "3.1.1",
61
- "@storybook/addon-docs": "10.5.4",
62
- "@storybook/addon-links": "10.5.4",
63
- "@storybook/react": "10.5.4",
64
- "@storybook/react-vite": "10.5.4",
61
+ "@storybook/addon-docs": "10.5.5",
62
+ "@storybook/addon-links": "10.5.5",
63
+ "@storybook/react": "10.5.5",
64
+ "@storybook/react-vite": "10.5.5",
65
65
  "@testing-library/jest-dom": "7.0.0",
66
66
  "@testing-library/react": "16.3.2",
67
67
  "@testing-library/user-event": "14.6.1",
68
68
  "eslint-import-resolver-typescript": "4.4.5",
69
69
  "eslint-plugin-react": "7.37.5",
70
70
  "eslint-plugin-react-hooks": "7.1.1",
71
- "eslint-plugin-storybook": "10.5.4",
72
- "jsdom": "29.1.1",
71
+ "eslint-plugin-storybook": "10.5.5",
72
+ "jsdom": "30.0.1",
73
73
  "lucide-react": "1.27.0",
74
74
  "react": "19.2.8",
75
75
  "react-dom": "19.2.8",
76
76
  "react-is": "19.2.8",
77
77
  "rimraf": "6.1.3",
78
- "storybook": "10.5.4",
78
+ "storybook": "10.5.5",
79
79
  "styled-components": "6.4.4",
80
80
  "@camunda/camunda-composite-components": "0.25.4"
81
81
  },
@@ -101,8 +101,8 @@
101
101
  "mobx": "6.16.1",
102
102
  "mobx-react-lite": "4.1.1",
103
103
  "mobx-state-tree": "7.3.1",
104
- "@camunda/ccma-api": "0.5.0",
105
- "@camunda/ccma-shared-types": "0.5.0"
104
+ "@camunda/ccma-api": "0.5.2",
105
+ "@camunda/ccma-shared-types": "0.6.0"
106
106
  },
107
107
  "scripts": {
108
108
  "clean": "rimraf lib/",