@camunda/ccma-saas-frontend 0.5.0 → 0.6.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-charts-dashboard/elements/bar-chart.js +2 -2
- package/lib/esm/components/c4-cluster-client-credentials/c4-cluster-client-credentials.js +1 -1
- package/lib/esm/components/c4-cluster-client-credentials-identity/c4-cluster-client-credentials-identity.js +1 -1
- package/lib/esm/components/c4-cluster-details-encryption/c4-cluster-details-encryption.d.ts +1 -1
- package/lib/esm/components/c4-cluster-details-encryption/c4-cluster-details-encryption.js +24 -1
- package/lib/esm/components/c4-cluster-details-encryption/c4-cluster-details-encryption.types.d.ts +14 -1
- package/lib/esm/components/c4-cluster-list/c4-cluster-list.d.ts +1 -1
- package/lib/esm/components/c4-cluster-list/c4-cluster-list.js +24 -9
- package/lib/esm/components/c4-cluster-list/c4-cluster-list.types.d.ts +6 -0
- package/lib/esm/components/c4-cluster-overview/cluster-details.d.ts +2 -0
- package/lib/esm/components/c4-cluster-overview/cluster-details.js +10 -1
- package/lib/esm/components/c4-invite-user-to-organization-modal/c4-invite-user-to-organization-modal.js +15 -8
- package/lib/esm/components/c4-invite-user-to-organization-modal/c4-invite-user-to-organization-modal.types.d.ts +1 -0
- package/lib/esm/components/c4-structured-list/c4-structured-list.js +15 -1
- package/lib/esm/components/shared-charts/ds-line-chart.js +2 -2
- package/lib/esm/components/shared-charts/recharts-tokens.d.ts +24 -9
- package/lib/esm/components/shared-charts/recharts-tokens.js +40 -13
- package/lib/esm/i18n/en/entities/orgroles.json +26 -0
- package/lib/esm/i18n/en/modals/backups.json +2 -0
- package/lib/esm/i18n/en/pages/clusterdetails.json +1 -0
- package/lib/esm/i18n/en/pages/clusters.json +4 -1
- package/lib/esm/runtime/nav/use-webapp-nav-data.d.ts +18 -0
- package/lib/esm/runtime/nav/use-webapp-nav-data.js +39 -15
- package/lib/esm/utils/role-labels.d.ts +25 -7
- package/lib/esm/utils/role-labels.js +94 -13
- package/lib/esm/widgets/cluster-details/c4-cluster-details-app.js +11 -2
- package/lib/esm/widgets/cluster-details/tabs/c4-cluster-details-encryption-tab.d.ts +2 -0
- package/lib/esm/widgets/cluster-details/tabs/c4-cluster-details-encryption-tab.js +16 -3
- package/lib/esm/widgets/cluster-details/tabs/c4-cluster-details-hot-backups-tab.d.ts +19 -0
- package/lib/esm/widgets/cluster-details/tabs/c4-cluster-details-hot-backups-tab.js +108 -58
- package/lib/esm/widgets/cluster-details/tabs/c4-cluster-details-overview-tab.js +3 -0
- package/lib/esm/widgets/cluster-details/tabs/c4-cluster-details-settings-tab.js +2 -8
- package/lib/esm/widgets/clusters/c4-clusters-page.js +18 -1
- package/lib/esm/widgets/clusters/c4-clusters-page.types.d.ts +4 -0
- package/lib/esm/widgets/management/c4-management-app.d.ts +1 -1
- package/lib/esm/widgets/management/c4-management-app.js +38 -56
- package/lib/esm/widgets/management/c4-management-app.types.d.ts +2 -0
- package/lib/esm/widgets/management/tabs/c4-management-users-tab.d.ts +2 -1
- package/lib/esm/widgets/management/tabs/c4-management-users-tab.js +46 -17
- 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 +22 -8
- package/lib/esm/widgets/user-details/c4-user-details-page.types.d.ts +2 -0
- package/package.json +11 -11
|
@@ -32,11 +32,21 @@ function convertFeWeekdayToCron(weekday) {
|
|
|
32
32
|
}
|
|
33
33
|
return weekday + 1;
|
|
34
34
|
}
|
|
35
|
-
function parseCronSchedule(schedule) {
|
|
35
|
+
export function parseCronSchedule(schedule) {
|
|
36
36
|
try {
|
|
37
37
|
const cron = CronExpressionParser.parse(schedule);
|
|
38
38
|
const isHourly = cron.fields.hour.values.length > 1;
|
|
39
39
|
if (isHourly) {
|
|
40
|
+
// Sub-hourly schedules reuse the "every hour" hour-field (all 24
|
|
41
|
+
// values) with extra minute marks layered on top — see
|
|
42
|
+
// `buildScheduleCronOverrides`.
|
|
43
|
+
const minuteCount = cron.fields.minute.values.length;
|
|
44
|
+
if (minuteCount === 4) {
|
|
45
|
+
return { frequency: 'Every 15 minutes' };
|
|
46
|
+
}
|
|
47
|
+
if (minuteCount === 2) {
|
|
48
|
+
return { frequency: 'Every 30 minutes' };
|
|
49
|
+
}
|
|
40
50
|
return { frequency: 'Hourly' };
|
|
41
51
|
}
|
|
42
52
|
const hour = Number(cron.fields.hour.values[0]);
|
|
@@ -84,12 +94,81 @@ function parseCronSchedule(schedule) {
|
|
|
84
94
|
};
|
|
85
95
|
}
|
|
86
96
|
}
|
|
97
|
+
const SUB_HOURLY_MINUTES = {
|
|
98
|
+
'15min': [0, 15, 30, 45],
|
|
99
|
+
'30min': [0, 30],
|
|
100
|
+
};
|
|
101
|
+
export function buildScheduleCronOverrides(frequency, startingHour, startingMinute, weekdays) {
|
|
102
|
+
const totalHours = 24;
|
|
103
|
+
const spansAllHours = frequency === 'hourly' || frequency === '15min' || frequency === '30min';
|
|
104
|
+
const hours = spansAllHours
|
|
105
|
+
? Array.from({ length: totalHours }, (_, index) => index)
|
|
106
|
+
: [startingHour];
|
|
107
|
+
const fieldOverrides = {
|
|
108
|
+
hour: hours,
|
|
109
|
+
minute: SUB_HOURLY_MINUTES[frequency] ?? [startingMinute],
|
|
110
|
+
};
|
|
111
|
+
if (frequency === 'weekly') {
|
|
112
|
+
// Guard against an unrecognized weekday name: `indexOf` would otherwise
|
|
113
|
+
// return -1, and `convertFeWeekdayToCron(-1)` silently yields 0 (Sunday),
|
|
114
|
+
// injecting a day the user never selected.
|
|
115
|
+
fieldOverrides.dayOfWeek = weekdays
|
|
116
|
+
.filter((day) => WEEKDAYS.includes(day))
|
|
117
|
+
.map((day) => convertFeWeekdayToCron(WEEKDAYS.indexOf(day)));
|
|
118
|
+
}
|
|
119
|
+
return fieldOverrides;
|
|
120
|
+
}
|
|
121
|
+
// Derives the "Edit schedule" modal's form state from an existing schedule's
|
|
122
|
+
// cron string. Mirrors `parseCronSchedule`'s hour/minute reading (same
|
|
123
|
+
// sub-hourly-spans-all-24-hours shape from `buildScheduleCronOverrides`), but
|
|
124
|
+
// returns the internal `ScheduleFrequency` value plus local start time /
|
|
125
|
+
// weekdays for populating the editable form, rather than a display label.
|
|
126
|
+
// Returns `undefined` for an unparseable schedule.
|
|
127
|
+
export function deriveScheduleFormState(schedule) {
|
|
128
|
+
try {
|
|
129
|
+
const cron = CronExpressionParser.parse(schedule);
|
|
130
|
+
const isHourly = cron.fields.hour.values.length > 1;
|
|
131
|
+
// Convert UTC time to local time
|
|
132
|
+
const utcHour = Number(cron.fields.hour.values[0]);
|
|
133
|
+
const utcMinute = Number(cron.fields.minute.values[0]);
|
|
134
|
+
const utcDate = new Date();
|
|
135
|
+
utcDate.setUTCHours(utcHour);
|
|
136
|
+
utcDate.setUTCMinutes(utcMinute);
|
|
137
|
+
const localTime = `${String(utcDate.getHours()).padStart(2, '0')}:${String(utcDate.getMinutes()).padStart(2, '0')}`;
|
|
138
|
+
if (isHourly) {
|
|
139
|
+
const minuteCount = cron.fields.minute.values.length;
|
|
140
|
+
const frequency = minuteCount === 4 ? '15min' : minuteCount === 2 ? '30min' : 'hourly';
|
|
141
|
+
return { frequency, startingTime: '00:00', weekdays: [] };
|
|
142
|
+
}
|
|
143
|
+
const isDaily = cron.fields.dayOfWeek.values.length === 0 ||
|
|
144
|
+
cron.fields.dayOfWeek.values.length === 8;
|
|
145
|
+
if (isDaily) {
|
|
146
|
+
return { frequency: 'daily', startingTime: localTime, weekdays: [] };
|
|
147
|
+
}
|
|
148
|
+
const weekdays = cron.fields.dayOfWeek.values.filter((day) => typeof day === 'number')
|
|
149
|
+
.map((day) => WEEKDAYS[convertCronWeekdayToFe(day)])
|
|
150
|
+
.filter((weekday) => Boolean(weekday));
|
|
151
|
+
return { frequency: 'weekly', startingTime: localTime, weekdays };
|
|
152
|
+
}
|
|
153
|
+
catch {
|
|
154
|
+
return undefined;
|
|
155
|
+
}
|
|
156
|
+
}
|
|
87
157
|
function toDateOrDash(value) {
|
|
88
158
|
if (!value)
|
|
89
159
|
return '-';
|
|
90
160
|
const date = value instanceof Date ? value : new Date(String(value));
|
|
91
161
|
return Number.isNaN(date.getTime()) ? '-' : date;
|
|
92
162
|
}
|
|
163
|
+
// Manual (on-demand) backups are created with `generateName: 'on-demand-'`
|
|
164
|
+
// (k8sHotBackup.controller.ts); scheduled ones are named `scheduled-...` by
|
|
165
|
+
// the operator. There's no dedicated field on BackupDto for this — the name
|
|
166
|
+
// prefix is the only signal. Checked on `name`, not `uuid`, to match the
|
|
167
|
+
// backend's own throttle check (k8sHotBackup.controller.ts) in case the two
|
|
168
|
+
// ever diverge.
|
|
169
|
+
function isManualBackup(backup) {
|
|
170
|
+
return backup.name.includes('on-demand');
|
|
171
|
+
}
|
|
93
172
|
function safeTranslate(t, key, fallback) {
|
|
94
173
|
if (!t)
|
|
95
174
|
return fallback;
|
|
@@ -98,7 +177,13 @@ function safeTranslate(t, key, fallback) {
|
|
|
98
177
|
}
|
|
99
178
|
const C4ClusterDetailsHotBackupsTabImpl = (props) => {
|
|
100
179
|
const { Select, SelectItem } = useSelectFamily();
|
|
101
|
-
const { cluster, orgId, clusterId, apiConfig, canMutateCluster, isHotBackupEnabled, docsUrls, t, onNavigate, onReloadCluster, } = props;
|
|
180
|
+
const { cluster, orgId, clusterId, apiConfig, canMutateCluster, isHotBackupEnabled, manualBackupRetainedCount, scheduledBackupRetainedCount, docsUrls, t, onNavigate, onReloadCluster, } = props;
|
|
181
|
+
// The operator (BackupRetention CR / BackupSchedule history limits) falls
|
|
182
|
+
// back to 3 whenever the org has no override — see hotBackupManualRetainedCount
|
|
183
|
+
// / hotBackupScheduledRetainedCount in SalesPlan.dto.ts.
|
|
184
|
+
const manualRetainedCount = manualBackupRetainedCount ?? 3;
|
|
185
|
+
const scheduledRetainedCount = scheduledBackupRetainedCount ?? 3;
|
|
186
|
+
const minCreatePeriodMinutes = HOTBACKUP_MIN_CREATE_PERIOD / (60 * 1000);
|
|
102
187
|
const data = useC4ConsoleData();
|
|
103
188
|
const runtime = useC4ConsoleRuntime();
|
|
104
189
|
const { add: addNotification } = useC4ConsoleNotifications();
|
|
@@ -238,7 +323,7 @@ const C4ClusterDetailsHotBackupsTabImpl = (props) => {
|
|
|
238
323
|
uuid: backup.uuid,
|
|
239
324
|
name: backup.name,
|
|
240
325
|
status: backup.status,
|
|
241
|
-
type: backup
|
|
326
|
+
type: isManualBackup(backup) ? 'Manual' : 'Scheduled',
|
|
242
327
|
started: toDateOrDash(backup.created),
|
|
243
328
|
completed: toDateOrDash(backup.completed),
|
|
244
329
|
// Resolved server-side from the backup's `generationUuid` label. Falls
|
|
@@ -256,7 +341,12 @@ const C4ClusterDetailsHotBackupsTabImpl = (props) => {
|
|
|
256
341
|
tasklistStatus: String(backup.tasklistStatus),
|
|
257
342
|
optimizeStatus: String(backup.optimizeStatus),
|
|
258
343
|
}));
|
|
344
|
+
// Only manual backups count toward the 15-minute throttle: a scheduled run
|
|
345
|
+
// (now possibly every 15/30 minutes) must never block the customer from
|
|
346
|
+
// creating a manual backup — matches the backend's own check in
|
|
347
|
+
// k8sHotBackup.controller.ts.
|
|
259
348
|
const lastCreatedTimestamp = Math.max(...hotBackups
|
|
349
|
+
.filter(isManualBackup)
|
|
260
350
|
.map((b) => toDateOrDash(b.created))
|
|
261
351
|
.filter((d) => d !== '-')
|
|
262
352
|
.map((d) => d.getTime()), 0);
|
|
@@ -381,45 +471,14 @@ const C4ClusterDetailsHotBackupsTabImpl = (props) => {
|
|
|
381
471
|
setBackupMutationError('');
|
|
382
472
|
setScheduleStartingTimeInvalid(false);
|
|
383
473
|
const schedule = backupSchedule?.schedule ?? '';
|
|
384
|
-
|
|
385
|
-
|
|
386
|
-
|
|
387
|
-
|
|
388
|
-
|
|
389
|
-
|
|
390
|
-
|
|
391
|
-
|
|
392
|
-
utcDate.setUTCHours(utcHour);
|
|
393
|
-
utcDate.setUTCMinutes(utcMinute);
|
|
394
|
-
const localHour = utcDate.getHours();
|
|
395
|
-
const localMinute = utcDate.getMinutes();
|
|
396
|
-
if (isHourly) {
|
|
397
|
-
setScheduleFrequency('hourly');
|
|
398
|
-
setScheduleStartingTime('00:00');
|
|
399
|
-
setScheduleWeekdays([]);
|
|
400
|
-
}
|
|
401
|
-
else if (cron.fields.dayOfWeek.values.length === 0 ||
|
|
402
|
-
cron.fields.dayOfWeek.values.length === 8) {
|
|
403
|
-
setScheduleFrequency('daily');
|
|
404
|
-
setScheduleStartingTime(`${String(localHour).padStart(2, '0')}:${String(localMinute).padStart(2, '0')}`);
|
|
405
|
-
setScheduleWeekdays([]);
|
|
406
|
-
}
|
|
407
|
-
else {
|
|
408
|
-
setScheduleFrequency('weekly');
|
|
409
|
-
setScheduleStartingTime(`${String(localHour).padStart(2, '0')}:${String(localMinute).padStart(2, '0')}`);
|
|
410
|
-
setScheduleWeekdays(cron.fields.dayOfWeek.values.filter((day) => typeof day === 'number').map((day) => {
|
|
411
|
-
const index = convertCronWeekdayToFe(day);
|
|
412
|
-
return WEEKDAYS[index] ?? '';
|
|
413
|
-
}));
|
|
414
|
-
}
|
|
415
|
-
setScheduleIsCreate(false);
|
|
416
|
-
}
|
|
417
|
-
catch {
|
|
418
|
-
setScheduleFrequency('daily');
|
|
419
|
-
setScheduleStartingTime('00:00');
|
|
420
|
-
setScheduleWeekdays([]);
|
|
421
|
-
setScheduleIsCreate(true);
|
|
422
|
-
}
|
|
474
|
+
const derived = schedule
|
|
475
|
+
? deriveScheduleFormState(schedule)
|
|
476
|
+
: undefined;
|
|
477
|
+
if (derived) {
|
|
478
|
+
setScheduleFrequency(derived.frequency);
|
|
479
|
+
setScheduleStartingTime(derived.startingTime);
|
|
480
|
+
setScheduleWeekdays(derived.weekdays);
|
|
481
|
+
setScheduleIsCreate(false);
|
|
423
482
|
}
|
|
424
483
|
else {
|
|
425
484
|
setScheduleFrequency('daily');
|
|
@@ -483,7 +542,7 @@ const C4ClusterDetailsHotBackupsTabImpl = (props) => {
|
|
|
483
542
|
setBackupMutationBusy(false);
|
|
484
543
|
}
|
|
485
544
|
})();
|
|
486
|
-
}, children: _jsxs(Stack, { gap: 4, children: [backupMutationError && _jsx("p", { children: backupMutationError }), _jsxs("div", { children: ["You can create a manual backup every
|
|
545
|
+
}, children: _jsxs(Stack, { gap: 4, children: [backupMutationError && _jsx("p", { children: backupMutationError }), _jsxs("div", { children: ["You can create a manual backup every ", minCreatePeriodMinutes, ' ', "minutes. Only the ", manualRetainedCount, " most recent successful manual backups are kept. If you already have ", manualRetainedCount, ' ', "manual backups, the oldest manual backup is automatically removed to make space for the new backup. You can also have", ' ', scheduledRetainedCount, " scheduled backups in addition to your", ' ', manualRetainedCount, " manual backups.", ' ', _jsx("a", { href: docsUrls.hotBackups, target: '_blank', rel: 'noreferrer', onClick: () => {
|
|
487
546
|
trackDocsOpen('cluster-backups', docsUrls.hotBackups);
|
|
488
547
|
onNavigate?.({
|
|
489
548
|
kind: 'openUrl',
|
|
@@ -628,18 +687,7 @@ const C4ClusterDetailsHotBackupsTabImpl = (props) => {
|
|
|
628
687
|
time.setMinutes(Number(minuteStr));
|
|
629
688
|
const startingHour = time.getUTCHours();
|
|
630
689
|
const startingMinute = time.getUTCMinutes();
|
|
631
|
-
const
|
|
632
|
-
let hours = [startingHour];
|
|
633
|
-
if (scheduleFrequency === 'hourly') {
|
|
634
|
-
hours = Array.from({ length: totalHours }, (_, index) => index);
|
|
635
|
-
}
|
|
636
|
-
const fieldOverrides = {
|
|
637
|
-
hour: hours,
|
|
638
|
-
minute: [startingMinute],
|
|
639
|
-
};
|
|
640
|
-
if (scheduleFrequency === 'weekly') {
|
|
641
|
-
fieldOverrides.dayOfWeek = scheduleWeekdays.map((day) => convertFeWeekdayToCron(WEEKDAYS.indexOf(day)));
|
|
642
|
-
}
|
|
690
|
+
const fieldOverrides = buildScheduleCronOverrides(scheduleFrequency, startingHour, startingMinute, scheduleWeekdays);
|
|
643
691
|
const exp = CronExpression.fieldsToExpression(CronFieldCollection.from(baseCron.fields, fieldOverrides));
|
|
644
692
|
await ConsoleBackupScheduleService.updateBackupSchedule({
|
|
645
693
|
config: apiConfig,
|
|
@@ -660,7 +708,7 @@ const C4ClusterDetailsHotBackupsTabImpl = (props) => {
|
|
|
660
708
|
setBackupMutationBusy(false);
|
|
661
709
|
}
|
|
662
710
|
})();
|
|
663
|
-
}, children: _jsxs(Stack, { gap: 6, children: [backupMutationError && _jsx("p", { children: backupMutationError }), _jsxs("p", { children: ["Only the
|
|
711
|
+
}, children: _jsxs(Stack, { gap: 6, children: [backupMutationError && _jsx("p", { children: backupMutationError }), _jsxs("p", { children: ["Only the ", scheduledRetainedCount, " most recent successful scheduled backups are kept. If you already have ", scheduledRetainedCount, ' ', "scheduled backups, the oldest scheduled backup is automatically removed to make space for the new backup. You can also have", ' ', manualRetainedCount, " manual backups in addition to your", ' ', scheduledRetainedCount, " scheduled backups.", ' ', _jsx("a", { href: docsUrls.hotBackups, target: '_blank', rel: 'noreferrer', onClick: () => {
|
|
664
712
|
trackDocsOpen('cluster-backups', docsUrls.hotBackups);
|
|
665
713
|
onNavigate?.({
|
|
666
714
|
kind: 'openUrl',
|
|
@@ -670,7 +718,7 @@ const C4ClusterDetailsHotBackupsTabImpl = (props) => {
|
|
|
670
718
|
const newFreq = event.target.value;
|
|
671
719
|
trackEvent(`listBackups:schedule:modal:confirm:${newFreq}`, `Selected backup frequency is ${newFreq} `, { create: scheduleIsCreate });
|
|
672
720
|
setScheduleFrequency(newFreq);
|
|
673
|
-
}, children: [_jsx(SelectItem, { value: 'hourly', text: 'Hourly' }, 'schedule-frequency-hourly'), _jsx(SelectItem, { value: 'daily', text: 'Daily' }, 'schedule-frequency-daily'), _jsx(SelectItem, { value: 'weekly', text: 'Weekly' }, 'schedule-frequency-weekly')] }), scheduleFrequency === 'weekly' && (_jsxs("fieldset", { className: 'cds--fieldset', children: [_jsx("legend", { className: 'cds--label', children: "Select days" }), _jsx("div", { style: {
|
|
721
|
+
}, children: [_jsx(SelectItem, { value: '15min', text: 'Every 15 minutes' }, 'schedule-frequency-15min'), _jsx(SelectItem, { value: '30min', text: 'Every 30 minutes' }, 'schedule-frequency-30min'), _jsx(SelectItem, { value: 'hourly', text: 'Hourly' }, 'schedule-frequency-hourly'), _jsx(SelectItem, { value: 'daily', text: 'Daily' }, 'schedule-frequency-daily'), _jsx(SelectItem, { value: 'weekly', text: 'Weekly' }, 'schedule-frequency-weekly')] }), scheduleFrequency === 'weekly' && (_jsxs("fieldset", { className: 'cds--fieldset', children: [_jsx("legend", { className: 'cds--label', children: "Select days" }), _jsx("div", { style: {
|
|
674
722
|
display: 'grid',
|
|
675
723
|
gridTemplateColumns: 'repeat(auto-fill, 120px)',
|
|
676
724
|
gridGap: '0px 0px',
|
|
@@ -692,7 +740,9 @@ const C4ClusterDetailsHotBackupsTabImpl = (props) => {
|
|
|
692
740
|
}, children: _jsx(TextInput, { id: 'backup-schedule-start-time', labelText: '', style: { minWidth: '120px' }, placeholder: 'hh:mm', value: scheduleStartingTime, onChange: (event) => {
|
|
693
741
|
setScheduleStartingTime(event.target.value);
|
|
694
742
|
setScheduleStartingTimeInvalid(false);
|
|
695
|
-
}, invalid: scheduleStartingTimeInvalid, invalidText: safeTranslate(t, 'backups:schedule.create.startingInvalidText', 'Required field'), type: 'time' }) }), "UTC ", -new Date().getTimezoneOffset() / 60 > 0 ? '+' : ' ', -new Date().getTimezoneOffset() / 60, ' ', safeTranslate(t, 'backups:schedule.create.timezone', '(local time zone)')] })), scheduleFrequency === '
|
|
743
|
+
}, invalid: scheduleStartingTimeInvalid, invalidText: safeTranslate(t, 'backups:schedule.create.startingInvalidText', 'Required field'), type: 'time' }) }), "UTC ", -new Date().getTimezoneOffset() / 60 > 0 ? '+' : ' ', -new Date().getTimezoneOffset() / 60, ' ', safeTranslate(t, 'backups:schedule.create.timezone', '(local time zone)')] })), (scheduleFrequency === '15min' || scheduleFrequency === '30min') && (_jsx("span", { children: safeTranslate(t, scheduleFrequency === '15min'
|
|
744
|
+
? 'backups:schedule.create.15min'
|
|
745
|
+
: 'backups:schedule.create.30min', `Create a backup every ${scheduleFrequency === '15min' ? '15' : '30'} minutes`) })), scheduleFrequency === 'hourly' && (_jsxs("div", { style: { display: 'flex', alignItems: 'center', gap: '4px' }, children: [_jsx("span", { children: safeTranslate(t, 'backups:schedule.create.hourly', 'Create a backup every hour starting at') }), _jsx("div", { style: { display: 'inline-block' }, children: `${(new Date().getUTCHours() + 1)
|
|
696
746
|
.toString()
|
|
697
747
|
.padStart(2, '0')}:${new Date()
|
|
698
748
|
.getUTCMinutes()
|
|
@@ -1487,6 +1487,9 @@ const C4ClusterDetailsOverviewTabImpl = (props) => {
|
|
|
1487
1487
|
},
|
|
1488
1488
|
wakeLabel: safeTranslate(t, 'clusterdetails:overview.clusterDetails.status.wakeLabel', 'Resume cluster'),
|
|
1489
1489
|
wakeVisibility: canWakeCluster && !isClusterPausedReconciliation && !restoreInProgress,
|
|
1490
|
+
wakeDisabledReason: cluster?.isFailoverSource === true
|
|
1491
|
+
? safeTranslate(t, 'clusterdetails:overview.clusterDetails.status.wakeDisabledFailoverSource', 'This cluster was failed over and can no longer be resumed.')
|
|
1492
|
+
: undefined,
|
|
1490
1493
|
sleepAction: canSleepCluster && !isClusterPausedReconciliation && !restoreInProgress
|
|
1491
1494
|
? async () => {
|
|
1492
1495
|
const { ConsoleClusterService } = await import('@camunda/ccma-api');
|
|
@@ -595,19 +595,13 @@ export const C4ClusterDetailsSettingsTab = (props) => {
|
|
|
595
595
|
const shouldShowExternalIdp = useMemo(() => {
|
|
596
596
|
return checkClusterVersion('8.10.0-alpha3') && isByoidpFeatureEnabled;
|
|
597
597
|
}, [checkClusterVersion, isByoidpFeatureEnabled]);
|
|
598
|
-
const isOptimizeFilteringFeatureEnabled = runtime.featureFlags?.isEnabled?.('console.optimizeFiltering') ?? false;
|
|
599
598
|
const shouldShowOptimizeFiltering = useMemo(() => {
|
|
600
599
|
return (
|
|
601
600
|
// `hasOptimize === false` means the plan allocates no Optimize replicas, so
|
|
602
601
|
// there is no Optimize deployment for these filters to configure.
|
|
603
602
|
props.cluster?.hasOptimize !== false &&
|
|
604
|
-
checkClusterVersion(OPTIMIZE_FILTERING_MIN_VERSION)
|
|
605
|
-
|
|
606
|
-
}, [
|
|
607
|
-
props.cluster?.hasOptimize,
|
|
608
|
-
checkClusterVersion,
|
|
609
|
-
isOptimizeFilteringFeatureEnabled,
|
|
610
|
-
]);
|
|
603
|
+
checkClusterVersion(OPTIMIZE_FILTERING_MIN_VERSION));
|
|
604
|
+
}, [props.cluster?.hasOptimize, checkClusterVersion]);
|
|
611
605
|
const isAppIntegrationsFeatureEnabled = runtime.featureFlags?.isEnabled?.('console.appIntegrations') ?? false;
|
|
612
606
|
const shouldShowAppIntegrations = useMemo(() => {
|
|
613
607
|
const zeebeVersion = props.cluster?.generation?.versions?.zeebe;
|
|
@@ -177,8 +177,10 @@ function buildDefaultTranslations(t) {
|
|
|
177
177
|
overflowMenu: {
|
|
178
178
|
delete: translate('c4console:clusters.list.overflowMenu.delete', 'Delete'),
|
|
179
179
|
resume: translate('c4console:clusters.list.overflowMenu.resume', 'Resume'),
|
|
180
|
+
resumeUnavailableFailoverSource: translate('c4console:clusters.list.overflowMenu.resumeUnavailableFailoverSource', 'Resume (unavailable — this cluster was failed over)'),
|
|
180
181
|
failover: translate('c4console:clusters.list.overflowMenu.failover', 'Failover'),
|
|
181
182
|
failoverSyncPending: translate('c4console:clusters.list.overflowMenu.failoverSyncPending', 'Failover (unavailable until backup data is synced to the secondary region)'),
|
|
183
|
+
failoverAlreadyFailedOver: translate('c4console:clusters.list.overflowMenu.failoverAlreadyFailedOver', 'Failover (unavailable — this cluster was already failed over)'),
|
|
182
184
|
},
|
|
183
185
|
tags: {
|
|
184
186
|
addLabel: translate('c4console:clusters.tags.addLabel', 'Add tag'),
|
|
@@ -857,6 +859,21 @@ export const C4ClustersPage = observer(({ orgId, gettingStartedHref, onNavigate,
|
|
|
857
859
|
}, [rawClusters, runtime.stage]);
|
|
858
860
|
const isMultiRegionClusterFallback = useCallback((clusterId) => multiRegionClusterIds.has(clusterId), [multiRegionClusterIds]);
|
|
859
861
|
const isFailoverSyncPending = useCallback((clusterId) => syncPendingClusterIds.has(clusterId), [syncPendingClusterIds]);
|
|
862
|
+
const failoverSourceClusterIds = useMemo(() => {
|
|
863
|
+
const ids = new Set();
|
|
864
|
+
for (const rawCluster of rawClusters) {
|
|
865
|
+
if (rawCluster.isFailoverSource !== true)
|
|
866
|
+
continue;
|
|
867
|
+
const clusterId = getString(rawCluster, 'id') ??
|
|
868
|
+
getString(rawCluster, 'clusterId') ??
|
|
869
|
+
getString(rawCluster, 'uuid') ??
|
|
870
|
+
getString(rawCluster, 'clusterUuid');
|
|
871
|
+
if (clusterId)
|
|
872
|
+
ids.add(clusterId);
|
|
873
|
+
}
|
|
874
|
+
return ids;
|
|
875
|
+
}, [rawClusters]);
|
|
876
|
+
const isFailoverSource = useCallback((clusterId) => failoverSourceClusterIds.has(clusterId), [failoverSourceClusterIds]);
|
|
860
877
|
const isPageLoading = isLoading || authz.isLoading;
|
|
861
878
|
useEffect(() => {
|
|
862
879
|
if (!error) {
|
|
@@ -867,7 +884,7 @@ export const C4ClustersPage = observer(({ orgId, gettingStartedHref, onNavigate,
|
|
|
867
884
|
orgId,
|
|
868
885
|
});
|
|
869
886
|
}, [error, orgId, runtime.telemetry]);
|
|
870
|
-
return (_jsxs(_Fragment, { children: [_jsx(C4ClusterList, { orgId: orgId, clusters: clusters, loading: isPageLoading, urls: urls, permissions: derivedPermissions, onNavigate: handleNavigate, onDeleteCluster: handleDeleteCluster, onAssignTag: handleAssignTag, onWakeCluster: handleWakeCluster, onFailoverCluster: handleFailoverCluster, trialNotification: derivedTrialNotification, encryptionNotification: encryptionNotification, clusterCapMessage: clusterCapMessage, emptyStateContent: derivedEmptyStateContent, translations: resolvedTranslations, isClusterPaused: isClusterPausedOverride ?? isClusterPausedFallback, isMultiRegionCluster: isMultiRegionClusterFallback, isFailoverSyncPending: isFailoverSyncPending, isRunningOnUnsupportedGeneration: isRunningOnUnsupportedGenerationOverride ??
|
|
887
|
+
return (_jsxs(_Fragment, { children: [_jsx(C4ClusterList, { orgId: orgId, clusters: clusters, loading: isPageLoading, urls: urls, permissions: derivedPermissions, onNavigate: handleNavigate, onDeleteCluster: handleDeleteCluster, onAssignTag: handleAssignTag, onWakeCluster: handleWakeCluster, onFailoverCluster: handleFailoverCluster, trialNotification: derivedTrialNotification, encryptionNotification: encryptionNotification, clusterCapMessage: clusterCapMessage, emptyStateContent: derivedEmptyStateContent, translations: resolvedTranslations, isClusterPaused: isClusterPausedOverride ?? isClusterPausedFallback, isMultiRegionCluster: isMultiRegionClusterFallback, isFailoverSyncPending: isFailoverSyncPending, isFailoverSource: isFailoverSource, isRunningOnUnsupportedGeneration: isRunningOnUnsupportedGenerationOverride ??
|
|
871
888
|
isRunningOnUnsupportedGenerationFallback }), deleteTarget ? (_jsx(Modal, { open: deleteModalOpen, danger: true, modalHeading: safeTranslate('clustermodals:delete.heading', 'Delete cluster'), primaryButtonText: safeTranslate('clustermodals:delete.buttons.primary', 'Delete'), secondaryButtonText: safeTranslate('clustermodals:delete.buttons.secondary', 'Cancel'), primaryButtonDisabled: deleteBusy || deleteConfirmation.trim() !== 'DELETE', onRequestClose: () => {
|
|
872
889
|
if (deleteBusy)
|
|
873
890
|
return;
|
|
@@ -26,9 +26,13 @@ export interface C4ClustersPageTranslations {
|
|
|
26
26
|
overflowMenu: {
|
|
27
27
|
delete: string;
|
|
28
28
|
resume: string;
|
|
29
|
+
/** Shown as the action label for a cluster that was failed over and can never be resumed. */
|
|
30
|
+
resumeUnavailableFailoverSource?: string;
|
|
29
31
|
failover?: string;
|
|
30
32
|
/** Shown as the action label while the initial secondary bucket sync is pending. */
|
|
31
33
|
failoverSyncPending?: string;
|
|
34
|
+
/** Shown as the action label for a cluster that was already failed over. */
|
|
35
|
+
failoverAlreadyFailedOver?: string;
|
|
32
36
|
};
|
|
33
37
|
tags: {
|
|
34
38
|
addLabel: string;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { type JSX } from 'react';
|
|
2
2
|
import type { C4ManagementAppProps } from './c4-management-app.types.js';
|
|
3
|
-
export declare const C4ManagementApp: (({ orgId, desiredTabId, onTabChange, onNavigate, legacyTabs, userPersonaRole, isLicensingModel2025: isLicensingModel2025Prop, tenantsValueMetricEnabled, hdpValueMetricsFor2025Enabled, urls, onNeedsReload, }: C4ManagementAppProps) => JSX.Element) & {
|
|
3
|
+
export declare const C4ManagementApp: (({ orgId, desiredTabId, onTabChange, onNavigate, legacyTabs, userPersonaRole, isLicensingModel2025: isLicensingModel2025Prop, tenantsValueMetricEnabled, hdpValueMetricsFor2025Enabled, permissionsReworkEnabled, urls, onNeedsReload, }: C4ManagementAppProps) => JSX.Element) & {
|
|
4
4
|
displayName: string;
|
|
5
5
|
};
|
|
@@ -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, ConsoleValueMetricsService, EarlyAccessFeaturesService, HdpService, HttpError, OrganizationMembersService, OrgsService, UsageAlertsService, } from '@camunda/ccma-api';
|
|
10
|
-
import { checkVersion, getDisplayedSalesPlan, getRevisitedSalesPlanName, OrganizationRole, SseEntity, VersionCheckOperator, } from '@camunda/ccma-shared-types';
|
|
10
|
+
import { addMonthsClamped, checkVersion, diffInWholeMonths, getCurrentEnterpriseTerm, getDisplayedSalesPlan, getRevisitedSalesPlanName, OrganizationRole, peakWithinTerm, SseEntity, toUtcDayStartMs, 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';
|
|
@@ -20,7 +20,7 @@ import { useC4ConsoleRuntime, useC4DesignSystem, } from '../../runtime/c4-consol
|
|
|
20
20
|
import { toApiConfig } from '../../runtime/to-api-config.js';
|
|
21
21
|
import { toIdentityApiBaseUrl } from '../../runtime/to-identity-api-base-url.js';
|
|
22
22
|
import { Link, Stack } from '../../ui/index.js';
|
|
23
|
-
import {
|
|
23
|
+
import { legacySectionRoles } from '../../utils/role-labels.js';
|
|
24
24
|
import { useExtendTrial } from '../use-extend-trial.js';
|
|
25
25
|
import { C4ManagementPage } from './c4-management-page.js';
|
|
26
26
|
import { managementTab } from './management-tabs.js';
|
|
@@ -493,28 +493,11 @@ function toDate(value) {
|
|
|
493
493
|
}
|
|
494
494
|
return undefined;
|
|
495
495
|
}
|
|
496
|
-
|
|
497
|
-
|
|
498
|
-
|
|
499
|
-
|
|
500
|
-
|
|
501
|
-
if (next.getDate() !== originalDay) {
|
|
502
|
-
next.setDate(0);
|
|
503
|
-
}
|
|
504
|
-
return next;
|
|
505
|
-
}
|
|
506
|
-
// HDP value metrics are bucketed per UTC day (a BigQuery DATE column, so every
|
|
507
|
-
// row's ts is UTC midnight), whereas the enterprise period bounds keep the
|
|
508
|
-
// wall-clock time of enterpriseStartDate. Comparing the two directly would drop
|
|
509
|
-
// the term's first day whenever the plan was created after midnight, so both
|
|
510
|
-
// bounds are collapsed to the UTC day they fall on before comparing.
|
|
511
|
-
function toUtcDayStartMs(date) {
|
|
512
|
-
return Date.UTC(date.getUTCFullYear(), date.getUTCMonth(), date.getUTCDate());
|
|
513
|
-
}
|
|
514
|
-
function diffInMonthsSimple(start, end) {
|
|
515
|
-
return ((end.getFullYear() - start.getFullYear()) * 12 +
|
|
516
|
-
(end.getMonth() - start.getMonth()));
|
|
517
|
-
}
|
|
496
|
+
// Contract-period arithmetic (month-end clamping, current-period resolution,
|
|
497
|
+
// the UTC-day normalisation that keeps a term's first day from being dropped
|
|
498
|
+
// when the plan was created after midnight) lives in `@camunda/ccma-shared-types`
|
|
499
|
+
// so this tab, control-frontend and accounts-frontend cannot disagree about
|
|
500
|
+
// which days a figure covers. See `enterpriseTerm.utils.ts`.
|
|
518
501
|
function formatDate(date) {
|
|
519
502
|
try {
|
|
520
503
|
return Intl.DateTimeFormat('en-GB', {
|
|
@@ -539,7 +522,7 @@ function themeNameToClassName(theme) {
|
|
|
539
522
|
return 'g10';
|
|
540
523
|
}
|
|
541
524
|
}
|
|
542
|
-
export const C4ManagementApp = observer(({ orgId, desiredTabId, onTabChange, onNavigate, legacyTabs, userPersonaRole, isLicensingModel2025: isLicensingModel2025Prop, tenantsValueMetricEnabled = false, hdpValueMetricsFor2025Enabled = false, urls, onNeedsReload, }) => {
|
|
525
|
+
export const C4ManagementApp = observer(({ orgId, desiredTabId, onTabChange, onNavigate, legacyTabs, userPersonaRole, isLicensingModel2025: isLicensingModel2025Prop, tenantsValueMetricEnabled = false, hdpValueMetricsFor2025Enabled = false, permissionsReworkEnabled = false, urls, onNeedsReload, }) => {
|
|
543
526
|
const runtime = useC4ConsoleRuntime();
|
|
544
527
|
const designSystem = useC4DesignSystem();
|
|
545
528
|
const data = useC4ConsoleData();
|
|
@@ -952,7 +935,9 @@ export const C4ManagementApp = observer(({ orgId, desiredTabId, onTabChange, onN
|
|
|
952
935
|
const [billingClusters, setBillingClusters] = useState([]);
|
|
953
936
|
const [billingMetricsMonthly, setBillingMetricsMonthly] = useState([]);
|
|
954
937
|
const [billingUsageAlerts, setBillingUsageAlerts] = useState([]);
|
|
955
|
-
|
|
938
|
+
// Raw daily points rather than a pre-reduced peak: the peak has to be taken
|
|
939
|
+
// over the current contract period, which isn't known at fetch time.
|
|
940
|
+
const [billingTenantUsage, setBillingTenantUsage] = useState([]);
|
|
956
941
|
const [billingHdpUsageMetrics, setBillingHdpUsageMetrics] = useState([]);
|
|
957
942
|
const [apiClients, setApiClients] = useState([]);
|
|
958
943
|
const [apiClientsLoading, setApiClientsLoading] = useState(false);
|
|
@@ -1157,16 +1142,13 @@ export const C4ManagementApp = observer(({ orgId, desiredTabId, onTabChange, onN
|
|
|
1157
1142
|
const alerts = alertsResult.status === 'fulfilled' ? alertsResult.value : undefined;
|
|
1158
1143
|
const loadErrors = [monthlyResult, alertsResult, hdpUsageResult].filter((result) => result.status === 'rejected');
|
|
1159
1144
|
const tenantUsage = tenantsResult.status === 'fulfilled' ? tenantsResult.value : [];
|
|
1160
|
-
const tenantPeak = tenantUsage.length > 0
|
|
1161
|
-
? Math.max(...tenantUsage.map((point) => point.value))
|
|
1162
|
-
: 0;
|
|
1163
1145
|
const hdpUsageMetrics = hdpUsageResult.status === 'fulfilled'
|
|
1164
1146
|
? (hdpUsageResult.value?.valueMetrics?.valueMetrics ?? [])
|
|
1165
1147
|
: [];
|
|
1166
1148
|
setBillingClusters(normalizedClusters);
|
|
1167
1149
|
setBillingMetricsMonthly(monthly ?? []);
|
|
1168
1150
|
setBillingUsageAlerts(alerts?.usageAlerts ?? []);
|
|
1169
|
-
|
|
1151
|
+
setBillingTenantUsage(tenantUsage);
|
|
1170
1152
|
setBillingHdpUsageMetrics(hdpUsageMetrics);
|
|
1171
1153
|
if (loadErrors.length > 0) {
|
|
1172
1154
|
const firstError = loadErrors[0]?.reason;
|
|
@@ -1179,7 +1161,7 @@ export const C4ManagementApp = observer(({ orgId, desiredTabId, onTabChange, onN
|
|
|
1179
1161
|
setBillingClusters([]);
|
|
1180
1162
|
setBillingMetricsMonthly([]);
|
|
1181
1163
|
setBillingUsageAlerts([]);
|
|
1182
|
-
|
|
1164
|
+
setBillingTenantUsage([]);
|
|
1183
1165
|
setBillingHdpUsageMetrics([]);
|
|
1184
1166
|
setBillingError(error instanceof Error ? error.message : 'Could not load billing');
|
|
1185
1167
|
}
|
|
@@ -1241,7 +1223,7 @@ export const C4ManagementApp = observer(({ orgId, desiredTabId, onTabChange, onN
|
|
|
1241
1223
|
// the correct reference point for period labels.
|
|
1242
1224
|
const inferredStartDate = startCandidates
|
|
1243
1225
|
.filter((c) => typeof c.monthsSinceStart === 'number')
|
|
1244
|
-
.map((c) =>
|
|
1226
|
+
.map((c) => addMonthsClamped(c.startDate, -c.monthsSinceStart))
|
|
1245
1227
|
.sort((a, b) => a.getTime() - b.getTime())[0];
|
|
1246
1228
|
const orgEnterpriseStartBilling = toDate(getNestedValue(org, ['organizationToSalesPlan', 'enterpriseStartDate']));
|
|
1247
1229
|
const orgTrialStartBilling = toDate(getNestedValue(org, ['organizationToSalesPlan', 'trialPlanStartDate']));
|
|
@@ -1258,20 +1240,10 @@ export const C4ManagementApp = observer(({ orgId, desiredTabId, onTabChange, onN
|
|
|
1258
1240
|
const durationInMonths = typeof durationInMonthsRaw === 'number' && durationInMonthsRaw > 0
|
|
1259
1241
|
? durationInMonthsRaw
|
|
1260
1242
|
: 12;
|
|
1261
|
-
const monthsDiff = Math.abs(diffInMonthsSimple(startDate, now));
|
|
1262
|
-
const completedPeriods = Math.floor(monthsDiff / durationInMonths);
|
|
1263
|
-
const periodStart = addMonthsSafe(startDate, completedPeriods * durationInMonths);
|
|
1264
|
-
const periodEnd = new Date(addMonthsSafe(periodStart, durationInMonths).getTime() - DAY_MS);
|
|
1265
|
-
const startMonth = completedPeriods * durationInMonths;
|
|
1266
|
-
const endMonth = startMonth + (durationInMonths - 1);
|
|
1267
1243
|
return {
|
|
1268
1244
|
startDate,
|
|
1269
1245
|
durationInMonths,
|
|
1270
|
-
|
|
1271
|
-
periodEnd,
|
|
1272
|
-
startMonth,
|
|
1273
|
-
endMonth,
|
|
1274
|
-
nextRenewal: addMonthsSafe(periodStart, durationInMonths),
|
|
1246
|
+
...getCurrentEnterpriseTerm({ startDate, durationInMonths, now }),
|
|
1275
1247
|
};
|
|
1276
1248
|
}, [billingMetricsMonthly, org]);
|
|
1277
1249
|
const billingIncludedMetrics = useMemo(() => {
|
|
@@ -1288,9 +1260,16 @@ export const C4ManagementApp = observer(({ orgId, desiredTabId, onTabChange, onN
|
|
|
1288
1260
|
};
|
|
1289
1261
|
}, [org]);
|
|
1290
1262
|
const billingCurrentMetrics = useMemo(() => {
|
|
1263
|
+
const periodStartDayMs = toUtcDayStartMs(billingEnterprisePeriod.periodStart);
|
|
1264
|
+
const periodEndDayMs = toUtcDayStartMs(billingEnterprisePeriod.periodEnd);
|
|
1265
|
+
// Peak tenants *inside the current contract period*, matching the window
|
|
1266
|
+
// the PI/DI/TU totals below use. Reducing over the whole fetched history
|
|
1267
|
+
// instead would let a previous term's peak be billed against this term's
|
|
1268
|
+
// included quota. Tenants is a gauge, so the peak is taken over the daily
|
|
1269
|
+
// org totals rather than summed. Shared with the two internal tools so all
|
|
1270
|
+
// three surfaces report the same number for the same org.
|
|
1271
|
+
const tenantPeak = peakWithinTerm(billingTenantUsage, billingEnterprisePeriod);
|
|
1291
1272
|
if (hdpValueMetricsFor2025Enabled && isLicensingModel2025) {
|
|
1292
|
-
const periodStartDayMs = toUtcDayStartMs(billingEnterprisePeriod.periodStart);
|
|
1293
|
-
const periodEndDayMs = toUtcDayStartMs(billingEnterprisePeriod.periodEnd);
|
|
1294
1273
|
return billingHdpUsageMetrics
|
|
1295
1274
|
.filter((entry) => entry.date.ts >= periodStartDayMs &&
|
|
1296
1275
|
entry.date.ts <= periodEndDayMs)
|
|
@@ -1303,7 +1282,7 @@ export const C4ManagementApp = observer(({ orgId, desiredTabId, onTabChange, onN
|
|
|
1303
1282
|
processInstances: 0,
|
|
1304
1283
|
decisionInstances: 0,
|
|
1305
1284
|
taskUsers: 0,
|
|
1306
|
-
tenants:
|
|
1285
|
+
tenants: tenantPeak,
|
|
1307
1286
|
});
|
|
1308
1287
|
}
|
|
1309
1288
|
const relevant = billingMetricsMonthly.filter((entry) => {
|
|
@@ -1321,7 +1300,7 @@ export const C4ManagementApp = observer(({ orgId, desiredTabId, onTabChange, onN
|
|
|
1321
1300
|
processInstances: 0,
|
|
1322
1301
|
decisionInstances: 0,
|
|
1323
1302
|
taskUsers: 0,
|
|
1324
|
-
tenants:
|
|
1303
|
+
tenants: tenantPeak,
|
|
1325
1304
|
});
|
|
1326
1305
|
}, [
|
|
1327
1306
|
billingEnterprisePeriod.endMonth,
|
|
@@ -1329,7 +1308,7 @@ export const C4ManagementApp = observer(({ orgId, desiredTabId, onTabChange, onN
|
|
|
1329
1308
|
billingEnterprisePeriod.periodStart,
|
|
1330
1309
|
billingEnterprisePeriod.periodEnd,
|
|
1331
1310
|
billingMetricsMonthly,
|
|
1332
|
-
|
|
1311
|
+
billingTenantUsage,
|
|
1333
1312
|
billingHdpUsageMetrics,
|
|
1334
1313
|
hdpValueMetricsFor2025Enabled,
|
|
1335
1314
|
isLicensingModel2025,
|
|
@@ -1562,7 +1541,7 @@ export const C4ManagementApp = observer(({ orgId, desiredTabId, onTabChange, onN
|
|
|
1562
1541
|
// the correct reference point for period labels.
|
|
1563
1542
|
const inferredStartDate = startCandidates
|
|
1564
1543
|
.filter((c) => typeof c.monthsSinceStart === 'number')
|
|
1565
|
-
.map((c) =>
|
|
1544
|
+
.map((c) => addMonthsClamped(c.startDate, -c.monthsSinceStart))
|
|
1566
1545
|
.sort((a, b) => a.getTime() - b.getTime())[0];
|
|
1567
1546
|
const orgEnterpriseStart = toDate(getNestedValue(org, ['organizationToSalesPlan', 'enterpriseStartDate']));
|
|
1568
1547
|
const orgTrialStart = toDate(getNestedValue(org, ['organizationToSalesPlan', 'trialPlanStartDate']));
|
|
@@ -1573,13 +1552,13 @@ export const C4ManagementApp = observer(({ orgId, desiredTabId, onTabChange, onN
|
|
|
1573
1552
|
inferredStartDate ??
|
|
1574
1553
|
now;
|
|
1575
1554
|
const durationInMonths = usageGroupBy === 'month' ? 1 : 12;
|
|
1576
|
-
const monthsDiff =
|
|
1555
|
+
const monthsDiff = diffInWholeMonths(startDate, now);
|
|
1577
1556
|
const iterationsRaw = usageGroupBy === 'month' ? monthsDiff : Math.floor(monthsDiff / 12);
|
|
1578
1557
|
const iterations = Math.max(0, Math.abs(iterationsRaw));
|
|
1579
1558
|
const periods = [];
|
|
1580
1559
|
for (let i = 0; i <= iterations; i++) {
|
|
1581
|
-
const periodStart =
|
|
1582
|
-
const periodEnd = new Date(
|
|
1560
|
+
const periodStart = addMonthsClamped(startDate, i * durationInMonths);
|
|
1561
|
+
const periodEnd = new Date(addMonthsClamped(periodStart, durationInMonths).getTime() - DAY_MS);
|
|
1583
1562
|
periods.push({ start: periodStart, end: periodEnd });
|
|
1584
1563
|
}
|
|
1585
1564
|
// If monthly metrics are missing, build the full period list and aggregate from per-day metrics.
|
|
@@ -1666,8 +1645,8 @@ export const C4ManagementApp = observer(({ orgId, desiredTabId, onTabChange, onN
|
|
|
1666
1645
|
const iterations2 = iterations;
|
|
1667
1646
|
const aggregated = [];
|
|
1668
1647
|
for (let i = 0; i <= iterations2; i++) {
|
|
1669
|
-
const periodStart =
|
|
1670
|
-
const periodEnd = new Date(
|
|
1648
|
+
const periodStart = addMonthsClamped(startDate, i * durationInMonths);
|
|
1649
|
+
const periodEnd = new Date(addMonthsClamped(periodStart, durationInMonths).getTime() - DAY_MS);
|
|
1671
1650
|
const currentStartMonth = i * durationInMonths;
|
|
1672
1651
|
const currentEndMonth = i * durationInMonths + (durationInMonths - 1);
|
|
1673
1652
|
const perCluster = [];
|
|
@@ -2610,13 +2589,16 @@ export const C4ManagementApp = observer(({ orgId, desiredTabId, onTabChange, onN
|
|
|
2610
2589
|
const more = [];
|
|
2611
2590
|
if (mayUpdateGeneralVisible) {
|
|
2612
2591
|
primary.push(OrganizationRole.MODELER, OrganizationRole.ANALYST);
|
|
2592
|
+
if (permissionsReworkEnabled) {
|
|
2593
|
+
primary.push(OrganizationRole.OPERATIONS_ENGINEER);
|
|
2594
|
+
}
|
|
2613
2595
|
}
|
|
2614
2596
|
if (mayUpdateAdminVisible) {
|
|
2615
2597
|
primary.push(OrganizationRole.ADMIN);
|
|
2616
2598
|
}
|
|
2617
2599
|
// Candidate set only; the users tab filters it per member.
|
|
2618
2600
|
if (mayUpdateGeneralVisible) {
|
|
2619
|
-
more.push(...
|
|
2601
|
+
more.push(...legacySectionRoles(permissionsReworkEnabled));
|
|
2620
2602
|
}
|
|
2621
2603
|
more.push(OrganizationRole.MEMBER);
|
|
2622
2604
|
return { primary, more };
|
|
@@ -2693,7 +2675,7 @@ export const C4ManagementApp = observer(({ orgId, desiredTabId, onTabChange, onN
|
|
|
2693
2675
|
id: 'users',
|
|
2694
2676
|
label: getTabLabel(legacyTabs, 'users', tabTitle('users')),
|
|
2695
2677
|
visible: canReadMembers,
|
|
2696
|
-
component: (_jsx(C4ManagementUsersTab, { orgId: orgId, members: members, loading: membersLoading, mayManageUsersActions: mayManageUsersActions, mayInviteUsers: Boolean(mayInviteMembers || mayInviteAdmins), showLegacyClusterRoles: showLegacyClusterRoles, inviteModal: {
|
|
2678
|
+
component: (_jsx(C4ManagementUsersTab, { orgId: orgId, members: members, loading: membersLoading, mayManageUsersActions: mayManageUsersActions, mayInviteUsers: Boolean(mayInviteMembers || mayInviteAdmins), showLegacyClusterRoles: showLegacyClusterRoles, permissionsReworkEnabled: permissionsReworkEnabled, inviteModal: {
|
|
2697
2679
|
showAdminRole: Boolean(mayInviteAdmins),
|
|
2698
2680
|
learnMoreUrl: identityAuthorizationsDocsUrl,
|
|
2699
2681
|
}, changeRolesModal: {
|
|
@@ -76,6 +76,8 @@ export interface C4ManagementAppProps {
|
|
|
76
76
|
* gated behind the feature flag.
|
|
77
77
|
*/
|
|
78
78
|
hdpValueMetricsFor2025Enabled?: boolean;
|
|
79
|
+
/** Aligned org-role model active (camunda-hub#25467). */
|
|
80
|
+
permissionsReworkEnabled?: boolean;
|
|
79
81
|
urls?: C4ManagementUrls;
|
|
80
82
|
/**
|
|
81
83
|
* Called when the component needs the host to reload org data (e.g. after a
|
|
@@ -10,6 +10,7 @@ export interface C4ManagementUsersTabProps {
|
|
|
10
10
|
mayInviteUsers: boolean;
|
|
11
11
|
mayAssignNewOwner: boolean;
|
|
12
12
|
showLegacyClusterRoles?: boolean;
|
|
13
|
+
permissionsReworkEnabled?: boolean;
|
|
13
14
|
inviteModal?: {
|
|
14
15
|
showAdminRole?: boolean;
|
|
15
16
|
learnMoreUrl?: string;
|
|
@@ -34,4 +35,4 @@ export interface C4ManagementUsersTabProps {
|
|
|
34
35
|
onAssignNewOwner: (newOwnerUserId: string, oldOwnerNewRoles: string[]) => Promise<void>;
|
|
35
36
|
onUpdateUserRoles: (userId: string, roles: string[]) => Promise<void>;
|
|
36
37
|
}
|
|
37
|
-
export declare const C4ManagementUsersTab: ({ orgId, members, loading, mayManageUsersActions, mayInviteUsers, mayAssignNewOwner, showLegacyClusterRoles, inviteModal, changeRolesModal, currentUserEmail, onNavigateToUser, t, telemetry, onRemoveUser, onInviteUser, onResendInvite, onCancelInvite, onAssignNewOwner, onUpdateUserRoles, }: C4ManagementUsersTabProps) => JSX.Element;
|
|
38
|
+
export declare const C4ManagementUsersTab: ({ orgId, members, loading, mayManageUsersActions, mayInviteUsers, mayAssignNewOwner, showLegacyClusterRoles, permissionsReworkEnabled, inviteModal, changeRolesModal, currentUserEmail, onNavigateToUser, t, telemetry, onRemoveUser, onInviteUser, onResendInvite, onCancelInvite, onAssignNewOwner, onUpdateUserRoles, }: C4ManagementUsersTabProps) => JSX.Element;
|