@camunda/camunda-composite-components 0.22.3 → 0.22.5
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/package.json +98 -0
- package/lib/esm/src/api/api.d.ts +29 -0
- package/lib/esm/src/api/api.js +92 -0
- package/lib/esm/src/api/clusters.d.ts +10 -0
- package/lib/esm/src/api/clusters.js +32 -0
- package/lib/esm/src/api/endpoints.const.d.ts +22 -0
- package/lib/esm/src/api/endpoints.const.js +70 -0
- package/lib/esm/src/api/help-center.d.ts +42 -0
- package/lib/esm/src/api/help-center.js +56 -0
- package/lib/esm/src/api/jwt.utils.d.ts +5 -0
- package/lib/esm/src/api/jwt.utils.js +26 -0
- package/lib/esm/src/api/notifications.d.ts +41 -0
- package/lib/esm/src/api/notifications.js +170 -0
- package/lib/esm/src/api/organizations.d.ts +15 -0
- package/lib/esm/src/api/organizations.js +16 -0
- package/lib/esm/src/api/profile.d.ts +20 -0
- package/lib/esm/src/api/profile.js +48 -0
- package/lib/esm/src/api/status.d.ts +7 -0
- package/lib/esm/src/api/status.js +46 -0
- package/lib/esm/src/assets/c3-icons.d.ts +5 -0
- package/lib/esm/src/assets/c3-icons.js +5 -0
- package/lib/esm/src/assets/c3-icons.types.d.ts +3 -0
- package/lib/esm/src/assets/c3-icons.types.js +6 -0
- package/lib/esm/src/components/c3-app-teaser/app-teaser-cards-config.d.ts +5 -0
- package/lib/esm/src/components/c3-app-teaser/app-teaser-cards-config.js +94 -0
- package/lib/esm/src/components/c3-app-teaser/app-teaser-cards.d.ts +17 -0
- package/lib/esm/src/components/c3-app-teaser/app-teaser-cards.js +31 -0
- package/lib/esm/src/components/c3-app-teaser/app-teaster-card.d.ts +14 -0
- package/lib/esm/src/components/c3-app-teaser/app-teaster-card.js +24 -0
- package/lib/esm/src/components/c3-app-teaser/c3-app-teaser-page.d.ts +9 -0
- package/lib/esm/src/components/c3-app-teaser/c3-app-teaser-page.js +48 -0
- package/lib/esm/src/components/c3-app-teaser/c3-app-teaser-page.test.d.ts +1 -0
- package/lib/esm/src/components/c3-app-teaser/c3-app-teaser-page.test.js +33 -0
- package/lib/esm/src/components/c3-app-teaser/c3-app-teaser.d.ts +14 -0
- package/lib/esm/src/components/c3-app-teaser/c3-app-teaser.js +53 -0
- package/lib/esm/src/components/c3-cluster-tag/c3-cluster-tag.d.ts +6 -0
- package/lib/esm/src/components/c3-cluster-tag/c3-cluster-tag.js +84 -0
- package/lib/esm/src/components/c3-cluster-tag/c3-cluster-tag.test.d.ts +1 -0
- package/lib/esm/src/components/c3-cluster-tag/c3-cluster-tag.test.js +13 -0
- package/lib/esm/src/components/c3-cluster-tag/c3-cluster-tag.types.d.ts +26 -0
- package/lib/esm/src/components/c3-cluster-tag/c3-cluster-tag.types.js +11 -0
- package/lib/esm/src/components/c3-data-table/c3-data-table.d.ts +3 -0
- package/lib/esm/src/components/c3-data-table/c3-data-table.js +509 -0
- package/lib/esm/src/components/c3-data-table/c3-data-table.types.d.ts +122 -0
- package/lib/esm/src/components/c3-data-table/c3-data-table.types.js +6 -0
- package/lib/esm/src/components/c3-data-table/link-button/link-button.d.ts +3 -0
- package/lib/esm/src/components/c3-data-table/link-button/link-button.js +15 -0
- package/lib/esm/src/components/c3-data-table/link-button/link-button.types.d.ts +8 -0
- package/lib/esm/src/components/c3-data-table/link-button/link-button.types.js +6 -0
- package/lib/esm/src/components/c3-empty-state/c3-empty-state.d.ts +3 -0
- package/lib/esm/src/components/c3-empty-state/c3-empty-state.js +15 -0
- package/lib/esm/src/components/c3-empty-state/c3-empty-state.test.d.ts +1 -0
- package/lib/esm/src/components/c3-empty-state/c3-empty-state.test.js +25 -0
- package/lib/esm/src/components/c3-empty-state/c3-empty-state.types.d.ts +29 -0
- package/lib/esm/src/components/c3-empty-state/c3-empty-state.types.js +6 -0
- package/lib/esm/src/components/c3-help-center/c3-help-center-provider.d.ts +19 -0
- package/lib/esm/src/components/c3-help-center/c3-help-center-provider.js +58 -0
- package/lib/esm/src/components/c3-help-center/c3-help-center.d.ts +16 -0
- package/lib/esm/src/components/c3-help-center/c3-help-center.js +218 -0
- package/lib/esm/src/components/c3-help-center/c3-help-center.types.d.ts +43 -0
- package/lib/esm/src/components/c3-help-center/c3-help-center.types.js +6 -0
- package/lib/esm/src/components/c3-help-center/defaultHelpCenterConfig.d.ts +10 -0
- package/lib/esm/src/components/c3-help-center/defaultHelpCenterConfig.js +17 -0
- package/lib/esm/src/components/c3-help-center/help-center-hint.d.ts +4 -0
- package/lib/esm/src/components/c3-help-center/help-center-hint.js +15 -0
- package/lib/esm/src/components/c3-help-center/help-center.d.ts +18 -0
- package/lib/esm/src/components/c3-help-center/help-center.js +189 -0
- package/lib/esm/src/components/c3-help-center/recommendations.d.ts +4 -0
- package/lib/esm/src/components/c3-help-center/recommendations.js +55 -0
- package/lib/esm/src/components/c3-help-center/styles.d.ts +4 -0
- package/lib/esm/src/components/c3-help-center/styles.js +48 -0
- package/lib/esm/src/components/c3-help-center/tabs/feedback.d.ts +9 -0
- package/lib/esm/src/components/c3-help-center/tabs/feedback.js +141 -0
- package/lib/esm/src/components/c3-help-center/tabs/tabContent.d.ts +20 -0
- package/lib/esm/src/components/c3-help-center/tabs/tabContent.js +22 -0
- package/lib/esm/src/components/c3-help-center/tabs/tabContentSkeleton.d.ts +2 -0
- package/lib/esm/src/components/c3-help-center/tabs/tabContentSkeleton.js +26 -0
- package/lib/esm/src/components/c3-help-center/tile.d.ts +10 -0
- package/lib/esm/src/components/c3-help-center/tile.js +61 -0
- package/lib/esm/src/components/c3-navigation/c3-info-button.d.ts +4 -0
- package/lib/esm/src/components/c3-navigation/c3-info-button.js +9 -0
- package/lib/esm/src/components/c3-navigation/c3-navigation-actions/c3-action-buttons.d.ts +6 -0
- package/lib/esm/src/components/c3-navigation/c3-navigation-actions/c3-action-buttons.js +18 -0
- package/lib/esm/src/components/c3-navigation/c3-navigation-actions/c3-action-buttons.types.d.ts +10 -0
- package/lib/esm/src/components/c3-navigation/c3-navigation-actions/c3-action-buttons.types.js +6 -0
- package/lib/esm/src/components/c3-navigation/c3-navigation-appbar/c3-navigation-appbar.d.ts +4 -0
- package/lib/esm/src/components/c3-navigation/c3-navigation-appbar/c3-navigation-appbar.js +380 -0
- package/lib/esm/src/components/c3-navigation/c3-navigation-appbar/components.d.ts +2 -0
- package/lib/esm/src/components/c3-navigation/c3-navigation-appbar/components.js +21 -0
- package/lib/esm/src/components/c3-navigation/c3-navigation-sidebar/c3-info-sidebar.d.ts +6 -0
- package/lib/esm/src/components/c3-navigation/c3-navigation-sidebar/c3-info-sidebar.js +38 -0
- package/lib/esm/src/components/c3-navigation/c3-navigation-sidebar/c3-navigation-sidebar-element.d.ts +12 -0
- package/lib/esm/src/components/c3-navigation/c3-navigation-sidebar/c3-navigation-sidebar-element.js +68 -0
- package/lib/esm/src/components/c3-navigation/c3-navigation-sidebar/c3-navigation-sidebar.d.ts +10 -0
- package/lib/esm/src/components/c3-navigation/c3-navigation-sidebar/c3-navigation-sidebar.js +87 -0
- package/lib/esm/src/components/c3-navigation/c3-navigation-sidebar/c3-navigation-sidebar.types.d.ts +81 -0
- package/lib/esm/src/components/c3-navigation/c3-navigation-sidebar/c3-navigation-sidebar.types.js +6 -0
- package/lib/esm/src/components/c3-navigation/c3-navigation-sidebar/c3-notification-sidebar.d.ts +5 -0
- package/lib/esm/src/components/c3-navigation/c3-navigation-sidebar/c3-notification-sidebar.js +107 -0
- package/lib/esm/src/components/c3-navigation/c3-navigation-sidebar/c3-sidebar-state-provider.d.ts +29 -0
- package/lib/esm/src/components/c3-navigation/c3-navigation-sidebar/c3-sidebar-state-provider.js +54 -0
- package/lib/esm/src/components/c3-navigation/c3-navigation-sidebar/c3-user-sidebar.d.ts +6 -0
- package/lib/esm/src/components/c3-navigation/c3-navigation-sidebar/c3-user-sidebar.js +57 -0
- package/lib/esm/src/components/c3-navigation/c3-navigation-sidebar/components.d.ts +2 -0
- package/lib/esm/src/components/c3-navigation/c3-navigation-sidebar/components.js +11 -0
- package/lib/esm/src/components/c3-navigation/c3-navigation.d.ts +7 -0
- package/lib/esm/src/components/c3-navigation/c3-navigation.js +262 -0
- package/lib/esm/src/components/c3-navigation/c3-navigation.test.d.ts +1 -0
- package/lib/esm/src/components/c3-navigation/c3-navigation.test.js +89 -0
- package/lib/esm/src/components/c3-navigation/c3-navigation.types.d.ts +97 -0
- package/lib/esm/src/components/c3-navigation/c3-navigation.types.js +6 -0
- package/lib/esm/src/components/c3-navigation/c3-notification-provider/c3-notification-container.d.ts +13 -0
- package/lib/esm/src/components/c3-navigation/c3-notification-provider/c3-notification-container.js +100 -0
- package/lib/esm/src/components/c3-navigation/c3-notification-provider/c3-notification-provider.d.ts +19 -0
- package/lib/esm/src/components/c3-navigation/c3-notification-provider/c3-notification-provider.js +110 -0
- package/lib/esm/src/components/c3-navigation/c3-org-name.d.ts +6 -0
- package/lib/esm/src/components/c3-navigation/c3-org-name.js +34 -0
- package/lib/esm/src/components/c3-navigation/c3-org-sidebar/c3-org-sidebar.d.ts +6 -0
- package/lib/esm/src/components/c3-navigation/c3-org-sidebar/c3-org-sidebar.js +188 -0
- package/lib/esm/src/components/c3-navigation/c3-org-sidebar/components.d.ts +29 -0
- package/lib/esm/src/components/c3-navigation/c3-org-sidebar/components.js +92 -0
- package/lib/esm/src/components/c3-navigation/helpers.d.ts +8 -0
- package/lib/esm/src/components/c3-navigation/helpers.js +58 -0
- package/lib/esm/src/components/c3-navigation/index.d.ts +2 -0
- package/lib/esm/src/components/c3-navigation/index.js +8 -0
- package/lib/esm/src/components/c3-navigation/stories/story-helpers.d.ts +35 -0
- package/lib/esm/src/components/c3-navigation/stories/story-helpers.js +264 -0
- package/lib/esm/src/components/c3-navigation/stories/story-templates.d.ts +9 -0
- package/lib/esm/src/components/c3-navigation/stories/story-templates.js +38 -0
- package/lib/esm/src/components/c3-onboarding-survey/c3-onboarding-survey.d.ts +14 -0
- package/lib/esm/src/components/c3-onboarding-survey/c3-onboarding-survey.js +94 -0
- package/lib/esm/src/components/c3-onboarding-survey/defaultOnboardingConfig.d.ts +16 -0
- package/lib/esm/src/components/c3-onboarding-survey/defaultOnboardingConfig.js +8 -0
- package/lib/esm/src/components/c3-onboarding-survey/elements/dropdownSelect.d.ts +15 -0
- package/lib/esm/src/components/c3-onboarding-survey/elements/dropdownSelect.js +58 -0
- package/lib/esm/src/components/c3-onboarding-survey/elements/inlineNotification.d.ts +3 -0
- package/lib/esm/src/components/c3-onboarding-survey/elements/inlineNotification.js +10 -0
- package/lib/esm/src/components/c3-onboarding-survey/elements/radioGroupMulti.d.ts +7 -0
- package/lib/esm/src/components/c3-onboarding-survey/elements/radioGroupMulti.js +53 -0
- package/lib/esm/src/components/c3-onboarding-survey/elements/radioGroupSingle.d.ts +7 -0
- package/lib/esm/src/components/c3-onboarding-survey/elements/radioGroupSingle.js +36 -0
- package/lib/esm/src/components/c3-onboarding-survey/elements/textField.d.ts +6 -0
- package/lib/esm/src/components/c3-onboarding-survey/elements/textField.js +14 -0
- package/lib/esm/src/components/c3-onboarding-survey/helpers.d.ts +1 -0
- package/lib/esm/src/components/c3-onboarding-survey/helpers.js +10 -0
- package/lib/esm/src/components/c3-onboarding-survey/onboarding.types.d.ts +30 -0
- package/lib/esm/src/components/c3-onboarding-survey/onboarding.types.js +13 -0
- package/lib/esm/src/components/c3-onboarding-survey/onboardingModal.d.ts +25 -0
- package/lib/esm/src/components/c3-onboarding-survey/onboardingModal.js +52 -0
- package/lib/esm/src/components/c3-onboarding-survey/onboardingPage.d.ts +21 -0
- package/lib/esm/src/components/c3-onboarding-survey/onboardingPage.js +35 -0
- package/lib/esm/src/components/c3-onboarding-survey/onboardingSurvey.d.ts +17 -0
- package/lib/esm/src/components/c3-onboarding-survey/onboardingSurvey.js +148 -0
- package/lib/esm/src/components/c3-onboarding-survey/step.d.ts +7 -0
- package/lib/esm/src/components/c3-onboarding-survey/step.js +44 -0
- package/lib/esm/src/components/c3-page/c3-breadcrumb/c3-breadcrumb.d.ts +3 -0
- package/lib/esm/src/components/c3-page/c3-breadcrumb/c3-breadcrumb.js +28 -0
- package/lib/esm/src/components/c3-page/c3-breadcrumb/c3-breadcrumb.types.d.ts +19 -0
- package/lib/esm/src/components/c3-page/c3-breadcrumb/c3-breadcrumb.types.js +6 -0
- package/lib/esm/src/components/c3-page/c3-page.d.ts +4 -0
- package/lib/esm/src/components/c3-page/c3-page.js +16 -0
- package/lib/esm/src/components/c3-page/c3-page.test.d.ts +1 -0
- package/lib/esm/src/components/c3-page/c3-page.test.js +25 -0
- package/lib/esm/src/components/c3-page/c3-page.types.d.ts +18 -0
- package/lib/esm/src/components/c3-page/c3-page.types.js +6 -0
- package/lib/esm/src/components/c3-page/c3-tabs/c3-tabs.d.ts +3 -0
- package/lib/esm/src/components/c3-page/c3-tabs/c3-tabs.js +37 -0
- package/lib/esm/src/components/c3-page/c3-tabs/c3-tabs.types.d.ts +14 -0
- package/lib/esm/src/components/c3-page/c3-tabs/c3-tabs.types.js +6 -0
- package/lib/esm/src/components/c3-responsive-stack/c3-responsive-stack.d.ts +2 -0
- package/lib/esm/src/components/c3-responsive-stack/c3-responsive-stack.js +18 -0
- package/lib/esm/src/components/c3-user-configuration/authToken.d.ts +30 -0
- package/lib/esm/src/components/c3-user-configuration/authToken.js +30 -0
- package/lib/esm/src/components/c3-user-configuration/c3-profile-provider/c3-profile-provider.d.ts +26 -0
- package/lib/esm/src/components/c3-user-configuration/c3-profile-provider/c3-profile-provider.js +117 -0
- package/lib/esm/src/components/c3-user-configuration/c3-profile-provider/carbon-theme-provider.d.ts +13 -0
- package/lib/esm/src/components/c3-user-configuration/c3-profile-provider/carbon-theme-provider.js +29 -0
- package/lib/esm/src/components/c3-user-configuration/c3-user-configuration-provider.d.ts +54 -0
- package/lib/esm/src/components/c3-user-configuration/c3-user-configuration-provider.js +43 -0
- package/lib/esm/src/components/styles.d.ts +13 -0
- package/lib/esm/src/components/styles.js +90 -0
- package/lib/esm/src/components/test-utils.d.ts +3 -0
- package/lib/esm/src/components/test-utils.js +32 -0
- package/lib/esm/src/contexts/c3-cluster-update-manager.d.ts +12 -0
- package/lib/esm/src/contexts/c3-cluster-update-manager.js +27 -0
- package/lib/esm/src/hooks/useApi.d.ts +20 -0
- package/lib/esm/src/hooks/useApi.js +54 -0
- package/lib/esm/src/index.d.ts +23 -0
- package/lib/esm/src/index.js +19 -0
- package/lib/esm/src/utils/camunda.d.ts +21 -0
- package/lib/esm/src/utils/camunda.js +59 -0
- package/lib/esm/src/utils/camunda.types.d.ts +63 -0
- package/lib/esm/src/utils/camunda.types.js +6 -0
- package/lib/esm/src/utils/versionCheck.utils.d.ts +15 -0
- package/lib/esm/src/utils/versionCheck.utils.js +79 -0
- package/package.json +18 -18
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import type { FC } from 'react';
|
|
2
|
+
import type { StartingPrice } from '../../api/organizations';
|
|
3
|
+
export declare const teaserApps: readonly ["tasklist", "operate", "optimize"];
|
|
4
|
+
export type TeaserApp = (typeof teaserApps)[number];
|
|
5
|
+
export type C3AppTeaserProps = {
|
|
6
|
+
appName: TeaserApp;
|
|
7
|
+
canCreateCluster: boolean;
|
|
8
|
+
canUpgradePlan: boolean;
|
|
9
|
+
hasTrialExpired: boolean;
|
|
10
|
+
hasSleepingCluster: boolean;
|
|
11
|
+
onClickCta: () => void;
|
|
12
|
+
pricing: StartingPrice | null;
|
|
13
|
+
};
|
|
14
|
+
export declare const C3AppTeaser: FC<C3AppTeaserProps>;
|
|
@@ -0,0 +1,53 @@
|
|
|
1
|
+
import { Fragment as _Fragment, 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 { Add, Settings } from '@carbon/react/icons/index.esm.js';
|
|
8
|
+
import { getReadableAppName } from '../../utils/camunda.js';
|
|
9
|
+
import { DefaultStyleWrapper } from '../styles.js';
|
|
10
|
+
import { AppTeaserCards } from './app-teaser-cards.js';
|
|
11
|
+
import { appTeaserCardsConfig } from './app-teaser-cards-config.js';
|
|
12
|
+
export const teaserApps = ['tasklist', 'operate', 'optimize'];
|
|
13
|
+
export const C3AppTeaser = ({ appName: app, hasTrialExpired, hasSleepingCluster, canUpgradePlan, canCreateCluster, onClickCta, }) => {
|
|
14
|
+
const appName = app ? getReadableAppName(app) : '';
|
|
15
|
+
const variants = {
|
|
16
|
+
upgrade: {
|
|
17
|
+
title: `Upgrade your plan${appName ? ` to use ${appName}` : ''}`,
|
|
18
|
+
subtitle: `Creating a cluster and accessing the ${appName} app and features
|
|
19
|
+
are not available with the Modeling plan`,
|
|
20
|
+
ctaText: 'Contact us',
|
|
21
|
+
ctaIcon: null,
|
|
22
|
+
disabledMessage: 'Contact your admin to upgrade',
|
|
23
|
+
},
|
|
24
|
+
manageClusters: {
|
|
25
|
+
title: `Resume your cluster${appName ? ` to use ${appName}` : ''}`,
|
|
26
|
+
subtitle: `The ${appName} app requires an active
|
|
27
|
+
cluster to run.`,
|
|
28
|
+
ctaText: 'Manage clusters',
|
|
29
|
+
ctaIcon: Settings,
|
|
30
|
+
disabledMessage: 'Contact your admin to unpause your cluster',
|
|
31
|
+
},
|
|
32
|
+
createClusters: {
|
|
33
|
+
title: `Create a cluster${appName ? ` to use ${appName}` : ''}`,
|
|
34
|
+
subtitle: `The ${appName} app requires a cluster to run.
|
|
35
|
+
Begin by creating your cluster.`,
|
|
36
|
+
ctaText: 'Create Cluster',
|
|
37
|
+
ctaIcon: Add,
|
|
38
|
+
disabledMessage: 'Contact your admin to create a cluster',
|
|
39
|
+
},
|
|
40
|
+
};
|
|
41
|
+
const variant = hasTrialExpired
|
|
42
|
+
? variants.upgrade
|
|
43
|
+
: hasSleepingCluster
|
|
44
|
+
? variants.manageClusters
|
|
45
|
+
: variants.createClusters;
|
|
46
|
+
return (_jsx(_Fragment, { children: _jsx(DefaultStyleWrapper, { children: _jsx(AppTeaserCards, { title: variant.title, subtitle: _jsx(_Fragment, { children: variant.subtitle }), subtext: '', cta: {
|
|
47
|
+
action: onClickCta,
|
|
48
|
+
text: variant.ctaText,
|
|
49
|
+
renderIcon: variant.ctaIcon,
|
|
50
|
+
disabled: hasTrialExpired ? !canUpgradePlan : !canCreateCluster,
|
|
51
|
+
disabledMessage: variant.disabledMessage,
|
|
52
|
+
}, cards: appTeaserCardsConfig[app] }) }) }));
|
|
53
|
+
};
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
import type { FC } from 'react';
|
|
2
|
+
import type { C3ClusterTagProps, C3ClusterTagWithClusterNameProps, CamundaClusterStage } from './c3-cluster-tag.types';
|
|
3
|
+
export type TagColor = 'green' | 'blue' | 'purple' | 'red' | 'cool-gray' | 'magenta' | 'cyan' | 'teal' | 'gray' | 'warm-gray' | 'high-contrast' | 'outline';
|
|
4
|
+
export declare const C3ClusterTagWithClusterName: FC<C3ClusterTagWithClusterNameProps>;
|
|
5
|
+
export declare const C3ClusterTag: FC<C3ClusterTagProps>;
|
|
6
|
+
export declare function getColorForStage(stage: CamundaClusterStage): TagColor | undefined;
|
|
@@ -0,0 +1,84 @@
|
|
|
1
|
+
import { jsx as _jsx, Fragment as _Fragment } 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 { Tag } from '@carbon/react';
|
|
8
|
+
import { useC3Profile } from '../c3-user-configuration/c3-profile-provider/c3-profile-provider.js';
|
|
9
|
+
export const C3ClusterTagWithClusterName = (props) => {
|
|
10
|
+
const conditionalRendering = props.conditionalRendering || (() => true);
|
|
11
|
+
const { clusters } = useC3Profile();
|
|
12
|
+
let clustername;
|
|
13
|
+
if ('clusterName' in props) {
|
|
14
|
+
clustername = props.clusterName;
|
|
15
|
+
}
|
|
16
|
+
else if ('clusterUuid' in props) {
|
|
17
|
+
const foundCluster = clusters?.find((cluster) => cluster.uuid === props.clusterUuid);
|
|
18
|
+
clustername = foundCluster?.name;
|
|
19
|
+
}
|
|
20
|
+
let color;
|
|
21
|
+
let stage;
|
|
22
|
+
if ('stage' in props) {
|
|
23
|
+
stage = props.stage;
|
|
24
|
+
}
|
|
25
|
+
else if ('clusterUuid' in props) {
|
|
26
|
+
const foundCluster = clusters?.find((cluster) => cluster.uuid === props.clusterUuid);
|
|
27
|
+
if (foundCluster?.labels?.camunda &&
|
|
28
|
+
foundCluster?.labels?.camunda?.length > 0) {
|
|
29
|
+
stage = foundCluster.labels.camunda[0];
|
|
30
|
+
}
|
|
31
|
+
}
|
|
32
|
+
color = getColorForStage(stage);
|
|
33
|
+
if (!color) {
|
|
34
|
+
color = 'cool-gray';
|
|
35
|
+
}
|
|
36
|
+
let label;
|
|
37
|
+
if (clustername && stage) {
|
|
38
|
+
label = `${clustername} : ${stage}`;
|
|
39
|
+
}
|
|
40
|
+
else if (clustername) {
|
|
41
|
+
label = clustername;
|
|
42
|
+
}
|
|
43
|
+
else if (stage) {
|
|
44
|
+
label = stage;
|
|
45
|
+
}
|
|
46
|
+
if (label && conditionalRendering(stage)) {
|
|
47
|
+
return _jsx(Tag, { type: color, children: label });
|
|
48
|
+
}
|
|
49
|
+
else {
|
|
50
|
+
return _jsx(_Fragment, {});
|
|
51
|
+
}
|
|
52
|
+
};
|
|
53
|
+
export const C3ClusterTag = (props) => {
|
|
54
|
+
const { clusters } = useC3Profile();
|
|
55
|
+
return 'stage' in props ? (_jsx(Tag, { type: getColorForStage(props.stage), children: props.stage })) : 'clusterUuid' in props ? (generateFromInput({
|
|
56
|
+
clusterUuid: props.clusterUuid,
|
|
57
|
+
allClusters: clusters,
|
|
58
|
+
conditionalRendering: props.conditionalRendering || (() => true),
|
|
59
|
+
})) : (_jsx(_Fragment, {}));
|
|
60
|
+
};
|
|
61
|
+
function generateFromInput(props) {
|
|
62
|
+
const foundCluster = props.allClusters?.find((cluster) => cluster.uuid === props.clusterUuid);
|
|
63
|
+
if (foundCluster?.labels?.camunda &&
|
|
64
|
+
foundCluster?.labels?.camunda?.length > 0) {
|
|
65
|
+
const label = foundCluster.labels.camunda[0];
|
|
66
|
+
return getColorForStage(label) &&
|
|
67
|
+
props.conditionalRendering(label) ? (_jsx(Tag, { type: getColorForStage(label), children: label })) : (_jsx(_Fragment, {}));
|
|
68
|
+
}
|
|
69
|
+
return _jsx(_Fragment, {});
|
|
70
|
+
}
|
|
71
|
+
export function getColorForStage(stage) {
|
|
72
|
+
switch (stage) {
|
|
73
|
+
case 'dev':
|
|
74
|
+
return 'green';
|
|
75
|
+
case 'test':
|
|
76
|
+
return 'blue';
|
|
77
|
+
case 'stage':
|
|
78
|
+
return 'purple';
|
|
79
|
+
case 'prod':
|
|
80
|
+
return 'red';
|
|
81
|
+
default:
|
|
82
|
+
return undefined;
|
|
83
|
+
}
|
|
84
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1,13 @@
|
|
|
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 { expect, test } from '@playwright/test';
|
|
7
|
+
import { getStory } from '../test-utils.js';
|
|
8
|
+
test.describe('Cluster tag', () => {
|
|
9
|
+
test('Basic', async ({ page }) => {
|
|
10
|
+
await getStory(page, 'components-c3clustertag--basic');
|
|
11
|
+
await expect(page).toHaveScreenshot();
|
|
12
|
+
});
|
|
13
|
+
});
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
export declare const StageClusterLabels: {
|
|
2
|
+
readonly dev: "dev";
|
|
3
|
+
readonly test: "test";
|
|
4
|
+
readonly stage: "stage";
|
|
5
|
+
readonly prod: "prod";
|
|
6
|
+
};
|
|
7
|
+
export type CamundaClusterStage = keyof typeof StageClusterLabels;
|
|
8
|
+
export type CamundaClusterStageLabel = (typeof StageClusterLabels)[CamundaClusterStage];
|
|
9
|
+
export type C3ClusterTagProps = ({
|
|
10
|
+
clusterUuid: string;
|
|
11
|
+
} | {
|
|
12
|
+
stage: CamundaClusterStage;
|
|
13
|
+
}) & {
|
|
14
|
+
conditionalRendering?: (stage: CamundaClusterStage) => boolean;
|
|
15
|
+
};
|
|
16
|
+
export type C3ClusterTagWithClusterNameProps = ({
|
|
17
|
+
clusterUuid: string;
|
|
18
|
+
} | {
|
|
19
|
+
clusterName?: string;
|
|
20
|
+
stage: CamundaClusterStage;
|
|
21
|
+
} | {
|
|
22
|
+
clusterName: string;
|
|
23
|
+
stage?: CamundaClusterStage;
|
|
24
|
+
}) & {
|
|
25
|
+
conditionalRendering?: (stage: CamundaClusterStage) => boolean;
|
|
26
|
+
};
|
|
@@ -0,0 +1,11 @@
|
|
|
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
|
+
export const StageClusterLabels = {
|
|
7
|
+
dev: 'dev',
|
|
8
|
+
test: 'test',
|
|
9
|
+
stage: 'stage',
|
|
10
|
+
prod: 'prod',
|
|
11
|
+
};
|
|
@@ -0,0 +1,3 @@
|
|
|
1
|
+
import { type JSX } from 'react';
|
|
2
|
+
import type { C3DataTableProps, RowBaseProps } from './c3-data-table.types';
|
|
3
|
+
export declare const C3DataTable: <T extends RowBaseProps>({ data, headers, options, toolbar: singleToolbar, toolbars, isLoading, title, description, actions, id, queryPrefix, }: C3DataTableProps<T>) => JSX.Element;
|