@camunda/ccma-saas-frontend 0.37.1 → 0.37.2

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.
@@ -91,7 +91,8 @@
91
91
  "secondary": "Cancel"
92
92
  },
93
93
  "loadingText": "Deleting...",
94
- "description": "Are you sure you want to delete the alert",
94
+ "description": "Are you sure you want to delete the alert for \"{{target}}\"?",
95
+ "descriptionNoTarget": "Are you sure you want to delete the alert?",
95
96
  "error": {
96
97
  "generic": "We're having trouble deleting the alert"
97
98
  }
@@ -47,6 +47,9 @@ export const C4ClusterDetailsAlertsTab = (props) => {
47
47
  const [alertUrlInvalidText, setAlertUrlInvalidText] = useState('');
48
48
  const [alertHmacInvalid, setAlertHmacInvalid] = useState(false);
49
49
  const [alertHmacInvalidText, setAlertHmacInvalidText] = useState('');
50
+ // Kept in state, not read from props.alerts on each render: the host reloads
51
+ // the alerts before the dialog closes, and the text must not change then.
52
+ const [deleteAlertTarget, setDeleteAlertTarget] = useState('');
50
53
  const alertEmailDestination = props.userEmail?.includes('@')
51
54
  ? ` (to ${props.userEmail})`
52
55
  : '';
@@ -121,6 +124,7 @@ export const C4ClusterDetailsAlertsTab = (props) => {
121
124
  }, onDeleteAlert: (alertId) => {
122
125
  trackEvent('clusterOverviewAlerts:deleteModal:open', 'Open Delete Alerts Modal', { alertId });
123
126
  setSelectedAlertId(alertId);
127
+ setDeleteAlertTarget(props.alerts.find((a) => a.id === alertId)?.userIdOrWebhook ?? '');
124
128
  setAlertMutationError('');
125
129
  setDeleteAlertOpen(true);
126
130
  }, onNoAlertsDocsClick: () => {
@@ -242,5 +246,7 @@ export const C4ClusterDetailsAlertsTab = (props) => {
242
246
  setAlertMutationBusy(false);
243
247
  }
244
248
  })();
245
- }, children: _jsxs(Stack, { gap: 6, children: [alertMutationError && (_jsx(C4InlineNotification, { kind: 'error', title: safeTranslate(props.t, 'alerts:delete.error.generic', "We're having trouble deleting the alert"), subtitle: alertMutationError, lowContrast: true, hideCloseButton: true })), _jsx("p", { children: safeTranslate(props.t, 'alerts:delete.description', 'Are you sure you want to delete the alert') })] }) })] }));
249
+ }, children: _jsxs(Stack, { gap: 6, children: [alertMutationError && (_jsx(C4InlineNotification, { kind: 'error', title: safeTranslate(props.t, 'alerts:delete.error.generic', "We're having trouble deleting the alert"), subtitle: alertMutationError, lowContrast: true, hideCloseButton: true })), _jsx("p", { style: { overflowWrap: 'anywhere' }, children: deleteAlertTarget
250
+ ? safeTranslate(props.t, 'alerts:delete.description', `Are you sure you want to delete the alert for "${deleteAlertTarget}"?`, { target: deleteAlertTarget })
251
+ : safeTranslate(props.t, 'alerts:delete.descriptionNoTarget', 'Are you sure you want to delete the alert?') })] }) })] }));
246
252
  };
@@ -249,10 +249,12 @@ export const C4ClusterDetailsSettingsTab = (props) => {
249
249
  setIsUpdatingLowLatency(false);
250
250
  }
251
251
  }, [props, clusterApi, runtime.telemetry]);
252
+ // Unset means on: the cluster runs Swagger until it is switched off.
253
+ const isSwaggerEnabled = props.cluster?.externalMetadata?.swagger ?? true;
252
254
  const toggleSwagger = useCallback(async () => {
253
255
  if (!props.cluster)
254
256
  return;
255
- const nextState = !props.cluster.externalMetadata?.swagger;
257
+ const nextState = !isSwaggerEnabled;
256
258
  setIsUpdatingSwagger(true);
257
259
  try {
258
260
  await clusterApi.updateCluster({
@@ -275,7 +277,7 @@ export const C4ClusterDetailsSettingsTab = (props) => {
275
277
  finally {
276
278
  setIsUpdatingSwagger(false);
277
279
  }
278
- }, [props, clusterApi, runtime.telemetry]);
280
+ }, [props, clusterApi, runtime.telemetry, isSwaggerEnabled]);
279
281
  const updateSecretsFilterMode = useCallback(async (mode) => {
280
282
  if (!props.cluster)
281
283
  return;
@@ -1041,7 +1043,7 @@ export const C4ClusterDetailsSettingsTab = (props) => {
1041
1043
  },
1042
1044
  ...(isSwaggerToggleVisible && {
1043
1045
  swaggerToggle: {
1044
- enabled: props.cluster.externalMetadata?.swagger ?? true,
1046
+ enabled: isSwaggerEnabled,
1045
1047
  description: (_jsxs(_Fragment, { children: [safeTranslate(props.t, 'clusterdetails:settings.swagger.description', 'The Orchestration Cluster REST API is documented using the'), ' ', _jsx(Link, { href: 'https://github.com/camunda/camunda/blob/main/zeebe/gateway-protocol/src/main/proto/rest-api.yaml', target: '_blank', children: safeTranslate(props.t, 'clusterdetails:settings.swagger.spec', 'OpenAPI specification') }), safeTranslate(props.t, 'clusterdetails:settings.swagger.description2', '. When enabled, it is accessible via Swagger UI.'), _jsx("br", {}), _jsx("br", {}), (() => {
1046
1048
  const swaggerUrl = buildClusterSwaggerUrl({
1047
1049
  cluster: props.cluster,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@camunda/ccma-saas-frontend",
3
- "version": "0.37.1",
3
+ "version": "0.37.2",
4
4
  "description": "Camunda Composite Components",
5
5
  "bugs": {
6
6
  "url": "https://github.com/camunda/camunda-cloud-management-apps/issues"