@camunda/camunda-composite-components 0.22.4 → 0.22.6
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 +387 -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 +99 -0
- package/package.json +16 -16
|
@@ -0,0 +1,189 @@
|
|
|
1
|
+
import { Fragment as _Fragment, jsx as _jsx, jsxs as _jsxs } 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 { Button, ModalFooter, SideNav, SideNavItems, SideNavMenuItem, Stack, } from '@carbon/react';
|
|
8
|
+
import { Undo } from '@carbon/react/icons/index.esm.js';
|
|
9
|
+
import React, { useEffect, useState } from 'react';
|
|
10
|
+
import styled from 'styled-components';
|
|
11
|
+
import { getTiles } from '../../api/help-center.js';
|
|
12
|
+
import { useC3Profile } from '../c3-user-configuration/c3-profile-provider/c3-profile-provider.js';
|
|
13
|
+
import { useC3UserConfiguration } from '../c3-user-configuration/c3-user-configuration-provider.js';
|
|
14
|
+
import { useC3HelpCenter } from './c3-help-center-provider.js';
|
|
15
|
+
import { StyledModalBody, StyledModalHeader } from './styles.js';
|
|
16
|
+
import { Feedback } from './tabs/feedback.js';
|
|
17
|
+
import { TabContent } from './tabs/tabContent.js';
|
|
18
|
+
import { TabContentSkeleton } from './tabs/tabContentSkeleton.js';
|
|
19
|
+
const StyledModalFooter = styled(ModalFooter) `
|
|
20
|
+
height: 62px;
|
|
21
|
+
padding-right: 16px;
|
|
22
|
+
padding-top: 16px;
|
|
23
|
+
padding-bottom: 16px;
|
|
24
|
+
border-top: 1px;
|
|
25
|
+
border-style: solid;
|
|
26
|
+
border-color: ${({ $hcTheme }) => $hcTheme === 'light' ? '#E0E0E0' : '#727272'};
|
|
27
|
+
background-color: ${({ $hcTheme }) => $hcTheme === 'light' ? '#FFFFFF' : '#161616'};
|
|
28
|
+
`;
|
|
29
|
+
export const HelpCenter = ({ configuration, persona, email, audience, flags = [], onRequestResumeSurvey, onRequestRetakeSurvey, onRequestClose, mixpanelTrack, theme, origin, initialTab, }) => {
|
|
30
|
+
const { tabs } = configuration;
|
|
31
|
+
const firstTab = tabs[0].id;
|
|
32
|
+
const { userToken: token, activeOrganizationId, domain, } = useC3UserConfiguration();
|
|
33
|
+
const { activeOrg: organization, clusters } = useC3Profile();
|
|
34
|
+
const clusterIds = (clusters || []).map((cluster) => cluster.uuid);
|
|
35
|
+
const { showTabId } = useC3HelpCenter();
|
|
36
|
+
const [activeTab, setActiveTab] = useState(firstTab);
|
|
37
|
+
const [rawTabTiles, setRawTabTiles] = useState({});
|
|
38
|
+
const [tabTiles, setTabTiles] = useState({});
|
|
39
|
+
const [isLoadingTiles, setIsLoadingTiles] = useState(false);
|
|
40
|
+
let header = '';
|
|
41
|
+
let content = _jsx(_Fragment, {});
|
|
42
|
+
React.useEffect(() => {
|
|
43
|
+
;
|
|
44
|
+
(async () => {
|
|
45
|
+
const tiles = {};
|
|
46
|
+
setIsLoadingTiles(true);
|
|
47
|
+
for (const singleTab of tabs) {
|
|
48
|
+
if (token) {
|
|
49
|
+
const { result } = await getTiles({
|
|
50
|
+
tileConfig: singleTab.tiles,
|
|
51
|
+
cloudAudience: audience,
|
|
52
|
+
persona,
|
|
53
|
+
clusterIds,
|
|
54
|
+
salesPlanType: organization?.salesPlan?.type ?? '',
|
|
55
|
+
flags,
|
|
56
|
+
accessToken: token,
|
|
57
|
+
});
|
|
58
|
+
if (result)
|
|
59
|
+
tiles[singleTab.id] = result;
|
|
60
|
+
}
|
|
61
|
+
}
|
|
62
|
+
setIsLoadingTiles(false);
|
|
63
|
+
setRawTabTiles(tiles);
|
|
64
|
+
})();
|
|
65
|
+
}, [
|
|
66
|
+
token,
|
|
67
|
+
JSON.stringify(persona),
|
|
68
|
+
audience,
|
|
69
|
+
JSON.stringify(organization),
|
|
70
|
+
JSON.stringify(clusters),
|
|
71
|
+
JSON.stringify(tabs),
|
|
72
|
+
]);
|
|
73
|
+
useEffect(() => {
|
|
74
|
+
if (!tabs || !rawTabTiles)
|
|
75
|
+
return;
|
|
76
|
+
const tiles = {};
|
|
77
|
+
for (const tab of tabs) {
|
|
78
|
+
if (rawTabTiles[tab.id])
|
|
79
|
+
tiles[tab.id] =
|
|
80
|
+
rawTabTiles[tab.id]?.map((card) => {
|
|
81
|
+
if (domain)
|
|
82
|
+
card.link = card.link?.replaceAll('{cloudAudience}', domain);
|
|
83
|
+
card.link = card.link?.replaceAll('{currentOrgId}', activeOrganizationId);
|
|
84
|
+
card.link = card.link?.replaceAll('{clusterId}', clusterIds[0]);
|
|
85
|
+
card.link = card.link?.replaceAll('{email}', email);
|
|
86
|
+
return card;
|
|
87
|
+
}) || [];
|
|
88
|
+
}
|
|
89
|
+
setTabTiles(tiles);
|
|
90
|
+
}, [JSON.stringify(rawTabTiles), email, domain]);
|
|
91
|
+
useEffect(() => {
|
|
92
|
+
setActiveTab(initialTab ?? firstTab);
|
|
93
|
+
}, [initialTab]);
|
|
94
|
+
useEffect(() => {
|
|
95
|
+
if (showTabId) {
|
|
96
|
+
setActiveTab(showTabId);
|
|
97
|
+
}
|
|
98
|
+
}, [showTabId]);
|
|
99
|
+
if (activeTab === 'feedback') {
|
|
100
|
+
header = 'Share your feedback';
|
|
101
|
+
}
|
|
102
|
+
else if (activeTab === 'recommendations' &&
|
|
103
|
+
Object.keys(tabTiles).length === 0 &&
|
|
104
|
+
isLoadingTiles) {
|
|
105
|
+
header = 'Your recommendations';
|
|
106
|
+
content = _jsx(TabContentSkeleton, {});
|
|
107
|
+
}
|
|
108
|
+
else if (activeTab === 'recommendations' &&
|
|
109
|
+
Object.keys(tabTiles).length === 0) {
|
|
110
|
+
header = '';
|
|
111
|
+
content = (_jsx("div", { style: {
|
|
112
|
+
height: '100%',
|
|
113
|
+
display: 'flex',
|
|
114
|
+
justifyContent: 'center',
|
|
115
|
+
alignItems: 'center',
|
|
116
|
+
}, children: _jsx("div", { style: {
|
|
117
|
+
height: '200px',
|
|
118
|
+
width: '450px',
|
|
119
|
+
}, children: _jsxs(Stack, { orientation: 'horizontal', gap: 6, children: [_jsx("svg", { width: '64', height: '64', viewBox: '0 0 64 64', fill: 'none', xmlns: 'http://www.w3.org/2000/svg', children: _jsx("path", { d: 'M22.5379 14.9379C22.5379 9.46436 26.9851 5.0171 32.4587 5.0171C37.9322 5.0171 42.3795 9.46436 42.3795 14.9379C42.3795 20.4115 37.9322 24.8587 32.4587 24.8587C26.9851 24.8587 22.5379 20.3944 22.5379 14.9379ZM53.4976 38.7137L51.445 59H13.4723L11.4197 38.7137H20.5024V34.5743L10 26.86V5H16.3288V23.6443L24.5733 29.6994H41.4045L44.415 33.8046V38.7308L53.4976 38.7137ZM36.1704 48.8568C36.1704 46.8042 34.5112 45.1451 32.4587 45.1451C30.4061 45.1451 28.7469 46.8042 28.7469 48.8568C28.7469 50.9094 30.4061 52.5686 32.4587 52.5686C34.5112 52.5686 36.1704 50.9094 36.1704 48.8568Z', fill: '#FC5D0D' }) }), _jsxs(Stack, { gap: 3, children: [_jsx("h2", { children: "Personalize your experience" }), _jsxs(Stack, { gap: 6, children: [_jsx("p", { style: { maxWidth: '400px' }, children: "Complete a 1-minute survey to access personalized next steps and educational content designed for you" }), _jsx(Stack, { gap: 3, children: _jsx(Button, { id: 'additional-feedback-button', size: 'md', onClick: () => {
|
|
120
|
+
onRequestRetakeSurvey();
|
|
121
|
+
}, children: "Start now" }) })] })] })] }) }) }));
|
|
122
|
+
}
|
|
123
|
+
else {
|
|
124
|
+
const tab = configuration.tabs.find((tab) => tab.id === activeTab);
|
|
125
|
+
header = tab?.title ?? '';
|
|
126
|
+
if (tabTiles[activeTab]) {
|
|
127
|
+
content = (_jsx(TabContent, { onboarding: (() => {
|
|
128
|
+
if (activeTab === 'recommendations') {
|
|
129
|
+
return {
|
|
130
|
+
complete: persona.complete || false,
|
|
131
|
+
resumeSurvey: onRequestResumeSurvey,
|
|
132
|
+
};
|
|
133
|
+
}
|
|
134
|
+
else {
|
|
135
|
+
return undefined;
|
|
136
|
+
}
|
|
137
|
+
})(), origin: origin, type: tab?.tiletype || 'grid', tiles: tabTiles[activeTab], mixpanelTrack: mixpanelTrack, salesPlanType: organization?.salesPlan?.type ?? '' }));
|
|
138
|
+
}
|
|
139
|
+
}
|
|
140
|
+
const tabBar = [
|
|
141
|
+
...configuration.tabs.map(({ id, label }) => ({
|
|
142
|
+
id,
|
|
143
|
+
name: id,
|
|
144
|
+
text: label,
|
|
145
|
+
})),
|
|
146
|
+
{ id: 'feedback', name: 'feedback', text: 'Share your feedback' },
|
|
147
|
+
];
|
|
148
|
+
return (_jsxs(_Fragment, { children: [_jsx(StyledModalHeader, { title: '', label: '', closeModal: onRequestClose, style: {
|
|
149
|
+
backgroundColor: theme === 'light' ? '#FFFFFF' : '#161616',
|
|
150
|
+
marginBottom: '0',
|
|
151
|
+
}, children: _jsx("h4", { style: { marginLeft: '16rem' }, children: header }) }), _jsx(StyledModalBody, { style: {
|
|
152
|
+
backgroundColor: theme === 'light' ? '#FFFFFF' : '#161616',
|
|
153
|
+
marginBottom: 0,
|
|
154
|
+
}, children: _jsxs("div", { style: {
|
|
155
|
+
height: persona.complete && activeTab === 'recommendations'
|
|
156
|
+
? '634px'
|
|
157
|
+
: '696px',
|
|
158
|
+
}, children: [_jsx(SideNav, { isFixedNav: true, expanded: true, isChildOfHeader: false, "aria-label": 'Side nav', children: _jsxs(SideNavItems, { children: [_jsx(SideNavMenuItem, { children: _jsx("h5", { children: "Help Center" }) }), _jsx("li", { style: { marginTop: '4px' }, children: _jsx(Stack, { children: _jsx("ul", { children: tabBar.map(({ name, id, text }) => {
|
|
159
|
+
const active = activeTab === name;
|
|
160
|
+
let tabBackgroundColor = theme === 'light' ? '#F4F4F4' : '#161616';
|
|
161
|
+
let tabButtonColor = theme === 'light' ? '#525252' : '#f4f4f4';
|
|
162
|
+
if (active) {
|
|
163
|
+
tabBackgroundColor =
|
|
164
|
+
theme === 'light' ? '#E5E5E5' : '#8D8D8D3D';
|
|
165
|
+
tabButtonColor =
|
|
166
|
+
theme === 'light' ? '#161616' : '#f4f4f4';
|
|
167
|
+
}
|
|
168
|
+
return (_jsx("li", { children: _jsx(Button, { className: active ? 'active' : '', kind: 'secondary', onClick: () => {
|
|
169
|
+
setActiveTab(name);
|
|
170
|
+
mixpanelTrack?.('helpcenter:open', {
|
|
171
|
+
to: id,
|
|
172
|
+
from: origin,
|
|
173
|
+
});
|
|
174
|
+
}, style: {
|
|
175
|
+
width: '100%',
|
|
176
|
+
backgroundColor: tabBackgroundColor,
|
|
177
|
+
color: tabButtonColor,
|
|
178
|
+
}, "aria-label": text, children: text }) }, name));
|
|
179
|
+
}) }) }) }), _jsx("li", { style: { position: 'absolute', bottom: '20px' }, children: _jsx("ul", { children: configuration.links?.map((link) => (_jsx(SideNavMenuItem, { href: link.link, target: '_blank', children: _jsx("span", { className: 'cds--link', children: link.label }) }, link.label.split(' ').join('-').toLowerCase()))) }) })] }) }), content, _jsx("div", { style: { display: activeTab === 'feedback' ? 'block' : 'none' }, children: _jsx(Feedback, { audience: audience, theme: theme, mixpanelTrack: mixpanelTrack, setHeader: (head) => {
|
|
180
|
+
header = head;
|
|
181
|
+
}, salesPlanType: organization?.salesPlan?.type ?? '' }) })] }) }), persona.complete && activeTab === 'recommendations' && (_jsx(StyledModalFooter, { "$hcTheme": theme, children: _jsx("div", { children: _jsx(Button, { kind: 'tertiary', renderIcon: Undo, onClick: onRequestRetakeSurvey, size: 'sm', style: {
|
|
182
|
+
maxWidth: '200px',
|
|
183
|
+
height: '32px',
|
|
184
|
+
alignItems: 'center',
|
|
185
|
+
paddingTop: '0px',
|
|
186
|
+
paddingBottom: '0px',
|
|
187
|
+
marginRight: '6px',
|
|
188
|
+
}, children: "Retake the survey" }) }) }))] }));
|
|
189
|
+
};
|
|
@@ -0,0 +1,55 @@
|
|
|
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 recommendations = (persona, flags, tileConfig, salesPlanType, hasClusters) => {
|
|
7
|
+
persona = { ...persona, ...{ flags, salesPlanType, hasClusters } };
|
|
8
|
+
if (!tileConfig) {
|
|
9
|
+
return [];
|
|
10
|
+
}
|
|
11
|
+
return tileConfig
|
|
12
|
+
.filter((tile) => {
|
|
13
|
+
if (!tile.prerequestites || typeof tile.prerequestites === 'boolean') {
|
|
14
|
+
return true;
|
|
15
|
+
}
|
|
16
|
+
if (tile.prerequestites.length === 1) {
|
|
17
|
+
const pre = tile.prerequestites[0];
|
|
18
|
+
const personaEntry = persona[pre.id];
|
|
19
|
+
return evaluateRequirement(personaEntry, pre.value, pre.not);
|
|
20
|
+
}
|
|
21
|
+
switch (tile.bool) {
|
|
22
|
+
case 'OR':
|
|
23
|
+
return tile.prerequestites.reduce((prev, curr) => {
|
|
24
|
+
const personaEntry = persona[curr.id];
|
|
25
|
+
return (prev || evaluateRequirement(personaEntry, curr.value, curr.not));
|
|
26
|
+
}, false);
|
|
27
|
+
case 'AND':
|
|
28
|
+
return tile.prerequestites.reduce((prev, curr) => {
|
|
29
|
+
const personaEntry = persona[curr.id];
|
|
30
|
+
return (prev && evaluateRequirement(personaEntry, curr.value, curr.not));
|
|
31
|
+
}, true);
|
|
32
|
+
default:
|
|
33
|
+
return true;
|
|
34
|
+
}
|
|
35
|
+
})
|
|
36
|
+
.map((tile) => tile.id);
|
|
37
|
+
};
|
|
38
|
+
function evaluateRequirement(personaEntry, reqValue, reqNot) {
|
|
39
|
+
if (personaEntry instanceof Array) {
|
|
40
|
+
if (reqNot) {
|
|
41
|
+
return !personaEntry.includes(`${reqValue}`);
|
|
42
|
+
}
|
|
43
|
+
else {
|
|
44
|
+
return personaEntry.includes(`${reqValue}`);
|
|
45
|
+
}
|
|
46
|
+
}
|
|
47
|
+
else {
|
|
48
|
+
if (reqNot) {
|
|
49
|
+
return `${personaEntry}` !== `${reqValue}`;
|
|
50
|
+
}
|
|
51
|
+
else {
|
|
52
|
+
return `${personaEntry}` === `${reqValue}`;
|
|
53
|
+
}
|
|
54
|
+
}
|
|
55
|
+
}
|
|
@@ -0,0 +1,48 @@
|
|
|
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 { ModalBody, ModalHeader } from '@carbon/react';
|
|
7
|
+
import styled, { css } from 'styled-components';
|
|
8
|
+
import { body01, heading01, heading02, heading03, heading04, heading05, heading06, } from '../styles.js';
|
|
9
|
+
export const headingStyles = css `
|
|
10
|
+
h1 {
|
|
11
|
+
${heading06}
|
|
12
|
+
}
|
|
13
|
+
|
|
14
|
+
h2 {
|
|
15
|
+
${heading05}
|
|
16
|
+
}
|
|
17
|
+
|
|
18
|
+
h3 {
|
|
19
|
+
${heading04}
|
|
20
|
+
}
|
|
21
|
+
|
|
22
|
+
h4 {
|
|
23
|
+
${heading03}
|
|
24
|
+
}
|
|
25
|
+
|
|
26
|
+
h5 {
|
|
27
|
+
${heading02}
|
|
28
|
+
}
|
|
29
|
+
|
|
30
|
+
h6 {
|
|
31
|
+
${heading01}
|
|
32
|
+
}
|
|
33
|
+
`;
|
|
34
|
+
export const StyledModalHeader = styled(ModalHeader) `
|
|
35
|
+
${headingStyles}
|
|
36
|
+
`;
|
|
37
|
+
export const StyledModalBody = styled(ModalBody) `
|
|
38
|
+
padding-left: 17rem;
|
|
39
|
+
@media (max-width: 768px) {
|
|
40
|
+
padding-left: 1rem;
|
|
41
|
+
}
|
|
42
|
+
|
|
43
|
+
${headingStyles}
|
|
44
|
+
|
|
45
|
+
p {
|
|
46
|
+
${body01}
|
|
47
|
+
}
|
|
48
|
+
`;
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import type { Dict } from 'mixpanel-browser';
|
|
2
|
+
import { type FC } from 'react';
|
|
3
|
+
export declare const Feedback: FC<{
|
|
4
|
+
audience: string;
|
|
5
|
+
theme: string;
|
|
6
|
+
setHeader: (header: string) => void;
|
|
7
|
+
salesPlanType: string;
|
|
8
|
+
mixpanelTrack?: (event: string, data: Dict | undefined) => void;
|
|
9
|
+
}>;
|
|
@@ -0,0 +1,141 @@
|
|
|
1
|
+
import { jsx as _jsx, Fragment as _Fragment, jsxs as _jsxs } 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 { Button, Checkbox, FileUploaderDropContainer, FileUploaderItem, InlineLoading, RadioTile, Stack, StaticNotification, TextArea, Tooltip, } from '@carbon/react';
|
|
8
|
+
import { Chat, Debug, Idea, Information } from '@carbon/react/icons/index.esm.js';
|
|
9
|
+
import React, { useState } from 'react';
|
|
10
|
+
import styled from 'styled-components';
|
|
11
|
+
import { submitFeedback } from '../../../api/help-center.js';
|
|
12
|
+
import { useC3UserConfiguration } from '../../c3-user-configuration/c3-user-configuration-provider.js';
|
|
13
|
+
var ReportType;
|
|
14
|
+
(function (ReportType) {
|
|
15
|
+
ReportType["Feedback"] = "feedback";
|
|
16
|
+
ReportType["Idea"] = "idea";
|
|
17
|
+
ReportType["Bug"] = "bug";
|
|
18
|
+
})(ReportType || (ReportType = {}));
|
|
19
|
+
var Title;
|
|
20
|
+
(function (Title) {
|
|
21
|
+
Title["Feedback"] = "Describe your thoughts";
|
|
22
|
+
Title["Idea"] = "Describe your suggestion";
|
|
23
|
+
Title["Bug"] = "Describe the issue";
|
|
24
|
+
})(Title || (Title = {}));
|
|
25
|
+
var Placeholder;
|
|
26
|
+
(function (Placeholder) {
|
|
27
|
+
Placeholder["Feedback"] = "Tell us about your experience";
|
|
28
|
+
Placeholder["Idea"] = "Tell us how we can improve our product";
|
|
29
|
+
Placeholder["Bug"] = "Tell us what went wrong";
|
|
30
|
+
})(Placeholder || (Placeholder = {}));
|
|
31
|
+
const StyledRadioTile = styled(RadioTile) `
|
|
32
|
+
min-width: 200px;
|
|
33
|
+
`;
|
|
34
|
+
export const Feedback = (props) => {
|
|
35
|
+
props.setHeader('Share your feedback');
|
|
36
|
+
const { userToken } = useC3UserConfiguration();
|
|
37
|
+
const [selectedType, setSelectedType] = useState(ReportType.Feedback);
|
|
38
|
+
const [content, setContent] = useState({
|
|
39
|
+
title: Title.Feedback,
|
|
40
|
+
placeholder: Placeholder.Feedback,
|
|
41
|
+
});
|
|
42
|
+
const [suggestion, setSuggestion] = useState('');
|
|
43
|
+
const [allowContact, setAllowContact] = useState(true);
|
|
44
|
+
const [file, setFile] = useState(undefined);
|
|
45
|
+
const [submitted, setSubmitted] = useState(false);
|
|
46
|
+
const [isDoingAsyncWork, setisDoingAsyncWork] = useState(false);
|
|
47
|
+
React.useEffect(() => {
|
|
48
|
+
switch (selectedType) {
|
|
49
|
+
case ReportType.Feedback:
|
|
50
|
+
setContent({
|
|
51
|
+
title: Title.Feedback,
|
|
52
|
+
placeholder: Placeholder.Feedback,
|
|
53
|
+
});
|
|
54
|
+
break;
|
|
55
|
+
case ReportType.Bug:
|
|
56
|
+
setContent({ title: Title.Bug, placeholder: Placeholder.Bug });
|
|
57
|
+
break;
|
|
58
|
+
default:
|
|
59
|
+
setContent({ title: Title.Idea, placeholder: Placeholder.Idea });
|
|
60
|
+
}
|
|
61
|
+
}, [selectedType]);
|
|
62
|
+
function submit() {
|
|
63
|
+
if (!userToken)
|
|
64
|
+
return;
|
|
65
|
+
setisDoingAsyncWork(true);
|
|
66
|
+
props.mixpanelTrack?.('helpcenter:click', {
|
|
67
|
+
to: 'feedback_send',
|
|
68
|
+
type: selectedType,
|
|
69
|
+
from: origin,
|
|
70
|
+
});
|
|
71
|
+
const formData = new FormData();
|
|
72
|
+
formData.append('reportType', selectedType);
|
|
73
|
+
formData.append('suggestion', suggestion);
|
|
74
|
+
formData.append('allowContact', '' + allowContact);
|
|
75
|
+
if (props.salesPlanType) {
|
|
76
|
+
formData.append('salesPlanType', props.salesPlanType);
|
|
77
|
+
}
|
|
78
|
+
if (file) {
|
|
79
|
+
formData.append('file', file);
|
|
80
|
+
}
|
|
81
|
+
submitFeedback({
|
|
82
|
+
token: userToken,
|
|
83
|
+
audience: props.audience,
|
|
84
|
+
formData,
|
|
85
|
+
})
|
|
86
|
+
.then(() => {
|
|
87
|
+
setisDoingAsyncWork(false);
|
|
88
|
+
setSubmitted(true);
|
|
89
|
+
})
|
|
90
|
+
.catch(() => {
|
|
91
|
+
setisDoingAsyncWork(false);
|
|
92
|
+
});
|
|
93
|
+
}
|
|
94
|
+
const orgIsEnterprise = props.salesPlanType === 'enterprise';
|
|
95
|
+
if (submitted) {
|
|
96
|
+
props.setHeader('');
|
|
97
|
+
return (_jsx("div", { style: {
|
|
98
|
+
height: '100%',
|
|
99
|
+
display: 'flex',
|
|
100
|
+
justifyContent: 'center',
|
|
101
|
+
alignItems: 'center',
|
|
102
|
+
}, children: _jsx("div", { style: {
|
|
103
|
+
height: '200px',
|
|
104
|
+
width: '450px',
|
|
105
|
+
}, children: _jsxs(Stack, { orientation: 'horizontal', gap: 6, children: [_jsx("svg", { width: '62', height: '54', viewBox: '0 0 62 54', fill: 'none', xmlns: 'http://www.w3.org/2000/svg', children: _jsx("path", { d: 'M60.7573 6.91209L56.137 2.22698C55.3173 1.39576 54.2441 0.972656 53.1711 0.972656C52.0981 0.972656 51.0248 1.39576 50.2051 2.22698L20.635 32.2572L11.7819 23.2496C10.9622 22.4184 9.88904 21.9953 8.81588 21.9953C7.74272 21.9953 6.66971 22.4032 5.85001 23.2496L1.22972 27.9347C-0.409906 29.5972 -0.409906 32.3025 1.22972 33.9649L20.65 53.6726L60.7723 12.9425C62.4117 11.2798 62.4117 8.57471 60.7573 6.91209Z', fill: '#FC5D0D' }) }), _jsxs(Stack, { gap: 3, children: [_jsx("h2", { children: "Feedback submitted successfully" }), _jsxs(Stack, { gap: 6, children: [_jsx("p", { style: { maxWidth: '400px' }, children: orgIsEnterprise ? (_jsx(_Fragment, { children: "Your feedback will be forwarded to your Customer Success Manager who will ensure that your inputs are addressed promptly." })) : (_jsxs(_Fragment, { children: ["Thanks for sharing your feedback. ", _jsx("br", {}), "We use suggestions like yours to improve our service."] })) }), _jsx(Stack, { gap: 3, children: _jsx(Button, { id: 'additional-feedback-button', size: 'md', onClick: () => {
|
|
106
|
+
setSuggestion('');
|
|
107
|
+
setFile(undefined);
|
|
108
|
+
setSelectedType(ReportType.Feedback);
|
|
109
|
+
setAllowContact(false);
|
|
110
|
+
setSubmitted(false);
|
|
111
|
+
}, children: "Share additional feedback" }) })] })] })] }) }) }));
|
|
112
|
+
}
|
|
113
|
+
return (_jsx("div", { children: _jsxs(Stack, { gap: 6, children: [_jsx("p", { children: "We actively use this information to fix problems and improve your experience with our products." }), !orgIsEnterprise && (_jsxs("div", { children: [_jsx("h5", { style: { marginBottom: '12px' }, children: "What type of feedback would you like to share?" }), _jsxs("div", { style: {
|
|
114
|
+
display: 'flex',
|
|
115
|
+
justifyContent: 'space-between',
|
|
116
|
+
columnGap: '12px',
|
|
117
|
+
}, children: [_jsx("div", { style: { flexGrow: '1' }, children: _jsx(StyledRadioTile, { checked: selectedType === ReportType.Feedback, onChange: (value) => setSelectedType(value), value: ReportType.Feedback, children: _jsxs(Stack, { children: [_jsx(Chat, { size: '40' }), _jsx("p", { children: "General feedback" })] }) }) }), _jsx("div", { style: { flexGrow: '1' }, children: _jsx(StyledRadioTile, { checked: selectedType === ReportType.Idea, onChange: (value) => setSelectedType(value), value: ReportType.Idea, children: _jsxs(Stack, { children: [_jsx(Idea, { size: '40' }), _jsx("p", { children: "Suggest an idea" })] }) }) }), _jsx("div", { style: { flexGrow: '1' }, children: _jsx(StyledRadioTile, { checked: selectedType === ReportType.Bug, onChange: (value) => setSelectedType(value), value: ReportType.Bug, children: _jsxs(Stack, { children: [_jsx(Debug, { size: '40' }), _jsx("p", { children: "Report a bug" })] }) }) })] })] })), _jsx("div", { children: _jsxs(Stack, { children: [!orgIsEnterprise && (_jsx("h5", { style: { marginBottom: '-16px' }, children: content.title })), orgIsEnterprise && (_jsx(StaticNotification, { lowContrast: true, kind: 'info', title: 'If you are looking to get technical support, please use our Jira support system.', style: { maxWidth: '100%' }, actionButtonLabel: 'Open a ticket', onActionButtonClick: () => window.open('https://jira.camunda.com/projects/SUPPORT/queues', '_blank'), "aria-describedby": 'help-center-feedback-notification', titleId: 'help-center-feedback-notification' })), _jsx(TextArea, { labelText: '', id: 'feedback-text', placeholder: content.placeholder, rows: 4, onChange: (event) => {
|
|
118
|
+
setSuggestion(event.target.value);
|
|
119
|
+
}, value: suggestion }), !orgIsEnterprise && (_jsxs(_Fragment, { children: [_jsxs("h5", { children: ["Upload file (optional)", _jsx(Tooltip, { label: 'Please be sure to redact any confidential information, such as intellectual property, addresses or account numbers before uploading files.', align: 'bottom', children: _jsx(Button, { kind: 'ghost', "aria-label": 'Information', renderIcon: Information, iconDescription: 'Information', style: {
|
|
120
|
+
marginTop: '-10px',
|
|
121
|
+
backgroundColor: props.theme === 'light' ? '#FFFFFF' : '#161616',
|
|
122
|
+
color: props.theme === 'light' ? '#161616' : '#F4F4F4',
|
|
123
|
+
paddingLeft: '0px',
|
|
124
|
+
} }) })] }), _jsx("p", { className: 'cds--label-description', style: { marginTop: '-24px' }, children: "Max. file size is 5MB. Supported file types are .jpg and .png." })] })), !orgIsEnterprise &&
|
|
125
|
+
(() => {
|
|
126
|
+
if (file !== undefined) {
|
|
127
|
+
return (_jsx(FileUploaderItem, { name: file.name, iconDescription: 'Delete file', invalid: (() => {
|
|
128
|
+
return file.size > 5000000;
|
|
129
|
+
})(), status: 'edit', errorSubject: 'File exceeds size limit.', size: 'lg', style: { marginTop: '-32px', maxWidth: '100%' }, onDelete: () => {
|
|
130
|
+
setFile(undefined);
|
|
131
|
+
} }));
|
|
132
|
+
}
|
|
133
|
+
else {
|
|
134
|
+
return (_jsx(FileUploaderDropContainer, { labelText: 'Drag and drop file here or click to upload', multiple: false, accept: ['image/jpeg', 'image/jpg', 'image/png'], onAddFiles: (_evt, { addedFiles }) => {
|
|
135
|
+
setFile(addedFiles[0]);
|
|
136
|
+
}, style: { marginTop: '-32px', maxWidth: '100%' } }));
|
|
137
|
+
}
|
|
138
|
+
})(), !orgIsEnterprise && (_jsx("div", { children: _jsx(Checkbox, { id: 'allow-contact', labelText: 'Camunda may contact me about my feedback', checked: allowContact, onChange: () => {
|
|
139
|
+
setAllowContact(!allowContact);
|
|
140
|
+
} }) })), _jsx("div", { children: _jsx("div", { children: isDoingAsyncWork ? (_jsx(InlineLoading, { description: 'Submitting feedback...', status: 'active', style: { marginLeft: '1rem' } })) : (_jsx(Button, { kind: 'primary', disabled: suggestion.trim().length === 0, onClick: submit, children: "Submit feedback" })) }) })] }) })] }) }));
|
|
141
|
+
};
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import type { Dict } from 'mixpanel-browser';
|
|
2
|
+
import type { FC } from 'react';
|
|
3
|
+
import type { WpCardType } from '../c3-help-center.types';
|
|
4
|
+
export declare const TAB_TYPES: {
|
|
5
|
+
readonly Grid: "grid";
|
|
6
|
+
readonly Column: "column";
|
|
7
|
+
};
|
|
8
|
+
export type TabType = (typeof TAB_TYPES)[keyof typeof TAB_TYPES];
|
|
9
|
+
export declare const TileWrapper: any;
|
|
10
|
+
export declare const TabContent: FC<{
|
|
11
|
+
onboarding: {
|
|
12
|
+
complete: boolean;
|
|
13
|
+
resumeSurvey: () => void;
|
|
14
|
+
} | undefined;
|
|
15
|
+
tiles: WpCardType[];
|
|
16
|
+
type: TabType;
|
|
17
|
+
salesPlanType: string;
|
|
18
|
+
origin: string;
|
|
19
|
+
mixpanelTrack?: (event: string, data: Dict | undefined) => void;
|
|
20
|
+
}>;
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
import { jsx as _jsx, jsxs as _jsxs } 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 { ActionableNotification, Stack } from '@carbon/react';
|
|
8
|
+
import styled from 'styled-components';
|
|
9
|
+
import { HelpCenterTile } from '../tile.js';
|
|
10
|
+
export const TAB_TYPES = {
|
|
11
|
+
Grid: 'grid',
|
|
12
|
+
Column: 'column',
|
|
13
|
+
};
|
|
14
|
+
export const TileWrapper = styled.div `
|
|
15
|
+
display: flex;
|
|
16
|
+
flex-wrap: wrap;
|
|
17
|
+
justify-content: flex-start;
|
|
18
|
+
gap: var(--cds-spacing-05);
|
|
19
|
+
`;
|
|
20
|
+
export const TabContent = ({ onboarding, type, origin, tiles, mixpanelTrack }) => {
|
|
21
|
+
return (_jsx("div", { children: _jsxs(Stack, { children: [onboarding && onboarding?.complete !== true && (_jsx(ActionableNotification, { kind: 'info', inline: true, lowContrast: true, hideCloseButton: true, style: { maxWidth: '100%', marginBottom: '1rem' }, actionButtonLabel: 'Resume survey', onActionButtonClick: onboarding.resumeSurvey, title: 'Complete the new user survey to see more recommendations', subtitle: '' })), _jsx(TileWrapper, { children: tiles.map((tile) => (_jsx(HelpCenterTile, { origin: origin, tabType: type, tile: tile, mixpanelTrack: mixpanelTrack }, tile.card_id))) })] }) }));
|
|
22
|
+
};
|
|
@@ -0,0 +1,26 @@
|
|
|
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 { SkeletonPlaceholder } from '@carbon/react';
|
|
8
|
+
import styled from 'styled-components';
|
|
9
|
+
import { TileWrapper } from './tabContent.js';
|
|
10
|
+
const TileOuter = styled.div `
|
|
11
|
+
background: var(--cds-layer-02, #f4f4f4);
|
|
12
|
+
display: flex;
|
|
13
|
+
width: 300px;
|
|
14
|
+
height: 300px;
|
|
15
|
+
padding: 16px;
|
|
16
|
+
flex-direction: column;
|
|
17
|
+
align-items: flex-start;
|
|
18
|
+
gap: 16px;
|
|
19
|
+
`;
|
|
20
|
+
const TileSkeleton = styled(SkeletonPlaceholder) `
|
|
21
|
+
width: 100%;
|
|
22
|
+
height: 100%;
|
|
23
|
+
`;
|
|
24
|
+
export const TabContentSkeleton = () => (_jsx(TileWrapper, { children: Array(6)
|
|
25
|
+
.fill('_')
|
|
26
|
+
.map((_, i) => (_jsx(TileOuter, { children: _jsx(TileSkeleton, {}) }, `tile-skeleton-${i}-${Math.random() * 10000}`))) }));
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import type { Dict } from 'mixpanel-browser';
|
|
2
|
+
import type { FC } from 'react';
|
|
3
|
+
import type { WpCardType } from './c3-help-center.types';
|
|
4
|
+
import { type TabType } from './tabs/tabContent';
|
|
5
|
+
export declare const HelpCenterTile: FC<{
|
|
6
|
+
tile: WpCardType;
|
|
7
|
+
tabType: TabType;
|
|
8
|
+
origin: string;
|
|
9
|
+
mixpanelTrack?: (event: string, data: Dict | undefined) => void;
|
|
10
|
+
}>;
|
|
@@ -0,0 +1,61 @@
|
|
|
1
|
+
import { jsx as _jsx, jsxs as _jsxs } 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 { Button, Stack, Tag, Tile } from '@carbon/react';
|
|
8
|
+
import { ArrowRight } from '@carbon/react/icons/index.esm.js';
|
|
9
|
+
import ReactMarkdown from 'react-markdown';
|
|
10
|
+
import styled from 'styled-components';
|
|
11
|
+
import { TAB_TYPES } from './tabs/tabContent.js';
|
|
12
|
+
const TileHeading = styled.h6 `
|
|
13
|
+
font-size: var(--cds-heading-compact-01-font-size);
|
|
14
|
+
font-weight: var(--cds-heading-compact-01-font-weight);
|
|
15
|
+
line-height: var(--cds-heading-compact-01-line-height);
|
|
16
|
+
letter-spacing: var(--cds-heading-compact-01-letter-spacing);
|
|
17
|
+
`;
|
|
18
|
+
const TileDescription = styled.p `
|
|
19
|
+
height: 50px;
|
|
20
|
+
color: var(--cds-text-secondary);
|
|
21
|
+
`;
|
|
22
|
+
const TileStack = styled.div `
|
|
23
|
+
display: flex;
|
|
24
|
+
flex-direction: column;
|
|
25
|
+
`;
|
|
26
|
+
const TileWrapper = styled.div `
|
|
27
|
+
width: ${({ $width }) => `${$width}px`};
|
|
28
|
+
@media (max-width: 768px) {
|
|
29
|
+
width: auto;
|
|
30
|
+
}
|
|
31
|
+
`;
|
|
32
|
+
export const HelpCenterTile = ({ tile, tabType, origin, mixpanelTrack }) => {
|
|
33
|
+
const { title, description, timeToComplete, cta, image, link, card_id } = tile;
|
|
34
|
+
if (tabType === TAB_TYPES.Grid) {
|
|
35
|
+
return (_jsx(TileWrapper, { "$width": 300, children: _jsxs(Tile, { style: {
|
|
36
|
+
justifySelf: 'start',
|
|
37
|
+
}, className: 'cds--layer-two', children: [_jsxs(Stack, { orientation: 'vertical', gap: 3, children: [_jsx("img", { src: image, alt: title }), _jsxs(TileStack, { children: [_jsx(TileHeading, { children: title }), _jsx(TileDescription, { children: description }), _jsx("div", { style: { marginLeft: '-4px', marginTop: '12px' }, children: (() => {
|
|
38
|
+
let content = _jsx("div", { style: { height: '32px' } });
|
|
39
|
+
if (timeToComplete) {
|
|
40
|
+
content = (_jsx(Tag, { type: 'warm-gray', size: 'sm', children: timeToComplete }));
|
|
41
|
+
}
|
|
42
|
+
return content;
|
|
43
|
+
})() })] })] }), _jsx(Button, { size: 'sm', as: 'a', href: link, target: '_blank', onClick: () => {
|
|
44
|
+
mixpanelTrack?.(`helpcenter:click`, {
|
|
45
|
+
from: origin,
|
|
46
|
+
to: card_id,
|
|
47
|
+
});
|
|
48
|
+
}, renderIcon: ArrowRight, kind: 'tertiary', className: 'cds--switcher__item', style: { alignSelf: 'end', marginTop: '10px', maxWidth: '100%' }, children: cta })] }) }));
|
|
49
|
+
}
|
|
50
|
+
return (_jsx(TileWrapper, { "$width": 214, children: _jsx(Tile, { style: {
|
|
51
|
+
justifySelf: 'start',
|
|
52
|
+
height: 'initial',
|
|
53
|
+
}, className: 'cds--layer-two', onClick: () => {
|
|
54
|
+
mixpanelTrack?.(`helpcenter:click`, {
|
|
55
|
+
to: card_id,
|
|
56
|
+
from: origin,
|
|
57
|
+
});
|
|
58
|
+
}, children: _jsxs(Stack, { orientation: 'vertical', gap: 3, children: [_jsx("img", { src: image, alt: title }), _jsxs(Stack, { children: [_jsx("h5", { children: title }), _jsx(ReactMarkdown, { components: {
|
|
59
|
+
a: ({ children, href }) => (_jsx("a", { href: href, target: '_blank', rel: 'noopener noreferrer', children: children })),
|
|
60
|
+
}, children: description })] })] }) }) }));
|
|
61
|
+
};
|
|
@@ -0,0 +1,9 @@
|
|
|
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 { HeaderGlobalAction } from '@carbon/react';
|
|
8
|
+
import { Help } from '@carbon/react/icons/index.esm.js';
|
|
9
|
+
export const InfoButton = ({ onClick }) => (_jsx(HeaderGlobalAction, { "aria-label": 'Open Help Center', tooltipAlignment: 'center', onClick: onClick, children: _jsx(Help, { size: 20 }) }));
|