@camunda/ccma-saas-frontend 0.32.0 → 0.33.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-cluster-list/c4-cluster-list.js +3 -1
- package/lib/esm/components/c4-cluster-list/c4-cluster-list.types.d.ts +2 -2
- package/lib/esm/components/c4-cluster-migration/c4-cluster-migration.d.ts +2 -1
- package/lib/esm/components/c4-cluster-migration/c4-cluster-migration.js +46 -15
- package/lib/esm/components/c4-cluster-migration/c4-cluster-migration.types.d.ts +47 -12
- package/lib/esm/components/c4-cluster-migration/migration-translations.d.ts +2 -4
- package/lib/esm/components/c4-cluster-migration/migration-translations.js +90 -15
- package/lib/esm/i18n/en/pages/clusterdetails.json +63 -14
- package/lib/esm/i18n/en/pages/createcluster.json +1 -1
- package/lib/esm/index.d.ts +2 -1
- package/lib/esm/utils/migration-aws-policy.d.ts +22 -0
- package/lib/esm/utils/migration-aws-policy.js +54 -0
- package/lib/esm/utils/migration-view.d.ts +98 -0
- package/lib/esm/utils/migration-view.js +52 -0
- package/lib/esm/utils/migration-workaround.d.ts +46 -32
- package/lib/esm/utils/migration-workaround.js +212 -48
- package/lib/esm/widgets/cluster-details/c4-cluster-details-app.js +50 -40
- package/lib/esm/widgets/cluster-details/tabs/c4-cluster-details-overview-tab.js +2 -2
- package/lib/esm/widgets/clusters/c4-clusters-page.js +8 -7
- package/lib/esm/widgets/create-cluster/c4-create-cluster-page.js +3 -3
- package/package.json +3 -3
- package/lib/esm/components/c4-cluster-migration/backup-id.d.ts +0 -2
- package/lib/esm/components/c4-cluster-migration/backup-id.js +0 -9
|
@@ -18,7 +18,8 @@ import { SELF_MANAGED_MIGRATION_FLAG } from '../../runtime/self-managed-migratio
|
|
|
18
18
|
import { toApiConfig } from '../../runtime/to-api-config.js';
|
|
19
19
|
import { Checkbox, Modal, Stack, TextInput } from '../../ui/index.js';
|
|
20
20
|
import { Select, SelectItem } from '../../ui/families.js';
|
|
21
|
-
import {
|
|
21
|
+
import { isMigrationLocked } from '../../utils/migration-view.js';
|
|
22
|
+
import { getMigrationView, isMigrationLabel, isMigrationPlan, } from '../../utils/migration-workaround.js';
|
|
22
23
|
import { safeTranslate } from '../../utils/safe-translate.js';
|
|
23
24
|
import { clusterHealthOverride } from '../cluster-health-override.js';
|
|
24
25
|
import { isClusterReconciliationPaused } from '../is-cluster-reconciliation-paused.js';
|
|
@@ -140,7 +141,7 @@ function mapClusterToListItem(rawCluster, index) {
|
|
|
140
141
|
? camundaTags.filter((t) => typeof t === 'string')
|
|
141
142
|
: [];
|
|
142
143
|
const customArray = Array.isArray(customTags)
|
|
143
|
-
? customTags.filter((t) => typeof t === 'string' && !
|
|
144
|
+
? customTags.filter((t) => typeof t === 'string' && !isMigrationLabel(t))
|
|
144
145
|
: [];
|
|
145
146
|
const tags = [...camundaArray, ...customArray];
|
|
146
147
|
const currentClusterLoad = getOptionalNumber(rawCluster, 'currentClusterLoad');
|
|
@@ -399,7 +400,7 @@ export const C4ClustersPage = observer(({ orgId, scope = 'cluster', gettingStart
|
|
|
399
400
|
}, [clusterCapacityMap]);
|
|
400
401
|
const expiryNow = useExpiryClock(rawClusters.some((rawCluster) => getPathString(rawCluster, ['ttl', 'expiresAt']) !== undefined));
|
|
401
402
|
const clusterList = useMemo(() => {
|
|
402
|
-
//
|
|
403
|
+
// A migration cluster has no actions but Delete until it is complete.
|
|
403
404
|
const lockedIds = new Set();
|
|
404
405
|
const tokenClusters = authz.features.console?.clusters;
|
|
405
406
|
const canUpgradeFromToken = (tokenClusters?.canUpgradeGeneration ?? false) ||
|
|
@@ -419,13 +420,13 @@ export const C4ClustersPage = observer(({ orgId, scope = 'cluster', gettingStart
|
|
|
419
420
|
now: expiryNow,
|
|
420
421
|
copy: expiryCopy,
|
|
421
422
|
});
|
|
422
|
-
const
|
|
423
|
-
?
|
|
423
|
+
const migrationView = migrationActive
|
|
424
|
+
? getMigrationView({
|
|
424
425
|
name: mappedItem.name,
|
|
425
426
|
description: getPathString(rawCluster, ['description']),
|
|
426
427
|
})
|
|
427
428
|
: undefined;
|
|
428
|
-
if (
|
|
429
|
+
if (isMigrationLocked(migrationView)) {
|
|
429
430
|
lockedIds.add(mappedItem.id);
|
|
430
431
|
}
|
|
431
432
|
const item = expiry
|
|
@@ -1020,7 +1021,7 @@ export const C4ClustersPage = observer(({ orgId, scope = 'cluster', gettingStart
|
|
|
1020
1021
|
params: { orgId, clusterId: tagTarget.clusterId },
|
|
1021
1022
|
body: {
|
|
1022
1023
|
labels: {
|
|
1023
|
-
// The
|
|
1024
|
+
// The state of a migration lives in custom labels.
|
|
1024
1025
|
// Send the custom labels again: the PATCH replaces them.
|
|
1025
1026
|
custom: customLabelsOf(rawClusters, tagTarget.clusterId),
|
|
1026
1027
|
camunda: [selectedTag],
|
|
@@ -18,7 +18,7 @@ import { useC4ConsoleRuntime, useC4FeatureFlag, } from '../../runtime/c4-console
|
|
|
18
18
|
import { SELF_MANAGED_MIGRATION_FLAG } from '../../runtime/self-managed-migration.js';
|
|
19
19
|
import { toApiConfig } from '../../runtime/to-api-config.js';
|
|
20
20
|
import { Link, Stack } from '../../ui/index.js';
|
|
21
|
-
import {
|
|
21
|
+
import { buildMigrationCreateName, isValidAwsRoleArn, MIGRATION_NAME_MAX_LENGTH, MIGRATION_ROLE_ARN_MAX_LENGTH, } from '../../utils/migration-workaround.js';
|
|
22
22
|
import { safeTranslate } from '../../utils/safe-translate.js';
|
|
23
23
|
/**
|
|
24
24
|
* What the customer types to confirm the delete of the source cluster. It
|
|
@@ -306,7 +306,7 @@ export function buildCreateClusterTranslations(t) {
|
|
|
306
306
|
migrationRoleArnInvalid: translate('createcluster:form.migration.roleArn.validation.invalid', 'Enter a valid AWS IAM role ARN, for example arn:aws:iam::123456789012:role/role-name.'),
|
|
307
307
|
migrationRoleArnMaxLength: translate('createcluster:form.migration.roleArn.validation.maxLength', "The ARN can't be longer than 150 characters."),
|
|
308
308
|
migrationRegionHint: translate('createcluster:form.migration.regionHint', 'Select an AWS region above.'),
|
|
309
|
-
migrationNameMaxLength: translate('createcluster:form.migration.name.validation.maxLength', "Cluster names can't be longer than
|
|
309
|
+
migrationNameMaxLength: translate('createcluster:form.migration.name.validation.maxLength', "Cluster names can't be longer than 33 characters when you migrate."),
|
|
310
310
|
descriptionTitle: translate('createcluster:form.description.title', 'Description (optional)'),
|
|
311
311
|
descriptionPlaceholder: translate('createcluster:form.description.placeholder', 'Enter a description for the cluster'),
|
|
312
312
|
descriptionValidationMaxLength: translate('createcluster:form.description.validation.maxLength', 'Description cannot be longer than 150 characters.'),
|
|
@@ -945,7 +945,7 @@ export const C4CreateClusterPage = observer(({ orgId, afterCreateModalUrl, talkT
|
|
|
945
945
|
// the migration until the operator has migration fields.
|
|
946
946
|
const migration = migrationAvailable ? params.migration : undefined;
|
|
947
947
|
const body = {
|
|
948
|
-
name: migration ?
|
|
948
|
+
name: migration ? buildMigrationCreateName(params.name) : params.name,
|
|
949
949
|
planTypeId: params.clusterPlanType,
|
|
950
950
|
...(params.clusterPlan && { clusterPlanId: params.clusterPlan }),
|
|
951
951
|
channelId: params.channel,
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@camunda/ccma-saas-frontend",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.33.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": "9.
|
|
89
|
-
"@camunda/ccma-shared-types": "14.
|
|
88
|
+
"@camunda/ccma-api": "9.2.0",
|
|
89
|
+
"@camunda/ccma-shared-types": "14.2.0",
|
|
90
90
|
"@pactsafe/pactsafe-react-sdk": "2.15.0",
|
|
91
91
|
"cron-parser": "5.10.2",
|
|
92
92
|
"mobx": "6.16.1",
|
|
@@ -1,9 +0,0 @@
|
|
|
1
|
-
/*
|
|
2
|
-
* Copyright Camunda Services GmbH and/or licensed to Camunda Services GmbH
|
|
3
|
-
* under one or more contributor license agreements. Licensed under a commercial license.
|
|
4
|
-
* You may not use this file except in compliance with the commercial license.
|
|
5
|
-
*/
|
|
6
|
-
// TODO(3844-workaround): Delete with the operator integration.
|
|
7
|
-
const MAX_BACKUP_ID = BigInt('9223372036854775807');
|
|
8
|
-
/** A backup ID is an integer from 1 to 2^63-1. A string keeps every digit. */
|
|
9
|
-
export const isValidBackupId = (value) => /^[1-9]\d{0,18}$/.test(value) && BigInt(value) <= MAX_BACKUP_ID;
|