@camunda/ccma-saas-frontend 0.0.35 → 0.0.37
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/assetUrls.d.ts +19 -0
- package/lib/esm/assetUrls.js +41 -0
- package/lib/esm/assets/ai.svg +14 -0
- package/lib/esm/assets/alerts.svg +5 -0
- package/lib/esm/assets/auditlogs.svg +9 -0
- package/lib/esm/assets/backup.svg +3 -0
- package/lib/esm/assets/clientApi.svg +10 -0
- package/lib/esm/assets/cluster.svg +4 -0
- package/lib/esm/assets/connectorSecret.svg +3 -0
- package/lib/esm/assets/consoleAPI.svg +3 -0
- package/lib/esm/assets/error.svg +11 -0
- package/lib/esm/assets/fatalError.svg +5 -0
- package/lib/esm/assets/ipwhitelist.svg +3 -0
- package/lib/esm/assets/monitoring.svg +6 -0
- package/lib/esm/assets/operatePreview.jpg +0 -0
- package/lib/esm/assets/optimizePreview.jpg +0 -0
- package/lib/esm/assets/secureConnectivity.svg +11 -0
- package/lib/esm/assets/tasklistPreview.jpg +0 -0
- package/lib/esm/assets/upgrade.svg +4 -0
- package/lib/esm/components/c4-ai-usage/c4-ai-usage.js +2 -1
- package/lib/esm/components/c4-audit-log/c4-audit-log.js +2 -1
- package/lib/esm/components/c4-cluster-byom-clients/c4-cluster-byom-clients.js +3 -2
- package/lib/esm/components/c4-cluster-details-activity/c4-cluster-details-activity.js +2 -1
- package/lib/esm/components/c4-cluster-details-alerts/c4-cluster-details-alerts.js +3 -2
- package/lib/esm/components/c4-cluster-details-clients/c4-cluster-details-clients.js +3 -2
- package/lib/esm/components/c4-cluster-details-connector-secrets/c4-cluster-details-connector-secrets.js +3 -2
- package/lib/esm/components/c4-cluster-details-hot-backups/c4-cluster-details-hot-backups.js +5 -4
- package/lib/esm/components/c4-cluster-details-ip-whitelist/c4-cluster-details-ip-whitelist.js +2 -1
- package/lib/esm/components/c4-cluster-details-secure-connectivity/c4-cluster-details-secure-connectivity.js +10 -2
- 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 +52 -3
- package/lib/esm/components/c4-cluster-overview/applications.spec.d.ts +1 -0
- package/lib/esm/components/c4-cluster-overview/applications.spec.js +26 -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-clusters-empty-state/c4-clusters-empty-state.js +4 -3
- package/lib/esm/components/c4-create-cluster/c4-create-cluster.js +21 -7
- package/lib/esm/components/c4-create-cluster/c4-create-cluster.spec.js +116 -0
- package/lib/esm/components/c4-create-cluster/c4-create-cluster.types.d.ts +2 -1
- package/lib/esm/components/c4-job-dashboard-details-page/elements/c4-job-dashboard-error-table.js +1 -1
- package/lib/esm/components/c4-management-api/c4-management-api.js +2 -1
- package/lib/esm/components/c4-management-settings/c4-management-settings.js +2 -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/modals/clusterclients.json +3 -0
- package/lib/esm/i18n/en/pages/clusterdetails.json +17 -1
- package/lib/esm/i18n/en/pages/createcluster.json +3 -2
- package/lib/esm/index.d.ts +1 -0
- package/lib/esm/index.js +1 -0
- 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 +10 -11
- package/lib/esm/widgets/cluster-details/c4-cluster-details-app.types.d.ts +1 -1
- package/lib/esm/widgets/cluster-details/c4-cluster-details-page.js +0 -11
- package/lib/esm/widgets/cluster-details/c4-cluster-details-page.types.d.ts +1 -1
- package/lib/esm/widgets/cluster-details/tabs/c4-cluster-details-clients-tab.js +21 -5
- package/lib/esm/widgets/cluster-details/tabs/c4-cluster-details-clients-tab.spec.js +19 -0
- 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 +50 -20
- 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-secure-connectivity-tab.js +33 -41
- package/lib/esm/widgets/cluster-details/tabs/c4-cluster-details-secure-connectivity-tab.spec.js +64 -0
- package/lib/esm/widgets/cluster-details/tabs/c4-cluster-details-settings-tab.js +34 -3
- package/lib/esm/widgets/cluster-details/tabs/c4-cluster-details-settings-tab.spec.js +74 -1
- package/lib/esm/widgets/connector-management/c4-connector-management.shared.js +4 -2
- 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 +7 -15
- package/lib/esm/widgets/create-cluster/c4-create-cluster-page.types.d.ts +0 -1
- package/lib/esm/widgets/dashboard/c4-dashboard-app.js +1 -1
- 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/management/c4-management-app.js +26 -23
- 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
|
@@ -39,7 +39,7 @@ vi.mock('../../../components/c4-cluster-settings/c4-cluster-settings', () => {
|
|
|
39
39
|
return {
|
|
40
40
|
C4ClusterSettings: (props) => {
|
|
41
41
|
lastClusterSettingsProps = props;
|
|
42
|
-
return (_jsxs("div", { "data-testid": 'C4ClusterSettings', children: [props.tasklistSettings?.action ? (_jsx("button", { type: 'button', onClick: props.tasklistSettings.action.onClick, disabled: props.tasklistSettings.action.disabled, children: props.tasklistSettings.action.label })) : null, props.settings?.resourceBasedAuthorizations?.action ? (_jsx("button", { type: 'button', onClick: props.settings.resourceBasedAuthorizations.action.onClick, children: props.settings.resourceBasedAuthorizations.action.label })) : null, props.settings?.identityBasedAuthorizations?.action ? (_jsx("button", { type: 'button', onClick: props.settings.identityBasedAuthorizations.action.onClick, children: props.settings.identityBasedAuthorizations.action.label })) : null] }));
|
|
42
|
+
return (_jsxs("div", { "data-testid": 'C4ClusterSettings', children: [props.tasklistSettings?.action ? (_jsx("button", { type: 'button', onClick: props.tasklistSettings.action.onClick, disabled: props.tasklistSettings.action.disabled, children: props.tasklistSettings.action.label })) : null, props.settings?.resourceBasedAuthorizations?.action ? (_jsx("button", { type: 'button', onClick: props.settings.resourceBasedAuthorizations.action.onClick, children: props.settings.resourceBasedAuthorizations.action.label })) : null, props.settings?.identityBasedAuthorizations?.action ? (_jsx("button", { type: 'button', onClick: props.settings.identityBasedAuthorizations.action.onClick, children: props.settings.identityBasedAuthorizations.action.label })) : null, props.settings?.swaggerToggle?.description] }));
|
|
43
43
|
},
|
|
44
44
|
};
|
|
45
45
|
});
|
|
@@ -156,6 +156,12 @@ describe('C4ClusterDetailsSettingsTab version gating', () => {
|
|
|
156
156
|
backendUrls: {},
|
|
157
157
|
}, children: _jsx(C4ClusterDetailsSettingsTab, { cluster: cluster, orgId: 'org-1', clusterId: 'cluster-1', docsUrls: stubDocsUrls, apiConfig: { stage: 'dev' }, canEditCluster: true, canDeleteCluster: false, canManageUsers: false, t: (k) => k, onReloadCluster: onReloadCluster, onRequestDelete: () => undefined }) }));
|
|
158
158
|
await userEvent.click(screen.getByRole('button', { name: 'Upgrade to Tasklist v2' }));
|
|
159
|
+
expect(ConsoleClusterService.updateCluster).not.toHaveBeenCalled();
|
|
160
|
+
expect(await screen.findByRole('heading', { name: 'Upgrade to Tasklist v2' })).toBeInTheDocument();
|
|
161
|
+
const upgradeButtons = screen.getAllByRole('button', {
|
|
162
|
+
name: 'Upgrade to Tasklist v2',
|
|
163
|
+
});
|
|
164
|
+
await userEvent.click(upgradeButtons[upgradeButtons.length - 1]);
|
|
159
165
|
await waitFor(() => {
|
|
160
166
|
expect(ConsoleClusterService.updateCluster).toHaveBeenCalledWith(expect.objectContaining({
|
|
161
167
|
body: { tasklistV2Enabled: true },
|
|
@@ -235,3 +241,70 @@ describe('C4ClusterDetailsSettingsTab version gating', () => {
|
|
|
235
241
|
expect(onReloadCluster).toHaveBeenCalled();
|
|
236
242
|
});
|
|
237
243
|
});
|
|
244
|
+
describe('C4ClusterDetailsSettingsTab swagger URL', () => {
|
|
245
|
+
beforeAll(() => {
|
|
246
|
+
globalThis.ResizeObserver = resizeObserverStub;
|
|
247
|
+
});
|
|
248
|
+
beforeEach(() => {
|
|
249
|
+
lastClusterSettingsProps = undefined;
|
|
250
|
+
});
|
|
251
|
+
afterEach(() => {
|
|
252
|
+
cleanup();
|
|
253
|
+
});
|
|
254
|
+
afterAll(() => {
|
|
255
|
+
globalThis.ResizeObserver = originalResizeObserver;
|
|
256
|
+
});
|
|
257
|
+
function renderSwaggerTab(options) {
|
|
258
|
+
const cluster = {
|
|
259
|
+
...createCluster({ zeebeVersion: 'zeebe:8.8.0-alpha8' }),
|
|
260
|
+
status: {
|
|
261
|
+
ready: 'Ready',
|
|
262
|
+
...(options.operateUrl && { operateUrl: options.operateUrl }),
|
|
263
|
+
},
|
|
264
|
+
externalMetadata: {
|
|
265
|
+
swagger: options.swagger ?? true,
|
|
266
|
+
},
|
|
267
|
+
};
|
|
268
|
+
render(_jsx(C4ConsoleRuntimeProvider, { config: {
|
|
269
|
+
stage: 'dev',
|
|
270
|
+
auth: { getAccessToken: async () => 'token' },
|
|
271
|
+
backendUrls: {},
|
|
272
|
+
}, children: _jsx(C4ClusterDetailsSettingsTab, { cluster: cluster, orgId: 'org-1', clusterId: 'cluster-1', apiConfig: { stage: 'dev' }, canEditCluster: true, canDeleteCluster: false, canManageUsers: false, t: (k) => k, docsUrls: stubDocsUrls, onReloadCluster: async () => undefined, onRequestDelete: () => undefined }) }));
|
|
273
|
+
}
|
|
274
|
+
it('shows swagger URL in operate.* format for 8.8.x clusters', () => {
|
|
275
|
+
renderSwaggerTab({
|
|
276
|
+
swagger: true,
|
|
277
|
+
operateUrl: 'https://lpp-1.operate.dev.ultrawombat.com/cluster-1',
|
|
278
|
+
});
|
|
279
|
+
// 8.8.0-alpha8 < 8.9.0 → use operate.{domain} with /swagger-ui/index.html path
|
|
280
|
+
const expectedUrl = 'https://lpp-1.operate.dev.ultrawombat.com/cluster-1/swagger-ui/index.html';
|
|
281
|
+
expect(screen.getByRole('link', { name: expectedUrl })).toBeInTheDocument();
|
|
282
|
+
});
|
|
283
|
+
it('shows swagger URL in api.* format for 8.9+ clusters', () => {
|
|
284
|
+
const cluster = {
|
|
285
|
+
...createCluster({ zeebeVersion: 'zeebe:8.9.0' }),
|
|
286
|
+
status: {
|
|
287
|
+
ready: 'Ready',
|
|
288
|
+
operateUrl: 'https://lpp-1.operate.dev.ultrawombat.com/cluster-1',
|
|
289
|
+
},
|
|
290
|
+
externalMetadata: { swagger: true },
|
|
291
|
+
};
|
|
292
|
+
render(_jsx(C4ConsoleRuntimeProvider, { config: {
|
|
293
|
+
stage: 'dev',
|
|
294
|
+
auth: { getAccessToken: async () => 'token' },
|
|
295
|
+
backendUrls: {},
|
|
296
|
+
}, children: _jsx(C4ClusterDetailsSettingsTab, { cluster: cluster, orgId: 'org-1', clusterId: 'cluster-1', apiConfig: { stage: 'dev' }, canEditCluster: true, canDeleteCluster: false, canManageUsers: false, t: (k) => k, docsUrls: stubDocsUrls, onReloadCluster: async () => undefined, onRequestDelete: () => undefined }) }));
|
|
297
|
+
// 8.9.0 >= 8.9.0 → use api.{domain} with /swagger path
|
|
298
|
+
const expectedUrl = 'https://lpp-1.api.dev.ultrawombat.com/cluster-1/swagger';
|
|
299
|
+
expect(screen.getByRole('link', { name: expectedUrl })).toBeInTheDocument();
|
|
300
|
+
});
|
|
301
|
+
it('hides swagger URL link when swagger is disabled', () => {
|
|
302
|
+
renderSwaggerTab({
|
|
303
|
+
swagger: false,
|
|
304
|
+
operateUrl: 'https://lpp-1.operate.dev.ultrawombat.com/cluster-1',
|
|
305
|
+
});
|
|
306
|
+
expect(screen.queryByRole('link', {
|
|
307
|
+
name: /ultrawombat\.com.*swagger/,
|
|
308
|
+
})).not.toBeInTheDocument();
|
|
309
|
+
});
|
|
310
|
+
});
|
|
@@ -7,6 +7,8 @@ import { Fragment as _Fragment, jsx as _jsx } from "react/jsx-runtime";
|
|
|
7
7
|
import { C4ConnectorsContextProvider } from '@camunda/c4-connectors';
|
|
8
8
|
import { C3EmptyState } from '@camunda/camunda-composite-components';
|
|
9
9
|
import { useEffect, useMemo, useState } from 'react';
|
|
10
|
+
import { C4_ASSET_URLS } from '../../assetUrls.js';
|
|
11
|
+
import { C4_EXTERNAL_URLS } from '../../externalUrls.const.js';
|
|
10
12
|
import { useC4ConsoleData } from '../../runtime/c4-console-data-context.js';
|
|
11
13
|
import { useC4ConsoleRuntime } from '../../runtime/c4-console-runtime-context.js';
|
|
12
14
|
function isRecord(value) {
|
|
@@ -64,7 +66,7 @@ export function useConnectorManagementRuntime(options) {
|
|
|
64
66
|
if (!connectorsUrl || !accessToken) {
|
|
65
67
|
return _jsx(_Fragment, { children: children });
|
|
66
68
|
}
|
|
67
|
-
return (_jsx(C4ConnectorsContextProvider, { organizationId: orgId, apiBaseUrl: connectorsUrl, docsUrl:
|
|
69
|
+
return (_jsx(C4ConnectorsContextProvider, { organizationId: orgId, apiBaseUrl: connectorsUrl, docsUrl: C4_EXTERNAL_URLS.docs.consoleManageConnectors, camundaAuth: {
|
|
68
70
|
token: accessToken,
|
|
69
71
|
refreshTokenMethod: () => runtime.auth.getAccessToken(),
|
|
70
72
|
}, children: children }));
|
|
@@ -84,7 +86,7 @@ export const C4ConnectorManagementErrorBoundaryFallback = () => {
|
|
|
84
86
|
const runtime = useC4ConsoleRuntime();
|
|
85
87
|
const t = runtime.i18n?.t;
|
|
86
88
|
return (_jsx(C3EmptyState, { icon: {
|
|
87
|
-
path:
|
|
89
|
+
path: C4_ASSET_URLS.fatalErrorIcon,
|
|
88
90
|
altText: 'errorIcon',
|
|
89
91
|
}, heading: safeTranslate(t, 'connectormanagement:error-boundary-fallback.title', 'Error'), description: safeTranslate(t, 'connectormanagement:error-boundary-fallback.description', 'An error occurred while rendering this page. Please try again later.'), button: {
|
|
90
92
|
onClick: () => (window.location.href = window.location.origin),
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import type React from 'react';
|
|
2
2
|
import type { C4CreateClusterPageProps } from './c4-create-cluster-page.types';
|
|
3
|
-
export declare const C4CreateClusterPage: (({ orgId, afterCreateModalUrl, talkToAnExpertUrl, externalLinks,
|
|
3
|
+
export declare const C4CreateClusterPage: (({ orgId, afterCreateModalUrl, talkToAnExpertUrl, externalLinks, onNavigate, }: C4CreateClusterPageProps) => React.ReactElement) & {
|
|
4
4
|
displayName: string;
|
|
5
5
|
};
|
|
@@ -204,6 +204,7 @@ function buildCreateClusterTranslations(t) {
|
|
|
204
204
|
generationTitle: translate('createcluster:form.generation.title', 'Channel'),
|
|
205
205
|
olderGenerationsLabel: translate('createcluster:form.generation.olderGenerationsLabel', 'View older generations'),
|
|
206
206
|
olderGenerationsHelperText: translate('createcluster:form.generation.olderGenerationsHelperText', 'These are older generations that are used in your organization.'),
|
|
207
|
+
orgUnlockedGenerationsHelperText: translate('createcluster:form.generation.orgUnlockedGenerationsHelperText', 'These are older generations that have been unlocked for your organization.'),
|
|
207
208
|
autoUpdateTitle: translate('createcluster:form.autoUpdate.title', 'Automatic cluster patch updates'),
|
|
208
209
|
autoUpdateDescription: translate('createcluster:form.autoUpdate.description', 'When enabled, the cluster will be updated to the latest patch release. For entirely new cluster versions, updates will need to be performed manually. Please note that during the update, there may be a brief period of unavailability for the cluster.'),
|
|
209
210
|
autoUpdateDescriptionIfDisabled: translate('createcluster:form.autoUpdate.descriptionIfDisabled', 'Only available for generations in the stable channel.'),
|
|
@@ -235,7 +236,7 @@ function buildCreateClusterTranslations(t) {
|
|
|
235
236
|
stageSleepInactivity: translate('clusterdetails:settings.tags.sleepInactivity', 'Auto-pauses after inactivity'),
|
|
236
237
|
};
|
|
237
238
|
}
|
|
238
|
-
export const C4CreateClusterPage = observer(({ orgId, afterCreateModalUrl, talkToAnExpertUrl, externalLinks,
|
|
239
|
+
export const C4CreateClusterPage = observer(({ orgId, afterCreateModalUrl, talkToAnExpertUrl, externalLinks, onNavigate, }) => {
|
|
239
240
|
const runtime = useC4ConsoleRuntime();
|
|
240
241
|
const data = useC4ConsoleData();
|
|
241
242
|
const resolvedTalkToAnExpertUrl = useMemo(() => talkToAnExpertUrl ??
|
|
@@ -249,19 +250,6 @@ export const C4CreateClusterPage = observer(({ orgId, afterCreateModalUrl, talkT
|
|
|
249
250
|
const links = useMemo(() => {
|
|
250
251
|
return resolveExternalLinks(externalLinks);
|
|
251
252
|
}, [externalLinks]);
|
|
252
|
-
const visibilitiesRecord = useMemo(() => {
|
|
253
|
-
return isRecord(visibilities) ? visibilities : {};
|
|
254
|
-
}, [visibilities]);
|
|
255
|
-
const alphaAsDefault = getPathBoolean(visibilitiesRecord, [
|
|
256
|
-
'clusterList',
|
|
257
|
-
'experimentAlphaChannel',
|
|
258
|
-
'alphaAsDefault',
|
|
259
|
-
]) ?? false;
|
|
260
|
-
const advancedOfferingVisible = getPathBoolean(visibilitiesRecord, [
|
|
261
|
-
'features',
|
|
262
|
-
'advancedOffering',
|
|
263
|
-
'visible',
|
|
264
|
-
]) ?? false;
|
|
265
253
|
const [creationParameters, setCreationParameters] = useState({});
|
|
266
254
|
const [creationParametersLoading, setCreationParametersLoading] = useState(false);
|
|
267
255
|
const [organizations, setOrganizations] = useState([]);
|
|
@@ -349,6 +337,8 @@ export const C4CreateClusterPage = observer(({ orgId, afterCreateModalUrl, talkT
|
|
|
349
337
|
const salesPlanName = useMemo(() => {
|
|
350
338
|
return getPathString(organizationToSalesPlan, ['salesPlan', 'name']);
|
|
351
339
|
}, [organizationToSalesPlan]);
|
|
340
|
+
const alphaAsDefault = salesPlanTypeRaw === SalesPlanType.TRIAL;
|
|
341
|
+
const advancedOfferingVisible = salesPlanTypeRaw === SalesPlanType.ENTERPRISE;
|
|
352
342
|
const displayedSalesPlan = useMemo(() => {
|
|
353
343
|
const trialStateExpired = getBoolean(organizationToSalesPlan, 'trialStateExpired') ?? false;
|
|
354
344
|
if (!salesPlanTypeRaw) {
|
|
@@ -499,7 +489,8 @@ export const C4CreateClusterPage = observer(({ orgId, afterCreateModalUrl, talkT
|
|
|
499
489
|
]);
|
|
500
490
|
const rawClassification = getString(generation, 'classification');
|
|
501
491
|
const classification = rawClassification === 'channel' ||
|
|
502
|
-
rawClassification === 'existingCluster'
|
|
492
|
+
rawClassification === 'existingCluster' ||
|
|
493
|
+
rawClassification === 'orgUnlocked'
|
|
503
494
|
? rawClassification
|
|
504
495
|
: undefined;
|
|
505
496
|
return {
|
|
@@ -729,6 +720,7 @@ export const C4CreateClusterPage = observer(({ orgId, afterCreateModalUrl, talkT
|
|
|
729
720
|
channels: channelsWithGenerations,
|
|
730
721
|
olderGenerationsLabel: translations.olderGenerationsLabel,
|
|
731
722
|
olderGenerationsHelperText: translations.olderGenerationsHelperText,
|
|
723
|
+
orgUnlockedGenerationsHelperText: translations.orgUnlockedGenerationsHelperText,
|
|
732
724
|
},
|
|
733
725
|
autoUpdate: {
|
|
734
726
|
title: translations.autoUpdateTitle,
|
|
@@ -241,7 +241,7 @@ export const C4DashboardApp = observer((props) => {
|
|
|
241
241
|
const clustersAmount = clusters.length;
|
|
242
242
|
const healthyClustersAmount = clusters.filter((cluster) => {
|
|
243
243
|
const ready = cluster?.status?.ready;
|
|
244
|
-
return ready === true || ready === 'healthy';
|
|
244
|
+
return ready === true || ready?.toLowerCase?.() === 'healthy';
|
|
245
245
|
}).length;
|
|
246
246
|
return (_jsx(C4OldDashboard, { usersAmount: usersCount, invitationsAmount: invitationsAmount, clustersAmount: clustersAmount, healthyClustersAmount: healthyClustersAmount, updateAvailable: false, permissions: {
|
|
247
247
|
showUsers: true,
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import type React from 'react';
|
|
2
2
|
import type { C4GroupDetailsPageProps } from './c4-group-details-page.types';
|
|
3
|
-
export declare const C4GroupDetailsPage: (({ orgId, groupId, externalLinks,
|
|
3
|
+
export declare const C4GroupDetailsPage: (({ orgId, groupId, externalLinks, onNavigate, }: C4GroupDetailsPageProps) => React.ReactElement) & {
|
|
4
4
|
displayName: string;
|
|
5
5
|
};
|
|
@@ -5,27 +5,18 @@ import { jsx as _jsx, Fragment as _Fragment } from "react/jsx-runtime";
|
|
|
5
5
|
* You may not use this file except in compliance with the commercial license.
|
|
6
6
|
*/
|
|
7
7
|
import { C4GroupsDetails, C4IdentityContextProvider, } from '@camunda/c4-identity';
|
|
8
|
-
import { OrganizationRole } from '@camunda/ccma-shared-types';
|
|
8
|
+
import { checkVersion, OrganizationRole, VersionCheckOperator, } from '@camunda/ccma-shared-types';
|
|
9
9
|
import { observer } from 'mobx-react-lite';
|
|
10
10
|
import { useEffect, useMemo, useState } from 'react';
|
|
11
11
|
import { C4PageTemplate } from '../../components/c4-page-template/c4-page-template.js';
|
|
12
12
|
import { getC4GroupDetailsExternalLinks } from '../../externalUrls.const.js';
|
|
13
|
+
import { useC4ConsoleAuthz } from '../../runtime/c4-console-authz.js';
|
|
13
14
|
import { useC4ConsoleData } from '../../runtime/c4-console-data-context.js';
|
|
14
15
|
import { useC4ConsoleRuntime } from '../../runtime/c4-console-runtime-context.js';
|
|
15
16
|
import { toIdentityApiBaseUrl } from '../../runtime/to-identity-api-base-url.js';
|
|
16
17
|
function isRecord(value) {
|
|
17
18
|
return Boolean(value) && typeof value === 'object';
|
|
18
19
|
}
|
|
19
|
-
function getPathBoolean(record, path) {
|
|
20
|
-
let current = record;
|
|
21
|
-
for (const key of path) {
|
|
22
|
-
if (!isRecord(current)) {
|
|
23
|
-
return false;
|
|
24
|
-
}
|
|
25
|
-
current = current[key];
|
|
26
|
-
}
|
|
27
|
-
return typeof current === 'boolean' ? current : false;
|
|
28
|
-
}
|
|
29
20
|
function safeTranslate(t, key, fallback) {
|
|
30
21
|
try {
|
|
31
22
|
const translated = t?.(key);
|
|
@@ -41,18 +32,26 @@ function sendNavigate(onNavigate, event) {
|
|
|
41
32
|
function resolveLinks(links) {
|
|
42
33
|
return getC4GroupDetailsExternalLinks(links);
|
|
43
34
|
}
|
|
44
|
-
export const C4GroupDetailsPage = observer(({ orgId, groupId, externalLinks,
|
|
35
|
+
export const C4GroupDetailsPage = observer(({ orgId, groupId, externalLinks, onNavigate, }) => {
|
|
45
36
|
const runtime = useC4ConsoleRuntime();
|
|
46
37
|
const data = useC4ConsoleData();
|
|
38
|
+
const authz = useC4ConsoleAuthz({ orgId });
|
|
47
39
|
const t = runtime.i18n?.t;
|
|
48
40
|
const links = useMemo(() => resolveLinks(externalLinks), [externalLinks]);
|
|
49
|
-
const
|
|
41
|
+
const orgPermissions = authz.orgPermissions;
|
|
42
|
+
const hasClustersCache = Boolean(data.clusters[orgId]);
|
|
50
43
|
useEffect(() => {
|
|
51
44
|
if (!orgId) {
|
|
52
45
|
return;
|
|
53
46
|
}
|
|
54
47
|
data.fetchMembers(orgId);
|
|
55
48
|
}, [orgId, data.fetchMembers]);
|
|
49
|
+
useEffect(() => {
|
|
50
|
+
if (!orgId || hasClustersCache) {
|
|
51
|
+
return;
|
|
52
|
+
}
|
|
53
|
+
data.fetchClusters(orgId);
|
|
54
|
+
}, [data.fetchClusters, hasClustersCache, orgId]);
|
|
56
55
|
const membersCache = data.members[orgId];
|
|
57
56
|
const membersLoading = membersCache?.isLoading ?? true;
|
|
58
57
|
const members = (membersCache?.data ?? []).filter(isRecord);
|
|
@@ -82,19 +81,29 @@ export const C4GroupDetailsPage = observer(({ orgId, groupId, externalLinks, vis
|
|
|
82
81
|
return Boolean(invite.accepted);
|
|
83
82
|
});
|
|
84
83
|
}, [members]);
|
|
85
|
-
const permissionsMaySee =
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
84
|
+
const permissionsMaySee = Boolean(orgPermissions?.org.users.member.read);
|
|
85
|
+
const permissionsMayAssign = Boolean(orgPermissions?.org.users.member.create);
|
|
86
|
+
const clustersCache = data.clusters[orgId];
|
|
87
|
+
const clusters = (clustersCache?.data ?? []);
|
|
88
|
+
const hasAtLeastOneIdentityIntegrationCluster = useMemo(() => {
|
|
89
|
+
return clusters.some((cluster) => {
|
|
90
|
+
const record = isRecord(cluster) ? cluster : {};
|
|
91
|
+
const generation = isRecord(record.generation) ? record.generation : {};
|
|
92
|
+
const versions = isRecord(generation.versions)
|
|
93
|
+
? generation.versions
|
|
94
|
+
: {};
|
|
95
|
+
const zeebe = typeof versions.zeebe === 'string' ? versions.zeebe : undefined;
|
|
96
|
+
if (!zeebe?.includes(':')) {
|
|
97
|
+
return false;
|
|
98
|
+
}
|
|
99
|
+
return checkVersion({
|
|
100
|
+
possiblyVersionOrDockerPath: zeebe,
|
|
101
|
+
trueForSnapshot: true,
|
|
102
|
+
operator: VersionCheckOperator.GreaterThanOrEqual,
|
|
103
|
+
versionToCompareTo: '8.8.0-alpha5',
|
|
104
|
+
});
|
|
105
|
+
});
|
|
106
|
+
}, [clusters]);
|
|
98
107
|
const getRoles = useMemo(() => {
|
|
99
108
|
return async () => ({
|
|
100
109
|
data: Object.values(OrganizationRole).map((role) => ({
|
|
@@ -6,7 +6,7 @@ import { jsx as _jsx, jsxs as _jsxs, Fragment as _Fragment } from "react/jsx-run
|
|
|
6
6
|
*/
|
|
7
7
|
import { C4GroupsList, C4IdentityContextProvider } from '@camunda/c4-identity';
|
|
8
8
|
import { useC3Profile } from '@camunda/camunda-composite-components';
|
|
9
|
-
import { AuditLoggerService,
|
|
9
|
+
import { AuditLoggerService, ConsoleApiClientsService, ConsoleValueMetricsService, EarlyAccessFeaturesService, HttpError, OrganizationMembersService, OrgsService, UsageAlertsService, } from '@camunda/ccma-api';
|
|
10
10
|
import { checkVersion, getDisplayedSalesPlan, getRevisitedSalesPlanName, OrganizationRole, SseEntity, VersionCheckOperator, } from '@camunda/ccma-shared-types';
|
|
11
11
|
import { Link, Stack } from '@carbon/react';
|
|
12
12
|
import { observer } from 'mobx-react-lite';
|
|
@@ -868,7 +868,6 @@ export const C4ManagementApp = observer(({ orgId, desiredTabId, onTabChange, onN
|
|
|
868
868
|
const [billingLoading, setBillingLoading] = useState(false);
|
|
869
869
|
const [billingError, setBillingError] = useState(undefined);
|
|
870
870
|
const [billingClusters, setBillingClusters] = useState([]);
|
|
871
|
-
const [billingPlanTypes, setBillingPlanTypes] = useState([]);
|
|
872
871
|
const [billingMetricsMonthly, setBillingMetricsMonthly] = useState([]);
|
|
873
872
|
const [billingUsageAlerts, setBillingUsageAlerts] = useState([]);
|
|
874
873
|
const [apiClients, setApiClients] = useState([]);
|
|
@@ -1042,13 +1041,7 @@ export const C4ManagementApp = observer(({ orgId, desiredTabId, onTabChange, onN
|
|
|
1042
1041
|
const clusters = data.clusters[orgId]?.error
|
|
1043
1042
|
? []
|
|
1044
1043
|
: (data.getClusters(orgId) ?? []);
|
|
1045
|
-
const [
|
|
1046
|
-
ConsoleAdminService.getAllClusterPlanTypes({
|
|
1047
|
-
config: apiConfig,
|
|
1048
|
-
params: {
|
|
1049
|
-
headers: {},
|
|
1050
|
-
},
|
|
1051
|
-
}),
|
|
1044
|
+
const [monthlyResult, alertsResult] = await Promise.allSettled([
|
|
1052
1045
|
ConsoleValueMetricsService.getValueMetrics({
|
|
1053
1046
|
config: apiConfig,
|
|
1054
1047
|
params: {
|
|
@@ -1062,14 +1055,21 @@ export const C4ManagementApp = observer(({ orgId, desiredTabId, onTabChange, onN
|
|
|
1062
1055
|
}),
|
|
1063
1056
|
]);
|
|
1064
1057
|
const normalizedClusters = (clusters ?? []).filter((item) => Boolean(item) && typeof item === 'object');
|
|
1058
|
+
const monthly = monthlyResult.status === 'fulfilled' ? monthlyResult.value : [];
|
|
1059
|
+
const alerts = alertsResult.status === 'fulfilled' ? alertsResult.value : undefined;
|
|
1060
|
+
const loadErrors = [monthlyResult, alertsResult].filter((result) => result.status === 'rejected');
|
|
1065
1061
|
setBillingClusters(normalizedClusters);
|
|
1066
|
-
setBillingPlanTypes(planTypes ?? []);
|
|
1067
1062
|
setBillingMetricsMonthly(monthly ?? []);
|
|
1068
1063
|
setBillingUsageAlerts(alerts?.usageAlerts ?? []);
|
|
1064
|
+
if (loadErrors.length > 0) {
|
|
1065
|
+
const firstError = loadErrors[0]?.reason;
|
|
1066
|
+
setBillingError(firstError instanceof Error
|
|
1067
|
+
? firstError.message
|
|
1068
|
+
: 'Could not load some billing data');
|
|
1069
|
+
}
|
|
1069
1070
|
}
|
|
1070
1071
|
catch (error) {
|
|
1071
1072
|
setBillingClusters([]);
|
|
1072
|
-
setBillingPlanTypes([]);
|
|
1073
1073
|
setBillingMetricsMonthly([]);
|
|
1074
1074
|
setBillingUsageAlerts([]);
|
|
1075
1075
|
setBillingError(error instanceof Error ? error.message : 'Could not load billing');
|
|
@@ -1078,15 +1078,6 @@ export const C4ManagementApp = observer(({ orgId, desiredTabId, onTabChange, onN
|
|
|
1078
1078
|
setBillingLoading(false);
|
|
1079
1079
|
}
|
|
1080
1080
|
}, [apiConfig, orgId]);
|
|
1081
|
-
const clusterPlanTypeByUuid = useMemo(() => {
|
|
1082
|
-
const map = new Map();
|
|
1083
|
-
for (const planType of billingPlanTypes) {
|
|
1084
|
-
if (planType?.uuid) {
|
|
1085
|
-
map.set(planType.uuid, planType);
|
|
1086
|
-
}
|
|
1087
|
-
}
|
|
1088
|
-
return map;
|
|
1089
|
-
}, [billingPlanTypes]);
|
|
1090
1081
|
const enterpriseDevOnly = useMemo(() => getNestedBoolean(org, ['metadata', 'enterpriseDevOnly']), [org]);
|
|
1091
1082
|
const isLicensingModel2025 = useMemo(() => isLicensingModel2025Prop ??
|
|
1092
1083
|
getNestedValue(org, ['metadata', 'licensingModel']) === '2025', [isLicensingModel2025Prop, org]);
|
|
@@ -1210,10 +1201,22 @@ export const C4ManagementApp = observer(({ orgId, desiredTabId, onTabChange, onN
|
|
|
1210
1201
|
if (!reservedMap) {
|
|
1211
1202
|
return [];
|
|
1212
1203
|
}
|
|
1204
|
+
const clusterPlanTypeNames = new Map();
|
|
1205
|
+
for (const cluster of billingClusters) {
|
|
1206
|
+
const planTypeObj = getRecord(cluster, 'planType');
|
|
1207
|
+
const planTypeUuid = planTypeObj?.uuid;
|
|
1208
|
+
const planTypeName = planTypeObj?.name;
|
|
1209
|
+
if (typeof planTypeUuid === 'string' &&
|
|
1210
|
+
planTypeUuid.length > 0 &&
|
|
1211
|
+
typeof planTypeName === 'string' &&
|
|
1212
|
+
planTypeName.length > 0) {
|
|
1213
|
+
clusterPlanTypeNames.set(planTypeUuid, planTypeName);
|
|
1214
|
+
}
|
|
1215
|
+
}
|
|
1213
1216
|
return Object.keys(reservedMap)
|
|
1214
1217
|
.map((clusterPlanTypeId) => {
|
|
1215
1218
|
const reserved = getNumber(reservedMap[clusterPlanTypeId]);
|
|
1216
|
-
const
|
|
1219
|
+
const planTypeName = clusterPlanTypeNames.get(clusterPlanTypeId);
|
|
1217
1220
|
const matchingClusters = billingClusters.filter((cluster) => {
|
|
1218
1221
|
const planTypeObj = getRecord(cluster, 'planType');
|
|
1219
1222
|
return planTypeObj?.uuid === clusterPlanTypeId;
|
|
@@ -1225,14 +1228,14 @@ export const C4ManagementApp = observer(({ orgId, desiredTabId, onTabChange, onN
|
|
|
1225
1228
|
}, 0);
|
|
1226
1229
|
return {
|
|
1227
1230
|
id: clusterPlanTypeId,
|
|
1228
|
-
name:
|
|
1231
|
+
name: planTypeName ?? '-',
|
|
1229
1232
|
used,
|
|
1230
1233
|
clusters: clustersCount,
|
|
1231
1234
|
reserved,
|
|
1232
1235
|
};
|
|
1233
1236
|
})
|
|
1234
1237
|
.filter((row) => row.reserved > 0);
|
|
1235
|
-
}, [billingClusters,
|
|
1238
|
+
}, [billingClusters, org]);
|
|
1236
1239
|
const billingTabProps = useMemo(() => {
|
|
1237
1240
|
return {
|
|
1238
1241
|
billingIsEnterprise,
|
|
@@ -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 = [];
|