@camunda/ccma-saas-frontend 0.7.1 → 0.7.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.
Files changed (100) hide show
  1. package/lib/esm/components/c4-breadcrumb/c4-breadcrumb.d.ts +1 -1
  2. package/lib/esm/components/c4-breadcrumb/c4-breadcrumb.js +4 -4
  3. package/lib/esm/components/c4-breadcrumb/c4-breadcrumb.types.d.ts +6 -0
  4. package/lib/esm/components/c4-cluster-details-activity/c4-cluster-details-activity.js +2 -1
  5. package/lib/esm/components/c4-cluster-details-encryption/c4-cluster-details-encryption.js +10 -5
  6. package/lib/esm/components/c4-cluster-details-hot-backups/c4-cluster-details-hot-backups.js +4 -3
  7. package/lib/esm/components/c4-cluster-details-secure-connectivity/c4-cluster-details-secure-connectivity.js +2 -1
  8. package/lib/esm/components/c4-cluster-list/c4-cluster-list.d.ts +1 -1
  9. package/lib/esm/components/c4-cluster-list/c4-cluster-list.js +6 -4
  10. package/lib/esm/components/c4-cluster-list/c4-cluster-list.types.d.ts +7 -0
  11. package/lib/esm/components/c4-cluster-overview/applications.d.ts +8 -0
  12. package/lib/esm/components/c4-cluster-overview/applications.js +28 -23
  13. package/lib/esm/components/c4-cluster-overview/c4-cluster-overview.d.ts +1 -1
  14. package/lib/esm/components/c4-cluster-overview/c4-cluster-overview.js +5 -5
  15. package/lib/esm/components/c4-cluster-overview/c4-cluster-overview.types.d.ts +10 -0
  16. package/lib/esm/components/c4-cluster-overview/cluster-details.d.ts +7 -0
  17. package/lib/esm/components/c4-cluster-overview/cluster-details.js +5 -2
  18. package/lib/esm/components/c4-cluster-overview/cluster-load.d.ts +7 -0
  19. package/lib/esm/components/c4-cluster-overview/cluster-load.js +9 -5
  20. package/lib/esm/components/c4-cluster-settings/elements/danger-zone.js +2 -1
  21. package/lib/esm/components/c4-cluster-settings/elements/settings-tile.js +2 -1
  22. package/lib/esm/components/c4-job-dashboard-details-page/c4-job-dashboard-details-page.d.ts +1 -1
  23. package/lib/esm/components/c4-job-dashboard-details-page/c4-job-dashboard-details-page.js +2 -2
  24. package/lib/esm/components/c4-job-dashboard-details-page/c4-job-dashboard-details-page.types.d.ts +10 -0
  25. package/lib/esm/components/c4-job-dashboard-details-page/elements/c4-job-dashboard-chart-heading.js +2 -1
  26. package/lib/esm/components/c4-job-dashboard-details-page/elements/c4-job-dashboard-error-table.js +3 -2
  27. package/lib/esm/components/c4-job-dashboard-details-page/elements/c4-job-dashboard-worker-table.js +3 -2
  28. package/lib/esm/components/c4-job-dashboard-entry-point/c4-job-dashboard-entry-point.d.ts +1 -1
  29. package/lib/esm/components/c4-job-dashboard-entry-point/c4-job-dashboard-entry-point.js +7 -2
  30. package/lib/esm/components/c4-job-dashboard-entry-point/c4-job-dashboard-entry-point.types.d.ts +8 -0
  31. package/lib/esm/components/c4-job-dashboard-overview-page/c4-job-dashboard-overview.d.ts +1 -1
  32. package/lib/esm/components/c4-job-dashboard-overview-page/c4-job-dashboard-overview.js +2 -2
  33. package/lib/esm/components/c4-job-dashboard-overview-page/c4-job-dashboard-overview.types.d.ts +10 -0
  34. package/lib/esm/components/c4-job-dashboard-shared/c4-job-dashboard-error-handler.js +3 -2
  35. package/lib/esm/components/c4-link-button/c4-link-button.d.ts +1 -1
  36. package/lib/esm/components/c4-link-button/c4-link-button.js +2 -2
  37. package/lib/esm/components/c4-link-button/c4-link-button.types.d.ts +6 -0
  38. package/lib/esm/components/c4-page-template/c4-page-template.d.ts +13 -1
  39. package/lib/esm/components/c4-page-template/c4-page-template.js +3 -3
  40. package/lib/esm/i18n/en/pages/clusterdetails.json +3 -0
  41. package/lib/esm/i18n/en/pages/job-dashboard.json +2 -0
  42. package/lib/esm/index.d.ts +13 -1
  43. package/lib/esm/index.js +7 -1
  44. package/lib/esm/runtime/index.d.ts +1 -0
  45. package/lib/esm/runtime/index.js +1 -0
  46. package/lib/esm/utils/safe-translate.d.ts +27 -0
  47. package/lib/esm/utils/safe-translate.js +56 -0
  48. package/lib/esm/utils/section-heading-style.d.ts +13 -0
  49. package/lib/esm/utils/section-heading-style.js +25 -0
  50. package/lib/esm/widgets/c4-widget-scope.types.d.ts +20 -0
  51. package/lib/esm/widgets/c4-widget-scope.types.js +6 -0
  52. package/lib/esm/widgets/cluster-details/c4-cluster-details-app.js +24 -55
  53. package/lib/esm/widgets/cluster-details/c4-cluster-details-app.types.d.ts +27 -0
  54. package/lib/esm/widgets/cluster-details/c4-cluster-details-page.d.ts +1 -1
  55. package/lib/esm/widgets/cluster-details/c4-cluster-details-page.js +31 -4
  56. package/lib/esm/widgets/cluster-details/c4-cluster-details-page.types.d.ts +14 -0
  57. package/lib/esm/widgets/cluster-details/tabs/c4-cluster-details-byom-clients-tab.js +3 -2
  58. package/lib/esm/widgets/cluster-details/tabs/c4-cluster-details-clients-tab.d.ts +9 -1
  59. package/lib/esm/widgets/cluster-details/tabs/c4-cluster-details-clients-tab.js +5 -13
  60. package/lib/esm/widgets/cluster-details/tabs/c4-cluster-details-connector-secrets-tab.d.ts +31 -2
  61. package/lib/esm/widgets/cluster-details/tabs/c4-cluster-details-connector-secrets-tab.js +32 -22
  62. package/lib/esm/widgets/cluster-details/tabs/c4-cluster-details-overview-tab.d.ts +16 -1
  63. package/lib/esm/widgets/cluster-details/tabs/c4-cluster-details-overview-tab.js +7 -2
  64. package/lib/esm/widgets/clusters/c4-clusters-page.d.ts +1 -1
  65. package/lib/esm/widgets/clusters/c4-clusters-page.js +2 -2
  66. package/lib/esm/widgets/clusters/c4-clusters-page.types.d.ts +7 -0
  67. package/lib/esm/widgets/connector-management/c4-connector-management-executable-details-page.d.ts +1 -1
  68. package/lib/esm/widgets/connector-management/c4-connector-management-executable-details-page.js +10 -5
  69. package/lib/esm/widgets/connector-management/c4-connector-management-executable-details-page.types.d.ts +9 -0
  70. package/lib/esm/widgets/connector-management/c4-connector-management-executables-table-page.d.ts +1 -1
  71. package/lib/esm/widgets/connector-management/c4-connector-management-executables-table-page.js +10 -5
  72. package/lib/esm/widgets/connector-management/c4-connector-management-executables-table-page.types.d.ts +9 -0
  73. package/lib/esm/widgets/connector-management/c4-connector-management-outbound-details-page.d.ts +1 -1
  74. package/lib/esm/widgets/connector-management/c4-connector-management-outbound-details-page.js +10 -5
  75. package/lib/esm/widgets/connector-management/c4-connector-management-outbound-details-page.types.d.ts +9 -0
  76. package/lib/esm/widgets/connector-management/c4-connector-management-page.d.ts +1 -1
  77. package/lib/esm/widgets/connector-management/c4-connector-management-page.js +10 -5
  78. package/lib/esm/widgets/connector-management/c4-connector-management-page.types.d.ts +10 -0
  79. package/lib/esm/widgets/environment/c4-cluster-api-clients-widget.d.ts +5 -0
  80. package/lib/esm/widgets/environment/c4-cluster-api-clients-widget.js +61 -0
  81. package/lib/esm/widgets/environment/c4-cluster-api-clients-widget.types.d.ts +21 -0
  82. package/lib/esm/widgets/environment/c4-cluster-api-clients-widget.types.js +6 -0
  83. package/lib/esm/widgets/environment/c4-cluster-connector-secrets-widget.d.ts +5 -0
  84. package/lib/esm/widgets/environment/c4-cluster-connector-secrets-widget.js +58 -0
  85. package/lib/esm/widgets/environment/c4-cluster-connector-secrets-widget.types.d.ts +22 -0
  86. package/lib/esm/widgets/environment/c4-cluster-connector-secrets-widget.types.js +6 -0
  87. package/lib/esm/widgets/environment/use-cluster-api-clients.d.ts +26 -0
  88. package/lib/esm/widgets/environment/use-cluster-api-clients.js +48 -0
  89. package/lib/esm/widgets/environment/use-cluster-swagger-url.d.ts +19 -0
  90. package/lib/esm/widgets/environment/use-cluster-swagger-url.js +44 -0
  91. package/lib/esm/widgets/environment/use-cluster-version-flags.d.ts +16 -0
  92. package/lib/esm/widgets/environment/use-cluster-version-flags.js +40 -0
  93. package/lib/esm/widgets/job-worker/c4-job-worker-details-page.d.ts +1 -1
  94. package/lib/esm/widgets/job-worker/c4-job-worker-details-page.js +34 -25
  95. package/lib/esm/widgets/job-worker/c4-job-worker-overview-page.d.ts +1 -1
  96. package/lib/esm/widgets/job-worker/c4-job-worker-overview-page.js +26 -21
  97. package/lib/esm/widgets/job-worker/c4-job-worker.helpers.d.ts +12 -0
  98. package/lib/esm/widgets/job-worker/c4-job-worker.helpers.js +6 -0
  99. package/lib/esm/widgets/job-worker/c4-job-worker.types.d.ts +19 -0
  100. package/package.json +6 -6
