@camunda/ccma-saas-frontend 0.15.1 → 0.17.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-audit-log/c4-audit-log.js +53 -42
- package/lib/esm/components/c4-billing-page/c4-billing-page.js +5 -1
- package/lib/esm/components/c4-breadcrumb/c4-breadcrumb.js +8 -3
- package/lib/esm/components/c4-cluster-byom-clients/c4-cluster-byom-clients.d.ts +10 -0
- package/lib/esm/components/c4-cluster-byom-clients/c4-cluster-byom-clients.js +9 -1
- package/lib/esm/components/c4-cluster-client-credentials/c4-cluster-client-credentials.js +13 -5
- package/lib/esm/components/c4-cluster-client-credentials/ds-credential-items.d.ts +14 -0
- package/lib/esm/components/c4-cluster-client-credentials/ds-credential-items.js +18 -0
- package/lib/esm/components/c4-cluster-client-credentials-identity/c4-cluster-client-credentials-identity.js +18 -7
- package/lib/esm/components/c4-cluster-details-clients/c4-cluster-details-clients.mocks.js +2 -2
- package/lib/esm/components/c4-cluster-list/c4-cluster-list.js +4 -10
- package/lib/esm/components/c4-cluster-list/c4-cluster-list.types.d.ts +1 -4
- package/lib/esm/components/c4-cluster-overview/applications.d.ts +16 -0
- package/lib/esm/components/c4-cluster-overview/applications.js +130 -17
- package/lib/esm/components/c4-cluster-overview/c4-cluster-overview.d.ts +34 -1
- package/lib/esm/components/c4-cluster-overview/c4-cluster-overview.js +31 -0
- package/lib/esm/components/c4-cluster-overview/cluster-details.js +11 -9
- package/lib/esm/components/c4-cluster-overview/cluster-load.d.ts +4 -3
- package/lib/esm/components/c4-cluster-overview/cluster-load.js +17 -13
- package/lib/esm/components/c4-cluster-overview/ds-section.d.ts +23 -0
- package/lib/esm/components/c4-cluster-overview/ds-section.js +19 -0
- package/lib/esm/components/c4-cluster-overview/ds-status-icon-text.d.ts +33 -0
- package/lib/esm/components/c4-cluster-overview/ds-status-icon-text.js +34 -0
- package/lib/esm/components/c4-cluster-settings/elements/external-identity-provider-modal.js +7 -1
- package/lib/esm/components/c4-cluster-settings/elements/settings-tile.d.ts +6 -1
- package/lib/esm/components/c4-cluster-settings/elements/settings-tile.js +5 -2
- package/lib/esm/components/c4-console-dashboard/c4-console-dashboard.js +4 -5
- package/lib/esm/components/c4-create-cluster/c4-create-cluster-tile-grid.js +40 -15
- package/lib/esm/components/c4-create-cluster/c4-create-cluster.js +24 -4
- package/lib/esm/components/c4-create-cluster/c4-create-cluster.types.d.ts +12 -0
- package/lib/esm/components/c4-create-cluster-api-client-modal/c4-create-cluster-api-client-modal.js +2 -1
- package/lib/esm/components/c4-create-cluster-api-client-modal/scopes-description-text.d.ts +11 -0
- package/lib/esm/components/c4-create-cluster-api-client-modal/scopes-description-text.js +16 -0
- package/lib/esm/components/c4-inline-notification/c4-inline-notification.js +4 -1
- package/lib/esm/components/c4-invite-user-to-organization-modal/c4-invite-user-to-organization-modal.js +6 -2
- package/lib/esm/components/c4-invite-user-to-organization-modal/c4-invite-user-to-organization-modal.types.d.ts +6 -0
- package/lib/esm/components/c4-job-dashboard-details-page/c4-job-dashboard-details-page.mocks.js +1 -1
- package/lib/esm/components/c4-job-dashboard-details-page/elements/c4-job-dashboard-error-table.js +1 -0
- package/lib/esm/components/c4-job-dashboard-details-page/elements/c4-job-dashboard-piechart.js +1 -1
- package/lib/esm/components/c4-job-dashboard-details-page/elements/c4-job-dashboard-time-chart.js +13 -6
- package/lib/esm/components/c4-job-dashboard-entry-point/c4-job-dashboard-entry-point.js +24 -5
- package/lib/esm/components/c4-job-dashboard-entry-point/c4-job-dashboard-entry-point.types.d.ts +4 -4
- package/lib/esm/components/c4-job-dashboard-overview-page/c4-job-dashboard-overview.mocks.js +1 -1
- package/lib/esm/components/c4-job-dashboard-shared/c4-job-dashboard-ds-colors.d.ts +1 -1
- package/lib/esm/components/c4-job-dashboard-shared/c4-job-dashboard-ds-colors.js +3 -1
- package/lib/esm/components/c4-job-dashboard-shared/c4-job-dashboard-error-handler.d.ts +7 -1
- package/lib/esm/components/c4-job-dashboard-shared/c4-job-dashboard-error-handler.js +8 -4
- package/lib/esm/components/c4-job-dashboard-shared/c4-job-dashboard-time-range-dropdown.js +6 -1
- package/lib/esm/components/c4-management-settings/c4-management-settings.js +58 -42
- package/lib/esm/components/c4-multi-step-modal/c4-multi-step-modal.js +4 -0
- package/lib/esm/components/c4-old-dashboard/c4-old-dashboard.js +11 -10
- package/lib/esm/components/c4-old-dashboard/c4-old-dashboard.types.d.ts +4 -0
- package/lib/esm/components/c4-pricing-card/c4-pricing-card.js +9 -1
- package/lib/esm/components/c4-sm-cluster-details/details.js +2 -8
- package/lib/esm/components/c4-tabs/c4-tabs.js +6 -1
- package/lib/esm/components/c4-usage-history/elements/usage-history-charts.d.ts +3 -3
- package/lib/esm/components/c4-usage-metrics-per-cluster/c4-usage-metrics-per-cluster.js +2 -8
- package/lib/esm/externalUrls.const.d.ts +1 -1
- package/lib/esm/externalUrls.const.js +1 -2
- package/lib/esm/i18n/en/modals/billing.json +2 -2
- package/lib/esm/i18n/en/modals/clusterclients.json +6 -6
- package/lib/esm/i18n/en/modals/invitations.json +1 -0
- package/lib/esm/i18n/en/modals/users.json +1 -0
- package/lib/esm/i18n/en/pages/clusterdetails.json +4 -1
- package/lib/esm/i18n/en/pages/createcluster.json +5 -0
- package/lib/esm/i18n/en/pages/dashboard.json +7 -5
- package/lib/esm/i18n/en/pages/orgmanagement.json +4 -0
- package/lib/esm/index.d.ts +1 -1
- package/lib/esm/index.js +1 -1
- package/lib/esm/runtime/c4-console-events-context.d.ts +5 -1
- package/lib/esm/runtime/c4-console-events-context.js +16 -2
- package/lib/esm/runtime/c4-console-runtime-context.d.ts +7 -6
- package/lib/esm/runtime/c4-console-runtime-context.js +29 -12
- package/lib/esm/runtime/c4-console-runtime.types.d.ts +7 -7
- package/lib/esm/runtime/c4-user-notifications-context.js +6 -2
- package/lib/esm/runtime/c4-user-notifications-context.types.d.ts +5 -1
- package/lib/esm/runtime/use-hub-api-naming.d.ts +8 -11
- package/lib/esm/runtime/use-hub-api-naming.js +9 -12
- package/lib/esm/runtime/use-is-qa-user.d.ts +23 -0
- package/lib/esm/runtime/use-is-qa-user.js +64 -0
- package/lib/esm/ui/c4-cluster-tag.d.ts +11 -0
- package/lib/esm/ui/c4-cluster-tag.js +39 -0
- package/lib/esm/ui/ds-compact-code-block.d.ts +15 -0
- package/lib/esm/ui/ds-compact-code-block.js +33 -0
- package/lib/esm/ui/index.d.ts +13 -3
- package/lib/esm/ui/index.js +14 -7
- package/lib/esm/widgets/cluster-details/c4-cluster-details-app.js +21 -6
- package/lib/esm/widgets/cluster-details/c4-cluster-details-app.types.d.ts +4 -2
- package/lib/esm/widgets/cluster-details/c4-cluster-details-page.d.ts +1 -1
- package/lib/esm/widgets/cluster-details/c4-cluster-details-page.js +31 -12
- package/lib/esm/widgets/cluster-details/c4-cluster-details-page.types.d.ts +6 -1
- package/lib/esm/widgets/cluster-details/cluster-region-code.d.ts +8 -0
- package/lib/esm/widgets/cluster-details/cluster-region-code.js +17 -0
- package/lib/esm/widgets/cluster-details/tabs/c4-cluster-details-byom-clients-tab.js +44 -6
- package/lib/esm/widgets/cluster-details/tabs/c4-cluster-details-clients-tab.js +6 -4
- package/lib/esm/widgets/cluster-details/tabs/c4-cluster-details-hot-backups-tab.js +2 -14
- package/lib/esm/widgets/cluster-details/tabs/c4-cluster-details-overview-tab.d.ts +7 -0
- package/lib/esm/widgets/cluster-details/tabs/c4-cluster-details-overview-tab.js +23 -11
- package/lib/esm/widgets/cluster-details/tabs/c4-cluster-details-settings-tab.js +11 -15
- package/lib/esm/widgets/cluster-details/upgrade-gate.d.ts +23 -0
- package/lib/esm/widgets/cluster-details/upgrade-gate.js +36 -0
- package/lib/esm/widgets/cluster-details/use-upgrade-gate.d.ts +24 -0
- package/lib/esm/widgets/cluster-details/use-upgrade-gate.js +73 -0
- package/lib/esm/widgets/clusters/c4-clusters-page.js +0 -4
- package/lib/esm/widgets/create-cluster/c4-create-cluster-page.d.ts +4 -1
- package/lib/esm/widgets/create-cluster/c4-create-cluster-page.js +44 -17
- package/lib/esm/widgets/create-cluster/c4-create-cluster-page.types.d.ts +0 -3
- package/lib/esm/widgets/dashboard/c4-dashboard-app.js +12 -11
- package/lib/esm/widgets/dashboard/c4-dashboard-app.types.d.ts +2 -3
- package/lib/esm/widgets/group-details/c4-group-details-page.d.ts +1 -1
- package/lib/esm/widgets/group-details/c4-group-details-page.js +10 -3
- package/lib/esm/widgets/group-details/c4-group-details-page.types.d.ts +5 -0
- package/lib/esm/widgets/management/c4-management-app.d.ts +1 -1
- package/lib/esm/widgets/management/c4-management-app.js +34 -36
- package/lib/esm/widgets/management/c4-management-app.types.d.ts +10 -9
- package/lib/esm/widgets/management/tabs/c4-management-billing-tab.d.ts +0 -1
- package/lib/esm/widgets/management/tabs/c4-management-billing-tab.js +1 -2
- package/lib/esm/widgets/management/tabs/c4-management-pricing-tab.js +1 -1
- package/lib/esm/widgets/management/tabs/c4-management-usage-tab.d.ts +2 -2
- package/lib/esm/widgets/management/tabs/c4-management-users-tab.d.ts +3 -1
- package/lib/esm/widgets/management/tabs/c4-management-users-tab.js +2 -2
- 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 +5 -2
- package/lib/esm/widgets/user-details/c4-user-details-page.types.d.ts +5 -0
- package/package.json +23 -23
- package/lib/esm/runtime/cluster-duplication.d.ts +0 -10
- package/lib/esm/runtime/cluster-duplication.js +0 -15
- package/lib/esm/widgets/management/tabs/c4-management-groups-tab.d.ts +0 -13
- package/lib/esm/widgets/management/tabs/c4-management-groups-tab.js +0 -26
|
@@ -5,7 +5,11 @@ interface C4ConsoleEventsState {
|
|
|
5
5
|
}
|
|
6
6
|
export interface C4ConsoleEventsProviderProps {
|
|
7
7
|
children: React.ReactNode;
|
|
8
|
-
/**
|
|
8
|
+
/**
|
|
9
|
+
* Set `false` to disable the live subscription, for example in Storybook or
|
|
10
|
+
* in tests. Default `true`. The provider also opens no stream for a QA user
|
|
11
|
+
* (`useIsQaUser`).
|
|
12
|
+
*/
|
|
9
13
|
live?: boolean;
|
|
10
14
|
}
|
|
11
15
|
export declare const C4ConsoleEventsProvider: ({ children, live, }: C4ConsoleEventsProviderProps) => React.JSX.Element;
|
|
@@ -8,6 +8,7 @@ import { ExternalConsoleService, } from '@camunda/ccma-api';
|
|
|
8
8
|
import { createContext, useContext, useEffect, useMemo, useState } from 'react';
|
|
9
9
|
import { useC4ConsoleRuntime } from './c4-console-runtime-context.js';
|
|
10
10
|
import { toApiConfig } from './to-api-config.js';
|
|
11
|
+
import { useIsQaUser } from './use-is-qa-user.js';
|
|
11
12
|
/**
|
|
12
13
|
* Bridges the Console org/cluster SSE stream to the `clusterchange` window
|
|
13
14
|
* event that `C4ConsoleDataProvider` (and legacy c3 `useClusterUpdate`
|
|
@@ -24,9 +25,19 @@ const EventsContext = createContext(undefined);
|
|
|
24
25
|
let mountedBridgeCount = 0;
|
|
25
26
|
export const C4ConsoleEventsProvider = ({ children, live = true, }) => {
|
|
26
27
|
const runtime = useC4ConsoleRuntime();
|
|
28
|
+
// An automated QA run opens a new browser for each test, and no test reads
|
|
29
|
+
// the stream. The stream waits until the provider knows the user is no QA user.
|
|
30
|
+
const isQaUser = useIsQaUser(runtime);
|
|
31
|
+
const connects = live && isQaUser === false;
|
|
27
32
|
const [state, setState] = useState(live ? 'connecting' : 'closed');
|
|
33
|
+
// The provider opens no stream in these two cases, thus its state is closed.
|
|
28
34
|
useEffect(() => {
|
|
29
|
-
if (!live ||
|
|
35
|
+
if (!live || isQaUser) {
|
|
36
|
+
setState('closed');
|
|
37
|
+
}
|
|
38
|
+
}, [live, isQaUser]);
|
|
39
|
+
useEffect(() => {
|
|
40
|
+
if (!connects || typeof window === 'undefined') {
|
|
30
41
|
return;
|
|
31
42
|
}
|
|
32
43
|
mountedBridgeCount += 1;
|
|
@@ -37,6 +48,9 @@ export const C4ConsoleEventsProvider = ({ children, live = true, }) => {
|
|
|
37
48
|
'double-dispatches SSE events. Mount exactly one. See ' +
|
|
38
49
|
'packages/c4/docs/runtime.md.');
|
|
39
50
|
}
|
|
51
|
+
// `connectSse` starts in `connecting` but does not report it. After a QA
|
|
52
|
+
// session the state is `closed`, and it would stay so until the stream opens.
|
|
53
|
+
setState('connecting');
|
|
40
54
|
const connection = ExternalConsoleService.streamOrgEvents({
|
|
41
55
|
config: toApiConfig(runtime),
|
|
42
56
|
onStateChange: setState,
|
|
@@ -48,7 +62,7 @@ export const C4ConsoleEventsProvider = ({ children, live = true, }) => {
|
|
|
48
62
|
mountedBridgeCount -= 1;
|
|
49
63
|
connection.close();
|
|
50
64
|
};
|
|
51
|
-
}, [
|
|
65
|
+
}, [connects, runtime]);
|
|
52
66
|
const value = useMemo(() => ({ state }), [state]);
|
|
53
67
|
return (_jsx(EventsContext.Provider, { value: value, children: children }));
|
|
54
68
|
};
|
|
@@ -29,14 +29,15 @@ export declare const useC4ConsoleStage: () => ConsoleStage | undefined;
|
|
|
29
29
|
* boolean. Thus a flag must hold the behavior that the other hosts of this
|
|
30
30
|
* package must NOT get by default.
|
|
31
31
|
*
|
|
32
|
-
* The key is the
|
|
33
|
-
*
|
|
32
|
+
* The key is the key of the row in the flag table, for example
|
|
33
|
+
* `console.byoidp`. A key with no row reads as off.
|
|
34
34
|
*
|
|
35
35
|
* The value comes from one of two places. A host that gives
|
|
36
36
|
* `config.featureFlags` answers it itself. Every other host gets the flags
|
|
37
|
-
* that `C4ConsoleRuntimeProvider` reads from
|
|
38
|
-
*
|
|
39
|
-
*
|
|
40
|
-
* must not run
|
|
37
|
+
* that `C4ConsoleRuntimeProvider` reads from control-backend, or from
|
|
38
|
+
* accounts-backend when control-backend fails. That read is a request, thus a
|
|
39
|
+
* flag is off on the first render and the component renders again when the
|
|
40
|
+
* flags arrive. Do not use this hook for a one-time effect that must not run
|
|
41
|
+
* twice.
|
|
41
42
|
*/
|
|
42
43
|
export declare const useC4FeatureFlag: (flagKey: string) => boolean;
|
|
@@ -4,7 +4,7 @@ import { jsx as _jsx } from "react/jsx-runtime";
|
|
|
4
4
|
* under one or more contributor license agreements. Licensed under a commercial license.
|
|
5
5
|
* You may not use this file except in compliance with the commercial license.
|
|
6
6
|
*/
|
|
7
|
-
import { ExternalAccountsService } from '@camunda/ccma-api';
|
|
7
|
+
import { ControlFeatureFlagsService, ExternalAccountsService, } from '@camunda/ccma-api';
|
|
8
8
|
import { createContext, useContext, useEffect, useMemo, useRef, useState, } from 'react';
|
|
9
9
|
import { toApiConfig } from './to-api-config.js';
|
|
10
10
|
const RuntimeContext = createContext(undefined);
|
|
@@ -47,7 +47,7 @@ function useSyncCarbonThemeToDesignSystem(designSystem) {
|
|
|
47
47
|
};
|
|
48
48
|
}, [designSystem]);
|
|
49
49
|
}
|
|
50
|
-
/** Reads a dot path such as `console.
|
|
50
|
+
/** Reads a dot path such as `console.byoidp` out of the flags. */
|
|
51
51
|
function readFlag(flags, flagKey) {
|
|
52
52
|
if (!flags) {
|
|
53
53
|
return false;
|
|
@@ -62,8 +62,10 @@ function readFlag(flags, flagKey) {
|
|
|
62
62
|
return value === true;
|
|
63
63
|
}
|
|
64
64
|
/**
|
|
65
|
-
* Reads the flags of the caller
|
|
66
|
-
*
|
|
65
|
+
* Reads the flags of the caller, one time per organization and user, from
|
|
66
|
+
* `GET /api/feature-flags/evaluate` of control-backend. When that request
|
|
67
|
+
* fails, it reads `GET external/feature-flags` of accounts-backend. When both
|
|
68
|
+
* fail, every flag reads as off.
|
|
67
69
|
*
|
|
68
70
|
* It fetches nothing when the host gives `config.featureFlags`, thus a host
|
|
69
71
|
* that evaluates the flags itself makes no request. It also fetches nothing
|
|
@@ -118,7 +120,7 @@ function useFetchedFeatureFlags(config) {
|
|
|
118
120
|
}
|
|
119
121
|
return;
|
|
120
122
|
}
|
|
121
|
-
const
|
|
123
|
+
const request = {
|
|
122
124
|
// The token above is current, thus the request reuses it. A second
|
|
123
125
|
// call to `getAccessToken` of the host is not necessary.
|
|
124
126
|
config: {
|
|
@@ -126,7 +128,21 @@ function useFetchedFeatureFlags(config) {
|
|
|
126
128
|
auth: { getToken: async () => token },
|
|
127
129
|
},
|
|
128
130
|
params: { orgId },
|
|
129
|
-
}
|
|
131
|
+
};
|
|
132
|
+
let fetched;
|
|
133
|
+
try {
|
|
134
|
+
fetched = await ControlFeatureFlagsService.evaluate(request);
|
|
135
|
+
}
|
|
136
|
+
catch (controlError) {
|
|
137
|
+
// Control-backend can be down or limited. accounts-backend holds the
|
|
138
|
+
// same rows from its own copy in Redis, and it answers with the last
|
|
139
|
+
// rows that it knows. That is better than every flag off for a host
|
|
140
|
+
// that serves customers.
|
|
141
|
+
configRef.current.telemetry?.captureException?.(controlError, {
|
|
142
|
+
source: 'C4ConsoleRuntimeProvider.featureFlags.control',
|
|
143
|
+
});
|
|
144
|
+
fetched = await ExternalAccountsService.getFeatureFlags(request);
|
|
145
|
+
}
|
|
130
146
|
if (!cancelled) {
|
|
131
147
|
setFlags(fetched);
|
|
132
148
|
}
|
|
@@ -285,15 +301,16 @@ export const useC4ConsoleStage = () => {
|
|
|
285
301
|
* boolean. Thus a flag must hold the behavior that the other hosts of this
|
|
286
302
|
* package must NOT get by default.
|
|
287
303
|
*
|
|
288
|
-
* The key is the
|
|
289
|
-
*
|
|
304
|
+
* The key is the key of the row in the flag table, for example
|
|
305
|
+
* `console.byoidp`. A key with no row reads as off.
|
|
290
306
|
*
|
|
291
307
|
* The value comes from one of two places. A host that gives
|
|
292
308
|
* `config.featureFlags` answers it itself. Every other host gets the flags
|
|
293
|
-
* that `C4ConsoleRuntimeProvider` reads from
|
|
294
|
-
*
|
|
295
|
-
*
|
|
296
|
-
* must not run
|
|
309
|
+
* that `C4ConsoleRuntimeProvider` reads from control-backend, or from
|
|
310
|
+
* accounts-backend when control-backend fails. That read is a request, thus a
|
|
311
|
+
* flag is off on the first render and the component renders again when the
|
|
312
|
+
* flags arrive. Do not use this hook for a one-time effect that must not run
|
|
313
|
+
* twice.
|
|
297
314
|
*/
|
|
298
315
|
export const useC4FeatureFlag = (flagKey) => {
|
|
299
316
|
return useContext(RuntimeContext)?.featureFlags?.isEnabled?.(flagKey) ?? false;
|
|
@@ -71,15 +71,15 @@ export interface C4ConsoleRuntimeConfig {
|
|
|
71
71
|
* Overrides the feature flags of the host.
|
|
72
72
|
*
|
|
73
73
|
* Omit it and `C4ConsoleRuntimeProvider` reads the flags from
|
|
74
|
-
* `GET
|
|
75
|
-
*
|
|
76
|
-
* the
|
|
74
|
+
* `GET /api/feature-flags/evaluate` on control-backend. When that request
|
|
75
|
+
* fails, it reads `GET external/feature-flags` on accounts-backend. Thus the
|
|
76
|
+
* deployed backend owns the values, and the host holds no copy of the
|
|
77
|
+
* rules. This is the path for an external host such as Camunda Hub.
|
|
77
78
|
*
|
|
78
79
|
* Give it and the fetch does not happen, and this function answers every
|
|
79
|
-
* flag. console-frontend does this
|
|
80
|
-
*
|
|
81
|
-
*
|
|
82
|
-
* read `features()` directly and never come through here.
|
|
80
|
+
* flag. console-frontend does this on every stage. It is also the only host
|
|
81
|
+
* in this repository that mounts this provider — the control and accounts
|
|
82
|
+
* frontends read their flags directly and never come through here.
|
|
83
83
|
*/
|
|
84
84
|
featureFlags?: {
|
|
85
85
|
isEnabled: (flagKey: string) => boolean;
|
|
@@ -8,6 +8,7 @@ import { ExternalNotificationsService, } from '@camunda/ccma-api';
|
|
|
8
8
|
import { createContext, useCallback, useContext, useEffect, useMemo, useRef, useState, } from 'react';
|
|
9
9
|
import { useC4ConsoleRuntime } from './c4-console-runtime-context.js';
|
|
10
10
|
import { toApiConfig } from './to-api-config.js';
|
|
11
|
+
import { useIsQaUser } from './use-is-qa-user.js';
|
|
11
12
|
const NotificationsContext = createContext(undefined);
|
|
12
13
|
function sortNewestFirst(list) {
|
|
13
14
|
return [...list].sort((a, b) => b.timestamp - a.timestamp);
|
|
@@ -38,6 +39,7 @@ function mergeIncoming(list, incoming) {
|
|
|
38
39
|
*/
|
|
39
40
|
export const C4UserNotificationsProvider = ({ orgId, children, live = true, }) => {
|
|
40
41
|
const runtime = useC4ConsoleRuntime();
|
|
42
|
+
const isQaUser = useIsQaUser(runtime);
|
|
41
43
|
const [notifications, setNotifications] = useState([]);
|
|
42
44
|
const [isLoading, setIsLoading] = useState(true);
|
|
43
45
|
const [error, setError] = useState(undefined);
|
|
@@ -70,7 +72,9 @@ export const C4UserNotificationsProvider = ({ orgId, children, live = true, }) =
|
|
|
70
72
|
// Live SSE subscription, scoped to the current org. Closed on unmount and on
|
|
71
73
|
// org change (the c3 provider leaked this).
|
|
72
74
|
useEffect(() => {
|
|
73
|
-
|
|
75
|
+
// An automated QA run opens a new browser for each test, and no test reads
|
|
76
|
+
// a notification. The stream waits until the user is known to be no QA user.
|
|
77
|
+
if (!live || isQaUser !== false) {
|
|
74
78
|
return;
|
|
75
79
|
}
|
|
76
80
|
let connection;
|
|
@@ -91,7 +95,7 @@ export const C4UserNotificationsProvider = ({ orgId, children, live = true, }) =
|
|
|
91
95
|
});
|
|
92
96
|
}
|
|
93
97
|
return () => connection?.close();
|
|
94
|
-
}, [live, runtime, orgId]);
|
|
98
|
+
}, [live, isQaUser, runtime, orgId]);
|
|
95
99
|
const persistState = useCallback((uuid, state) => {
|
|
96
100
|
void ExternalNotificationsService.setNotificationState({
|
|
97
101
|
config: toApiConfig(runtime),
|
|
@@ -4,7 +4,11 @@ export interface C4UserNotificationsProviderProps {
|
|
|
4
4
|
/** Organization whose feed is shown. Changing it re-fetches and re-subscribes. */
|
|
5
5
|
orgId: string;
|
|
6
6
|
children: React.ReactNode;
|
|
7
|
-
/**
|
|
7
|
+
/**
|
|
8
|
+
* Set `false` to disable the live SSE subscription, for example in Storybook
|
|
9
|
+
* or in tests. Default `true`. The provider also opens no stream for a QA
|
|
10
|
+
* user (`useIsQaUser`).
|
|
11
|
+
*/
|
|
8
12
|
live?: boolean;
|
|
9
13
|
}
|
|
10
14
|
export interface C4UserNotificationsState {
|
|
@@ -1,25 +1,22 @@
|
|
|
1
|
-
export declare const
|
|
1
|
+
export declare const HUB_MODELER_API_NAMING_FLAG = "console.hubModelerApiNaming";
|
|
2
2
|
/**
|
|
3
3
|
* Whether the Administration API surfaces use the Hub wording.
|
|
4
4
|
*
|
|
5
5
|
* The Hub rollout renames the Modeler scopes: the scope group in the
|
|
6
6
|
* create-client modal reads "Hub API" and the scope columns read "Hub Scopes".
|
|
7
|
-
* The
|
|
8
|
-
*
|
|
9
|
-
* only on prod, until Hub is public.
|
|
7
|
+
* The flag `console.hubModelerApiNaming` holds the Hub wording. The flag table
|
|
8
|
+
* of each stage holds its value.
|
|
10
9
|
*
|
|
11
|
-
*
|
|
12
|
-
*
|
|
13
|
-
*
|
|
14
|
-
* An opt-in flag cannot do this: the runtime bridge gives a boolean, so c4
|
|
15
|
-
* cannot tell an unknown flag from a flag that the host turned off.
|
|
10
|
+
* A host that does not know the flag reads it as off (see `useC4FeatureFlag`),
|
|
11
|
+
* and gets the old wording: "Web Modeler API" and "Modeler Scopes". So does a
|
|
12
|
+
* tree with no runtime provider, and the first render before the flags arrive.
|
|
16
13
|
*
|
|
17
14
|
* Only the text changes. The scope values that go to the API (`GetModel`,
|
|
18
15
|
* `CreateModel`, ...) are the same for every host and every stage.
|
|
19
16
|
*
|
|
20
17
|
* Each renamed i18n key has a `Hub` sibling, for example
|
|
21
18
|
* `apiclients:create.fields.scopes.modeler.label` and `…modeler.labelHub`.
|
|
22
|
-
* When
|
|
23
|
-
*
|
|
19
|
+
* When every stage has the Hub wording, delete this hook, the Modeler variant
|
|
20
|
+
* of each key, and the `hubNaming` branch at every call site.
|
|
24
21
|
*/
|
|
25
22
|
export declare const useHubApiNaming: () => boolean;
|
|
@@ -4,28 +4,25 @@
|
|
|
4
4
|
* You may not use this file except in compliance with the commercial license.
|
|
5
5
|
*/
|
|
6
6
|
import { useC4FeatureFlag } from './c4-console-runtime-context.js';
|
|
7
|
-
export const
|
|
7
|
+
export const HUB_MODELER_API_NAMING_FLAG = 'console.hubModelerApiNaming';
|
|
8
8
|
/**
|
|
9
9
|
* Whether the Administration API surfaces use the Hub wording.
|
|
10
10
|
*
|
|
11
11
|
* The Hub rollout renames the Modeler scopes: the scope group in the
|
|
12
12
|
* create-client modal reads "Hub API" and the scope columns read "Hub Scopes".
|
|
13
|
-
* The
|
|
14
|
-
*
|
|
15
|
-
* only on prod, until Hub is public.
|
|
13
|
+
* The flag `console.hubModelerApiNaming` holds the Hub wording. The flag table
|
|
14
|
+
* of each stage holds its value.
|
|
16
15
|
*
|
|
17
|
-
*
|
|
18
|
-
*
|
|
19
|
-
*
|
|
20
|
-
* An opt-in flag cannot do this: the runtime bridge gives a boolean, so c4
|
|
21
|
-
* cannot tell an unknown flag from a flag that the host turned off.
|
|
16
|
+
* A host that does not know the flag reads it as off (see `useC4FeatureFlag`),
|
|
17
|
+
* and gets the old wording: "Web Modeler API" and "Modeler Scopes". So does a
|
|
18
|
+
* tree with no runtime provider, and the first render before the flags arrive.
|
|
22
19
|
*
|
|
23
20
|
* Only the text changes. The scope values that go to the API (`GetModel`,
|
|
24
21
|
* `CreateModel`, ...) are the same for every host and every stage.
|
|
25
22
|
*
|
|
26
23
|
* Each renamed i18n key has a `Hub` sibling, for example
|
|
27
24
|
* `apiclients:create.fields.scopes.modeler.label` and `…modeler.labelHub`.
|
|
28
|
-
* When
|
|
29
|
-
*
|
|
25
|
+
* When every stage has the Hub wording, delete this hook, the Modeler variant
|
|
26
|
+
* of each key, and the `hubNaming` branch at every call site.
|
|
30
27
|
*/
|
|
31
|
-
export const useHubApiNaming = () =>
|
|
28
|
+
export const useHubApiNaming = () => useC4FeatureFlag(HUB_MODELER_API_NAMING_FLAG);
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
import type { C4ConsoleRuntimeConfig } from './c4-console-runtime.types.js';
|
|
2
|
+
/**
|
|
3
|
+
* Tells whether the user is a user of an automated QA run. The live streams
|
|
4
|
+
* use it: a QA run opens a new browser for each test, and no test reads them.
|
|
5
|
+
*
|
|
6
|
+
* The email of `config.user` answers at once. A host that gives no `user`
|
|
7
|
+
* (Hub) gets the answer from the email in the `https://camunda.com/meta` claim
|
|
8
|
+
* of the access token. The token is read on the client without verification,
|
|
9
|
+
* which is enough for a hint: the backends check the same claim and answer 204
|
|
10
|
+
* to a QA user.
|
|
11
|
+
*
|
|
12
|
+
* Returns `undefined` until the token is read. A caller that must not open a
|
|
13
|
+
* stream for a QA user waits for `false`. A token that cannot be read gives
|
|
14
|
+
* `false`.
|
|
15
|
+
*
|
|
16
|
+
* The answer belongs to the session that it classified: the stage, the user id
|
|
17
|
+
* and the org id. When one of them changes, the hook returns `undefined` until
|
|
18
|
+
* the token of the new session is read. A host that gives no `user` and keeps
|
|
19
|
+
* one org id signals no change of session, thus it keeps the first answer. Give
|
|
20
|
+
* `config.user` for a host with more than one session in a page (see section 4a
|
|
21
|
+
* of `docs/runtime.md`).
|
|
22
|
+
*/
|
|
23
|
+
export declare function useIsQaUser(runtime: C4ConsoleRuntimeConfig): boolean | undefined;
|
|
@@ -0,0 +1,64 @@
|
|
|
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 { CAMUNDA_CLAIMS_NAMESPACE, isQaUserEmail, } from '@camunda/ccma-shared-types';
|
|
7
|
+
import { useEffect, useRef, useState } from 'react';
|
|
8
|
+
import { decodeAccessTokenPayload } from './decode-access-token.js';
|
|
9
|
+
/**
|
|
10
|
+
* Tells whether the user is a user of an automated QA run. The live streams
|
|
11
|
+
* use it: a QA run opens a new browser for each test, and no test reads them.
|
|
12
|
+
*
|
|
13
|
+
* The email of `config.user` answers at once. A host that gives no `user`
|
|
14
|
+
* (Hub) gets the answer from the email in the `https://camunda.com/meta` claim
|
|
15
|
+
* of the access token. The token is read on the client without verification,
|
|
16
|
+
* which is enough for a hint: the backends check the same claim and answer 204
|
|
17
|
+
* to a QA user.
|
|
18
|
+
*
|
|
19
|
+
* Returns `undefined` until the token is read. A caller that must not open a
|
|
20
|
+
* stream for a QA user waits for `false`. A token that cannot be read gives
|
|
21
|
+
* `false`.
|
|
22
|
+
*
|
|
23
|
+
* The answer belongs to the session that it classified: the stage, the user id
|
|
24
|
+
* and the org id. When one of them changes, the hook returns `undefined` until
|
|
25
|
+
* the token of the new session is read. A host that gives no `user` and keeps
|
|
26
|
+
* one org id signals no change of session, thus it keeps the first answer. Give
|
|
27
|
+
* `config.user` for a host with more than one session in a page (see section 4a
|
|
28
|
+
* of `docs/runtime.md`).
|
|
29
|
+
*/
|
|
30
|
+
export function useIsQaUser(runtime) {
|
|
31
|
+
const email = runtime.user?.email;
|
|
32
|
+
// The host usually gives `config` as an object literal, and the runtime value
|
|
33
|
+
// changes when the flags arrive. The effect below depends on primitives
|
|
34
|
+
// alone, or it reads the token again on each of those changes.
|
|
35
|
+
const runtimeRef = useRef(runtime);
|
|
36
|
+
runtimeRef.current = runtime;
|
|
37
|
+
const sessionKey = [runtime.stage, runtime.user?.sub, runtime.orgId].join('|');
|
|
38
|
+
const [fromToken, setFromToken] = useState(undefined);
|
|
39
|
+
useEffect(() => {
|
|
40
|
+
if (email) {
|
|
41
|
+
return;
|
|
42
|
+
}
|
|
43
|
+
let cancelled = false;
|
|
44
|
+
runtimeRef.current.auth
|
|
45
|
+
.getAccessToken()
|
|
46
|
+
.then((token) => {
|
|
47
|
+
const meta = decodeAccessTokenPayload(token ?? '')?.[CAMUNDA_CLAIMS_NAMESPACE];
|
|
48
|
+
return isQaUserEmail(meta?.email);
|
|
49
|
+
})
|
|
50
|
+
.catch(() => false)
|
|
51
|
+
.then((isQa) => {
|
|
52
|
+
if (!cancelled) {
|
|
53
|
+
setFromToken({ sessionKey, isQa });
|
|
54
|
+
}
|
|
55
|
+
});
|
|
56
|
+
return () => {
|
|
57
|
+
cancelled = true;
|
|
58
|
+
};
|
|
59
|
+
}, [email, sessionKey]);
|
|
60
|
+
if (email) {
|
|
61
|
+
return isQaUserEmail(email);
|
|
62
|
+
}
|
|
63
|
+
return fromToken?.sessionKey === sessionKey ? fromToken.isQa : undefined;
|
|
64
|
+
}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import type { C3ClusterTagProps } from '@camunda/design-system/carbon-compat';
|
|
2
|
+
import type { JSX } from 'react';
|
|
3
|
+
/**
|
|
4
|
+
* The ds branch of the `ClusterTag` stage chip. It has the API of the
|
|
5
|
+
* carbon-compat `C3ClusterTag` and the look of the environment tags in Hub.
|
|
6
|
+
*
|
|
7
|
+
* It supports the `stage` form only. Like the carbon-compat adapter, it shows
|
|
8
|
+
* nothing for the `clusterUuid` form, because it cannot read the c3 profile
|
|
9
|
+
* store. An unknown stage shows its raw value in `neutral`.
|
|
10
|
+
*/
|
|
11
|
+
export declare function C4ClusterTag(props: C3ClusterTagProps): JSX.Element | null;
|
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
import { jsx as _jsx } 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 { Badge } from '@camunda/design-system';
|
|
8
|
+
/**
|
|
9
|
+
* The badge variant of each stage. It is the color scheme of the environment
|
|
10
|
+
* tags in Hub (`getTagVariant` in camunda-hub), so that a cluster tag in
|
|
11
|
+
* Console and an environment tag in Hub look the same. It is not the scheme of
|
|
12
|
+
* the carbon-compat `C3ClusterTag`, which shows `dev` as `success`. The DS has
|
|
13
|
+
* no purple variant, thus `stage` is `warning`.
|
|
14
|
+
*/
|
|
15
|
+
const STAGE_VARIANT = {
|
|
16
|
+
prod: 'danger',
|
|
17
|
+
stage: 'warning',
|
|
18
|
+
test: 'info',
|
|
19
|
+
dev: 'neutral',
|
|
20
|
+
};
|
|
21
|
+
/**
|
|
22
|
+
* The ds branch of the `ClusterTag` stage chip. It has the API of the
|
|
23
|
+
* carbon-compat `C3ClusterTag` and the look of the environment tags in Hub.
|
|
24
|
+
*
|
|
25
|
+
* It supports the `stage` form only. Like the carbon-compat adapter, it shows
|
|
26
|
+
* nothing for the `clusterUuid` form, because it cannot read the c3 profile
|
|
27
|
+
* store. An unknown stage shows its raw value in `neutral`.
|
|
28
|
+
*/
|
|
29
|
+
export function C4ClusterTag(props) {
|
|
30
|
+
const stage = 'stage' in props ? props.stage : undefined;
|
|
31
|
+
if (!stage) {
|
|
32
|
+
return null;
|
|
33
|
+
}
|
|
34
|
+
if (props.conditionalRendering && !props.conditionalRendering(stage)) {
|
|
35
|
+
return null;
|
|
36
|
+
}
|
|
37
|
+
const variant = props.subtle ? 'neutral' : (STAGE_VARIANT[stage] ?? 'neutral');
|
|
38
|
+
return (_jsx(Badge, { variant: variant, className: `font-normal ${props.className ?? ''}`.trim(), children: stage }));
|
|
39
|
+
}
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import { CodeBlock } from '@camunda/design-system';
|
|
2
|
+
import type { ComponentProps, CSSProperties, JSX } from 'react';
|
|
3
|
+
/**
|
|
4
|
+
* ds-mode only. A single-line DS `CodeBlock` with less vertical padding and a
|
|
5
|
+
* vertically centered copy button, for a value in a row next to its label.
|
|
6
|
+
*
|
|
7
|
+
* The DS `CodeBlock` pads its box by 12px on every side, which makes a
|
|
8
|
+
* one-line value taller than the other rows. Its `className` only reaches the
|
|
9
|
+
* inner `pre`, so the wrapper sets a 6px vertical padding on the box and
|
|
10
|
+
* centers the copy button vertically. It depends on the CodeBlock markup,
|
|
11
|
+
* which `src/ui/ds-markup-contract.spec.tsx` pins.
|
|
12
|
+
*/
|
|
13
|
+
export declare function DsCompactCodeBlock({ maxWidth, ...props }: Omit<ComponentProps<typeof CodeBlock>, 'variant'> & {
|
|
14
|
+
maxWidth?: CSSProperties['maxWidth'];
|
|
15
|
+
}): JSX.Element;
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
import { jsx as _jsx } 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 { CodeBlock } from '@camunda/design-system';
|
|
8
|
+
import styled from 'styled-components';
|
|
9
|
+
const Frame = styled.div `
|
|
10
|
+
min-width: 0;
|
|
11
|
+
|
|
12
|
+
& [data-slot='code-block'] {
|
|
13
|
+
padding-block: 0.375rem;
|
|
14
|
+
}
|
|
15
|
+
|
|
16
|
+
& [data-slot='code-block'] > button {
|
|
17
|
+
top: 50%;
|
|
18
|
+
transform: translateY(-50%);
|
|
19
|
+
}
|
|
20
|
+
`;
|
|
21
|
+
/**
|
|
22
|
+
* ds-mode only. A single-line DS `CodeBlock` with less vertical padding and a
|
|
23
|
+
* vertically centered copy button, for a value in a row next to its label.
|
|
24
|
+
*
|
|
25
|
+
* The DS `CodeBlock` pads its box by 12px on every side, which makes a
|
|
26
|
+
* one-line value taller than the other rows. Its `className` only reaches the
|
|
27
|
+
* inner `pre`, so the wrapper sets a 6px vertical padding on the box and
|
|
28
|
+
* centers the copy button vertically. It depends on the CodeBlock markup,
|
|
29
|
+
* which `src/ui/ds-markup-contract.spec.tsx` pins.
|
|
30
|
+
*/
|
|
31
|
+
export function DsCompactCodeBlock({ maxWidth, ...props }) {
|
|
32
|
+
return (_jsx(Frame, { style: maxWidth === undefined ? undefined : { maxWidth }, children: _jsx(CodeBlock, { variant: 'single', ...props }) }));
|
|
33
|
+
}
|
package/lib/esm/ui/index.d.ts
CHANGED
|
@@ -19,8 +19,17 @@ export declare const ListItem: ComponentType<import("@carbon/react").ListItemPro
|
|
|
19
19
|
export declare const Loading: ComponentType<import("@carbon/react").LoadingProps>;
|
|
20
20
|
export declare const Modal: ComponentType<import("@carbon/react").ModalProps & import("react").RefAttributes<HTMLDivElement>>;
|
|
21
21
|
export declare const ComposedModal: ComponentType<import("@carbon/react").ComposedModalProps & import("react").RefAttributes<HTMLDivElement>>;
|
|
22
|
-
export declare const ModalHeader: ComponentType<import("@carbon/react").ModalHeaderProps &
|
|
23
|
-
|
|
22
|
+
export declare const ModalHeader: ComponentType<Omit<import("@carbon/react").ModalHeaderProps & {
|
|
23
|
+
ref?: React.Ref<HTMLDivElement>;
|
|
24
|
+
}, "ref"> & import("react").RefAttributes<HTMLDivElement>>;
|
|
25
|
+
export declare const ModalBody: ComponentType<Omit<{
|
|
26
|
+
children?: React.ReactNode;
|
|
27
|
+
className?: string;
|
|
28
|
+
hasForm?: boolean;
|
|
29
|
+
hasScrollingContent?: boolean;
|
|
30
|
+
} & import("react").HTMLAttributes<HTMLDivElement> & {
|
|
31
|
+
ref?: React.Ref<HTMLDivElement>;
|
|
32
|
+
}, "ref"> & import("react").RefAttributes<HTMLDivElement>>;
|
|
24
33
|
export declare const ModalFooter: ComponentType<import("@carbon/react").ModalFooterProps & import("react").RefAttributes<HTMLElement>>;
|
|
25
34
|
export declare const MultiSelect: typeof CarbonMultiSelect;
|
|
26
35
|
export declare const FilterableMultiSelect: typeof CarbonFilterableMultiSelect;
|
|
@@ -41,4 +50,5 @@ export declare const Tile: ComponentType<import("@carbon/react").TileProps & imp
|
|
|
41
50
|
export declare const Toggle: ComponentType<import("@carbon/react").ToggleProps>;
|
|
42
51
|
export declare const UnorderedList: ComponentType<import("@carbon/react").UnorderedListProps>;
|
|
43
52
|
export declare const Tooltip: typeof CarbonTooltip;
|
|
44
|
-
export {};
|
|
53
|
+
export { Badge as DsBadge, Card as DsCard, CodeBlock as DsCodeBlock, Heading as DsHeading, Popover as DsPopover, PopoverContent as DsPopoverContent, PopoverDescription as DsPopoverDescription, PopoverHeader as DsPopoverHeader, PopoverTitle as DsPopoverTitle, PopoverTrigger as DsPopoverTrigger, Progress as DsProgress, Text as DsText, } from '@camunda/design-system';
|
|
54
|
+
export { DsCompactCodeBlock } from './ds-compact-code-block.js';
|
package/lib/esm/ui/index.js
CHANGED
|
@@ -37,10 +37,11 @@
|
|
|
37
37
|
* `switchable(...)`, then point the consuming component's import at this module.
|
|
38
38
|
*/
|
|
39
39
|
import { C3ClusterTag as CarbonClusterTag } from '@camunda/camunda-composite-components';
|
|
40
|
-
import { BreadcrumbSkeleton as DsBreadcrumbSkeleton, Button as DsButton, Checkbox as DsCheckbox,
|
|
40
|
+
import { BreadcrumbSkeleton as DsBreadcrumbSkeleton, Button as DsButton, Checkbox as DsCheckbox, CodeSnippet as DsCodeSnippet, ComposedModal as DsComposedModal, Dropdown as DsDropdown, FilterableMultiSelect as DsFilterableMultiSelect, Form as DsForm, FormGroup as DsFormGroup, IconButton as DsIconButton, Link as DsLink, ListItem as DsListItem, Loading as DsLoading, ModalBody as DsModalBody, ModalFooter as DsModalFooter, ModalHeader as DsModalHeader, MultiSelect as DsMultiSelect, OverflowMenu as DsOverflowMenu, OverflowMenuItem as DsOverflowMenuItem, ProgressBar as DsProgressBar, Search as DsSearch, SkeletonPlaceholder as DsSkeletonPlaceholder, SkeletonText as DsSkeletonText, Stack as DsStack, TabsSkeleton as DsTabsSkeleton, Tag as DsTag, TextArea as DsTextArea, TextInput as DsTextInput, Tile as DsTile, Toggle as DsToggle, Tooltip as DsTooltip, UnorderedList as DsUnorderedList, } from '@camunda/design-system/carbon-compat';
|
|
41
41
|
import { BreadcrumbSkeleton as CarbonBreadcrumbSkeleton, Button as CarbonButton, Checkbox as CarbonCheckbox, CodeSnippet as CarbonCodeSnippet, ComposedModal as CarbonComposedModal, DefinitionTooltip as CarbonDefinitionTooltip, Dropdown as CarbonDropdown, FilterableMultiSelect as CarbonFilterableMultiSelect, Form as CarbonForm, FormGroup as CarbonFormGroup, IconButton as CarbonIconButton, Link as CarbonLink, ListItem as CarbonListItem, Loading as CarbonLoading, Modal as CarbonModal, ModalBody as CarbonModalBody, ModalFooter as CarbonModalFooter, ModalHeader as CarbonModalHeader, MultiSelect as CarbonMultiSelect, OverflowMenu as CarbonOverflowMenu, OverflowMenuItem as CarbonOverflowMenuItem, PasswordInput as CarbonPasswordInput, ProgressBar as CarbonProgressBar, Search as CarbonSearch, SkeletonPlaceholder as CarbonSkeletonPlaceholder, SkeletonText as CarbonSkeletonText, Stack as CarbonStack, TabsSkeleton as CarbonTabsSkeleton, Tag as CarbonTag, TextArea as CarbonTextArea, TextInput as CarbonTextInput, Tile as CarbonTile, Toggle as CarbonToggle, Tooltip as CarbonTooltip, UnorderedList as CarbonUnorderedList, } from '@carbon/react';
|
|
42
42
|
import { createElement, Fragment, } from 'react';
|
|
43
43
|
import { useC4DesignSystem } from '../runtime/c4-console-runtime-context.js';
|
|
44
|
+
import { C4ClusterTag } from './c4-cluster-tag.js';
|
|
44
45
|
import { C4DefinitionTooltip } from './c4-definition-tooltip.js';
|
|
45
46
|
import { C4ModalDialog } from './c4-modal-dialog.js';
|
|
46
47
|
import { C4PasswordInput } from './c4-password-input.js';
|
|
@@ -49,12 +50,12 @@ export const Button = switchable(CarbonButton, DsButton);
|
|
|
49
50
|
export const Checkbox = switchable(CarbonCheckbox, DsCheckbox);
|
|
50
51
|
export const CodeSnippet = switchable(CarbonCodeSnippet, DsCodeSnippet);
|
|
51
52
|
// The c3 stage chip. c3 is public and renders the Carbon `Tag` itself, thus the
|
|
52
|
-
// ds branch is
|
|
53
|
-
//
|
|
54
|
-
//
|
|
55
|
-
//
|
|
56
|
-
//
|
|
57
|
-
export const ClusterTag = switchable(CarbonClusterTag,
|
|
53
|
+
// ds branch is `C4ClusterTag` (see ./c4-cluster-tag). It renders the DS `Badge`
|
|
54
|
+
// with the colors of the environment tags in Hub (dev/test/stage/prod →
|
|
55
|
+
// neutral/info/warning/danger). It supports the `stage` form alone and shows
|
|
56
|
+
// nothing for `clusterUuid`, because it cannot read the c3 profile store. Look
|
|
57
|
+
// the stage up at the call site before you pass it.
|
|
58
|
+
export const ClusterTag = switchable(CarbonClusterTag, C4ClusterTag);
|
|
58
59
|
// carbon-compat ships no definition-tooltip adapter, so the ds branch is the DS
|
|
59
60
|
// component directly (see ./c4-definition-tooltip). Unlike Carbon's, it renders
|
|
60
61
|
// the definition through a portal, so an ancestor that hides overflow does not
|
|
@@ -159,3 +160,9 @@ function C4Tooltip(props) {
|
|
|
159
160
|
return createElement(DsTooltip, dsProps);
|
|
160
161
|
}
|
|
161
162
|
export const Tooltip = C4Tooltip;
|
|
163
|
+
// ds-mode only. DS leaves with no carbon counterpart, for the ds branch of a
|
|
164
|
+
// transformation component (one that branches on `useC4DesignSystem()`). A
|
|
165
|
+
// carbon branch must not render them. Import them from here, not from the DS
|
|
166
|
+
// package, so feature code keeps one import point for UI.
|
|
167
|
+
export { Badge as DsBadge, Card as DsCard, CodeBlock as DsCodeBlock, Heading as DsHeading, Popover as DsPopover, PopoverContent as DsPopoverContent, PopoverDescription as DsPopoverDescription, PopoverHeader as DsPopoverHeader, PopoverTitle as DsPopoverTitle, PopoverTrigger as DsPopoverTrigger, Progress as DsProgress, Text as DsText, } from '@camunda/design-system';
|
|
168
|
+
export { DsCompactCodeBlock } from './ds-compact-code-block.js';
|