@camunda/ccma-saas-frontend 0.27.7 → 0.28.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.
- package/lib/esm/components/c4-activity-retention-confirm-modal/c4-activity-retention-confirm-modal.d.ts +20 -0
- package/lib/esm/components/c4-activity-retention-confirm-modal/c4-activity-retention-confirm-modal.js +21 -0
- package/lib/esm/components/c4-management-activity/c4-management-activity.d.ts +1 -1
- package/lib/esm/components/c4-management-activity/c4-management-activity.js +16 -3
- package/lib/esm/components/c4-management-activity/c4-management-activity.types.d.ts +11 -0
- package/lib/esm/components/c4-management-settings/c4-management-settings.d.ts +1 -1
- package/lib/esm/components/c4-management-settings/c4-management-settings.js +129 -3
- package/lib/esm/components/c4-management-settings/c4-management-settings.types.d.ts +33 -0
- package/lib/esm/i18n/en/pages/orgmanagement.json +33 -1
- package/lib/esm/index.d.ts +2 -0
- package/lib/esm/index.js +1 -0
- package/lib/esm/runtime/c4-console-data-context.js +3 -0
- package/lib/esm/runtime/c4-console-data-context.types.d.ts +1 -0
- package/lib/esm/runtime/c4-console-data-store.d.ts +1 -0
- package/lib/esm/runtime/c4-console-data-store.js +6 -0
- package/lib/esm/utils/migration-workaround.d.ts +1 -1
- package/lib/esm/utils/migration-workaround.js +1 -1
- package/lib/esm/widgets/cluster-details/c4-cluster-details-app.js +18 -4
- package/lib/esm/widgets/clusters/c4-clusters-page.js +2 -3
- package/lib/esm/widgets/dashboard/c4-dashboard-app.js +3 -17
- package/lib/esm/widgets/management/c4-management-app.d.ts +1 -1
- package/lib/esm/widgets/management/c4-management-app.js +118 -2
- package/lib/esm/widgets/management/c4-management-app.types.d.ts +6 -0
- package/lib/esm/widgets/management/tabs/c4-management-settings-tab.d.ts +5 -1
- package/lib/esm/widgets/management/tabs/c4-management-settings-tab.js +3 -6
- package/package.json +3 -3
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import { type JSX } from 'react';
|
|
2
|
+
export interface C4ActivityRetentionConfirmModalProps {
|
|
3
|
+
open: boolean;
|
|
4
|
+
loading: boolean;
|
|
5
|
+
title: string;
|
|
6
|
+
/** The change that the user is about to save. `*text*` is bold. */
|
|
7
|
+
intro: string;
|
|
8
|
+
/** What the new period does. `*text*` is bold. */
|
|
9
|
+
summary: string;
|
|
10
|
+
/** Headed lists, shown in order. `*text*` is bold in an item. */
|
|
11
|
+
sections: {
|
|
12
|
+
heading: string;
|
|
13
|
+
items: string[];
|
|
14
|
+
}[];
|
|
15
|
+
cancelLabel: string;
|
|
16
|
+
confirmLabel: string;
|
|
17
|
+
onCancel: () => void;
|
|
18
|
+
onConfirm: () => void;
|
|
19
|
+
}
|
|
20
|
+
export declare const C4ActivityRetentionConfirmModal: ({ open, loading, title, intro, summary, sections, cancelLabel, confirmLabel, onCancel, onConfirm, }: C4ActivityRetentionConfirmModalProps) => JSX.Element;
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import { jsx as _jsx, Fragment as _Fragment, 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 { Fragment } from 'react';
|
|
8
|
+
import { Modal } from '../../ui/index.js';
|
|
9
|
+
/** Turns each `*text*` into bold text. The rest stays plain. */
|
|
10
|
+
const withEmphasis = (text) => (_jsx(_Fragment, { children: text.split('*').map((part, index) =>
|
|
11
|
+
// The odd parts are between two stars.
|
|
12
|
+
index % 2 === 1 ? (
|
|
13
|
+
// biome-ignore lint/suspicious/noArrayIndexKey: the parts never change order
|
|
14
|
+
_jsx("strong", { children: part }, index)) : (
|
|
15
|
+
// biome-ignore lint/suspicious/noArrayIndexKey: the parts never change order
|
|
16
|
+
_jsx(Fragment, { children: part }, index))) }));
|
|
17
|
+
export const C4ActivityRetentionConfirmModal = ({ open, loading, title, intro, summary, sections, cancelLabel, confirmLabel, onCancel, onConfirm, }) => (_jsxs(Modal, { modalHeading: title, open: open, onRequestClose: () => {
|
|
18
|
+
// The save cannot stop once it starts, so the dialog stays open.
|
|
19
|
+
if (!loading)
|
|
20
|
+
onCancel();
|
|
21
|
+
}, onRequestSubmit: onConfirm, primaryButtonText: confirmLabel, primaryButtonDisabled: loading, secondaryButtonText: cancelLabel, size: 'sm', danger: true, id: 'activity-retention-confirm-modal', preventCloseOnClickOutside: true, children: [_jsx("p", { children: withEmphasis(intro) }), _jsx("p", { style: { marginTop: '8px' }, children: withEmphasis(summary) }), sections.map((section) => (_jsxs("section", { style: { marginTop: '16px' }, children: [_jsx("h4", { style: { fontWeight: 600 }, children: section.heading }), _jsx("ul", { style: { marginTop: '4px', paddingLeft: '20px', listStyle: 'disc' }, children: section.items.map((item) => (_jsx("li", { children: withEmphasis(item) }, item))) })] }, section.heading)))] }));
|
|
@@ -4,4 +4,4 @@ import type { C4ManagementActivityProps } from './c4-management-activity.types.j
|
|
|
4
4
|
* A single, searchable, paginated data table with Name / Timestamp / Audit
|
|
5
5
|
* columns. Any column can sort it. The default order is newest first.
|
|
6
6
|
*/
|
|
7
|
-
export declare const C4ManagementActivity: ({ activities, loading, downloading, onExportJSON, onExportCSV, exportLabel, exportingLabel, exportJSONLabel, exportCSVLabel, searchLabel, nameColumnLabel, timestampColumnLabel, auditColumnLabel, }: C4ManagementActivityProps) => JSX.Element;
|
|
7
|
+
export declare const C4ManagementActivity: ({ activities, loading, downloading, onExportJSON, onExportCSV, exportLabel, exportingLabel, exportJSONLabel, exportCSVLabel, searchLabel, nameColumnLabel, timestampColumnLabel, auditColumnLabel, retentionNote, retentionSettingsLabel, retentionSettingsHref, onOpenRetentionSettings, }: C4ManagementActivityProps) => JSX.Element;
|
|
@@ -1,5 +1,6 @@
|
|
|
1
|
-
import { jsx as _jsx } from "react/jsx-runtime";
|
|
1
|
+
import { jsx as _jsx, Fragment as _Fragment, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
2
|
import { useMemo } from 'react';
|
|
3
|
+
import { Link, Stack } from '../../ui/index.js';
|
|
3
4
|
import { C4DataTable } from '../c4-data-table/c4-data-table.js';
|
|
4
5
|
/**
|
|
5
6
|
* Ascending timestamp comparator with `originalIndex` as a stable tie-breaker,
|
|
@@ -20,7 +21,7 @@ const compareByTimestamp = (a, b) => {
|
|
|
20
21
|
* A single, searchable, paginated data table with Name / Timestamp / Audit
|
|
21
22
|
* columns. Any column can sort it. The default order is newest first.
|
|
22
23
|
*/
|
|
23
|
-
export const C4ManagementActivity = ({ activities, loading, downloading, onExportJSON, onExportCSV, exportLabel, exportingLabel, exportJSONLabel, exportCSVLabel, searchLabel = 'Search activity', nameColumnLabel = 'Name', timestampColumnLabel = 'Timestamp', auditColumnLabel = 'Audit', }) => {
|
|
24
|
+
export const C4ManagementActivity = ({ activities, loading, downloading, onExportJSON, onExportCSV, exportLabel, exportingLabel, exportJSONLabel, exportCSVLabel, searchLabel = 'Search activity', nameColumnLabel = 'Name', timestampColumnLabel = 'Timestamp', auditColumnLabel = 'Audit', retentionNote, retentionSettingsLabel, retentionSettingsHref, onOpenRetentionSettings, }) => {
|
|
24
25
|
// Memoized so the mapped+sorted array keeps a stable identity across parent
|
|
25
26
|
// re-renders; a fresh array would reset the data table's page (TanStack
|
|
26
27
|
// `autoResetPageIndex`) and re-run the O(n log n) sort every render.
|
|
@@ -84,5 +85,17 @@ export const C4ManagementActivity = ({ activities, loading, downloading, onExpor
|
|
|
84
85
|
],
|
|
85
86
|
},
|
|
86
87
|
];
|
|
87
|
-
return (
|
|
88
|
+
return (_jsxs(Stack, { gap: 5, children: [retentionNote ? (_jsxs("p", { children: [retentionNote, retentionSettingsHref && retentionSettingsLabel ? (_jsxs(_Fragment, { children: [' ', _jsx(Link, { href: retentionSettingsHref, onClick: (event) => {
|
|
89
|
+
// A modified click opens the href in a new tab or window.
|
|
90
|
+
if (!onOpenRetentionSettings ||
|
|
91
|
+
event.metaKey ||
|
|
92
|
+
event.ctrlKey ||
|
|
93
|
+
event.shiftKey ||
|
|
94
|
+
event.altKey ||
|
|
95
|
+
event.button !== 0) {
|
|
96
|
+
return;
|
|
97
|
+
}
|
|
98
|
+
event.preventDefault();
|
|
99
|
+
onOpenRetentionSettings();
|
|
100
|
+
}, children: retentionSettingsLabel })] })) : null] })) : undefined, _jsx(C4DataTable, { data: rows, isLoading: loading, headers: headers, toolbar: toolbar, options: { pageSize: 20, pageSizes: [10, 20, 50, 100] }, queryPrefix: 'management-activity' })] }));
|
|
88
101
|
};
|
|
@@ -25,4 +25,15 @@ export interface C4ManagementActivityProps {
|
|
|
25
25
|
nameColumnLabel?: string;
|
|
26
26
|
timestampColumnLabel?: string;
|
|
27
27
|
auditColumnLabel?: string;
|
|
28
|
+
/** Tells how long entries are kept. Shown above the table when set. */
|
|
29
|
+
retentionNote?: string;
|
|
30
|
+
/** The label of the link to the retention setting. */
|
|
31
|
+
retentionSettingsLabel?: string;
|
|
32
|
+
/**
|
|
33
|
+
* The URL of the Settings tab, from the host. The link shows only when it is
|
|
34
|
+
* set, so that a copy or a new tab opens Settings.
|
|
35
|
+
*/
|
|
36
|
+
retentionSettingsHref?: string;
|
|
37
|
+
/** Called on a plain click of the link, for the navigation in the app. */
|
|
38
|
+
onOpenRetentionSettings?: () => void;
|
|
28
39
|
}
|
|
@@ -1,3 +1,3 @@
|
|
|
1
1
|
import { type JSX } from 'react';
|
|
2
2
|
import type { C4ManagementSettingsProps } from './c4-management-settings.types.js';
|
|
3
|
-
export declare const C4ManagementSettings: ({ orgId
|
|
3
|
+
export declare const C4ManagementSettings: ({ orgId, organizationName: _organizationName, hasAcceptedBetaTerms, suppressDropDisks, activityRetentionMonths, earlyAccessFeatures, recentlyAcceptedBeta, loading, error, permissions, onLeaveOrganization, onDeleteOrganization, onToggleSuppressDropDisks, onChangeActivityRetention, onToggleEarlyAccessFeature, onOptInToBeta, onOpenFeatureOptIn, onShareFeedback, onRetry, text, earlyAccessDocsUrl, }: C4ManagementSettingsProps) => JSX.Element;
|
|
@@ -1,16 +1,38 @@
|
|
|
1
1
|
import { jsx as _jsx, Fragment as _Fragment, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
+
import { ACTIVITY_RETENTION_CHOICES, ACTIVITY_RETENTION_NOT_SET, activityRetentionCutoff, isActivityRetentionMonths, } from '@camunda/ccma-shared-types';
|
|
2
3
|
import { LogOut, RefreshCw, Trash2 } from 'lucide-react';
|
|
3
|
-
import { useMemo } from 'react';
|
|
4
|
+
import { useEffect, useMemo, useRef, useState, } from 'react';
|
|
4
5
|
import { C4_ASSET_URLS } from '../../assetUrls.js';
|
|
5
6
|
import { Button, DsCard, Link, Stack } from '../../ui/index.js';
|
|
7
|
+
import { Select, SelectItem } from '../../ui/families.js';
|
|
6
8
|
import { SECTION_HEADING_STYLE } from '../../utils/section-heading-style.js';
|
|
7
9
|
import { C4ActionableNotification } from '../c4-actionable-notification/c4-actionable-notification.js';
|
|
10
|
+
import { C4ActivityRetentionConfirmModal } from '../c4-activity-retention-confirm-modal/c4-activity-retention-confirm-modal.js';
|
|
8
11
|
import { C4DataTable } from '../c4-data-table/c4-data-table.js';
|
|
9
12
|
import { C4EmptyState } from '../c4-empty-state/c4-empty-state.js';
|
|
10
13
|
import { C4ExternalLink } from '../c4-external-link/c4-external-link.js';
|
|
14
|
+
import { C4InlineNotification } from '../c4-inline-notification/c4-inline-notification.js';
|
|
11
15
|
import { C4StructuredListSkeleton } from '../c4-structured-list/c4-structured-list.js';
|
|
12
16
|
import { C4Toggle } from '../c4-toggle/c4-toggle.js';
|
|
13
|
-
export const C4ManagementSettings = ({ orgId
|
|
17
|
+
export const C4ManagementSettings = ({ orgId, organizationName: _organizationName, hasAcceptedBetaTerms, suppressDropDisks, activityRetentionMonths, earlyAccessFeatures, recentlyAcceptedBeta, loading, error, permissions, onLeaveOrganization, onDeleteOrganization, onToggleSuppressDropDisks, onChangeActivityRetention, onToggleEarlyAccessFeature, onOptInToBeta, onOpenFeatureOptIn, onShareFeedback, onRetry, text, earlyAccessDocsUrl, }) => {
|
|
18
|
+
const [selectedRetention, setSelectedRetention] = useState(undefined);
|
|
19
|
+
const [retentionSaveFailed, setRetentionSaveFailed] = useState(false);
|
|
20
|
+
const [confirmOpen, setConfirmOpen] = useState(false);
|
|
21
|
+
const [savingRetention, setSavingRetention] = useState(false);
|
|
22
|
+
// The host can switch the org and keep this component mounted. The draft of
|
|
23
|
+
// one org must not show, or save, for the next org.
|
|
24
|
+
const [retentionOrgId, setRetentionOrgId] = useState(orgId);
|
|
25
|
+
if (retentionOrgId !== orgId) {
|
|
26
|
+
setRetentionOrgId(orgId);
|
|
27
|
+
setSelectedRetention(undefined);
|
|
28
|
+
setRetentionSaveFailed(false);
|
|
29
|
+
setConfirmOpen(false);
|
|
30
|
+
setSavingRetention(false);
|
|
31
|
+
}
|
|
32
|
+
const orgIdRef = useRef(orgId);
|
|
33
|
+
useEffect(() => {
|
|
34
|
+
orgIdRef.current = orgId;
|
|
35
|
+
}, [orgId]);
|
|
14
36
|
const canBeToggled = (feature) => {
|
|
15
37
|
return !feature.requiresClickwrap || feature.hasAcceptedFeatureTerms;
|
|
16
38
|
};
|
|
@@ -87,6 +109,18 @@ export const C4ManagementSettings = ({ orgId: _orgId, organizationName: _organiz
|
|
|
87
109
|
...feature,
|
|
88
110
|
originalIndex: index,
|
|
89
111
|
})), [earlyAccessFeatures]);
|
|
112
|
+
const currentRetention = isActivityRetentionMonths(activityRetentionMonths)
|
|
113
|
+
? activityRetentionMonths
|
|
114
|
+
: undefined;
|
|
115
|
+
const newRetention = selectedRetention ?? currentRetention;
|
|
116
|
+
// The stored value caught up with the selection (a push failed after the
|
|
117
|
+
// DB write, or another owner saved). The draft and its error are stale.
|
|
118
|
+
useEffect(() => {
|
|
119
|
+
if (retentionSaveFailed && selectedRetention === currentRetention) {
|
|
120
|
+
setRetentionSaveFailed(false);
|
|
121
|
+
setSelectedRetention(undefined);
|
|
122
|
+
}
|
|
123
|
+
}, [retentionSaveFailed, selectedRetention, currentRetention]);
|
|
90
124
|
if (loading) {
|
|
91
125
|
return _jsx(C4StructuredListSkeleton, { rowCount: 6 });
|
|
92
126
|
}
|
|
@@ -97,6 +131,98 @@ export const C4ManagementSettings = ({ orgId: _orgId, organizationName: _organiz
|
|
|
97
131
|
const suppressDropDisksBody = (_jsxs(_Fragment, { children: [sectionHeading(text.suppressDropDisks.title), _jsx("p", { style: { marginTop: '8px', color: 'var(--neutral-foreground-subtle)' }, children: text.suppressDropDisks.description }), _jsx(C4Toggle, { id: 'suppress-drop-disks-toggle', supported: true, enabled: suppressDropDisks, title: '', notices: [], onClick: onToggleSuppressDropDisks, permissions: {
|
|
98
132
|
mayToggle: true,
|
|
99
133
|
} })] }));
|
|
134
|
+
// A shorter period deletes entries: the new period is limited, and the
|
|
135
|
+
// current one is "Not set" or longer.
|
|
136
|
+
const deletesEntries = newRetention !== undefined &&
|
|
137
|
+
currentRetention !== undefined &&
|
|
138
|
+
newRetention !== ACTIVITY_RETENTION_NOT_SET &&
|
|
139
|
+
(currentRetention === ACTIVITY_RETENTION_NOT_SET ||
|
|
140
|
+
newRetention < currentRetention);
|
|
141
|
+
const saveRetention = async (months) => {
|
|
142
|
+
const savedOrgId = orgId;
|
|
143
|
+
setSavingRetention(true);
|
|
144
|
+
setRetentionSaveFailed(false);
|
|
145
|
+
let failed = false;
|
|
146
|
+
try {
|
|
147
|
+
await onChangeActivityRetention(months);
|
|
148
|
+
}
|
|
149
|
+
catch {
|
|
150
|
+
failed = true;
|
|
151
|
+
}
|
|
152
|
+
// A result for an org that is no longer shown must not touch the draft of
|
|
153
|
+
// the current org.
|
|
154
|
+
if (orgIdRef.current !== savedOrgId)
|
|
155
|
+
return;
|
|
156
|
+
if (failed) {
|
|
157
|
+
// The selection stays, so the user can retry.
|
|
158
|
+
setRetentionSaveFailed(true);
|
|
159
|
+
}
|
|
160
|
+
else {
|
|
161
|
+
setSelectedRetention(undefined);
|
|
162
|
+
}
|
|
163
|
+
setSavingRetention(false);
|
|
164
|
+
setConfirmOpen(false);
|
|
165
|
+
};
|
|
166
|
+
const retentionText = text.activityRetention;
|
|
167
|
+
// Fills the values of the dialog. The dialog shows only for a shorter period,
|
|
168
|
+
// so the new period is a limited one, and the date is the cutoff of today.
|
|
169
|
+
const fillDialogText = (template) => template
|
|
170
|
+
.replaceAll('{{previous}}', currentRetention === undefined
|
|
171
|
+
? ''
|
|
172
|
+
: retentionText.options[currentRetention])
|
|
173
|
+
.replaceAll('{{period}}', newRetention === undefined ? '' : retentionText.options[newRetention])
|
|
174
|
+
.replaceAll('{{date}}', newRetention === undefined || deletesEntries === false
|
|
175
|
+
? ''
|
|
176
|
+
: Intl.DateTimeFormat('en-US', {
|
|
177
|
+
dateStyle: 'long',
|
|
178
|
+
timeZone: 'UTC',
|
|
179
|
+
}).format(activityRetentionCutoff(new Date(), newRetention)));
|
|
180
|
+
const activityRetentionBody = currentRetention === undefined ? undefined : (_jsxs(_Fragment, { children: [sectionHeading(retentionText.title), _jsx("p", { style: {
|
|
181
|
+
marginTop: '8px',
|
|
182
|
+
color: 'var(--neutral-foreground-subtle)',
|
|
183
|
+
}, children: retentionText.description }), permissions.mayChangeActivityRetention ? (_jsxs(_Fragment, { children: [_jsx(Select, { id: 'activity-retention-select', labelText: retentionText.title, hideLabel: true, value: String(newRetention), disabled: savingRetention, onChange: (event) => {
|
|
184
|
+
const months = Number(event.target.value);
|
|
185
|
+
if (isActivityRetentionMonths(months)) {
|
|
186
|
+
setSelectedRetention(months);
|
|
187
|
+
setRetentionSaveFailed(false);
|
|
188
|
+
}
|
|
189
|
+
}, children: ACTIVITY_RETENTION_CHOICES.map((months) => (_jsx(SelectItem, { value: String(months), text: retentionText.options[months] }, months))) }), _jsx(Button, { style: { marginTop: '24px' }, size: 'md', disabled: savingRetention ||
|
|
190
|
+
newRetention === undefined ||
|
|
191
|
+
newRetention === currentRetention, onClick: () => {
|
|
192
|
+
if (newRetention === undefined)
|
|
193
|
+
return;
|
|
194
|
+
if (deletesEntries) {
|
|
195
|
+
setConfirmOpen(true);
|
|
196
|
+
}
|
|
197
|
+
else {
|
|
198
|
+
void saveRetention(newRetention);
|
|
199
|
+
}
|
|
200
|
+
}, children: retentionText.saveButton }), retentionSaveFailed && newRetention !== currentRetention ? (_jsx("div", { style: { marginTop: '16px' }, children: _jsx(C4InlineNotification, { kind: 'error', title: retentionText.saveError, hideCloseButton: true }) })) : undefined, _jsx(C4ActivityRetentionConfirmModal, { open: confirmOpen, loading: savingRetention, title: retentionText.dialogTitle, intro: fillDialogText(retentionText.dialogIntro), summary: fillDialogText(retentionText.dialogSummary), sections: [
|
|
201
|
+
{
|
|
202
|
+
heading: retentionText.dialogNextHeading,
|
|
203
|
+
items: [
|
|
204
|
+
retentionText.dialogNext1,
|
|
205
|
+
retentionText.dialogNext2,
|
|
206
|
+
retentionText.dialogNext3,
|
|
207
|
+
].map(fillDialogText),
|
|
208
|
+
},
|
|
209
|
+
{
|
|
210
|
+
heading: retentionText.dialogBeforeHeading,
|
|
211
|
+
items: [
|
|
212
|
+
retentionText.dialogBefore1,
|
|
213
|
+
retentionText.dialogBefore2,
|
|
214
|
+
retentionText.dialogBefore3,
|
|
215
|
+
].map(fillDialogText),
|
|
216
|
+
},
|
|
217
|
+
], cancelLabel: retentionText.cancel, confirmLabel: retentionText.confirm, onCancel: () => {
|
|
218
|
+
if (!savingRetention)
|
|
219
|
+
setConfirmOpen(false);
|
|
220
|
+
}, onConfirm: () => {
|
|
221
|
+
if (newRetention !== undefined)
|
|
222
|
+
void saveRetention(newRetention);
|
|
223
|
+
} })] })) : (_jsx("p", { style: { marginTop: '8px' }, children: currentRetention === ACTIVITY_RETENTION_NOT_SET
|
|
224
|
+
? retentionText.readOnlyNotSet
|
|
225
|
+
: retentionText.readOnlyLimited(retentionText.options[currentRetention]) }))] }));
|
|
100
226
|
const deleteOrganizationBody = (_jsxs(_Fragment, { children: [sectionHeading(text.deleteOrganization.title), _jsx("p", { style: { marginTop: '8px', color: 'var(--neutral-foreground-subtle)' }, children: text.deleteOrganization.consequence }), _jsx(Button, { style: { marginTop: '24px' }, renderIcon: Trash2, kind: 'danger', size: 'md', iconDescription: text.deleteOrganization.buttonLabel, onClick: onDeleteOrganization, children: text.deleteOrganization.buttonLabel })] }));
|
|
101
227
|
const earlyAccessBody = (_jsxs(_Fragment, { children: [sectionHeading(text.earlyAccess.title), _jsx("p", { style: { marginTop: '12px', color: 'var(--neutral-foreground-subtle)' }, children: text.earlyAccess.description0 }), _jsxs("p", { style: {
|
|
102
228
|
marginBottom: '18px',
|
|
@@ -136,5 +262,5 @@ export const C4ManagementSettings = ({ orgId: _orgId, organizationName: _organiz
|
|
|
136
262
|
// organization and then Delete organization come last. The card is a flex
|
|
137
263
|
// column that stretches its children, so the cards with a button align them
|
|
138
264
|
// to the start; Alpha features keeps its full-width table.
|
|
139
|
-
return (_jsxs(Stack, { gap: 6, children: [permissions.maySuppressDropDisks && (_jsx(DsCard, { className: 'items-start gap-0 p-5', children: suppressDropDisksBody })), showEarlyAccess && (_jsx(DsCard, { className: 'gap-0 p-5', children: earlyAccessBody })), permissions.mayLeaveOrganization && (_jsx(DsCard, { className: 'items-start gap-0 p-5', children: leaveOrganizationBody })), permissions.mayDeleteOrganization && (_jsx(DsCard, { className: 'items-start gap-0 p-5', children: deleteOrganizationBody }))] }));
|
|
265
|
+
return (_jsxs(Stack, { gap: 6, children: [permissions.maySuppressDropDisks && (_jsx(DsCard, { className: 'items-start gap-0 p-5', children: suppressDropDisksBody })), activityRetentionBody && (_jsx(DsCard, { className: 'items-start gap-0 p-5', children: activityRetentionBody })), showEarlyAccess && (_jsx(DsCard, { className: 'gap-0 p-5', children: earlyAccessBody })), permissions.mayLeaveOrganization && (_jsx(DsCard, { className: 'items-start gap-0 p-5', children: leaveOrganizationBody })), permissions.mayDeleteOrganization && (_jsx(DsCard, { className: 'items-start gap-0 p-5', children: deleteOrganizationBody }))] }));
|
|
140
266
|
};
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import type { ActivityRetentionMonths } from '@camunda/ccma-shared-types';
|
|
1
2
|
export interface EarlyAccessFeature {
|
|
2
3
|
id: string;
|
|
3
4
|
name: string;
|
|
@@ -14,6 +15,8 @@ export interface C4ManagementSettingsProps {
|
|
|
14
15
|
organizationName: string;
|
|
15
16
|
hasAcceptedBetaTerms: boolean;
|
|
16
17
|
suppressDropDisks: boolean;
|
|
18
|
+
/** Months to keep Activity entries, 0 for forever. `undefined` hides the section. */
|
|
19
|
+
activityRetentionMonths?: number;
|
|
17
20
|
earlyAccessFeatures: EarlyAccessFeature[];
|
|
18
21
|
recentlyAcceptedBeta: boolean;
|
|
19
22
|
loading: boolean;
|
|
@@ -24,10 +27,12 @@ export interface C4ManagementSettingsProps {
|
|
|
24
27
|
maySuppressDropDisks: boolean;
|
|
25
28
|
mayToggleEarlyAccessFeatures: boolean;
|
|
26
29
|
mayOptInToBeta: boolean;
|
|
30
|
+
mayChangeActivityRetention: boolean;
|
|
27
31
|
};
|
|
28
32
|
onLeaveOrganization: () => void;
|
|
29
33
|
onDeleteOrganization: () => void;
|
|
30
34
|
onToggleSuppressDropDisks: () => void;
|
|
35
|
+
onChangeActivityRetention: (months: ActivityRetentionMonths) => Promise<void>;
|
|
31
36
|
onToggleEarlyAccessFeature: (featureId: string) => void;
|
|
32
37
|
onOptInToBeta: () => void;
|
|
33
38
|
onOpenFeatureOptIn: (featureId: string) => void;
|
|
@@ -44,6 +49,34 @@ export interface C4ManagementSettingsProps {
|
|
|
44
49
|
title: string;
|
|
45
50
|
description: string;
|
|
46
51
|
};
|
|
52
|
+
activityRetention: {
|
|
53
|
+
title: string;
|
|
54
|
+
description: string;
|
|
55
|
+
/** The label of each period, by its value in months. */
|
|
56
|
+
options: Record<ActivityRetentionMonths, string>;
|
|
57
|
+
saveButton: string;
|
|
58
|
+
/** Read-only text. Takes the label of the period. */
|
|
59
|
+
readOnlyLimited: (period: string) => string;
|
|
60
|
+
readOnlyNotSet: string;
|
|
61
|
+
dialogTitle: string;
|
|
62
|
+
/** `{{previous}}` and `{{period}}` are labels. `*text*` is bold. */
|
|
63
|
+
dialogIntro: string;
|
|
64
|
+
/** `{{period}}` is the label of the new period. */
|
|
65
|
+
dialogSummary: string;
|
|
66
|
+
dialogNextHeading: string;
|
|
67
|
+
/** `{{date}}` is the cutoff date, `{{period}}` the new period. */
|
|
68
|
+
dialogNext1: string;
|
|
69
|
+
dialogNext2: string;
|
|
70
|
+
dialogNext3: string;
|
|
71
|
+
dialogBeforeHeading: string;
|
|
72
|
+
dialogBefore1: string;
|
|
73
|
+
dialogBefore2: string;
|
|
74
|
+
dialogBefore3: string;
|
|
75
|
+
cancel: string;
|
|
76
|
+
confirm: string;
|
|
77
|
+
/** Shown when the save fails. */
|
|
78
|
+
saveError: string;
|
|
79
|
+
};
|
|
47
80
|
deleteOrganization: {
|
|
48
81
|
title: string;
|
|
49
82
|
consequence: string;
|
|
@@ -110,6 +110,8 @@
|
|
|
110
110
|
"title": "Activity",
|
|
111
111
|
"noActivity": "No Activity",
|
|
112
112
|
"search": "Search activity",
|
|
113
|
+
"retentionNote": "Entries older than {{period}} are deleted.",
|
|
114
|
+
"retentionSettingsLink": "View in Settings",
|
|
113
115
|
"columns": {
|
|
114
116
|
"name": "Name",
|
|
115
117
|
"timestamp": "Timestamp",
|
|
@@ -470,7 +472,37 @@
|
|
|
470
472
|
"deleteOrganization": "Delete organization",
|
|
471
473
|
"deleteConsequence": "The organization and its clusters, Web Modeler files, and other assets will be deleted. This action cannot be undone.",
|
|
472
474
|
"suppressDropDisks": "Suppress drop disks",
|
|
473
|
-
"suppressDropDisksDescription": "When enabled, disks of sleeping clusters will not be dropped automatically, preserving data during idle periods."
|
|
475
|
+
"suppressDropDisksDescription": "When enabled, disks of sleeping clusters will not be dropped automatically, preserving data during idle periods.",
|
|
476
|
+
"activityRetention": {
|
|
477
|
+
"title": "Activity retention",
|
|
478
|
+
"description": "Choose how long to keep Activity entries.",
|
|
479
|
+
"options": {
|
|
480
|
+
"6": "6 months",
|
|
481
|
+
"12": "1 year",
|
|
482
|
+
"18": "1.5 years",
|
|
483
|
+
"24": "2 years",
|
|
484
|
+
"36": "3 years",
|
|
485
|
+
"60": "5 years",
|
|
486
|
+
"120": "10 years",
|
|
487
|
+
"0": "Not set"
|
|
488
|
+
},
|
|
489
|
+
"saveButton": "Save",
|
|
490
|
+
"readOnlyNotSet": "Not set. Camunda decides when to delete older entries.",
|
|
491
|
+
"dialogTitle": "Delete older Activity entries?",
|
|
492
|
+
"dialogIntro": "You're changing Activity retention from *{{previous}}* to *{{period}}*.",
|
|
493
|
+
"dialogSummary": "Once you save, Camunda keeps Activity entries for {{period}}. Each day, it deletes entries that pass that age.",
|
|
494
|
+
"dialogNextHeading": "What happens next",
|
|
495
|
+
"dialogNext1": "Within 2 days, Camunda deletes all Activity entries from before *{{date}}*.",
|
|
496
|
+
"dialogNext2": "After that, entries are deleted every day once they're older than {{period}}.",
|
|
497
|
+
"dialogNext3": "Deleted entries no longer show in the Activity tab, CSV exports or the Activity API.",
|
|
498
|
+
"dialogBeforeHeading": "Before you continue",
|
|
499
|
+
"dialogBefore1": "You can't undo this. Deleted entries can't be restored, even if you choose a longer period later.",
|
|
500
|
+
"dialogBefore2": "If you need these entries for audits or compliance, export them as CSV first.",
|
|
501
|
+
"dialogBefore3": "Everyone in the organization sees a note on the Activity tab saying older entries are deleted.",
|
|
502
|
+
"cancel": "Cancel",
|
|
503
|
+
"confirm": "Delete and save",
|
|
504
|
+
"saveError": "Couldn't save the retention period. Try again."
|
|
505
|
+
}
|
|
474
506
|
},
|
|
475
507
|
"title": "Settings",
|
|
476
508
|
"dataListTitle": "Alpha features",
|
package/lib/esm/index.d.ts
CHANGED
|
@@ -3,6 +3,8 @@ export { C4ActionableNotification } from './components/c4-actionable-notificatio
|
|
|
3
3
|
export type { C4ActionableNotificationProps } from './components/c4-actionable-notification/c4-actionable-notification.types.js';
|
|
4
4
|
export { C4ActivityGraph } from './components/c4-activity-graph/c4-activity-graph.js';
|
|
5
5
|
export type { C4ActivityGraphProps } from './components/c4-activity-graph/c4-activity-graph.types.js';
|
|
6
|
+
export type { C4ActivityRetentionConfirmModalProps } from './components/c4-activity-retention-confirm-modal/c4-activity-retention-confirm-modal.js';
|
|
7
|
+
export { C4ActivityRetentionConfirmModal } from './components/c4-activity-retention-confirm-modal/c4-activity-retention-confirm-modal.js';
|
|
6
8
|
export { C4AiUsage } from './components/c4-ai-usage/c4-ai-usage.js';
|
|
7
9
|
export type { C4AiUsageProps } from './components/c4-ai-usage/c4-ai-usage.types.js';
|
|
8
10
|
export { C4AlphaClusterAtCheckout } from './components/c4-alpha-cluster-at-checkout/c4-alpha-cluster-at-checkout.js';
|
package/lib/esm/index.js
CHANGED
|
@@ -6,6 +6,7 @@
|
|
|
6
6
|
export { C4_ASSET_URLS } from './assetUrls.js';
|
|
7
7
|
export { C4ActionableNotification } from './components/c4-actionable-notification/c4-actionable-notification.js';
|
|
8
8
|
export { C4ActivityGraph } from './components/c4-activity-graph/c4-activity-graph.js';
|
|
9
|
+
export { C4ActivityRetentionConfirmModal } from './components/c4-activity-retention-confirm-modal/c4-activity-retention-confirm-modal.js';
|
|
9
10
|
export { C4AiUsage } from './components/c4-ai-usage/c4-ai-usage.js';
|
|
10
11
|
export { C4AlphaClusterAtCheckout } from './components/c4-alpha-cluster-at-checkout/c4-alpha-cluster-at-checkout.js';
|
|
11
12
|
export { C4ApiClientScopePicker } from './components/c4-api-client-scope-picker/c4-api-client-scope-picker.js';
|
|
@@ -73,6 +73,7 @@ export const C4ConsoleDataProvider = ({ children, initialState, }) => {
|
|
|
73
73
|
const invalidateWebappClusters = useCallback((orgId) => store.invalidateWebappClusters(orgId), [store]);
|
|
74
74
|
const invalidateAll = useCallback((orgId) => store.invalidateAll(orgId), [store]);
|
|
75
75
|
const getClusters = useCallback((orgId) => store.getClusters(orgId), [store]);
|
|
76
|
+
const getOrgInfoError = useCallback((orgId) => store.getOrgInfoError(orgId), [store]);
|
|
76
77
|
const getOrgInfo = useCallback((orgId) => store.getOrgInfo(orgId), [store]);
|
|
77
78
|
const getOrgOwner = useCallback((orgId) => store.getOrgOwner(orgId), [store]);
|
|
78
79
|
const getEarlyAccessFeatures = useCallback((orgId) => store.getEarlyAccessFeatures(orgId), [store]);
|
|
@@ -251,6 +252,7 @@ export const C4ConsoleDataProvider = ({ children, initialState, }) => {
|
|
|
251
252
|
// Convenience getters
|
|
252
253
|
getClusters,
|
|
253
254
|
getOrgInfo,
|
|
255
|
+
getOrgInfoError,
|
|
254
256
|
getOrgOwner,
|
|
255
257
|
getEarlyAccessFeatures,
|
|
256
258
|
getMembers,
|
|
@@ -290,6 +292,7 @@ export const C4ConsoleDataProvider = ({ children, initialState, }) => {
|
|
|
290
292
|
invalidateAll,
|
|
291
293
|
getClusters,
|
|
292
294
|
getOrgInfo,
|
|
295
|
+
getOrgInfoError,
|
|
293
296
|
getOrgOwner,
|
|
294
297
|
getEarlyAccessFeatures,
|
|
295
298
|
getMembers,
|
|
@@ -92,6 +92,7 @@ export interface C4ConsoleDataState {
|
|
|
92
92
|
invalidateAll: (orgId: string) => void;
|
|
93
93
|
getClusters: (orgId: string) => any[] | undefined;
|
|
94
94
|
getOrgInfo: (orgId: string) => unknown | undefined;
|
|
95
|
+
getOrgInfoError: (orgId: string) => Error | undefined;
|
|
95
96
|
getOrgOwner: (orgId: string) => {
|
|
96
97
|
owner: string;
|
|
97
98
|
email: string;
|
|
@@ -93,6 +93,7 @@ export declare const ConsoleDataStore: import("mobx-state-tree").IModelType<{
|
|
|
93
93
|
} & {
|
|
94
94
|
getClusters(orgId: string): any[] | undefined;
|
|
95
95
|
getOrgInfo(orgId: string): unknown | undefined;
|
|
96
|
+
getOrgInfoError(orgId: string): Error | undefined;
|
|
96
97
|
getOrgOwner(orgId: string): {
|
|
97
98
|
owner: string;
|
|
98
99
|
email: string;
|
|
@@ -144,6 +144,9 @@ export const ConsoleDataStore = types
|
|
|
144
144
|
const cached = self.orgInfo.get(orgId);
|
|
145
145
|
return cached?.data;
|
|
146
146
|
},
|
|
147
|
+
getOrgInfoError(orgId) {
|
|
148
|
+
return self.orgInfo.get(orgId)?.error ?? undefined;
|
|
149
|
+
},
|
|
147
150
|
getOrgOwner(orgId) {
|
|
148
151
|
const cached = self.orgOwner.get(orgId);
|
|
149
152
|
return cached?.data;
|
|
@@ -391,6 +394,9 @@ export const ConsoleDataStore = types
|
|
|
391
394
|
result = yield OrgsService.getOrgInfo({
|
|
392
395
|
config: apiConfig,
|
|
393
396
|
orgUuid: orgId,
|
|
397
|
+
// A forced read follows a write. The API cache can still hold
|
|
398
|
+
// the org from before the write.
|
|
399
|
+
cacheControl: { ignoreCache: options?.force === true },
|
|
394
400
|
});
|
|
395
401
|
}
|
|
396
402
|
catch (error) {
|
|
@@ -22,7 +22,7 @@ export declare const getMigrationInfo: (cluster: {
|
|
|
22
22
|
description?: string;
|
|
23
23
|
}) => MigrationInfo;
|
|
24
24
|
/**
|
|
25
|
-
* The one plan check of the details page
|
|
25
|
+
* The one plan check of the details page and the list. An
|
|
26
26
|
* unknown plan (slow or failed org request) keeps a prefixed cluster locked.
|
|
27
27
|
* Only a known other plan unlocks it.
|
|
28
28
|
*/
|
|
@@ -34,7 +34,7 @@ export const getMigrationInfo = (cluster) => {
|
|
|
34
34
|
return { state: 'none', displayName: cluster.name };
|
|
35
35
|
};
|
|
36
36
|
/**
|
|
37
|
-
* The one plan check of the details page
|
|
37
|
+
* The one plan check of the details page and the list. An
|
|
38
38
|
* unknown plan (slow or failed org request) keeps a prefixed cluster locked.
|
|
39
39
|
* Only a known other plan unlocks it.
|
|
40
40
|
*/
|
|
@@ -19,7 +19,7 @@ import { CLUSTER_CREATION_BLOCKED_FLAG } from '../../runtime/cluster-creation-bl
|
|
|
19
19
|
import { SELF_MANAGED_MIGRATION_FLAG } from '../../runtime/self-managed-migration.js';
|
|
20
20
|
import { toApiConfig } from '../../runtime/to-api-config.js';
|
|
21
21
|
import { Modal, Stack, TextInput } from '../../ui/index.js';
|
|
22
|
-
import { buildMigrateName, getMigrationInfo, isMigrationPlan, withBackupIdLabel, } from '../../utils/migration-workaround.js';
|
|
22
|
+
import { buildMigrateName, getMigrationInfo, isMigrationPlan, MIGRATION_NAME_MAX_LENGTH, withBackupIdLabel, } from '../../utils/migration-workaround.js';
|
|
23
23
|
import { safeTranslate } from '../../utils/safe-translate.js';
|
|
24
24
|
import { clusterHealthOverride } from '../cluster-health-override.js';
|
|
25
25
|
import { useClusterApiClients } from '../environment/use-cluster-api-clients.js';
|
|
@@ -556,7 +556,9 @@ export const C4ClusterDetailsApp = observer((props) => {
|
|
|
556
556
|
// but never confirms.
|
|
557
557
|
const migrationCanConfirm = migrationPlanType === SalesPlanType.ENTERPRISE &&
|
|
558
558
|
Boolean(authz.visibilities.clusters?.canEdit);
|
|
559
|
-
|
|
559
|
+
// TODO(3844-workaround): Rename stays open in a migration state, so a tester
|
|
560
|
+
// can change the name prefix and with it the state.
|
|
561
|
+
const canRename = Boolean(authz.visibilities.clusters?.canEdit);
|
|
560
562
|
const canDelete = !migrationLocked && Boolean(authz.visibilities.clusters?.canDelete);
|
|
561
563
|
const { hasIdentityIntegration, useClusterSecretsLabel } = useClusterVersionFlags(cluster);
|
|
562
564
|
const [dismissedFailedRestores, setDismissedFailedRestores] = useState(loadDismissedFailedRestores);
|
|
@@ -677,6 +679,17 @@ export const C4ClusterDetailsApp = observer((props) => {
|
|
|
677
679
|
cluster?.labels,
|
|
678
680
|
reloadCluster,
|
|
679
681
|
]);
|
|
682
|
+
// TODO(3844-workaround): A prefixed name that is too long makes the
|
|
683
|
+
// later PATCH of `onConfirmMigration` fail, because it adds a longer prefix.
|
|
684
|
+
const renamedMigrationInfo = migrationInfo === undefined
|
|
685
|
+
? undefined
|
|
686
|
+
: getMigrationInfo({
|
|
687
|
+
name: newClusterName,
|
|
688
|
+
description: clusterDescription,
|
|
689
|
+
});
|
|
690
|
+
const renameTooLongForMigration = renamedMigrationInfo !== undefined &&
|
|
691
|
+
renamedMigrationInfo.state !== 'none' &&
|
|
692
|
+
renamedMigrationInfo.displayName.length > MIGRATION_NAME_MAX_LENGTH;
|
|
680
693
|
const onRename = async () => {
|
|
681
694
|
setClusterMutationBusy(true);
|
|
682
695
|
setClusterMutationError('');
|
|
@@ -1719,7 +1732,7 @@ export const C4ClusterDetailsApp = observer((props) => {
|
|
|
1719
1732
|
// a change must not unmount the tabs, or an open editor loses its
|
|
1720
1733
|
// draft and the page moves under the pointer.
|
|
1721
1734
|
loading: (isClusterLoading && cluster?.uuid !== props.clusterId) ||
|
|
1722
|
-
authz.isLoading, padding: props.padding, clusterName:
|
|
1735
|
+
authz.isLoading, padding: props.padding, clusterName: cluster?.name, phaseTag: headerPhaseTag, healthStatus: headerHealthStatus, versionLabel: headerVersionLabel, regionCode: headerRegionCode, isDevelopmentPlan: cluster?.planType?.development, urls: { clusters: urls.clusters }, onNavigateToClusters: () => props.onNavigate?.({ kind: 'clusters', orgId: props.orgId }), menu: {
|
|
1723
1736
|
canRename,
|
|
1724
1737
|
canDelete,
|
|
1725
1738
|
canDuplicate,
|
|
@@ -1738,9 +1751,10 @@ export const C4ClusterDetailsApp = observer((props) => {
|
|
|
1738
1751
|
onChange: handleTabChange,
|
|
1739
1752
|
} }, `${props.orgId}:${props.clusterId}`), _jsx(Modal, { open: renameOpen, modalHeading: 'Rename cluster', primaryButtonText: 'Rename', secondaryButtonText: 'Cancel', primaryButtonDisabled: clusterMutationBusy ||
|
|
1740
1753
|
newClusterName.length === 0 ||
|
|
1754
|
+
renameTooLongForMigration ||
|
|
1741
1755
|
!!cluster?.restoreInProgress, onRequestClose: () => setRenameOpen(false), onRequestSubmit: () => {
|
|
1742
1756
|
void onRename();
|
|
1743
|
-
}, children: _jsxs(Stack, { gap: 4, children: [clusterMutationError && _jsx("p", { children: clusterMutationError }), _jsx(TextInput, { id: 'cluster-rename-name', labelText: 'Name', value: newClusterName, onChange: (event) => setNewClusterName(event.target.value) })] }) }), _jsx(Modal, { open: deleteOpen, danger: true, modalHeading: safeTranslate(t, 'clustermodals:delete.heading', 'Delete cluster'), primaryButtonText: safeTranslate(t, 'clustermodals:delete.buttons.primary', 'Delete'), secondaryButtonText: safeTranslate(t, 'clustermodals:delete.buttons.secondary', 'Cancel'), primaryButtonDisabled: clusterMutationBusy || deleteConfirmation !== 'DELETE', onRequestClose: () => setDeleteOpen(false), onRequestSubmit: () => {
|
|
1757
|
+
}, children: _jsxs(Stack, { gap: 4, children: [clusterMutationError && _jsx("p", { children: clusterMutationError }), renameTooLongForMigration && (_jsx("p", { "data-testid": 'cluster-rename-migration-too-long', children: `A name in a migration state can have at most ${MIGRATION_NAME_MAX_LENGTH} characters after the prefix.` })), _jsx(TextInput, { id: 'cluster-rename-name', labelText: 'Name', value: newClusterName, onChange: (event) => setNewClusterName(event.target.value) })] }) }), _jsx(Modal, { open: deleteOpen, danger: true, modalHeading: safeTranslate(t, 'clustermodals:delete.heading', 'Delete cluster'), primaryButtonText: safeTranslate(t, 'clustermodals:delete.buttons.primary', 'Delete'), secondaryButtonText: safeTranslate(t, 'clustermodals:delete.buttons.secondary', 'Cancel'), primaryButtonDisabled: clusterMutationBusy || deleteConfirmation !== 'DELETE', onRequestClose: () => setDeleteOpen(false), onRequestSubmit: () => {
|
|
1744
1758
|
void onDelete();
|
|
1745
1759
|
}, children: _jsxs(Stack, { gap: 6, children: [clusterMutationError && _jsx("p", { children: clusterMutationError }), _jsxs("p", { children: ["Are you sure you want to delete", ' ', _jsx("strong", { children: cluster?.name ?? 'this cluster' }), "? All cluster data, backups, and configurations will be deleted. This action cannot be undone."] }), _jsx(TextInput, { id: 'delete-confirmation-cluster', labelText: safeTranslate(t, 'clustermodals:delete.confirm.label', 'Type the word DELETE to confirm'), value: deleteConfirmation, onChange: (e) => setDeleteConfirmation(e.target.value), disabled: clusterMutationBusy })] }) })] }));
|
|
1746
1760
|
});
|
|
@@ -428,10 +428,9 @@ export const C4ClustersPage = observer(({ orgId, scope = 'cluster', gettingStart
|
|
|
428
428
|
if (migrationInfo && migrationInfo.state !== 'none') {
|
|
429
429
|
lockedIds.add(mappedItem.id);
|
|
430
430
|
}
|
|
431
|
-
const
|
|
432
|
-
? { ...mappedItem,
|
|
431
|
+
const item = expiry
|
|
432
|
+
? { ...mappedItem, expiry }
|
|
433
433
|
: mappedItem;
|
|
434
|
-
const item = expiry ? { ...named, expiry } : named;
|
|
435
434
|
// A restoring or reconciliation-paused cluster reports a raw status
|
|
436
435
|
// that says nothing useful. `clusterHealthOverride` owns the label
|
|
437
436
|
// that replaces it. This list, the header badge of the cluster page,
|
|
@@ -16,9 +16,7 @@ import { hasAvailableClusterReservation, isDeveloperBlockedFromClusterCreate, us
|
|
|
16
16
|
import { useC4ConsoleData } from '../../runtime/c4-console-data-context.js';
|
|
17
17
|
import { useC4ConsoleRuntime, useC4FeatureFlag, } from '../../runtime/c4-console-runtime-context.js';
|
|
18
18
|
import { CLUSTER_CREATION_BLOCKED_FLAG } from '../../runtime/cluster-creation-blocked.js';
|
|
19
|
-
import { SELF_MANAGED_MIGRATION_FLAG } from '../../runtime/self-managed-migration.js';
|
|
20
19
|
import { toApiConfig } from '../../runtime/to-api-config.js';
|
|
21
|
-
import { getMigrationInfo, isMigrationPlan, } from '../../utils/migration-workaround.js';
|
|
22
20
|
import { safeTranslate } from '../../utils/safe-translate.js';
|
|
23
21
|
import { isClusterReconciliationPaused } from '../is-cluster-reconciliation-paused.js';
|
|
24
22
|
const DAY = 24 * 60 * 60 * 1000;
|
|
@@ -117,17 +115,6 @@ export const C4DashboardApp = observer((props) => {
|
|
|
117
115
|
const externalUrls = useMemo(() => getC4DashboardUrls({ orgId, overrides: urls }), [orgId, urls]);
|
|
118
116
|
const { fetchClusters, fetchMembers, fetchAudits, fetchClients, fetchClusterCapacity, getClusters, } = data;
|
|
119
117
|
const orgInfo = data.getOrgInfo(orgId);
|
|
120
|
-
// TODO(3844-workaround): The migration state sits in the name prefix, so a
|
|
121
|
-
// cluster in a state shows its name without the prefix.
|
|
122
|
-
const migrationFlagOn = useC4FeatureFlag(SELF_MANAGED_MIGRATION_FLAG);
|
|
123
|
-
const migrationActive = migrationFlagOn &&
|
|
124
|
-
isMigrationPlan(orgInfo?.organizationToSalesPlan?.salesPlan?.salesPlanType);
|
|
125
|
-
const displayClusterName = useCallback((cluster) => migrationActive && typeof cluster.name === 'string'
|
|
126
|
-
? getMigrationInfo({
|
|
127
|
-
name: cluster.name,
|
|
128
|
-
description: cluster.description,
|
|
129
|
-
}).displayName
|
|
130
|
-
: cluster.name, [migrationActive]);
|
|
131
118
|
// Permissions derived from orgInfo. If orgInfo isn't loaded yet, default to
|
|
132
119
|
// not loading privileged data (members/activity). The dashboard should still render.
|
|
133
120
|
const canReadMembers = orgInfo?.permissions?.org?.users?.member?.read;
|
|
@@ -283,7 +270,7 @@ export const C4DashboardApp = observer((props) => {
|
|
|
283
270
|
for (const cluster of usageClusters ?? []) {
|
|
284
271
|
const id = getClusterId(cluster);
|
|
285
272
|
if (id && typeof cluster?.name === 'string') {
|
|
286
|
-
clusterNames.set(id,
|
|
273
|
+
clusterNames.set(id, cluster.name);
|
|
287
274
|
}
|
|
288
275
|
}
|
|
289
276
|
const { pi, di, latestTaskUsers } = toUsageChartPoints(usagePerDay, clusterNames, orgInfo?.name ?? orgId);
|
|
@@ -298,7 +285,6 @@ export const C4DashboardApp = observer((props) => {
|
|
|
298
285
|
: { dataPoints: di },
|
|
299
286
|
};
|
|
300
287
|
}, [
|
|
301
|
-
displayClusterName,
|
|
302
288
|
hostProvidesBilling,
|
|
303
289
|
isLicensingModel2025,
|
|
304
290
|
orgId,
|
|
@@ -361,7 +347,7 @@ export const C4DashboardApp = observer((props) => {
|
|
|
361
347
|
}
|
|
362
348
|
return {
|
|
363
349
|
id,
|
|
364
|
-
name:
|
|
350
|
+
name: cluster.name,
|
|
365
351
|
status: isClusterReconciliationPaused(cluster)
|
|
366
352
|
? 'maintenance'
|
|
367
353
|
: cluster.status?.ready || 'Unknown',
|
|
@@ -371,7 +357,7 @@ export const C4DashboardApp = observer((props) => {
|
|
|
371
357
|
version: cluster.generation?.name || '-',
|
|
372
358
|
};
|
|
373
359
|
})
|
|
374
|
-
.filter((cluster) => Boolean(cluster)), [clusters
|
|
360
|
+
.filter((cluster) => Boolean(cluster)), [clusters]);
|
|
375
361
|
// Check if any cluster has load data
|
|
376
362
|
const clusterLoadAvailable = clusterCapacityMap.size > 0;
|
|
377
363
|
// Get cluster load callback
|
|
@@ -2,6 +2,6 @@ import { type JSX } from 'react';
|
|
|
2
2
|
import type { CloudClientItem } from '../../components/c4-management-api/c4-management-api.types.js';
|
|
3
3
|
import type { C4ManagementAppProps } from './c4-management-app.types.js';
|
|
4
4
|
export declare function mapPermissionsToScopeStrings(permissions: string[], t: ((key: string, options?: Record<string, unknown>) => string) | undefined): Omit<CloudClientItem, 'id' | 'name' | 'clientId'>;
|
|
5
|
-
export declare const C4ManagementApp: (({ orgId, embedded, environmentsEnabled, desiredTabId, onTabChange, onNavigate, legacyTabs, userPersonaRole, isLicensingModel2025: isLicensingModel2025Prop, permissionsReworkEnabled, urls, onNeedsReload, }: C4ManagementAppProps) => JSX.Element) & {
|
|
5
|
+
export declare const C4ManagementApp: (({ orgId, embedded, environmentsEnabled, desiredTabId, onTabChange, onNavigate, getTabHref, legacyTabs, userPersonaRole, isLicensingModel2025: isLicensingModel2025Prop, permissionsReworkEnabled, urls, onNeedsReload, }: C4ManagementAppProps) => JSX.Element) & {
|
|
6
6
|
displayName: string;
|
|
7
7
|
};
|
|
@@ -7,7 +7,7 @@ import { jsx as _jsx, jsxs as _jsxs, Fragment as _Fragment } from "react/jsx-run
|
|
|
7
7
|
import { C4GroupsList, C4IdentityContextProvider } from '@camunda/c4-identity';
|
|
8
8
|
import { useC3Profile } from '@camunda/camunda-composite-components';
|
|
9
9
|
import { AuditLoggerService, ConsoleApiClientsService, ConsoleClusterParametersService, ConsoleValueMetricsService, EarlyAccessFeaturesService, HdpService, HttpError, OrganizationMembersService, OrgsService, UsageAlertsService, } from '@camunda/ccma-api';
|
|
10
|
-
import { addMonthsClamped, checkVersion, diffInWholeMonths, getCurrentEnterpriseTerm, getDisplayedSalesPlan, getRevisitedSalesPlanName, IDENTITY_MANAGEMENT_MIN_VERSION, NEW_CLUSTER_ROLES_MIN_VERSION, OrganizationRole, peakWithinTerm, SseEntity, toUtcDayStartMs, USAGE_SALES_PLAN_TYPES, VersionCheckOperator, } from '@camunda/ccma-shared-types';
|
|
10
|
+
import { ACTIVITY_RETENTION_CHOICES, ACTIVITY_RETENTION_FLAG, activityRetentionLabel, addMonthsClamped, checkVersion, diffInWholeMonths, getCurrentEnterpriseTerm, getDisplayedSalesPlan, getRevisitedSalesPlanName, IDENTITY_MANAGEMENT_MIN_VERSION, isActivityRetentionMonths, isLimitedActivityRetention, NEW_CLUSTER_ROLES_MIN_VERSION, OrganizationRole, peakWithinTerm, SseEntity, toUtcDayStartMs, USAGE_SALES_PLAN_TYPES, VersionCheckOperator, } from '@camunda/ccma-shared-types';
|
|
11
11
|
import { observer } from 'mobx-react-lite';
|
|
12
12
|
import { useCallback, useEffect, useMemo, useRef, useState, } from 'react';
|
|
13
13
|
import { C4AiUsage } from '../../components/c4-ai-usage/c4-ai-usage.js';
|
|
@@ -558,7 +558,7 @@ function themeNameToClassName(theme) {
|
|
|
558
558
|
return 'g10';
|
|
559
559
|
}
|
|
560
560
|
}
|
|
561
|
-
export const C4ManagementApp = observer(({ orgId, embedded = false, environmentsEnabled = false, desiredTabId, onTabChange, onNavigate, legacyTabs, userPersonaRole, isLicensingModel2025: isLicensingModel2025Prop, permissionsReworkEnabled = false, urls, onNeedsReload, }) => {
|
|
561
|
+
export const C4ManagementApp = observer(({ orgId, embedded = false, environmentsEnabled = false, desiredTabId, onTabChange, onNavigate, getTabHref, legacyTabs, userPersonaRole, isLicensingModel2025: isLicensingModel2025Prop, permissionsReworkEnabled = false, urls, onNeedsReload, }) => {
|
|
562
562
|
const runtime = useC4ConsoleRuntime();
|
|
563
563
|
const hubNaming = useHubApiNaming();
|
|
564
564
|
const data = useC4ConsoleData();
|
|
@@ -571,11 +571,14 @@ export const C4ManagementApp = observer(({ orgId, embedded = false, environments
|
|
|
571
571
|
const getMembers = data.getMembers;
|
|
572
572
|
const getClusters = data.getClusters;
|
|
573
573
|
const getOrgInfo = data.getOrgInfo;
|
|
574
|
+
const getOrgInfoError = data.getOrgInfoError;
|
|
574
575
|
const getOrgOwner = data.getOrgOwner;
|
|
575
576
|
const getEarlyAccessFeatures = data.getEarlyAccessFeatures;
|
|
576
577
|
const setOrgInfo = data.setOrgInfo;
|
|
577
578
|
const setEarlyAccessFeatures = data.setEarlyAccessFeatures;
|
|
578
579
|
const t = runtime.i18n?.t;
|
|
580
|
+
// safeTranslate does not interpolate its fallback, so fill it here.
|
|
581
|
+
const retentionNoteFor = useCallback((period) => safeTranslate(t, 'orgmanagement:tabs.activity.retentionNote', `Entries older than ${period} are deleted.`, { period }), [t]);
|
|
579
582
|
const c3Profile = useC3Profile();
|
|
580
583
|
const [resolvedUserEmail, setResolvedUserEmail] = useState(() => {
|
|
581
584
|
return typeof runtime.user?.email === 'string' && runtime.user.email
|
|
@@ -873,6 +876,31 @@ export const C4ManagementApp = observer(({ orgId, embedded = false, environments
|
|
|
873
876
|
mapEarlyAccessFeatures,
|
|
874
877
|
orgId,
|
|
875
878
|
]);
|
|
879
|
+
const reconcileActivityRetention = useCallback(async (savedOrgId) => {
|
|
880
|
+
try {
|
|
881
|
+
await withTimeout(fetchOrgInfo(savedOrgId, { force: true }), 10_000, 'Timed out loading organization');
|
|
882
|
+
}
|
|
883
|
+
catch {
|
|
884
|
+
// The read timed out. The section shows the save error.
|
|
885
|
+
return;
|
|
886
|
+
}
|
|
887
|
+
// A failed read does not reject. The store keeps the old data and
|
|
888
|
+
// sets `error`, so applying it would write the old value back.
|
|
889
|
+
if (getOrgInfoError(savedOrgId))
|
|
890
|
+
return;
|
|
891
|
+
const fresh = getOrgInfo(savedOrgId);
|
|
892
|
+
const months = fresh?.['activityRetentionMonths'];
|
|
893
|
+
const current = orgRef.current;
|
|
894
|
+
if (!isActivityRetentionMonths(months) ||
|
|
895
|
+
!current ||
|
|
896
|
+
current['uuid'] !== savedOrgId) {
|
|
897
|
+
return;
|
|
898
|
+
}
|
|
899
|
+
const nextOrg = { ...current, activityRetentionMonths: months };
|
|
900
|
+
orgRef.current = nextOrg;
|
|
901
|
+
setOrg(nextOrg);
|
|
902
|
+
setOrgInfo(savedOrgId, nextOrg);
|
|
903
|
+
}, [fetchOrgInfo, getOrgInfo, getOrgInfoError, setOrgInfo]);
|
|
876
904
|
const syncSettingsCache = useCallback(async ({ forceOrgInfo = false, forceEarlyAccess = false, } = {}) => {
|
|
877
905
|
if (!forceOrgInfo && !forceEarlyAccess) {
|
|
878
906
|
return;
|
|
@@ -2039,6 +2067,13 @@ export const C4ManagementApp = observer(({ orgId, embedded = false, environments
|
|
|
2039
2067
|
]);
|
|
2040
2068
|
const canReadActivity = useMemo(() => getNestedBoolean(org, ['permissions', 'org', 'activity', 'read']), [org]);
|
|
2041
2069
|
const clusterDefaultsTabEnabled = useC4FeatureFlag(ORG_CLUSTER_DEFAULTS_FLAG);
|
|
2070
|
+
const activityRetentionEnabled = useC4FeatureFlag(ACTIVITY_RETENTION_FLAG);
|
|
2071
|
+
const activityRetentionMonths = useMemo(() => {
|
|
2072
|
+
const months = org?.['activityRetentionMonths'];
|
|
2073
|
+
return activityRetentionEnabled && isActivityRetentionMonths(months)
|
|
2074
|
+
? months
|
|
2075
|
+
: undefined;
|
|
2076
|
+
}, [activityRetentionEnabled, org]);
|
|
2042
2077
|
// The same permission that the accounts route asks for on the write.
|
|
2043
2078
|
const canChangeOrgSettings = useMemo(() => getNestedBoolean(org, ['permissions', 'org', 'settings', 'update']), [org]);
|
|
2044
2079
|
const loadAudits = useCallback(async (opts) => {
|
|
@@ -2322,6 +2357,7 @@ export const C4ManagementApp = observer(({ orgId, embedded = false, environments
|
|
|
2322
2357
|
organizationName: orgName,
|
|
2323
2358
|
hasAcceptedBetaTerms,
|
|
2324
2359
|
suppressDropDisks,
|
|
2360
|
+
activityRetentionMonths,
|
|
2325
2361
|
earlyAccessFeatures: features,
|
|
2326
2362
|
recentlyAcceptedBeta,
|
|
2327
2363
|
loading: loading || (settingsLoading && features.length === 0),
|
|
@@ -2332,6 +2368,8 @@ export const C4ManagementApp = observer(({ orgId, embedded = false, environments
|
|
|
2332
2368
|
maySuppressDropDisks,
|
|
2333
2369
|
mayToggleEarlyAccessFeatures,
|
|
2334
2370
|
mayOptInToBeta: Boolean(betaGroupKey),
|
|
2371
|
+
// The route answers 403 for any other role.
|
|
2372
|
+
mayChangeActivityRetention: isCurrentUserOwner,
|
|
2335
2373
|
},
|
|
2336
2374
|
onLeaveOrganization: () => {
|
|
2337
2375
|
runtime.telemetry?.track?.('orgMembers:leave:open', {
|
|
@@ -2380,6 +2418,41 @@ export const C4ManagementApp = observer(({ orgId, embedded = false, environments
|
|
|
2380
2418
|
}
|
|
2381
2419
|
})();
|
|
2382
2420
|
},
|
|
2421
|
+
onChangeActivityRetention: async (months) => {
|
|
2422
|
+
// A failure rejects. The section shows the error and keeps the selection.
|
|
2423
|
+
let response;
|
|
2424
|
+
try {
|
|
2425
|
+
response = await OrgsService.updateActivityRetention({
|
|
2426
|
+
config: apiConfig,
|
|
2427
|
+
params: { orgId, months },
|
|
2428
|
+
});
|
|
2429
|
+
}
|
|
2430
|
+
catch (error) {
|
|
2431
|
+
// The route can store the period and still fail. Show the stored
|
|
2432
|
+
// value before the next save, or Save compares with a stale value.
|
|
2433
|
+
// The section keeps its controls disabled until this settles.
|
|
2434
|
+
await reconcileActivityRetention(orgId);
|
|
2435
|
+
throw error;
|
|
2436
|
+
}
|
|
2437
|
+
const savedMonths = response.activityRetentionMonths;
|
|
2438
|
+
// The cache keeps the value for a tab change or a remount.
|
|
2439
|
+
const cached = getOrgInfo(orgId);
|
|
2440
|
+
if (cached) {
|
|
2441
|
+
setOrgInfo(orgId, {
|
|
2442
|
+
...cached,
|
|
2443
|
+
activityRetentionMonths: savedMonths,
|
|
2444
|
+
});
|
|
2445
|
+
}
|
|
2446
|
+
// The owner can switch the org during the save. The response must
|
|
2447
|
+
// not change the org that shows now.
|
|
2448
|
+
const current = orgRef.current;
|
|
2449
|
+
if (!current || current['uuid'] !== orgId) {
|
|
2450
|
+
return;
|
|
2451
|
+
}
|
|
2452
|
+
const nextOrg = { ...current, activityRetentionMonths: savedMonths };
|
|
2453
|
+
orgRef.current = nextOrg;
|
|
2454
|
+
setOrg(nextOrg);
|
|
2455
|
+
},
|
|
2383
2456
|
onToggleEarlyAccessFeature: (featureId) => {
|
|
2384
2457
|
const feature = features.find((f) => f.id === featureId);
|
|
2385
2458
|
if (!feature) {
|
|
@@ -2438,6 +2511,31 @@ export const C4ManagementApp = observer(({ orgId, embedded = false, environments
|
|
|
2438
2511
|
consequence: safeTranslate(t, 'orgmanagement:tabs.settings.orgmanagement.deleteConsequence', 'This action cannot be undone.'),
|
|
2439
2512
|
buttonLabel: safeTranslate(t, 'orgmanagement:tabs.overview.actions.deleteOrg', 'Delete organization'),
|
|
2440
2513
|
},
|
|
2514
|
+
activityRetention: {
|
|
2515
|
+
title: safeTranslate(t, 'orgmanagement:tabs.settings.orgmanagement.activityRetention.title', 'Activity retention'),
|
|
2516
|
+
description: safeTranslate(t, 'orgmanagement:tabs.settings.orgmanagement.activityRetention.description', 'Choose how long to keep Activity entries.'),
|
|
2517
|
+
options: Object.fromEntries(ACTIVITY_RETENTION_CHOICES.map((months) => [
|
|
2518
|
+
months,
|
|
2519
|
+
safeTranslate(t, `orgmanagement:tabs.settings.orgmanagement.activityRetention.options.${months}`, activityRetentionLabel(months)),
|
|
2520
|
+
])),
|
|
2521
|
+
saveButton: safeTranslate(t, 'orgmanagement:tabs.settings.orgmanagement.activityRetention.saveButton', 'Save'),
|
|
2522
|
+
readOnlyLimited: retentionNoteFor,
|
|
2523
|
+
readOnlyNotSet: safeTranslate(t, 'orgmanagement:tabs.settings.orgmanagement.activityRetention.readOnlyNotSet', 'Not set. Camunda decides when to delete older entries.'),
|
|
2524
|
+
dialogTitle: safeTranslate(t, 'orgmanagement:tabs.settings.orgmanagement.activityRetention.dialogTitle', 'Delete older Activity entries?'),
|
|
2525
|
+
dialogIntro: safeTranslate(t, 'orgmanagement:tabs.settings.orgmanagement.activityRetention.dialogIntro', "You're changing Activity retention from *{{previous}}* to *{{period}}*."),
|
|
2526
|
+
dialogSummary: safeTranslate(t, 'orgmanagement:tabs.settings.orgmanagement.activityRetention.dialogSummary', 'Once you save, Camunda keeps Activity entries for {{period}}. Each day, it deletes entries that pass that age.'),
|
|
2527
|
+
dialogNextHeading: safeTranslate(t, 'orgmanagement:tabs.settings.orgmanagement.activityRetention.dialogNextHeading', 'What happens next'),
|
|
2528
|
+
dialogNext1: safeTranslate(t, 'orgmanagement:tabs.settings.orgmanagement.activityRetention.dialogNext1', 'Within 2 days, Camunda deletes all Activity entries from before *{{date}}*.'),
|
|
2529
|
+
dialogNext2: safeTranslate(t, 'orgmanagement:tabs.settings.orgmanagement.activityRetention.dialogNext2', "After that, entries are deleted every day once they're older than {{period}}."),
|
|
2530
|
+
dialogNext3: safeTranslate(t, 'orgmanagement:tabs.settings.orgmanagement.activityRetention.dialogNext3', 'Deleted entries no longer show in the Activity tab, CSV exports or the Activity API.'),
|
|
2531
|
+
dialogBeforeHeading: safeTranslate(t, 'orgmanagement:tabs.settings.orgmanagement.activityRetention.dialogBeforeHeading', 'Before you continue'),
|
|
2532
|
+
dialogBefore1: safeTranslate(t, 'orgmanagement:tabs.settings.orgmanagement.activityRetention.dialogBefore1', "You can't undo this. Deleted entries can't be restored, even if you choose a longer period later."),
|
|
2533
|
+
dialogBefore2: safeTranslate(t, 'orgmanagement:tabs.settings.orgmanagement.activityRetention.dialogBefore2', 'If you need these entries for audits or compliance, export them as CSV first.'),
|
|
2534
|
+
dialogBefore3: safeTranslate(t, 'orgmanagement:tabs.settings.orgmanagement.activityRetention.dialogBefore3', 'Everyone in the organization sees a note on the Activity tab saying older entries are deleted.'),
|
|
2535
|
+
cancel: safeTranslate(t, 'orgmanagement:tabs.settings.orgmanagement.activityRetention.cancel', 'Cancel'),
|
|
2536
|
+
confirm: safeTranslate(t, 'orgmanagement:tabs.settings.orgmanagement.activityRetention.confirm', 'Delete and save'),
|
|
2537
|
+
saveError: safeTranslate(t, 'orgmanagement:tabs.settings.orgmanagement.activityRetention.saveError', "Couldn't save the retention period. Try again."),
|
|
2538
|
+
},
|
|
2441
2539
|
earlyAccess: {
|
|
2442
2540
|
title: safeTranslate(t, 'orgmanagement:tabs.settings.dataListTitle', 'Early access'),
|
|
2443
2541
|
description0: safeTranslate(t, 'orgmanagement:tabs.settings.description0', 'Try new features before general availability.'),
|
|
@@ -2465,6 +2563,7 @@ export const C4ManagementApp = observer(({ orgId, embedded = false, environments
|
|
|
2465
2563
|
earlyAccessDocsUrl: externalUrls.earlyAccessDocsUrl,
|
|
2466
2564
|
};
|
|
2467
2565
|
}, [
|
|
2566
|
+
activityRetentionMonths,
|
|
2468
2567
|
apiConfig,
|
|
2469
2568
|
externalUrls.earlyAccessDocsUrl,
|
|
2470
2569
|
features,
|
|
@@ -2475,15 +2574,19 @@ export const C4ManagementApp = observer(({ orgId, embedded = false, environments
|
|
|
2475
2574
|
org,
|
|
2476
2575
|
orgId,
|
|
2477
2576
|
recentlyAcceptedBeta,
|
|
2577
|
+
reconcileActivityRetention,
|
|
2478
2578
|
resolvedUserEmail,
|
|
2479
2579
|
runtime.clickwrap?.betaGroupKey,
|
|
2480
2580
|
runtime.user?.email,
|
|
2581
|
+
retentionNoteFor,
|
|
2481
2582
|
settingsError,
|
|
2482
2583
|
settingsLoading,
|
|
2483
2584
|
syncSettingsCache,
|
|
2484
2585
|
t,
|
|
2485
2586
|
getEarlyAccessFeatures,
|
|
2587
|
+
getOrgInfo,
|
|
2486
2588
|
setEarlyAccessFeatures,
|
|
2589
|
+
setOrgInfo,
|
|
2487
2590
|
]);
|
|
2488
2591
|
const activityProps = useMemo(() => {
|
|
2489
2592
|
const memberByUserId = new Map(members
|
|
@@ -2544,8 +2647,20 @@ export const C4ManagementApp = observer(({ orgId, embedded = false, environments
|
|
|
2544
2647
|
nameColumnLabel: safeTranslate(t, 'orgmanagement:tabs.activity.columns.name', 'Name'),
|
|
2545
2648
|
timestampColumnLabel: safeTranslate(t, 'orgmanagement:tabs.activity.columns.timestamp', 'Timestamp'),
|
|
2546
2649
|
auditColumnLabel: safeTranslate(t, 'orgmanagement:tabs.activity.columns.audit', 'Audit'),
|
|
2650
|
+
...(activityRetentionMonths !== undefined &&
|
|
2651
|
+
isLimitedActivityRetention(activityRetentionMonths)
|
|
2652
|
+
? {
|
|
2653
|
+
retentionNote: retentionNoteFor(safeTranslate(t, `orgmanagement:tabs.settings.orgmanagement.activityRetention.options.${activityRetentionMonths}`, activityRetentionLabel(activityRetentionMonths))),
|
|
2654
|
+
retentionSettingsLabel: safeTranslate(t, 'orgmanagement:tabs.activity.retentionSettingsLink', 'View in Settings'),
|
|
2655
|
+
retentionSettingsHref: getTabHref?.('settings'),
|
|
2656
|
+
onOpenRetentionSettings: () => changeTab('settings'),
|
|
2657
|
+
}
|
|
2658
|
+
: {}),
|
|
2547
2659
|
};
|
|
2548
2660
|
}, [
|
|
2661
|
+
activityRetentionMonths,
|
|
2662
|
+
changeTab,
|
|
2663
|
+
getTabHref,
|
|
2549
2664
|
audits,
|
|
2550
2665
|
auditsDownloading,
|
|
2551
2666
|
auditsLoading,
|
|
@@ -2554,6 +2669,7 @@ export const C4ManagementApp = observer(({ orgId, embedded = false, environments
|
|
|
2554
2669
|
getAuditTimestampMs,
|
|
2555
2670
|
members,
|
|
2556
2671
|
orgId,
|
|
2672
|
+
retentionNoteFor,
|
|
2557
2673
|
t,
|
|
2558
2674
|
]);
|
|
2559
2675
|
const apiClientPermissions = useMemo(() => {
|
|
@@ -58,6 +58,12 @@ export interface C4ManagementAppProps {
|
|
|
58
58
|
desiredTabId?: string;
|
|
59
59
|
onTabChange?: (tabId: string) => void;
|
|
60
60
|
onNavigate?: (event: C4ManagementNavigateEvent) => void;
|
|
61
|
+
/**
|
|
62
|
+
* Returns the URL of a tab of this page, for a link that can open in a new
|
|
63
|
+
* tab. A click on the link still calls `onTabChange`. Without it, the widget
|
|
64
|
+
* shows no link to another tab.
|
|
65
|
+
*/
|
|
66
|
+
getTabHref?: (tabId: string) => string;
|
|
61
67
|
/**
|
|
62
68
|
* Temporary escape hatch while migrating: pass existing tabs from the host.
|
|
63
69
|
* The widget will replace the tabs it owns by ID (overview/users/settings).
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import type { ActivityRetentionMonths } from '@camunda/ccma-shared-types';
|
|
1
2
|
import type { JSX } from 'react';
|
|
2
3
|
import type { C4ManagementSettingsProps, EarlyAccessFeature } from '../../../components/c4-management-settings/c4-management-settings.types.js';
|
|
3
4
|
export interface C4ManagementSettingsTabProps {
|
|
@@ -5,6 +6,7 @@ export interface C4ManagementSettingsTabProps {
|
|
|
5
6
|
orgName: string;
|
|
6
7
|
hasAcceptedBetaTerms: boolean;
|
|
7
8
|
suppressDropDisks: boolean;
|
|
9
|
+
activityRetentionMonths?: number;
|
|
8
10
|
earlyAccessFeatures: EarlyAccessFeature[];
|
|
9
11
|
recentlyAcceptedBeta: boolean;
|
|
10
12
|
loading: boolean;
|
|
@@ -15,6 +17,7 @@ export interface C4ManagementSettingsTabProps {
|
|
|
15
17
|
maySuppressDropDisks: boolean;
|
|
16
18
|
mayToggleEarlyAccessFeatures: boolean;
|
|
17
19
|
mayOptInToBeta: boolean;
|
|
20
|
+
mayChangeActivityRetention: boolean;
|
|
18
21
|
};
|
|
19
22
|
clickwrapAccessId?: string;
|
|
20
23
|
clickwrapBetaGroupKey?: string;
|
|
@@ -29,6 +32,7 @@ export interface C4ManagementSettingsTabProps {
|
|
|
29
32
|
onLeaveOrganization: () => void;
|
|
30
33
|
onDeleteOrganization: () => void;
|
|
31
34
|
onToggleSuppressDropDisks: () => void;
|
|
35
|
+
onChangeActivityRetention: (months: ActivityRetentionMonths) => Promise<void>;
|
|
32
36
|
onToggleEarlyAccessFeature: (featureId: string) => void;
|
|
33
37
|
onAcceptBetaTerms: () => Promise<void>;
|
|
34
38
|
onAcceptFeatureTerms: (featureId: string) => void;
|
|
@@ -37,4 +41,4 @@ export interface C4ManagementSettingsTabProps {
|
|
|
37
41
|
text: C4ManagementSettingsProps['text'];
|
|
38
42
|
earlyAccessDocsUrl: string;
|
|
39
43
|
}
|
|
40
|
-
export declare const C4ManagementSettingsTab: ({ orgId, orgName, hasAcceptedBetaTerms, suppressDropDisks, earlyAccessFeatures, recentlyAcceptedBeta, loading, error, permissions, clickwrapAccessId, clickwrapBetaGroupKey, runtime, t, onLeaveOrganization, onDeleteOrganization, onToggleSuppressDropDisks, onToggleEarlyAccessFeature, onAcceptBetaTerms, onAcceptFeatureTerms, onShareFeedback, onRetry, text, earlyAccessDocsUrl, }: C4ManagementSettingsTabProps) => JSX.Element;
|
|
44
|
+
export declare const C4ManagementSettingsTab: ({ orgId, orgName, hasAcceptedBetaTerms, suppressDropDisks, activityRetentionMonths, earlyAccessFeatures, recentlyAcceptedBeta, loading, error, permissions, clickwrapAccessId, clickwrapBetaGroupKey, runtime, t, onLeaveOrganization, onDeleteOrganization, onToggleSuppressDropDisks, onChangeActivityRetention, onToggleEarlyAccessFeature, onAcceptBetaTerms, onAcceptFeatureTerms, onShareFeedback, onRetry, text, earlyAccessDocsUrl, }: C4ManagementSettingsTabProps) => JSX.Element;
|
|
@@ -1,15 +1,10 @@
|
|
|
1
1
|
import { jsx as _jsx, Fragment as _Fragment, 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
2
|
import { PSClickWrap } from '@pactsafe/pactsafe-react-sdk';
|
|
8
3
|
import { useState } from 'react';
|
|
9
4
|
import { C4ManagementSettings } from '../../../components/c4-management-settings/c4-management-settings.js';
|
|
10
5
|
import { Modal, Stack } from '../../../ui/index.js';
|
|
11
6
|
import { safeTranslate } from '../../../utils/safe-translate.js';
|
|
12
|
-
export const C4ManagementSettingsTab = ({ orgId, orgName, hasAcceptedBetaTerms, suppressDropDisks, earlyAccessFeatures, recentlyAcceptedBeta, loading, error, permissions, clickwrapAccessId, clickwrapBetaGroupKey, runtime, t, onLeaveOrganization, onDeleteOrganization, onToggleSuppressDropDisks, onToggleEarlyAccessFeature, onAcceptBetaTerms, onAcceptFeatureTerms, onShareFeedback, onRetry, text, earlyAccessDocsUrl, }) => {
|
|
7
|
+
export const C4ManagementSettingsTab = ({ orgId, orgName, hasAcceptedBetaTerms, suppressDropDisks, activityRetentionMonths, earlyAccessFeatures, recentlyAcceptedBeta, loading, error, permissions, clickwrapAccessId, clickwrapBetaGroupKey, runtime, t, onLeaveOrganization, onDeleteOrganization, onToggleSuppressDropDisks, onChangeActivityRetention, onToggleEarlyAccessFeature, onAcceptBetaTerms, onAcceptFeatureTerms, onShareFeedback, onRetry, text, earlyAccessDocsUrl, }) => {
|
|
13
8
|
const [clickwrapOpen, setClickwrapOpen] = useState(false);
|
|
14
9
|
const [clickwrapGroupKey, setClickwrapGroupKey] = useState(undefined);
|
|
15
10
|
const [clickwrapFeatureId, setClickwrapFeatureId] = useState(undefined);
|
|
@@ -29,6 +24,7 @@ export const C4ManagementSettingsTab = ({ orgId, orgName, hasAcceptedBetaTerms,
|
|
|
29
24
|
organizationName: orgName,
|
|
30
25
|
hasAcceptedBetaTerms,
|
|
31
26
|
suppressDropDisks,
|
|
27
|
+
activityRetentionMonths,
|
|
32
28
|
earlyAccessFeatures,
|
|
33
29
|
recentlyAcceptedBeta,
|
|
34
30
|
loading,
|
|
@@ -37,6 +33,7 @@ export const C4ManagementSettingsTab = ({ orgId, orgName, hasAcceptedBetaTerms,
|
|
|
37
33
|
onLeaveOrganization,
|
|
38
34
|
onDeleteOrganization,
|
|
39
35
|
onToggleSuppressDropDisks,
|
|
36
|
+
onChangeActivityRetention,
|
|
40
37
|
onToggleEarlyAccessFeature,
|
|
41
38
|
onOptInToBeta: () => {
|
|
42
39
|
// For beta opt-in, no feature ID is set
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@camunda/ccma-saas-frontend",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.28.0",
|
|
4
4
|
"description": "Camunda Composite Components",
|
|
5
5
|
"bugs": {
|
|
6
6
|
"url": "https://github.com/camunda/camunda-cloud-management-apps/issues"
|
|
@@ -85,8 +85,8 @@
|
|
|
85
85
|
"react-markdown": "^8.0.7 || ^10.0.0"
|
|
86
86
|
},
|
|
87
87
|
"dependencies": {
|
|
88
|
-
"@camunda/ccma-api": "7.8.
|
|
89
|
-
"@camunda/ccma-shared-types": "12.10.
|
|
88
|
+
"@camunda/ccma-api": "7.8.2",
|
|
89
|
+
"@camunda/ccma-shared-types": "12.10.1",
|
|
90
90
|
"@pactsafe/pactsafe-react-sdk": "2.15.0",
|
|
91
91
|
"cron-parser": "5.10.2",
|
|
92
92
|
"mobx": "6.16.1",
|