@@ -0,0 +1,16 @@
1
+ import type { ConsoleClusterDto } from '@camunda/ccma-shared-types';
2
+ export interface ClusterVersionFlags {
3
+ /** Identity-backed authorizations, available from Zeebe 8.8.0-alpha5. */
4
+ hasIdentityIntegration: boolean;
5
+ /** 8.10+ renames "Connector secrets" to "Cluster secrets" in the UI. */
6
+ useClusterSecretsLabel: boolean;
7
+ }
8
+ /**
9
+ * Version-gated capability flags derived from a cluster's Zeebe version.
10
+ *
11
+ * Extracted from `C4ClusterDetailsApp` so the app and every standalone widget
12
+ * that needs one of these flags (`C4ClusterApiClientsWidget`,
13
+ * `C4ClusterConnectorSecretsWidget`) share one implementation — otherwise the
14
+ * same two version gates would be copied three times and could drift.
15
+ */
16
+ export declare function useClusterVersionFlags(cluster: ConsoleClusterDto | undefined): ClusterVersionFlags;
@@ -0,0 +1,40 @@
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
+ import { CLUSTER_SECRETS_LABEL_MIN_VERSION, checkVersion, IDENTITY_MANAGEMENT_MIN_VERSION, VersionCheckOperator, } from '@camunda/ccma-shared-types';
7
+ import { useMemo } from 'react';
8
+ /**
9
+ * Version-gated capability flags derived from a cluster's Zeebe version.
10
+ *
11
+ * Extracted from `C4ClusterDetailsApp` so the app and every standalone widget
12
+ * that needs one of these flags (`C4ClusterApiClientsWidget`,
13
+ * `C4ClusterConnectorSecretsWidget`) share one implementation — otherwise the
14
+ * same two version gates would be copied three times and could drift.
15
+ */
16
+ export function useClusterVersionFlags(cluster) {
17
+ const zeebeVersion = cluster?.generation?.versions?.zeebe;
18
+ const hasIdentityIntegration = useMemo(() => {
19
+ if (!zeebeVersion)
20
+ return false;
21
+ return checkVersion({
22
+ possiblyVersionOrDockerPath: zeebeVersion,
23
+ trueForSnapshot: true,
24
+ operator: VersionCheckOperator.GreaterThanOrEqual,
25
+ versionToCompareTo: IDENTITY_MANAGEMENT_MIN_VERSION,
26
+ trueOnInvalidVersion: false,
27
+ });
28
+ }, [zeebeVersion]);
29
+ const useClusterSecretsLabel = useMemo(() => {
30
+ if (!zeebeVersion)
31
+ return false;
32
+ return checkVersion({
33
+ possiblyVersionOrDockerPath: zeebeVersion,
34
+ trueForSnapshot: 'compare',
35
+ operator: VersionCheckOperator.GreaterThanOrEqual,
36
+ versionToCompareTo: CLUSTER_SECRETS_LABEL_MIN_VERSION,
37
+ });
38
+ }, [zeebeVersion]);
39
+ return { hasIdentityIntegration, useClusterSecretsLabel };
40
+ }
@@ -1,5 +1,5 @@
1
1
  import type { JSX } from 'react';
