@camunda/ccma-saas-frontend 0.0.36 → 0.0.38
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.
- package/lib/esm/components/c4-breadcrumb/c4-breadcrumb.d.ts +1 -1
- package/lib/esm/components/c4-breadcrumb/c4-breadcrumb.js +10 -4
- package/lib/esm/components/c4-breadcrumb/c4-breadcrumb.types.d.ts +2 -0
- package/lib/esm/components/c4-cluster-list/c4-cluster-list.js +39 -28
- package/lib/esm/components/c4-cluster-list/c4-cluster-list.types.d.ts +2 -1
- package/lib/esm/components/c4-cluster-list/c4-cluster-list.waiting.spec.d.ts +1 -0
- package/lib/esm/components/c4-cluster-list/c4-cluster-list.waiting.spec.js +87 -0
- package/lib/esm/components/c4-cluster-overview/applications.d.ts +5 -1
- package/lib/esm/components/c4-cluster-overview/applications.js +70 -9
- package/lib/esm/components/c4-cluster-overview/applications.spec.d.ts +1 -0
- package/lib/esm/components/c4-cluster-overview/applications.spec.js +32 -0
- package/lib/esm/components/c4-cluster-overview/cluster-details.d.ts +8 -0
- package/lib/esm/components/c4-cluster-overview/cluster-details.js +26 -7
- package/lib/esm/components/c4-job-dashboard-details-page/elements/c4-job-dashboard-error-table.js +1 -1
- package/lib/esm/components/c4-page-template/c4-page-template.d.ts +1 -0
- package/lib/esm/components/c4-page-template/c4-page-template.js +1 -1
- package/lib/esm/externalUrls.const.d.ts +2 -1
- package/lib/esm/externalUrls.const.js +2 -1
- package/lib/esm/i18n/c4-console-i18n.js +0 -5
- package/lib/esm/i18n/en/pages/clusterdetails.json +13 -1
- package/lib/esm/i18n/en/pages/createcluster.json +1 -1
- package/lib/esm/runtime/build-cluster-swagger-url.d.ts +17 -0
- package/lib/esm/runtime/build-cluster-swagger-url.js +44 -0
- package/lib/esm/runtime/c4-console-authz.d.ts +1 -0
- package/lib/esm/runtime/c4-console-authz.js +4 -3
- package/lib/esm/runtime/c4-console-authz.spec.js +6 -2
- package/lib/esm/runtime/to-api-domain.d.ts +25 -0
- package/lib/esm/runtime/to-api-domain.js +46 -0
- package/lib/esm/widgets/cluster-details/c4-cluster-details-app.js +5 -5
- package/lib/esm/widgets/cluster-details/c4-cluster-details-page.js +40 -20
- package/lib/esm/widgets/cluster-details/c4-cluster-details-page.spec.js +26 -0
- package/lib/esm/widgets/cluster-details/c4-cluster-details-page.types.d.ts +3 -2
- package/lib/esm/widgets/cluster-details/tabs/c4-cluster-details-clients-tab.js +18 -2
- package/lib/esm/widgets/cluster-details/tabs/c4-cluster-details-connector-secrets-tab.js +9 -2
- package/lib/esm/widgets/cluster-details/tabs/c4-cluster-details-encryption-tab.js +1 -1
- package/lib/esm/widgets/cluster-details/tabs/c4-cluster-details-overview-tab.d.ts +1 -0
- package/lib/esm/widgets/cluster-details/tabs/c4-cluster-details-overview-tab.js +69 -34
- package/lib/esm/widgets/cluster-details/tabs/c4-cluster-details-overview-tab.spec.js +142 -0
- package/lib/esm/widgets/cluster-details/tabs/c4-cluster-details-settings-tab.js +47 -13
- package/lib/esm/widgets/cluster-details/tabs/c4-cluster-details-settings-tab.spec.js +74 -1
- package/lib/esm/widgets/clusters/c4-clusters-page.js +5 -8
- package/lib/esm/widgets/clusters/c4-clusters-page.spec.js +97 -15
- package/lib/esm/widgets/connector-management/c4-connector-management.shared.js +2 -1
- package/lib/esm/widgets/create-cluster/c4-create-cluster-page.d.ts +1 -1
- package/lib/esm/widgets/create-cluster/c4-create-cluster-page.js +3 -14
- package/lib/esm/widgets/create-cluster/c4-create-cluster-page.types.d.ts +0 -1
- package/lib/esm/widgets/dashboard/c4-dashboard-app.js +5 -2
- package/lib/esm/widgets/group-details/c4-group-details-page.d.ts +1 -1
- package/lib/esm/widgets/group-details/c4-group-details-page.js +35 -26
- package/lib/esm/widgets/group-details/c4-group-details-page.types.d.ts +0 -1
- package/lib/esm/widgets/is-cluster-reconciliation-paused.d.ts +6 -0
- package/lib/esm/widgets/is-cluster-reconciliation-paused.js +54 -0
- package/lib/esm/widgets/management/c4-management-app.js +12 -0
- package/lib/esm/widgets/management/tabs/c4-management-billing-tab.d.ts +2 -1
- package/lib/esm/widgets/management/tabs/c4-management-billing-tab.js +33 -27
- package/lib/esm/widgets/management/tabs/c4-management-billing-tab.spec.d.ts +1 -0
- package/lib/esm/widgets/management/tabs/c4-management-billing-tab.spec.js +246 -0
- package/lib/esm/widgets/user-details/c4-user-details-page.d.ts +1 -1
- package/lib/esm/widgets/user-details/c4-user-details-page.js +42 -67
- package/lib/esm/widgets/user-details/c4-user-details-page.types.d.ts +0 -1
- package/package.json +16 -16
|
@@ -0,0 +1,246 @@
|
|
|
1
|
+
import { jsx as _jsx, jsxs as _jsxs } 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 { UsageAlertMetric } from '@camunda/ccma-shared-types';
|
|
8
|
+
import { act, render, screen } from '@testing-library/react';
|
|
9
|
+
import userEvent from '@testing-library/user-event';
|
|
10
|
+
import { C4ManagementBillingTab } from './c4-management-billing-tab.js';
|
|
11
|
+
let lastUsageAlertsProps;
|
|
12
|
+
vi.mock('../../../components/c4-billing-page/c4-billing-page', () => ({
|
|
13
|
+
C4BillingPage: (props) => {
|
|
14
|
+
lastUsageAlertsProps = props.usageAlerts;
|
|
15
|
+
return (_jsx("div", { "data-testid": 'billing-page', children: props.usageAlerts?.data.rows.map((row) => (_jsxs("div", { "data-testid": `row-${row.key}`, children: [_jsx("span", { children: row.metric }), _jsx("span", { children: row.threshold }), _jsx("span", { children: row.status }), _jsx("button", { onClick: row.action?.onClick, children: row.action?.label })] }, row.key))) }));
|
|
16
|
+
},
|
|
17
|
+
}));
|
|
18
|
+
vi.mock('../../../components/c4-usage-alert-update-modal/c4-usage-alert-update-modal', () => ({
|
|
19
|
+
C4UsageAlertUpdateModal: (props) => (_jsxs("div", { children: [_jsx("input", { "data-testid": 'threshold-input', type: 'number', value: props.form.threashold.currentValue, onChange: (e) => props.form.threashold.onChange(Number(e.target.value)) }), _jsx("input", { "data-testid": 'status-input', type: 'checkbox', checked: props.form.status.currentValue, onChange: (e) => props.form.status.onChange(e.target.checked) }), props.form.threashold.errors.invalid && (_jsx("span", { "data-testid": 'invalid-text', children: props.form.threashold.errors.invalidText }))] })),
|
|
20
|
+
}));
|
|
21
|
+
const NOW = new Date('2024-01-01T00:00:00Z');
|
|
22
|
+
function makeAlert(metric, overrides = {}) {
|
|
23
|
+
return {
|
|
24
|
+
uuid: `alert-${metric}`,
|
|
25
|
+
created: NOW,
|
|
26
|
+
createdBy: 'user',
|
|
27
|
+
updated: NOW,
|
|
28
|
+
metric,
|
|
29
|
+
threshold: 80,
|
|
30
|
+
enabled: true,
|
|
31
|
+
triggered: false,
|
|
32
|
+
...overrides,
|
|
33
|
+
};
|
|
34
|
+
}
|
|
35
|
+
function renderTab(overrides = {}) {
|
|
36
|
+
lastUsageAlertsProps = undefined;
|
|
37
|
+
const base = {
|
|
38
|
+
billingIsEnterprise: true,
|
|
39
|
+
billingLoading: false,
|
|
40
|
+
billingError: undefined,
|
|
41
|
+
billingGeneralData: {
|
|
42
|
+
displaySalesPlan: 'Enterprise',
|
|
43
|
+
lastUpdated: NOW,
|
|
44
|
+
},
|
|
45
|
+
billingEnterprisePeriod: {
|
|
46
|
+
periodStart: NOW,
|
|
47
|
+
periodEnd: NOW,
|
|
48
|
+
nextRenewal: NOW,
|
|
49
|
+
},
|
|
50
|
+
billingUsageAlerts: [],
|
|
51
|
+
billingIncludedMetrics: {
|
|
52
|
+
processInstances: 0,
|
|
53
|
+
decisionInstances: 0,
|
|
54
|
+
taskUsers: 0,
|
|
55
|
+
},
|
|
56
|
+
billingCurrentMetrics: {
|
|
57
|
+
processInstances: 0,
|
|
58
|
+
decisionInstances: 0,
|
|
59
|
+
taskUsers: 0,
|
|
60
|
+
},
|
|
61
|
+
billingClusterReservations: [],
|
|
62
|
+
enterpriseDevOnly: false,
|
|
63
|
+
membersCount: 1,
|
|
64
|
+
changeTab: vi.fn(),
|
|
65
|
+
onUpdateUsageAlert: vi.fn(),
|
|
66
|
+
onCreateUsageAlert: vi.fn(),
|
|
67
|
+
};
|
|
68
|
+
return render(_jsx(C4ManagementBillingTab, { ...base, ...overrides }));
|
|
69
|
+
}
|
|
70
|
+
describe('C4ManagementBillingTab usage alerts', () => {
|
|
71
|
+
it('shows default placeholder rows when no alerts exist in the DB', () => {
|
|
72
|
+
renderTab({ billingUsageAlerts: [] });
|
|
73
|
+
expect(lastUsageAlertsProps).toBeDefined();
|
|
74
|
+
const rows = lastUsageAlertsProps.data.rows;
|
|
75
|
+
expect(rows).toHaveLength(3);
|
|
76
|
+
expect(rows.map((r) => r.threshold)).toEqual(['80%', '80%', '80%']);
|
|
77
|
+
expect(rows.map((r) => r.status)).toEqual(['Off', 'Off', 'Off']);
|
|
78
|
+
});
|
|
79
|
+
it('shows real alerts when they exist in the DB', () => {
|
|
80
|
+
renderTab({
|
|
81
|
+
billingUsageAlerts: [
|
|
82
|
+
makeAlert(UsageAlertMetric.PROCESS_INSTANCES, {
|
|
83
|
+
threshold: 90,
|
|
84
|
+
enabled: true,
|
|
85
|
+
}),
|
|
86
|
+
makeAlert(UsageAlertMetric.DECISION_INSTANCES, {
|
|
87
|
+
threshold: 50,
|
|
88
|
+
enabled: false,
|
|
89
|
+
}),
|
|
90
|
+
makeAlert(UsageAlertMetric.TASK_USERS, {
|
|
91
|
+
threshold: 75,
|
|
92
|
+
enabled: true,
|
|
93
|
+
}),
|
|
94
|
+
],
|
|
95
|
+
});
|
|
96
|
+
expect(lastUsageAlertsProps).toBeDefined();
|
|
97
|
+
const rows = lastUsageAlertsProps.data.rows;
|
|
98
|
+
expect(rows).toHaveLength(3);
|
|
99
|
+
expect(rows[0].threshold).toBe('90%');
|
|
100
|
+
expect(rows[0].status).toBe('On');
|
|
101
|
+
expect(rows[1].threshold).toBe('50%');
|
|
102
|
+
expect(rows[1].status).toBe('Off');
|
|
103
|
+
});
|
|
104
|
+
it('fills in default placeholder for a missing metric when others exist', () => {
|
|
105
|
+
renderTab({
|
|
106
|
+
billingUsageAlerts: [
|
|
107
|
+
makeAlert(UsageAlertMetric.PROCESS_INSTANCES, { threshold: 90 }),
|
|
108
|
+
],
|
|
109
|
+
});
|
|
110
|
+
expect(lastUsageAlertsProps).toBeDefined();
|
|
111
|
+
const rows = lastUsageAlertsProps.data.rows;
|
|
112
|
+
expect(rows).toHaveLength(3);
|
|
113
|
+
// PI row uses the real alert
|
|
114
|
+
const piRow = rows.find((r) => r.key.startsWith(`alert-${UsageAlertMetric.PROCESS_INSTANCES}`));
|
|
115
|
+
expect(piRow).toBeDefined();
|
|
116
|
+
expect(piRow.threshold).toBe('90%');
|
|
117
|
+
// DI row is a default placeholder
|
|
118
|
+
const diRow = rows.find((r) => r.key.startsWith('default-'));
|
|
119
|
+
expect(diRow).toBeDefined();
|
|
120
|
+
expect(diRow.threshold).toBe('80%');
|
|
121
|
+
});
|
|
122
|
+
it('places Process Instances first', () => {
|
|
123
|
+
renderTab({ billingUsageAlerts: [] });
|
|
124
|
+
expect(lastUsageAlertsProps).toBeDefined();
|
|
125
|
+
const rows = lastUsageAlertsProps.data.rows;
|
|
126
|
+
expect(rows[0].metric).toBe('Process Instances');
|
|
127
|
+
});
|
|
128
|
+
it('hides Decision Instances and Task Users for 2025 licensing model', () => {
|
|
129
|
+
renderTab({
|
|
130
|
+
isLicensingModel2025: true,
|
|
131
|
+
billingUsageAlerts: [],
|
|
132
|
+
});
|
|
133
|
+
expect(lastUsageAlertsProps).toBeDefined();
|
|
134
|
+
const rows = lastUsageAlertsProps.data.rows;
|
|
135
|
+
expect(rows).toHaveLength(1);
|
|
136
|
+
expect(rows[0].metric).toBe('Process Instances');
|
|
137
|
+
});
|
|
138
|
+
it('hides existing DI and TU alerts from the DB for 2025 licensing model', () => {
|
|
139
|
+
renderTab({
|
|
140
|
+
isLicensingModel2025: true,
|
|
141
|
+
billingUsageAlerts: [
|
|
142
|
+
makeAlert(UsageAlertMetric.PROCESS_INSTANCES, {
|
|
143
|
+
threshold: 90,
|
|
144
|
+
enabled: true,
|
|
145
|
+
}),
|
|
146
|
+
makeAlert(UsageAlertMetric.DECISION_INSTANCES, {
|
|
147
|
+
threshold: 50,
|
|
148
|
+
enabled: true,
|
|
149
|
+
}),
|
|
150
|
+
makeAlert(UsageAlertMetric.TASK_USERS, {
|
|
151
|
+
threshold: 75,
|
|
152
|
+
enabled: true,
|
|
153
|
+
}),
|
|
154
|
+
],
|
|
155
|
+
});
|
|
156
|
+
expect(lastUsageAlertsProps).toBeDefined();
|
|
157
|
+
const rows = lastUsageAlertsProps.data.rows;
|
|
158
|
+
expect(rows).toHaveLength(1);
|
|
159
|
+
expect(rows[0].metric).toBe('Process Instances');
|
|
160
|
+
expect(rows[0].threshold).toBe('90%');
|
|
161
|
+
expect(rows[0].status).toBe('On');
|
|
162
|
+
});
|
|
163
|
+
it('calls onCreateUsageAlert when editing a placeholder (no DB entry)', async () => {
|
|
164
|
+
const onCreateUsageAlert = vi.fn().mockResolvedValue(undefined);
|
|
165
|
+
renderTab({
|
|
166
|
+
billingUsageAlerts: [],
|
|
167
|
+
onCreateUsageAlert,
|
|
168
|
+
});
|
|
169
|
+
// Click Edit on the PI placeholder row
|
|
170
|
+
const editButton = screen.getAllByText('Edit')[0];
|
|
171
|
+
await act(async () => {
|
|
172
|
+
await userEvent.click(editButton);
|
|
173
|
+
});
|
|
174
|
+
// Modal opens — click the Update button
|
|
175
|
+
const updateButton = await screen.findByText('Update');
|
|
176
|
+
await act(async () => {
|
|
177
|
+
await userEvent.click(updateButton);
|
|
178
|
+
});
|
|
179
|
+
expect(onCreateUsageAlert).toHaveBeenCalledWith(UsageAlertMetric.PROCESS_INSTANCES, 80, false);
|
|
180
|
+
});
|
|
181
|
+
it('shows "no changes" validation error when editing an existing alert without changing values', async () => {
|
|
182
|
+
const onUpdateUsageAlert = vi.fn().mockResolvedValue(undefined);
|
|
183
|
+
renderTab({
|
|
184
|
+
billingUsageAlerts: [
|
|
185
|
+
makeAlert(UsageAlertMetric.PROCESS_INSTANCES, {
|
|
186
|
+
threshold: 80,
|
|
187
|
+
enabled: false,
|
|
188
|
+
}),
|
|
189
|
+
],
|
|
190
|
+
onUpdateUsageAlert,
|
|
191
|
+
});
|
|
192
|
+
const editButton = screen.getAllByText('Edit')[0];
|
|
193
|
+
await act(async () => {
|
|
194
|
+
await userEvent.click(editButton);
|
|
195
|
+
});
|
|
196
|
+
const updateButton = await screen.findByText('Update');
|
|
197
|
+
await act(async () => {
|
|
198
|
+
await userEvent.click(updateButton);
|
|
199
|
+
});
|
|
200
|
+
expect(onUpdateUsageAlert).not.toHaveBeenCalled();
|
|
201
|
+
expect(await screen.findByText('No changes to save.')).toBeInTheDocument();
|
|
202
|
+
});
|
|
203
|
+
it('calls onUpdateUsageAlert when editing an existing alert with changed values', async () => {
|
|
204
|
+
const onUpdateUsageAlert = vi.fn().mockResolvedValue(undefined);
|
|
205
|
+
renderTab({
|
|
206
|
+
billingUsageAlerts: [
|
|
207
|
+
makeAlert(UsageAlertMetric.PROCESS_INSTANCES, {
|
|
208
|
+
threshold: 80,
|
|
209
|
+
enabled: false,
|
|
210
|
+
}),
|
|
211
|
+
],
|
|
212
|
+
onUpdateUsageAlert,
|
|
213
|
+
});
|
|
214
|
+
const editButton = screen.getAllByText('Edit')[0];
|
|
215
|
+
await act(async () => {
|
|
216
|
+
await userEvent.click(editButton);
|
|
217
|
+
});
|
|
218
|
+
// Change the threshold to a different value
|
|
219
|
+
const thresholdInput = await screen.findByTestId('threshold-input');
|
|
220
|
+
await act(async () => {
|
|
221
|
+
await userEvent.clear(thresholdInput);
|
|
222
|
+
await userEvent.type(thresholdInput, '90');
|
|
223
|
+
});
|
|
224
|
+
const updateButton = screen.getByText('Update');
|
|
225
|
+
await act(async () => {
|
|
226
|
+
await userEvent.click(updateButton);
|
|
227
|
+
});
|
|
228
|
+
expect(onUpdateUsageAlert).toHaveBeenCalledWith(`alert-${UsageAlertMetric.PROCESS_INSTANCES}`, 90, false);
|
|
229
|
+
});
|
|
230
|
+
it('shows non-enterprise message when billingIsEnterprise is false', () => {
|
|
231
|
+
render(_jsx(C4ManagementBillingTab, { billingIsEnterprise: false, billingLoading: false, billingError: undefined, billingGeneralData: { displaySalesPlan: 'Pro', lastUpdated: NOW }, billingEnterprisePeriod: {
|
|
232
|
+
periodStart: NOW,
|
|
233
|
+
periodEnd: NOW,
|
|
234
|
+
nextRenewal: NOW,
|
|
235
|
+
}, billingUsageAlerts: [], billingIncludedMetrics: {
|
|
236
|
+
processInstances: 0,
|
|
237
|
+
decisionInstances: 0,
|
|
238
|
+
taskUsers: 0,
|
|
239
|
+
}, billingCurrentMetrics: {
|
|
240
|
+
processInstances: 0,
|
|
241
|
+
decisionInstances: 0,
|
|
242
|
+
taskUsers: 0,
|
|
243
|
+
}, billingClusterReservations: [], enterpriseDevOnly: false, membersCount: 1, changeTab: vi.fn(), onUpdateUsageAlert: vi.fn(), onCreateUsageAlert: vi.fn() }));
|
|
244
|
+
expect(screen.getByText('Billing is not available.')).toBeInTheDocument();
|
|
245
|
+
});
|
|
246
|
+
});
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import type React from 'react';
|
|
2
2
|
import type { C4UserDetailsPageProps } from './c4-user-details-page.types';
|
|
3
|
-
export declare const C4UserDetailsPage: (({ orgId, userEmail, externalLinks,
|
|
3
|
+
export declare const C4UserDetailsPage: (({ orgId, userEmail, externalLinks, onNavigate, }: C4UserDetailsPageProps) => React.ReactElement) & {
|
|
4
4
|
displayName: string;
|
|
5
5
|
};
|
|
@@ -12,6 +12,7 @@ import { useCallback, useEffect, useMemo, useRef, useState } from 'react';
|
|
|
12
12
|
import { C4PageTemplate } from '../../components/c4-page-template/c4-page-template.js';
|
|
13
13
|
import { C4UserDetails } from '../../components/c4-user-details/c4-user-details.js';
|
|
14
14
|
import { getC4UserDetailsExternalLinks } from '../../externalUrls.const.js';
|
|
15
|
+
import { useC4ConsoleAuthz } from '../../runtime/c4-console-authz.js';
|
|
15
16
|
import { useC4ConsoleData } from '../../runtime/c4-console-data-context.js';
|
|
16
17
|
import { useC4ConsoleRuntime } from '../../runtime/c4-console-runtime-context.js';
|
|
17
18
|
import { toApiConfig } from '../../runtime/to-api-config.js';
|
|
@@ -19,16 +20,6 @@ import { toIdentityApiBaseUrl } from '../../runtime/to-identity-api-base-url.js'
|
|
|
19
20
|
function isRecord(value) {
|
|
20
21
|
return Boolean(value) && typeof value === 'object';
|
|
21
22
|
}
|
|
22
|
-
function getPathBoolean(record, path) {
|
|
23
|
-
let current = record;
|
|
24
|
-
for (const key of path) {
|
|
25
|
-
if (!isRecord(current)) {
|
|
26
|
-
return false;
|
|
27
|
-
}
|
|
28
|
-
current = current[key];
|
|
29
|
-
}
|
|
30
|
-
return typeof current === 'boolean' ? current : false;
|
|
31
|
-
}
|
|
32
23
|
function safeTranslate(t, key, fallback) {
|
|
33
24
|
try {
|
|
34
25
|
const translated = t?.(key);
|
|
@@ -110,12 +101,14 @@ function roleLabelDescription(t, role) {
|
|
|
110
101
|
return { label: role, description: '' };
|
|
111
102
|
}
|
|
112
103
|
}
|
|
113
|
-
export const C4UserDetailsPage = observer(({ orgId, userEmail, externalLinks,
|
|
104
|
+
export const C4UserDetailsPage = observer(({ orgId, userEmail, externalLinks, onNavigate, }) => {
|
|
114
105
|
const runtime = useC4ConsoleRuntime();
|
|
115
106
|
const data = useC4ConsoleData();
|
|
107
|
+
const authz = useC4ConsoleAuthz({ orgId });
|
|
116
108
|
const links = useMemo(() => resolveLinks(externalLinks), [externalLinks]);
|
|
117
109
|
const t = runtime.i18n?.t;
|
|
118
|
-
const
|
|
110
|
+
const orgPermissions = authz.orgPermissions;
|
|
111
|
+
const hasClustersCache = Boolean(data.clusters[orgId]);
|
|
119
112
|
const decodedEmail = useMemo(() => {
|
|
120
113
|
try {
|
|
121
114
|
return decodeURIComponent(userEmail);
|
|
@@ -130,6 +123,12 @@ export const C4UserDetailsPage = observer(({ orgId, userEmail, externalLinks, vi
|
|
|
130
123
|
}
|
|
131
124
|
data.fetchMembers(orgId);
|
|
132
125
|
}, [orgId, data.fetchMembers]);
|
|
126
|
+
useEffect(() => {
|
|
127
|
+
if (!orgId || hasClustersCache) {
|
|
128
|
+
return;
|
|
129
|
+
}
|
|
130
|
+
data.fetchClusters(orgId);
|
|
131
|
+
}, [data.fetchClusters, hasClustersCache, orgId]);
|
|
133
132
|
const membersCache = data.members[orgId];
|
|
134
133
|
const membersLoading = membersCache?.isLoading ?? true;
|
|
135
134
|
const members = (membersCache?.data ?? []);
|
|
@@ -168,45 +167,34 @@ export const C4UserDetailsPage = observer(({ orgId, userEmail, externalLinks, vi
|
|
|
168
167
|
.then((token) => setIdentityToken(token))
|
|
169
168
|
.catch(() => setIdentityToken(undefined));
|
|
170
169
|
}, [identityApiBaseUrl, runtime.auth]);
|
|
171
|
-
const maySeeRoles =
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
|
|
191
|
-
|
|
192
|
-
|
|
193
|
-
|
|
194
|
-
|
|
195
|
-
|
|
196
|
-
|
|
197
|
-
|
|
198
|
-
|
|
199
|
-
'members',
|
|
200
|
-
'update',
|
|
201
|
-
'admin',
|
|
202
|
-
'visible',
|
|
203
|
-
]);
|
|
204
|
-
const maySeeAuthorizedResources = getPathBoolean(visibilitiesRecord, [
|
|
205
|
-
'orgSettings',
|
|
206
|
-
'userDetails',
|
|
207
|
-
'rba',
|
|
208
|
-
]);
|
|
209
|
-
const hasAtLeastOneIdentityIntegrationCluster = getPathBoolean(visibilitiesRecord, ['features', 'hasAtLeastOneIdentityIntegrationCluster', 'visible']);
|
|
170
|
+
const maySeeRoles = Boolean(orgPermissions?.org.users.general.read);
|
|
171
|
+
const canAssignRoles = Boolean(orgPermissions?.org.users.general.create);
|
|
172
|
+
const mayRemoveAdminRole = Boolean(orgPermissions?.org.users.admin.update);
|
|
173
|
+
const mayRemoveMemberRole = Boolean(orgPermissions?.org.users.member.update);
|
|
174
|
+
const mayUpdateAdminsVisible = Boolean(orgPermissions?.org.users.admin.update);
|
|
175
|
+
const maySeeAuthorizedResources = Boolean(orgPermissions?.cluster.settings.resourceBasedAuthorizations.configure
|
|
176
|
+
.update);
|
|
177
|
+
const clustersCache = data.clusters[orgId];
|
|
178
|
+
const clusters = (clustersCache?.data ?? []);
|
|
179
|
+
const hasAtLeastOneIdentityIntegrationCluster = useMemo(() => {
|
|
180
|
+
return clusters.some((cluster) => {
|
|
181
|
+
const record = isRecord(cluster) ? cluster : {};
|
|
182
|
+
const generation = isRecord(record.generation) ? record.generation : {};
|
|
183
|
+
const versions = isRecord(generation.versions)
|
|
184
|
+
? generation.versions
|
|
185
|
+
: {};
|
|
186
|
+
const zeebe = typeof versions.zeebe === 'string' ? versions.zeebe : undefined;
|
|
187
|
+
if (!zeebe?.includes(':')) {
|
|
188
|
+
return false;
|
|
189
|
+
}
|
|
190
|
+
return checkVersion({
|
|
191
|
+
possiblyVersionOrDockerPath: zeebe,
|
|
192
|
+
trueForSnapshot: true,
|
|
193
|
+
operator: VersionCheckOperator.GreaterThanOrEqual,
|
|
194
|
+
versionToCompareTo: '8.8.0-alpha5',
|
|
195
|
+
});
|
|
196
|
+
});
|
|
197
|
+
}, [clusters]);
|
|
210
198
|
const isAuthorizedResourcesReady = Boolean(identityApiBaseUrl && identityToken);
|
|
211
199
|
const authorizedResourcesConfig = useMemo(() => {
|
|
212
200
|
const userId = typeof user?.userId === 'string' ? user.userId : '';
|
|
@@ -244,8 +232,6 @@ export const C4UserDetailsPage = observer(({ orgId, userEmail, externalLinks, vi
|
|
|
244
232
|
const userName = typeof user?.name === 'string' ? user.name : '';
|
|
245
233
|
const userEmailAddress = typeof user?.email === 'string' ? user.email : '';
|
|
246
234
|
const userId = typeof user?.userId === 'string' ? user.userId : '';
|
|
247
|
-
const clustersCache = data.clusters[orgId];
|
|
248
|
-
const clusters = (clustersCache?.data ?? []);
|
|
249
235
|
const showOnly8_8Roles = useMemo(() => {
|
|
250
236
|
if (!orgId) {
|
|
251
237
|
return true;
|
|
@@ -268,20 +254,9 @@ export const C4UserDetailsPage = observer(({ orgId, userEmail, externalLinks, vi
|
|
|
268
254
|
});
|
|
269
255
|
});
|
|
270
256
|
}, [clusters, orgId]);
|
|
271
|
-
const mayUpdateGeneralVisible =
|
|
272
|
-
|
|
273
|
-
|
|
274
|
-
'update',
|
|
275
|
-
'general',
|
|
276
|
-
'visible',
|
|
277
|
-
]);
|
|
278
|
-
const mayUpdateAdminVisible = getPathBoolean(visibilitiesRecord, [
|
|
279
|
-
'orgSettings',
|
|
280
|
-
'members',
|
|
281
|
-
'update',
|
|
282
|
-
'admin',
|
|
283
|
-
'visible',
|
|
284
|
-
]);
|
|
257
|
+
const mayUpdateGeneralVisible = Boolean(orgPermissions?.org.users.general.update ||
|
|
258
|
+
orgPermissions?.org.users.admin.update);
|
|
259
|
+
const mayUpdateAdminVisible = Boolean(orgPermissions?.org.users.admin.update);
|
|
285
260
|
const editableRoles = useMemo(() => {
|
|
286
261
|
const primary = [];
|
|
287
262
|
const more = [];
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@camunda/ccma-saas-frontend",
|
|
3
|
-
"version": "0.0.
|
|
3
|
+
"version": "0.0.38",
|
|
4
4
|
"description": "Camunda Composite Components",
|
|
5
5
|
"bugs": {
|
|
6
6
|
"url": "https://github.com/camunda/camunda-cloud-management-apps/issues"
|
|
@@ -24,33 +24,33 @@
|
|
|
24
24
|
},
|
|
25
25
|
"devDependencies": {
|
|
26
26
|
"@camunda/c4-connectors": "1.4.0",
|
|
27
|
-
"@camunda/c4-identity": "0.0.
|
|
27
|
+
"@camunda/c4-identity": "0.0.38",
|
|
28
28
|
"@carbon/charts": "1.27.3",
|
|
29
29
|
"@carbon/charts-react": "1.27.3",
|
|
30
|
-
"@carbon/layout": "11.
|
|
30
|
+
"@carbon/layout": "11.51.0",
|
|
31
31
|
"@carbon/react": "1.103.0",
|
|
32
32
|
"@carbon/type": "11.56.0",
|
|
33
33
|
"@chromatic-com/storybook": "5.1.1",
|
|
34
34
|
"@mdx-js/react": "3.1.1",
|
|
35
|
-
"@storybook/addon-docs": "10.3.
|
|
36
|
-
"@storybook/addon-links": "10.3.
|
|
37
|
-
"@storybook/react": "10.3.
|
|
38
|
-
"@storybook/react-vite": "10.3.
|
|
35
|
+
"@storybook/addon-docs": "10.3.5",
|
|
36
|
+
"@storybook/addon-links": "10.3.5",
|
|
37
|
+
"@storybook/react": "10.3.5",
|
|
38
|
+
"@storybook/react-vite": "10.3.5",
|
|
39
39
|
"@testing-library/jest-dom": "6.9.1",
|
|
40
40
|
"@testing-library/react": "16.3.2",
|
|
41
41
|
"@testing-library/user-event": "14.6.1",
|
|
42
42
|
"eslint-import-resolver-typescript": "4.4.4",
|
|
43
43
|
"eslint-plugin-react": "7.37.5",
|
|
44
44
|
"eslint-plugin-react-hooks": "7.0.1",
|
|
45
|
-
"eslint-plugin-storybook": "10.3.
|
|
46
|
-
"jsdom": "29.0.
|
|
47
|
-
"react": "19.2.
|
|
48
|
-
"react-dom": "19.2.
|
|
49
|
-
"react-is": "19.2.
|
|
45
|
+
"eslint-plugin-storybook": "10.3.5",
|
|
46
|
+
"jsdom": "29.0.2",
|
|
47
|
+
"react": "19.2.5",
|
|
48
|
+
"react-dom": "19.2.5",
|
|
49
|
+
"react-is": "19.2.5",
|
|
50
50
|
"rimraf": "6.1.3",
|
|
51
|
-
"storybook": "10.3.
|
|
52
|
-
"styled-components": "6.
|
|
53
|
-
"@camunda/camunda-composite-components": "0.
|
|
51
|
+
"storybook": "10.3.5",
|
|
52
|
+
"styled-components": "6.4.0",
|
|
53
|
+
"@camunda/camunda-composite-components": "0.23.0"
|
|
54
54
|
},
|
|
55
55
|
"peerDependencies": {
|
|
56
56
|
"@camunda/c4-connectors": "1.x",
|
|
@@ -68,7 +68,7 @@
|
|
|
68
68
|
"cron-parser": "5.5.0",
|
|
69
69
|
"mobx": "6.15.0",
|
|
70
70
|
"mobx-react-lite": "4.1.1",
|
|
71
|
-
"mobx-state-tree": "7.
|
|
71
|
+
"mobx-state-tree": "7.2.0",
|
|
72
72
|
"semver": "7.7.4",
|
|
73
73
|
"@camunda/ccma-api": "0.0.4",
|
|
74
74
|
"@camunda/ccma-shared-types": "0.0.4"
|