2
2
  import type { C4JobWorkerDetailsPageProps } from './c4-job-worker.types.js';
3
- export declare const C4JobWorkerDetailsPage: (({ orgId, clusterId, jobType: jobTypeProp, onNavigate, }: C4JobWorkerDetailsPageProps) => JSX.Element) & {
3
+ export declare const C4JobWorkerDetailsPage: (({ orgId, clusterId, jobType: jobTypeProp, onNavigate, scope, }: C4JobWorkerDetailsPageProps) => JSX.Element) & {
4
4
  displayName: string;
5
5
  };
@@ -10,8 +10,8 @@ import { useCallback, useEffect, useMemo, useState } from 'react';
10
10
  import { C4JobDashboardDetailsPage } from '../../components/c4-job-dashboard-details-page/c4-job-dashboard-details-page.js';
11
11
  import { useC4ConsoleRuntime } from '../../runtime/c4-console-runtime-context.js';
12
12
  import { toApiConfig } from '../../runtime/to-api-config.js';
13
- import { getRegion, latestUpdateTime, makeTr, safeDecodeURIComponent, safeT, toJobsError, } from './c4-job-worker.helpers.js';
14
- function buildDetailsTranslations(tr) {
13
+ import { getRegion, latestUpdateTime, makeScopedTr, makeTr, safeDecodeURIComponent, safeT, toJobsError, } from './c4-job-worker.helpers.js';
14
+ function buildDetailsTranslations(tr, trScoped) {
15
15
  return {
16
16
  title: tr('details.title', 'Job type details'),
17
17
  lastUpdated: tr('shared.lastUpdated', 'Last updated'),
@@ -75,7 +75,7 @@ function buildDetailsTranslations(tr) {
75
75
  },
76
76
  empty: {
77
77
  title: tr('shared.errorHandler.empty.title', 'No data available.'),
78
- description: tr('shared.errorHandler.empty.description', 'No data was found for this cluster.'),
78
+ description: trScoped('shared.errorHandler.empty.description', 'No data was found for this cluster.', 'No data was found for this environment.'),
79
79
  learnMoreLabel: tr('shared.errorHandler.empty.learnMoreLabel', 'Learn more about jobs and job workers'),
80
80
  },
81
81
  generalError: {
@@ -101,11 +101,12 @@ const INITIAL_JOB_DATA = {
101
101
  const INITIAL_WORKER_DATA = { items: [], isLoading: false };
102
102
  const INITIAL_TIME_SERIES = { items: [], isLoading: false };
103
103
  const INITIAL_ERROR_DATA = { items: [], isLoading: false };
104
- export const C4JobWorkerDetailsPage = observer(({ orgId, clusterId, jobType: jobTypeProp, onNavigate, }) => {
104
+ export const C4JobWorkerDetailsPage = observer(({ orgId, clusterId, jobType: jobTypeProp, onNavigate, scope = 'cluster', }) => {
105
105
  const runtime = useC4ConsoleRuntime();
106
106
  const apiConfig = useMemo(() => toApiConfig(runtime), [runtime]);
107
107
  const t = runtime.i18n?.t;
108
108
  const tr = useMemo(() => makeTr(t), [t]);
109
+ const trScoped = useMemo(() => makeScopedTr(tr, scope), [tr, scope]);
109
110
  const [cluster, setCluster] = useState();
110
111
  const [clusterLoading, setClusterLoading] = useState(false);
111
112
  const [config, setConfig] = useState();
@@ -284,26 +285,34 @@ export const C4JobWorkerDetailsPage = observer(({ orgId, clusterId, jobType: job
284
285
  useEffect(() => {
285
286
  void loadData();
286
287
  }, [loadData]);
287
- const translations = useMemo(() => buildDetailsTranslations(tr), [tr]);
288
- const breadcrumb = useMemo(() => ({
289
- elements: [
290
- {
291
- key: '1',
292
- label: safeT(t, 'c4console:clusters.list.title', 'Clusters'),
293
- onClick: () => onNavigate?.({ kind: 'clusters', orgId }),
294
- },
295
- {
296
- key: '2',
297
- label: cluster?.name ?? clusterId,
298
- onClick: () => onNavigate?.({ kind: 'clusterDetails', orgId, clusterId }),
299
- },
300
- {
301
- key: '3',
302
- label: safeT(t, 'c4console:clusters.details.jobDashboard', 'Job dashboard'),
303
- onClick: () => onNavigate?.({ kind: 'jobWorkerOverview', orgId, clusterId }),
304
- },
305
- ],
306
- }), [cluster?.name, clusterId, onNavigate, orgId, t]);
288
+ const translations = useMemo(() => buildDetailsTranslations(tr, trScoped), [tr, trScoped]);
289
+ // In environment scope the host page owns the breadcrumb, so this widget
290
+ // contributes no trail of its own.
291
+ const breadcrumb = useMemo(() => scope === 'environment'
292
+ ? { elements: [] }
293
+ : {
294
+ elements: [
295
+ {
296
+ key: '1',
297
+ label: safeT(t, 'c4console:clusters.list.title', 'Clusters'),
298
+ onClick: () => onNavigate?.({ kind: 'clusters', orgId }),
299
+ },
300
+ {
301
+ key: '2',
302
+ label: cluster?.name ?? clusterId,
303
+ onClick: () => onNavigate?.({ kind: 'clusterDetails', orgId, clusterId }),
304
+ },
305
+ {
306
+ key: '3',
307
+ label: safeT(t, 'c4console:clusters.details.jobDashboard', 'Job dashboard'),
308
+ onClick: () => onNavigate?.({
309
+ kind: 'jobWorkerOverview',
310
+ orgId,
311
+ clusterId,
312
+ }),
313
+ },
314
+ ],
315
+ }, [cluster?.name, clusterId, onNavigate, orgId, scope, t]);
307
316
  const operateBaseUrl = cluster?.status?.operateUrl ?? null;
308
- return (_jsx(C4JobDashboardDetailsPage, { jobType: safeDecodeURIComponent(jobTypeProp), config: config, isLoadingConfig: configLoading || clusterLoading, lastUpdatedAt: lastUpdatedAt, breadcrumb: breadcrumb, jobData: jobData, workerData: workerData, timeSeries: timeSeries, errorData: { ...errorData, operateBaseUrl }, onTimeRangeChange: setRange, translations: translations }));
317
+ return (_jsx(C4JobDashboardDetailsPage, { jobType: safeDecodeURIComponent(jobTypeProp), config: config, isLoadingConfig: configLoading || clusterLoading, lastUpdatedAt: lastUpdatedAt, breadcrumb: breadcrumb, jobData: jobData, workerData: workerData, timeSeries: timeSeries, errorData: { ...errorData, operateBaseUrl }, onTimeRangeChange: setRange, translations: translations, padding: scope === 'environment' ? 'none' : 'default' }));
309
318
  });
@@ -1,5 +1,5 @@
1
1
  import type { JSX } from 'react';
2
2
  import type { C4JobWorkerOverviewPageProps } from './c4-job-worker.types.js';
3
- export declare const C4JobWorkerOverviewPage: (({ orgId, clusterId, onNavigate, }: C4JobWorkerOverviewPageProps) => JSX.Element) & {
3
+ export declare const C4JobWorkerOverviewPage: (({ orgId, clusterId, onNavigate, scope, }: C4JobWorkerOverviewPageProps) => JSX.Element) & {
4
4
  displayName: string;
5
5
  };
@@ -10,11 +10,11 @@ import { useCallback, useEffect, useMemo, useState } from 'react';
10
10
  import { C4JobDashboardOverviewPage } from '../../components/c4-job-dashboard-overview-page/c4-job-dashboard-overview.js';
11
11
  import { useC4ConsoleRuntime } from '../../runtime/c4-console-runtime-context.js';
12
12
  import { toApiConfig } from '../../runtime/to-api-config.js';
13
- import { getRegion, latestUpdateTime, makeTr, safeT, toJobsError, } from './c4-job-worker.helpers.js';
14
- function buildOverviewTranslations(tr) {
13
+ import { getRegion, latestUpdateTime, makeScopedTr, makeTr, safeT, toJobsError, } from './c4-job-worker.helpers.js';
14
+ function buildOverviewTranslations(tr, trScoped) {
15
15
  return {
16
16
  title: tr('overview.title', 'Job types'),
17
- description: tr('overview.description', 'View all job types running against the cluster.'),
17
+ description: trScoped('overview.description', 'View all job types running against the cluster.', 'View all job types running against the environment.'),
18
18
  learnMoreLabel: tr('overview.learnMoreLabel', 'See more information about job types here.'),
19
19
  searchLabel: tr('overview.search.label', 'Search'),
20
20
  lastUpdated: tr('shared.lastUpdated', 'Last updated'),
@@ -42,7 +42,7 @@ function buildOverviewTranslations(tr) {
42
42
  },
43
43
  empty: {
44
44
  title: tr('shared.errorHandler.empty.title', 'No data available.'),
45
- description: tr('shared.errorHandler.empty.description', 'No data was found for this cluster.'),
45
+ description: trScoped('shared.errorHandler.empty.description', 'No data was found for this cluster.', 'No data was found for this environment.'),
46
46
  learnMoreLabel: tr('shared.errorHandler.empty.learnMoreLabel', 'Learn more about Jobs and Job workers'),
47
47
  },
48
48
  generalError: {
@@ -61,11 +61,12 @@ function buildOverviewTranslations(tr) {
61
61
  },
62
62
  };
63
63
  }
64
- export const C4JobWorkerOverviewPage = observer(({ orgId, clusterId, onNavigate, }) => {
64
+ export const C4JobWorkerOverviewPage = observer(({ orgId, clusterId, onNavigate, scope = 'cluster', }) => {
65
65
  const runtime = useC4ConsoleRuntime();
66
66
  const apiConfig = useMemo(() => toApiConfig(runtime), [runtime]);
67
67
  const t = runtime.i18n?.t;
68
68
  const tr = useMemo(() => makeTr(t), [t]);
69
+ const trScoped = useMemo(() => makeScopedTr(tr, scope), [tr, scope]);
69
70
  const [cluster, setCluster] = useState();
70
71
  const [clusterLoading, setClusterLoading] = useState(false);
71
72
  const [config, setConfig] = useState();
@@ -178,20 +179,24 @@ export const C4JobWorkerOverviewPage = observer(({ orgId, clusterId, onNavigate,
178
179
  useEffect(() => {
179
180
  void loadData();
180
181
  }, [loadData]);
181
- const translations = useMemo(() => buildOverviewTranslations(tr), [tr]);
182
- const breadcrumb = useMemo(() => ({
183
- elements: [
184
- {
185
- key: '1',
186
- label: safeT(t, 'c4console:clusters.list.title', 'Clusters'),
187
- onClick: () => onNavigate?.({ kind: 'clusters', orgId }),
188
- },
189
- {
190
- key: '2',
191
- label: cluster?.name ?? clusterId,
192
- onClick: () => onNavigate?.({ kind: 'clusterDetails', orgId, clusterId }),
193
- },
194
- ],
195
- }), [cluster?.name, clusterId, onNavigate, orgId, t]);
196
- return (_jsx(C4JobDashboardOverviewPage, { breadcrumb: breadcrumb, lastUpdatedAt: lastUpdatedAt, items: items, onTimeRangeChange: setRange, error: tableError, config: config, isIncomplete: isIncomplete, isLoadingConfig: configLoading || clusterLoading, isLoadingTable: tableLoading, translations: translations }));
182
+ const translations = useMemo(() => buildOverviewTranslations(tr, trScoped), [tr, trScoped]);
183
+ // In environment scope the host page owns the breadcrumb, so this widget
184
+ // contributes no trail of its own.
185
+ const breadcrumb = useMemo(() => scope === 'environment'
186
+ ? { elements: [] }
187
+ : {
188
+ elements: [
189
+ {
190
+ key: '1',
191
+ label: safeT(t, 'c4console:clusters.list.title', 'Clusters'),
192
+ onClick: () => onNavigate?.({ kind: 'clusters', orgId }),
193
+ },
194
+ {
195
+ key: '2',
196
+ label: cluster?.name ?? clusterId,
197
+ onClick: () => onNavigate?.({ kind: 'clusterDetails', orgId, clusterId }),
198
+ },
199
+ ],
200
+ }, [cluster?.name, clusterId, onNavigate, orgId, scope, t]);
201
+ return (_jsx(C4JobDashboardOverviewPage, { breadcrumb: breadcrumb, lastUpdatedAt: lastUpdatedAt, items: items, onTimeRangeChange: setRange, error: tableError, config: config, isIncomplete: isIncomplete, isLoadingConfig: configLoading || clusterLoading, isLoadingTable: tableLoading, translations: translations, padding: scope === 'environment' ? 'none' : 'default' }));
197
202
  });
@@ -1,7 +1,19 @@
1
1
  import type { ConsoleClusterDto } from '@camunda/ccma-shared-types';
2
2
  import type { JobsError } from '../../components/c4-job-dashboard-shared/c4-job-dashboard-shared.types.js';
3
+ import type { C4WidgetScope } from '../c4-widget-scope.types.js';
3
4
  export type TranslateFn = (key: string) => string;
4
5
  export type Tr = (key: string, fallback: string) => string;
6
+ /**
7
+ * Resolves a copy string that reads differently per scope. In `'cluster'` scope
8
+ * it resolves `key`; in `'environment'` scope it resolves
9
+ * `<key>_environment` so both wordings can be translated independently.
10
+ *
11
+ * Composes over `Tr` rather than the shared `scopedTranslate`, because `Tr`
12
+ * already applies this module's `jobDashboard:` namespace. The suffix itself
13
+ * comes from `utils/safe-translate` so the convention lives in one place.
14
+ */
15
+ export type ScopedTr = (key: string, clusterFallback: string, environmentFallback: string) => string;
16
+ export declare function makeScopedTr(tr: Tr, scope: C4WidgetScope): ScopedTr;
5
17
  export declare function makeTr(t: TranslateFn | undefined): Tr;
6
18
  export declare function safeT(t: TranslateFn | undefined, key: string, fallback: string): string;
7
19
  export declare function getRegion(cluster: ConsoleClusterDto): string;
@@ -3,6 +3,12 @@
3
3
  * under one or more contributor license agreements. Licensed under a commercial license.
4
4
  * You may not use this file except in compliance with the commercial license.
5
5
  */
6
+ import { ENVIRONMENT_KEY_SUFFIX } from '../../utils/safe-translate.js';
7
+ export function makeScopedTr(tr, scope) {
8
+ return (key, clusterFallback, environmentFallback) => scope === 'environment'
9
+ ? tr(`${key}${ENVIRONMENT_KEY_SUFFIX}`, environmentFallback)
10
+ : tr(key, clusterFallback);
11
+ }
6
12
  export function makeTr(t) {
7
13
  return (key, fallback) => {
8
14
  if (!t)
@@ -1,3 +1,4 @@
1
+ import type { C4WidgetScope } from '../c4-widget-scope.types.js';
1
2
  export type C4JobWorkerNavigateEvent = {
2
3
  kind: 'clusters';
3
4
  orgId: string;
@@ -19,10 +20,28 @@ export interface C4JobWorkerOverviewPageProps {
19
20
  orgId: string;
20
21
  clusterId: string;
21
22
  onNavigate?: (event: C4JobWorkerNavigateEvent) => void;
23
+ /**
24
+ * Surface this page is rendered on. Defaults to `'cluster'`.
25
+ *
26
+ * `'environment'` switches the copy that describes the surface to environment
27
+ * wording, and **suppresses the page's own breadcrumb and page padding** — on
28
+ * an environment page the host owns navigation and spacing, so the widget
29
+ * renders only its title and content.
30
+ */
31
+ scope?: C4WidgetScope;
22
32
  }
23
33
  export interface C4JobWorkerDetailsPageProps {
24
34
  orgId: string;
25
35
  clusterId: string;
26
36
  jobType: string;
27
37
  onNavigate?: (event: C4JobWorkerNavigateEvent) => void;
38
+ /**
39
+ * Surface this page is rendered on. Defaults to `'cluster'`.
40
+ *
41
+ * `'environment'` switches the copy that describes the surface to environment
42
+ * wording, and **suppresses the page's own breadcrumb and page padding** — on
43
+ * an environment page the host owns navigation and spacing, so the widget
44
+ * renders only its title and content.
45
+ */
46
+ scope?: C4WidgetScope;
28
47
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@camunda/ccma-saas-frontend",
3
- "version": "0.7.1",
3
+ "version": "0.7.2",
4
4
  "description": "Camunda Composite Components",
5
5
  "bugs": {
6
6
  "url": "https://github.com/camunda/camunda-cloud-management-apps/issues"
@@ -46,6 +46,7 @@
46
46
  "@camunda/c4-connectors": "1.10.3",
47
47
  "@playwright/test": "1.62.0",
48
48
  "@camunda/c4-identity": "0.0.45",
49
+ "@camunda/camunda-composite-components": "0.25.4",
49
50
  "@camunda/design-system": "0.48.0",
50
51
  "@carbon/charts": "1.27.17",
51
52
  "@carbon/charts-react": "1.27.16",
@@ -76,8 +77,7 @@
76
77
  "react-is": "19.2.8",
77
78
  "rimraf": "6.1.3",
78
79
  "storybook": "10.5.5",
79
- "styled-components": "6.4.4",
80
- "@camunda/camunda-composite-components": "0.25.4"
80
+ "styled-components": "6.4.4"
81
81
  },
82
82
  "peerDependencies": {
83
83
  "@camunda/c4-connectors": "1.x",
@@ -96,13 +96,13 @@
96
96
  "react-markdown": "^8.0.7 || ^10.0.0"
97
97
  },
98
98
  "dependencies": {
99
+ "@camunda/ccma-api": "0.5.3",
100
+ "@camunda/ccma-shared-types": "0.7.0",
99
101
  "@pactsafe/pactsafe-react-sdk": "2.15.0",
100
102
  "cron-parser": "5.6.2",
101
103
  "mobx": "6.16.1",
102
104
  "mobx-react-lite": "4.1.1",
103
- "mobx-state-tree": "7.3.1",
104
- "@camunda/ccma-api": "0.5.3",
105
- "@camunda/ccma-shared-types": "0.7.0"
105
+ "mobx-state-tree": "7.3.1"
106
106
  },
107
107
  "scripts": {
108
108
  "clean": "rimraf lib/",