@integry/sdk 4.5.2 → 4.5.4
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/.vscode/launch.json +2 -2
- package/THIRD_PARTY_LICENSES +0 -37
- package/dist/esm/index.csm.d.ts +12 -2
- package/dist/esm/index.csm.js +7262 -1
- package/dist/umd/index.umd.d.ts +9 -1
- package/dist/umd/index.umd.js +7262 -1
- package/jest.config.cjs +10 -0
- package/package.json +10 -4
- package/src/components/AddTagButton/index.ts +23 -0
- package/src/components/BasicSelect/index.ts +114 -0
- package/src/components/BasicSelect/styles.module.scss +44 -0
- package/src/components/Button/index.ts +94 -0
- package/src/components/Button/styles.module.scss +152 -0
- package/src/components/CheckboxGroup/Checkbox.ts +104 -0
- package/src/components/CheckboxGroup/index.ts +190 -0
- package/src/components/CheckboxGroup/styles.module.scss +63 -0
- package/src/components/CollapsedMenu/index.ts +101 -0
- package/src/components/CollapsedMenu/styles.module.scss +46 -0
- package/src/components/ConfigureFieldWrapper/index.ts +85 -0
- package/src/components/ConfigureFieldWrapper/styles.module.scss +57 -0
- package/src/components/EditableText/index.ts +121 -0
- package/src/components/EditableText/styles.module.scss +38 -0
- package/src/components/EditableTextArea/index.ts +143 -0
- package/src/components/EditableTextArea/styles.module.scss +91 -0
- package/src/components/ErrorMessage/index.ts +16 -0
- package/src/components/ErrorMessage/styles.module.scss +19 -0
- package/src/components/ErrorPage/index.ts +42 -0
- package/src/components/ErrorPage/styles.module.scss +26 -0
- package/src/components/Footer/index.ts +41 -0
- package/src/components/Footer/styles.module.scss +40 -0
- package/src/components/HTMLContent/index.tsx +275 -0
- package/src/components/HTMLContent/styles.module.scss +3 -0
- package/src/components/InfoBox/index.ts +48 -0
- package/src/components/InfoBox/styles.module.scss +21 -0
- package/src/components/Input/BaseInput/index.ts +170 -0
- package/src/components/Input/BaseInput/styles.module.scss +94 -0
- package/src/components/Input/DateInput/index.ts +103 -0
- package/src/components/Input/DateInput/styles.module.scss +50 -0
- package/src/components/Input/Input/index.ts +206 -0
- package/src/components/Input/Input/styles.module.scss +14 -0
- package/src/components/Input/PasswordInput/index.ts +164 -0
- package/src/components/Input/PasswordInput/styles.module.scss +37 -0
- package/src/components/Input/index.ts +7 -0
- package/src/components/Label/index.ts +61 -0
- package/src/components/Label/styles.module.scss +41 -0
- package/src/components/LargeLoader/index.ts +25 -0
- package/src/components/LargeLoader/styles.module.scss +16 -0
- package/src/components/Listbox/ListBoxItem.ts +57 -0
- package/src/components/Listbox/index.ts +479 -0
- package/src/components/Listbox/styles.module.scss +197 -0
- package/src/components/Loader/index.ts +25 -0
- package/src/components/Loader/styles.module.scss +16 -0
- package/src/components/MediaGallery/MediaGalleryModal.ts +82 -0
- package/src/components/MediaGallery/MediaSlider.ts +76 -0
- package/src/components/MediaGallery/index.ts +92 -0
- package/src/components/MediaGallery/styles.module.scss +156 -0
- package/src/components/MediaUpload/index.ts +233 -0
- package/src/components/MediaUpload/styles.module.scss +118 -0
- package/src/components/Modal/index.ts +87 -0
- package/src/components/Modal/styles.module.scss +441 -0
- package/src/components/MultipurposeField/Dropdown/ListBoxItem.tsx +58 -0
- package/src/components/MultipurposeField/Dropdown/index.tsx +981 -0
- package/src/components/MultipurposeField/Dropdown/styles.module.scss +208 -0
- package/src/components/MultipurposeField/TagMenu/index.ts +384 -0
- package/src/components/MultipurposeField/TagMenu/styles.module.scss +136 -0
- package/src/components/MultipurposeField/TagOptions/index.tsx +83 -0
- package/src/components/MultipurposeField/TagOptions/styles.module.scss +95 -0
- package/src/components/MultipurposeField/index.tsx +687 -0
- package/src/components/MultipurposeField/styles.module.scss +56 -0
- package/src/components/NewModal/index.ts +69 -0
- package/src/components/NewModal/styles.module.scss +70 -0
- package/src/components/OverflowTooltip/index.tsx +59 -0
- package/src/components/PopUp/ConfirmationPopUp/index.ts +58 -0
- package/src/components/PopUp/ConfirmationPopUp/styles.module.scss +49 -0
- package/src/components/PopUp/SuccessPopUp/index.ts +62 -0
- package/src/components/PopUp/SuccessPopUp/styles.module.scss +38 -0
- package/src/components/RadioGroup/Radio.ts +129 -0
- package/src/components/RadioGroup/index.ts +169 -0
- package/src/components/RadioGroup/styles.module.scss +81 -0
- package/src/components/Search/index.ts +69 -0
- package/src/components/Search/styles.module.scss +149 -0
- package/src/components/TabBar/Tab.ts +33 -0
- package/src/components/TabBar/index.ts +64 -0
- package/src/components/TabBar/styles.module.scss +43 -0
- package/src/components/Tag/index.ts +29 -0
- package/src/components/Tag/styles.module.scss +57 -0
- package/src/components/TextArea/index.ts +172 -0
- package/src/components/TextArea/styles.module.scss +70 -0
- package/src/components/TextContent/index.tsx +128 -0
- package/src/components/TextContent/styles.module.scss +6 -0
- package/src/components/ThreeDotLoader/index.ts +39 -0
- package/src/components/ThreeDotLoader/styles.module.scss +41 -0
- package/src/components/TimeInput/index.ts +129 -0
- package/src/components/TimeInput/styles.module.scss +16 -0
- package/src/components/Toggle/index.ts +34 -0
- package/src/components/Toggle/styles.module.scss +56 -0
- package/src/components/Toggle-v2/index.ts +40 -0
- package/src/components/Toggle-v2/styles.module.scss +86 -0
- package/src/components/Tooltip/index.ts +271 -0
- package/src/components/Tooltip/styles.module.scss +105 -0
- package/src/components/form/ObjectField/index.ts +364 -0
- package/src/components/form/ObjectField/styles.module.scss +103 -0
- package/src/components/form/index.ts +3 -0
- package/src/contexts/AppContext.ts +12 -0
- package/src/declaration.d.ts +7 -0
- package/src/extensions/HMAC.ts +25 -0
- package/src/extensions/IntegryAPIError.ts +19 -0
- package/src/features/common/AccountDropdown/index.ts +291 -0
- package/src/features/common/AccountDropdown/styles.module.scss +19 -0
- package/src/features/common/ActionForm/index.ts +1818 -0
- package/src/features/common/ActionForm/styles.module.scss +23 -0
- package/src/features/common/AppCard/index.ts +207 -0
- package/src/features/common/AppCard/styles.module.scss +117 -0
- package/src/features/common/AppCardCompact/index.ts +189 -0
- package/src/features/common/AppCardCompact/styles.module.scss +141 -0
- package/src/features/common/AuthSelector/index.ts +537 -0
- package/src/features/common/AuthSelector/styles.module.scss +161 -0
- package/src/features/common/AuthSelectorCompact/index.ts +706 -0
- package/src/features/common/AuthSelectorCompact/styles.module.scss +219 -0
- package/src/features/common/AuthSelectorDropdown/index.ts +704 -0
- package/src/features/common/AuthSelectorDropdown/styles.module.scss +361 -0
- package/src/features/common/DynamicField/index.ts +229 -0
- package/src/features/common/DynamicField/styles.module.scss +67 -0
- package/src/features/common/DynamicTypedField/index.ts +217 -0
- package/src/features/common/DynamicTypedField/styles.module.scss +67 -0
- package/src/features/common/FunctionForm/index.ts +862 -0
- package/src/features/common/FunctionForm/styles.module.scss +163 -0
- package/src/features/common/MappingUI/index.ts +649 -0
- package/src/features/common/MappingUI/styles.module.scss +121 -0
- package/src/features/common/MarketplaceAppCard/index.ts +279 -0
- package/src/features/common/MarketplaceAppCard/styles.module.scss +231 -0
- package/src/features/common/MarketplaceAppCardCompact/index.ts +283 -0
- package/src/features/common/MarketplaceAppCardCompact/styles.module.scss +255 -0
- package/src/features/common/NewMappingUI/index.ts +515 -0
- package/src/features/common/NewMappingUI/styles.module.scss +113 -0
- package/src/features/common/RequestAppWidget/RequestAppModal/index.ts +67 -0
- package/src/features/common/RequestAppWidget/RequestAppModal/styles.module.scss +23 -0
- package/src/features/common/RequestAppWidget/index.ts +48 -0
- package/src/features/common/RequestAppWidget/request-app-form.ts +89 -0
- package/src/features/common/RequestAppWidget/styles.module.scss +43 -0
- package/src/features/common/SectionField/index.ts +272 -0
- package/src/features/common/SectionField/styles.module.scss +67 -0
- package/src/features/common/Step/index.ts +827 -0
- package/src/features/common/Step/styles.module.scss +12 -0
- package/src/features/common/StepNavigation/CollapsedSteps.ts +125 -0
- package/src/features/common/StepNavigation/NavItem.ts +111 -0
- package/src/features/common/StepNavigation/index.ts +257 -0
- package/src/features/common/StepNavigation/styles.module.scss +117 -0
- package/src/features/common/Steps/index.ts +1139 -0
- package/src/features/common/Steps/styles.module.scss +314 -0
- package/src/features/containers/AppFlowContainer/AppFlowListing/compactStyles.module.scss +383 -0
- package/src/features/containers/AppFlowContainer/AppFlowListing/flow-instance.tsx +367 -0
- package/src/features/containers/AppFlowContainer/AppFlowListing/flowCard.tsx +194 -0
- package/src/features/containers/AppFlowContainer/AppFlowListing/flowCardCompact.tsx +389 -0
- package/src/features/containers/AppFlowContainer/AppFlowListing/flowInstanceCompact.tsx +577 -0
- package/src/features/containers/AppFlowContainer/AppFlowListing/index.tsx +83 -0
- package/src/features/containers/AppFlowContainer/AppFlowListing/styles.module.scss +212 -0
- package/src/features/containers/AppFlowContainer/AppFlowWrap/app-page-loader.tsx +45 -0
- package/src/features/containers/AppFlowContainer/AppFlowWrap/index.tsx +1081 -0
- package/src/features/containers/AppFlowContainer/AppFlowWrap/styles.module.scss +452 -0
- package/src/features/containers/AppFlowContainer/Authentication/index.ts +610 -0
- package/src/features/containers/AppFlowContainer/Authentication/styles.module.scss +468 -0
- package/src/features/containers/AppFlowContainer/index.ts +114 -0
- package/src/features/containers/AppPageContainer/AppPage/index.tsx +262 -0
- package/src/features/containers/AppPageContainer/AppPage/styles.module.scss +120 -0
- package/src/features/containers/AppPageContainer/IntegrationCard/index.ts +165 -0
- package/src/features/containers/AppPageContainer/IntegrationCard/styles.module.scss +81 -0
- package/src/features/containers/AppPageContainer/index.tsx +93 -0
- package/src/features/containers/AppPageContainer/styles.module.scss +0 -0
- package/src/features/containers/AppsForFlows/index.ts +161 -0
- package/src/features/containers/AppsForFlows/styles.module.scss +280 -0
- package/src/features/containers/AppsForFlowsCompact/index.ts +161 -0
- package/src/features/containers/AppsForFlowsCompact/styles.module.scss +279 -0
- package/src/features/containers/AuthSetupContainer/AppSelection.ts +73 -0
- package/src/features/containers/AuthSetupContainer/AuthTypeSelection.ts +67 -0
- package/src/features/containers/AuthSetupContainer/Footer.ts +32 -0
- package/src/features/containers/AuthSetupContainer/Header.ts +39 -0
- package/src/features/containers/AuthSetupContainer/PostAdditionPopup.ts +27 -0
- package/src/features/containers/AuthSetupContainer/index.ts +349 -0
- package/src/features/containers/AuthSetupContainer/styles.module.scss +229 -0
- package/src/features/containers/FlowSetupContainer/index.ts +390 -0
- package/src/features/containers/FlowSetupContainer/styles.module.scss +18 -0
- package/src/features/containers/MarkeplaceApps/index.ts +574 -0
- package/src/features/containers/MarkeplaceApps/styles.module.scss +559 -0
- package/src/features/containers/MarketplaceAppsCompact/index.ts +576 -0
- package/src/features/containers/MarketplaceAppsCompact/styles.module.scss +546 -0
- package/src/features/containers/MarketplaceAppsContainer/index.ts +83 -0
- package/src/features/containers/MarketplaceContainer/AppCard/index.ts +91 -0
- package/src/features/containers/MarketplaceContainer/AppCard/styles.module.scss +66 -0
- package/src/features/containers/MarketplaceContainer/AppListing/index.ts +34 -0
- package/src/features/containers/MarketplaceContainer/AppListing/styles.module.scss +10 -0
- package/src/features/containers/MarketplaceContainer/MarketplaceContentWrap/index.ts +132 -0
- package/src/features/containers/MarketplaceContainer/MarketplaceContentWrap/styles.module.scss +117 -0
- package/src/features/containers/MarketplaceContainer/index.ts +242 -0
- package/src/features/containers/MarketplaceContainer/styles.module.scss +84 -0
- package/src/features/containers/SDKContainer/index.ts +817 -0
- package/src/features/containers/SDKContainer/styles.module.scss +266 -0
- package/src/features/containers/SDKDebugContainer/index.ts +137 -0
- package/src/features/containers/SDKDebugContainer/styles.module.scss +37 -0
- package/src/features/containers/SDKFailedContainer/index.ts +117 -0
- package/src/features/containers/SDKFailedContainer/styles.module.scss +57 -0
- package/src/features/integrations/IntegrationRow/Icons.ts +77 -0
- package/src/features/integrations/IntegrationRow/index.ts +129 -0
- package/src/features/integrations/IntegrationRow/styles.module.scss +62 -0
- package/src/features/integrations/IntegrationsHeader/index.ts +34 -0
- package/src/features/integrations/IntegrationsHeader/styles.module.scss +47 -0
- package/src/features/integrations/IntegrationsList/index.ts +252 -0
- package/src/features/integrations/IntegrationsList/styles.module.scss +67 -0
- package/src/features/templates/Template/index.ts +295 -0
- package/src/features/templates/Template/styles.module.scss +226 -0
- package/src/features/templates/TemplatesView/index.ts +368 -0
- package/src/features/templates/TemplatesView/styles.module.scss +71 -0
- package/src/features/templates/TemplatesViewCompact/index.ts +364 -0
- package/src/features/templates/TemplatesViewCompact/styles.module.scss +141 -0
- package/src/hooks/useAutosizeTextArea.ts +22 -0
- package/src/hooks/useCustomRef.ts +13 -0
- package/src/hooks/useDebounce.ts +17 -0
- package/src/hooks/useElementResize.ts +40 -0
- package/src/hooks/useEventListener.ts +44 -0
- package/src/hooks/useHover.ts +40 -0
- package/src/hooks/useOnClickOutside.ts +32 -0
- package/src/index.ts +2051 -0
- package/src/index.umd.ts +13 -0
- package/src/interfaces/index.ts +924 -0
- package/src/modules/api/index.ts +1315 -0
- package/src/modules/api/responseHandler.ts +38 -0
- package/src/modules/event-emitter/index.ts +72 -0
- package/src/modules/event-emitter/runners/abstract.ts +21 -0
- package/src/modules/event-emitter/runners/default.ts +11 -0
- package/src/modules/event-emitter/runners/ntimes.ts +28 -0
- package/src/modules/event-emitter/types.ts +34 -0
- package/src/store/actionFunctions.ts +1573 -0
- package/src/store/index.ts +17 -0
- package/src/store/initialState.ts +58 -0
- package/src/stories/Button.stories.tsx +83 -0
- package/src/stories/Checkbox/Checkbox.stories.tsx +41 -0
- package/src/stories/Checkbox/CheckboxGroup.stories.tsx +46 -0
- package/src/stories/EditableText.stories.tsx +35 -0
- package/src/stories/Input/BaseInput.stories.tsx +48 -0
- package/src/stories/Input/DateInput.stories.tsx +28 -0
- package/src/stories/Input/Input.stories.tsx +24 -0
- package/src/stories/Input/PasswordInput.stories.tsx +26 -0
- package/src/stories/Introduction.stories.mdx +211 -0
- package/src/stories/Label.stories.tsx +27 -0
- package/src/stories/Listbox.stories.tsx +122 -0
- package/src/stories/Radio/Radio.stories.tsx +39 -0
- package/src/stories/Radio/RadioGroup.stories.tsx +46 -0
- package/src/stories/StepNavigation/NavItem.stories.tsx +31 -0
- package/src/stories/StepNavigation/StepNavigation.stories.tsx +50 -0
- package/src/stories/TabBar.stories.tsx +31 -0
- package/src/stories/TextArea.stories.tsx +23 -0
- package/src/stories/TimeInput.stories.tsx +37 -0
- package/src/stories/Toggle.stories.tsx +33 -0
- package/src/stories/assets/code-brackets.svg +1 -0
- package/src/stories/assets/colors.svg +1 -0
- package/src/stories/assets/comments.svg +1 -0
- package/src/stories/assets/direction.svg +1 -0
- package/src/stories/assets/flow.svg +1 -0
- package/src/stories/assets/plugin.svg +1 -0
- package/src/stories/assets/repo.svg +1 -0
- package/src/stories/assets/stackalt.svg +1 -0
- package/src/types/index.ts +293 -0
- package/src/types/store.ts +366 -0
- package/src/types/utils.ts +19 -0
- package/src/utils/ActivityOutputUtils.ts +163 -0
- package/src/utils/common.ts +20 -0
- package/src/utils/copyToClipboard.ts +24 -0
- package/src/utils/datetime.ts +101 -0
- package/src/utils/getUrlParam.ts +11 -0
- package/src/utils/isAuthMessage.ts +16 -0
- package/src/utils/isBrowser.ts +1 -0
- package/src/utils/jsonEncodeDecode.ts +15 -0
- package/src/utils/objectUtils.ts +116 -0
- package/src/utils/popup.ts +30 -0
- package/src/utils/searchJson.ts +51 -0
- package/src/utils/stepUtils.ts +45 -0
- package/src/utils/truncate.ts +6 -0
- package/test/setup.ts +1 -0
- package/vitest.config.ts +10 -0
|
@@ -0,0 +1,817 @@
|
|
|
1
|
+
/* eslint-disable no-nested-ternary */
|
|
2
|
+
import { Modal } from '@/components/Modal';
|
|
3
|
+
import AppContext from '@/contexts/AppContext';
|
|
4
|
+
import TemplatesView from '@/features/templates/TemplatesView';
|
|
5
|
+
import TemplatesViewCompact from '@/features/templates/TemplatesViewCompact';
|
|
6
|
+
import { Template, TemplateStep, UserConfig } from '@/interfaces';
|
|
7
|
+
import { actionFunctions } from '@/store';
|
|
8
|
+
import {
|
|
9
|
+
TemplateFormRenderModes,
|
|
10
|
+
TemplateListingRenderModes,
|
|
11
|
+
ViewStyles,
|
|
12
|
+
} from '@/types';
|
|
13
|
+
import { StoreType } from '@/types/store';
|
|
14
|
+
import { html } from 'htm/preact';
|
|
15
|
+
import { useContext, useEffect, useRef } from 'preact/hooks';
|
|
16
|
+
import { connect } from 'unistore/preact';
|
|
17
|
+
|
|
18
|
+
import Authentication from '@/features/containers/AppFlowContainer/Authentication';
|
|
19
|
+
import { AuthData, isAuthMessage } from '@/utils/isAuthMessage';
|
|
20
|
+
import FlowSetupContainer from '../FlowSetupContainer';
|
|
21
|
+
import styles from './styles.module.scss';
|
|
22
|
+
|
|
23
|
+
interface ContainerProps extends StoreType {
|
|
24
|
+
deploymentId: string;
|
|
25
|
+
userConfig?: UserConfig;
|
|
26
|
+
layout: TemplateListingRenderModes;
|
|
27
|
+
renderMode: TemplateFormRenderModes;
|
|
28
|
+
renderFlowsMode?: TemplateFormRenderModes;
|
|
29
|
+
flowId?: number;
|
|
30
|
+
integrationId?: number;
|
|
31
|
+
params?: Record<string, string>;
|
|
32
|
+
}
|
|
33
|
+
|
|
34
|
+
const SDKContainer = (props: ContainerProps) => {
|
|
35
|
+
const context = useContext(AppContext);
|
|
36
|
+
const { flowId, integrationId } = props;
|
|
37
|
+
const defaultFlowId = flowId || 0;
|
|
38
|
+
const defautlIntegrationId = integrationId || 0;
|
|
39
|
+
const flowParams = props.params || {};
|
|
40
|
+
|
|
41
|
+
const templateListComponent = useRef<typeof TemplatesView | undefined>(
|
|
42
|
+
props.genericData.viewStyle === ViewStyles.COMPACT
|
|
43
|
+
? TemplatesViewCompact
|
|
44
|
+
: TemplatesView,
|
|
45
|
+
);
|
|
46
|
+
|
|
47
|
+
const onTemplateClick = (template: Template) => {
|
|
48
|
+
const { renderMode } = props;
|
|
49
|
+
if (renderMode === TemplateFormRenderModes.DETACHED) {
|
|
50
|
+
context?.eventEmitter.emit('should-load-flow', {
|
|
51
|
+
templateId: template.id,
|
|
52
|
+
flowId: template.id,
|
|
53
|
+
});
|
|
54
|
+
} else {
|
|
55
|
+
props.setStoreState({
|
|
56
|
+
showSetupModal: renderMode === TemplateFormRenderModes.MODAL,
|
|
57
|
+
showSetupInline: renderMode === TemplateFormRenderModes.INLINE,
|
|
58
|
+
genericData: {
|
|
59
|
+
...props.genericData,
|
|
60
|
+
templateId: template.id,
|
|
61
|
+
name: template.name,
|
|
62
|
+
},
|
|
63
|
+
});
|
|
64
|
+
}
|
|
65
|
+
|
|
66
|
+
// switch (renderMode) {
|
|
67
|
+
// case TemplateFormRenderModes.MODAL: {
|
|
68
|
+
// props.setStoreState({
|
|
69
|
+
// showSetupModal: true,
|
|
70
|
+
// genericData: {
|
|
71
|
+
// ...props.genericData,
|
|
72
|
+
// brandingApp: null,
|
|
73
|
+
// templateId,
|
|
74
|
+
// },
|
|
75
|
+
// });
|
|
76
|
+
// break;
|
|
77
|
+
// }
|
|
78
|
+
// case TemplateFormRenderModes.INLINE: {
|
|
79
|
+
// props.setStoreState({
|
|
80
|
+
// showSetupInline: true,
|
|
81
|
+
// genericData: {
|
|
82
|
+
// ...props.genericData,
|
|
83
|
+
// brandingApp: null,
|
|
84
|
+
// templateId,
|
|
85
|
+
// },
|
|
86
|
+
// });
|
|
87
|
+
// break;
|
|
88
|
+
// }
|
|
89
|
+
// case TemplateFormRenderModes.DETACHED: {
|
|
90
|
+
// context?.eventEmitter.emit('should-load-flow', {
|
|
91
|
+
// templateId,
|
|
92
|
+
// flowId: templateId,
|
|
93
|
+
// });
|
|
94
|
+
// break;
|
|
95
|
+
// }
|
|
96
|
+
// default:
|
|
97
|
+
// break;
|
|
98
|
+
// }
|
|
99
|
+
};
|
|
100
|
+
|
|
101
|
+
const getContainerName = () => props.genericData.name;
|
|
102
|
+
const getSelectedStep = () => {
|
|
103
|
+
const { stepState, stepMapping } = props;
|
|
104
|
+
const { currentStep, stepIndex, steps } = stepState;
|
|
105
|
+
let selectedStep: {
|
|
106
|
+
step: TemplateStep;
|
|
107
|
+
selectedAuthId: number | null;
|
|
108
|
+
} | null = null;
|
|
109
|
+
let shouldShowLastStep = false;
|
|
110
|
+
let shouldShowBackButton = false;
|
|
111
|
+
let isStepValid = false;
|
|
112
|
+
let showStepValidation = false;
|
|
113
|
+
if (stepIndex > -1 && currentStep?.type !== 'CONFIRMATION') {
|
|
114
|
+
selectedStep = stepMapping[Number(currentStep?.stepId)];
|
|
115
|
+
shouldShowLastStep = false;
|
|
116
|
+
shouldShowBackButton = stepState.stepIndex > 0;
|
|
117
|
+
isStepValid = currentStep?.isValid ?? false;
|
|
118
|
+
showStepValidation = stepState.showValidation;
|
|
119
|
+
} else if (
|
|
120
|
+
currentStep?.type === 'CONFIRMATION' &&
|
|
121
|
+
stepIndex === steps.length
|
|
122
|
+
) {
|
|
123
|
+
shouldShowBackButton = true;
|
|
124
|
+
shouldShowLastStep = true;
|
|
125
|
+
}
|
|
126
|
+
if (
|
|
127
|
+
(props.genericData.isTestIntegration &&
|
|
128
|
+
Number(selectedStep?.step.id) ===
|
|
129
|
+
Number(Object.keys(stepMapping)[0])) ||
|
|
130
|
+
props.genericData.customFlowSetupRender
|
|
131
|
+
) {
|
|
132
|
+
shouldShowBackButton = false;
|
|
133
|
+
}
|
|
134
|
+
return {
|
|
135
|
+
selectedStep,
|
|
136
|
+
isStepValid,
|
|
137
|
+
showStepValidation,
|
|
138
|
+
shouldShowBackButton,
|
|
139
|
+
shouldShowLastStep,
|
|
140
|
+
};
|
|
141
|
+
};
|
|
142
|
+
|
|
143
|
+
const getSelectedStepApp = (step: any) => {
|
|
144
|
+
if (step && step.authorization_type) {
|
|
145
|
+
return {
|
|
146
|
+
id: step.authorization_type.app.id,
|
|
147
|
+
name: step.authorization_type.app.name,
|
|
148
|
+
icon_url: step.authorization_type.app.icon_url,
|
|
149
|
+
authorization_type: step.authorization_type,
|
|
150
|
+
};
|
|
151
|
+
}
|
|
152
|
+
return {};
|
|
153
|
+
};
|
|
154
|
+
|
|
155
|
+
const getStepAuthorizations = (authorizations: any) => {
|
|
156
|
+
const updateAuthorizations: any = [];
|
|
157
|
+
authorizations.forEach((auth: any) => {
|
|
158
|
+
updateAuthorizations.push({
|
|
159
|
+
id: auth.authorizationId,
|
|
160
|
+
user_identity: auth.userIdentity,
|
|
161
|
+
access_token: auth.accessToken,
|
|
162
|
+
});
|
|
163
|
+
});
|
|
164
|
+
return updateAuthorizations;
|
|
165
|
+
};
|
|
166
|
+
|
|
167
|
+
const handleAuthSelected = (
|
|
168
|
+
authId: number,
|
|
169
|
+
stepId: number,
|
|
170
|
+
isVerified: boolean,
|
|
171
|
+
override: boolean,
|
|
172
|
+
) => {
|
|
173
|
+
const { stepState } = props;
|
|
174
|
+
const { currentStep } = stepState;
|
|
175
|
+
const dependentSteps = props.stepMapping[stepId].step.template_fields
|
|
176
|
+
.filter((el) => el.activity_field && el.activity_field.is_dynamic)
|
|
177
|
+
.map((el) => el.id);
|
|
178
|
+
// reset all dynamic steps if auth changes
|
|
179
|
+
|
|
180
|
+
if (props.stepMapping[stepId].selectedAuthId !== authId) {
|
|
181
|
+
props.setStepAuthorization(
|
|
182
|
+
stepId,
|
|
183
|
+
authId,
|
|
184
|
+
isVerified,
|
|
185
|
+
dependentSteps,
|
|
186
|
+
override,
|
|
187
|
+
);
|
|
188
|
+
}
|
|
189
|
+
|
|
190
|
+
const isMainApp =
|
|
191
|
+
props.stepMapping[stepId].step.activity.app.id ===
|
|
192
|
+
(props.genericData.app_id || -1);
|
|
193
|
+
// if (
|
|
194
|
+
// props.skipAuth &&
|
|
195
|
+
// currentStep?.type === 'AUTH' &&
|
|
196
|
+
// isMainApp &&
|
|
197
|
+
// isVerified
|
|
198
|
+
// ) {
|
|
199
|
+
// this.props.gotoNextStep();
|
|
200
|
+
// }
|
|
201
|
+
};
|
|
202
|
+
|
|
203
|
+
const deleteAuth = (authId: number, stepId: number, appId: number) => {
|
|
204
|
+
const deletedAuth = props.stepMapping[stepId].authorizations.filter(
|
|
205
|
+
(auth: any) => auth.authorizationId === authId,
|
|
206
|
+
)[0];
|
|
207
|
+
const authorizationId = Number(deletedAuth.authorizationId);
|
|
208
|
+
|
|
209
|
+
props.toggleDeleteAuthorizationFlag({
|
|
210
|
+
stepId,
|
|
211
|
+
authId: deletedAuth.authorizationId,
|
|
212
|
+
isDeleting: true,
|
|
213
|
+
error: '',
|
|
214
|
+
});
|
|
215
|
+
|
|
216
|
+
context?.eventEmitter.emit('did-begin-remove-authorization', {
|
|
217
|
+
authorizationId: Number(deletedAuth.authorizationId),
|
|
218
|
+
});
|
|
219
|
+
props.removeAuthorization({
|
|
220
|
+
stepId,
|
|
221
|
+
authId: deletedAuth.authorizationId,
|
|
222
|
+
});
|
|
223
|
+
context?.eventEmitter.emit('did-remove-authorization', {
|
|
224
|
+
authorizationId,
|
|
225
|
+
appId,
|
|
226
|
+
});
|
|
227
|
+
};
|
|
228
|
+
|
|
229
|
+
const onAuthResponseReceived = (
|
|
230
|
+
messageEvent: MessageEvent<AuthData>,
|
|
231
|
+
stepId: number,
|
|
232
|
+
) => {
|
|
233
|
+
if (isAuthMessage(messageEvent) && messageEvent.data.activity_name) {
|
|
234
|
+
if (stepId) {
|
|
235
|
+
const authId = Number(messageEvent.data.authorization_id);
|
|
236
|
+
if (!messageEvent.data.already_exists) {
|
|
237
|
+
props.addAuthorization({
|
|
238
|
+
stepId,
|
|
239
|
+
authData: {
|
|
240
|
+
authorizationId: messageEvent.data.authorization_id,
|
|
241
|
+
userIdentity: messageEvent.data.user_identity,
|
|
242
|
+
disableLink: '',
|
|
243
|
+
authType: '',
|
|
244
|
+
isVerified: false,
|
|
245
|
+
didFetchStatus: false,
|
|
246
|
+
isVerifying: false,
|
|
247
|
+
isDeleting: false,
|
|
248
|
+
error: '',
|
|
249
|
+
},
|
|
250
|
+
});
|
|
251
|
+
} else {
|
|
252
|
+
props.setStepAuthId({
|
|
253
|
+
stepId,
|
|
254
|
+
authId,
|
|
255
|
+
});
|
|
256
|
+
}
|
|
257
|
+
// context?.eventEmitter.emit('did-add-authorization', {
|
|
258
|
+
// identity: messageEvent.data.user_identity,
|
|
259
|
+
// authorizationId: Number(messageEvent.data.authorization_id),
|
|
260
|
+
// flowId: props.genericData.templateId,
|
|
261
|
+
// appId: appId || 0,
|
|
262
|
+
// appName: authApp?.name,
|
|
263
|
+
// appIcon: authApp?.icon_url,
|
|
264
|
+
// alreadyExists: messageEvent.data.already_exists,
|
|
265
|
+
// externalId: messageEvent.data.external_id,
|
|
266
|
+
// });
|
|
267
|
+
}
|
|
268
|
+
}
|
|
269
|
+
};
|
|
270
|
+
|
|
271
|
+
useEffect(() => {
|
|
272
|
+
const { renderMode } = props;
|
|
273
|
+
if (defaultFlowId !== 0) {
|
|
274
|
+
if (renderMode === TemplateFormRenderModes.DETACHED) {
|
|
275
|
+
context?.eventEmitter.emit('should-load-flow', {
|
|
276
|
+
templateId: defaultFlowId,
|
|
277
|
+
flowId: defaultFlowId,
|
|
278
|
+
});
|
|
279
|
+
} else if (defautlIntegrationId !== 0) {
|
|
280
|
+
props.setStoreState({
|
|
281
|
+
showSetupModal: renderMode === TemplateFormRenderModes.MODAL,
|
|
282
|
+
showSetupInline: renderMode === TemplateFormRenderModes.INLINE,
|
|
283
|
+
integrationIdToEdit: defautlIntegrationId,
|
|
284
|
+
genericData: {
|
|
285
|
+
...props.genericData,
|
|
286
|
+
templateId: defaultFlowId,
|
|
287
|
+
name: '',
|
|
288
|
+
},
|
|
289
|
+
});
|
|
290
|
+
} else {
|
|
291
|
+
props.setStoreState({
|
|
292
|
+
showSetupModal: renderMode === TemplateFormRenderModes.MODAL,
|
|
293
|
+
showSetupInline: renderMode === TemplateFormRenderModes.INLINE,
|
|
294
|
+
genericData: {
|
|
295
|
+
...props.genericData,
|
|
296
|
+
templateId: defaultFlowId,
|
|
297
|
+
name: '',
|
|
298
|
+
},
|
|
299
|
+
});
|
|
300
|
+
}
|
|
301
|
+
}
|
|
302
|
+
|
|
303
|
+
if (props.renderFlowsMode === TemplateFormRenderModes.MODAL) {
|
|
304
|
+
props.setStoreState({
|
|
305
|
+
showFlowsListModal: true,
|
|
306
|
+
});
|
|
307
|
+
}
|
|
308
|
+
}, []);
|
|
309
|
+
|
|
310
|
+
const {
|
|
311
|
+
renderMode,
|
|
312
|
+
renderFlowsMode,
|
|
313
|
+
layout,
|
|
314
|
+
deploymentId,
|
|
315
|
+
showSetupInline,
|
|
316
|
+
showSetupModal,
|
|
317
|
+
resetTemplateFields,
|
|
318
|
+
genericData,
|
|
319
|
+
} = props;
|
|
320
|
+
const viewStyle = (genericData.viewStyle || 'comfortable').toLowerCase();
|
|
321
|
+
const mainViewStyle = `flows-${viewStyle}-view--${renderFlowsMode}`;
|
|
322
|
+
|
|
323
|
+
return html`
|
|
324
|
+
<div
|
|
325
|
+
id="flows-${(genericData.viewStyle || 'comfortable').toLowerCase()}-view"
|
|
326
|
+
class="${styles['integry-container']} ${props.genericData.viewStyle ===
|
|
327
|
+
ViewStyles.COMPACT
|
|
328
|
+
? styles['compact-view']
|
|
329
|
+
: ''} ${styles[mainViewStyle]}"
|
|
330
|
+
>
|
|
331
|
+
${renderFlowsMode === TemplateFormRenderModes.MODAL
|
|
332
|
+
? !showSetupModal &&
|
|
333
|
+
html`
|
|
334
|
+
<${Modal}
|
|
335
|
+
isOpen=${props.showFlowsListModal}
|
|
336
|
+
isCompact=${genericData.viewStyle === ViewStyles.COMPACT}
|
|
337
|
+
onClose=${() => {
|
|
338
|
+
props.resetTemplateFields();
|
|
339
|
+
if (!props.genericData.isPreviewMode) {
|
|
340
|
+
props.setStoreState({
|
|
341
|
+
showFlowsListModal: false,
|
|
342
|
+
});
|
|
343
|
+
}
|
|
344
|
+
}}
|
|
345
|
+
CustomCloseElement=${() => html` <svg
|
|
346
|
+
style="cursor:pointer; position: absolute; right: 25px; top: 25px;"
|
|
347
|
+
width="14"
|
|
348
|
+
height="14"
|
|
349
|
+
viewBox="0 0 14 14"
|
|
350
|
+
fill="none"
|
|
351
|
+
xmlns="http://www.w3.org/2000/svg"
|
|
352
|
+
>
|
|
353
|
+
<path
|
|
354
|
+
d="M13 1L1 13"
|
|
355
|
+
stroke="#4F4F4F"
|
|
356
|
+
stroke-width="2"
|
|
357
|
+
stroke-linecap="round"
|
|
358
|
+
stroke-linejoin="round"
|
|
359
|
+
/>
|
|
360
|
+
<path
|
|
361
|
+
d="M1 1L13 13"
|
|
362
|
+
stroke="#4F4F4F"
|
|
363
|
+
stroke-width="2"
|
|
364
|
+
stroke-linecap="round"
|
|
365
|
+
stroke-linejoin="round"
|
|
366
|
+
/>
|
|
367
|
+
</svg>`}
|
|
368
|
+
>
|
|
369
|
+
<div class="integry-container__setup-form--modal" style="height: 100%;">
|
|
370
|
+
<div class=${styles.flowName}></div>
|
|
371
|
+
<${templateListComponent.current}
|
|
372
|
+
layout=${layout}
|
|
373
|
+
renderMode=${renderMode}
|
|
374
|
+
renderFlowsMode=${renderFlowsMode}
|
|
375
|
+
deploymentId=${deploymentId}
|
|
376
|
+
apiHandler=${context?.apiHandler}
|
|
377
|
+
eventEmitter=${context?.eventEmitter}
|
|
378
|
+
onTemplateClick=${onTemplateClick}
|
|
379
|
+
>
|
|
380
|
+
</${templateListComponent.current}>
|
|
381
|
+
</div>
|
|
382
|
+
<//>
|
|
383
|
+
`
|
|
384
|
+
: !showSetupInline &&
|
|
385
|
+
html`
|
|
386
|
+
<${templateListComponent.current}
|
|
387
|
+
layout=${layout}
|
|
388
|
+
renderMode=${renderMode}
|
|
389
|
+
renderFlowsMode=${renderFlowsMode}
|
|
390
|
+
deploymentId=${deploymentId}
|
|
391
|
+
apiHandler=${context?.apiHandler}
|
|
392
|
+
eventEmitter=${context?.eventEmitter}
|
|
393
|
+
onTemplateClick=${onTemplateClick}
|
|
394
|
+
>
|
|
395
|
+
</${templateListComponent.current}>
|
|
396
|
+
`}
|
|
397
|
+
${renderMode === TemplateFormRenderModes.INLINE &&
|
|
398
|
+
showSetupInline &&
|
|
399
|
+
html`
|
|
400
|
+
<div
|
|
401
|
+
class="${props.genericData.viewStyle === ViewStyles.COMPACT
|
|
402
|
+
? styles.inlineSetupCompact
|
|
403
|
+
: styles.inlineSetup} ${'integry-container__setup-form--inline'}"
|
|
404
|
+
>
|
|
405
|
+
<div
|
|
406
|
+
class=${props.genericData.testMultipurpose
|
|
407
|
+
? styles.flowNameCompact
|
|
408
|
+
: styles.flowName}
|
|
409
|
+
style="${genericData.viewStyle === ViewStyles.COMPACT
|
|
410
|
+
? 'margin: 0; width: 100%;'
|
|
411
|
+
: ''}"
|
|
412
|
+
>
|
|
413
|
+
${props.genericData.testMultipurpose &&
|
|
414
|
+
html`
|
|
415
|
+
${getSelectedStep().shouldShowBackButton &&
|
|
416
|
+
html`<svg
|
|
417
|
+
style="cursor: pointer;z-index: 1;"
|
|
418
|
+
onclick=${() => {
|
|
419
|
+
if (getSelectedStep().shouldShowBackButton) {
|
|
420
|
+
const currentSelectedStep =
|
|
421
|
+
props.stepState?.steps[props.stepState?.stepIndex - 1];
|
|
422
|
+
if (currentSelectedStep.type === 'AUTH') {
|
|
423
|
+
props.resetTemplateFields();
|
|
424
|
+
} else {
|
|
425
|
+
props.gotoPreviousStep();
|
|
426
|
+
}
|
|
427
|
+
} else {
|
|
428
|
+
props.resetTemplateFields();
|
|
429
|
+
}
|
|
430
|
+
}}
|
|
431
|
+
xmlns="http://www.w3.org/2000/svg"
|
|
432
|
+
width="32"
|
|
433
|
+
height="32"
|
|
434
|
+
viewBox="0 0 32 32"
|
|
435
|
+
fill="none"
|
|
436
|
+
>
|
|
437
|
+
<circle
|
|
438
|
+
cx="16"
|
|
439
|
+
cy="16"
|
|
440
|
+
r="15.5"
|
|
441
|
+
fill="white"
|
|
442
|
+
stroke="#E0E0E0"
|
|
443
|
+
/>
|
|
444
|
+
<path
|
|
445
|
+
d="M15.547 11.0504L15.8825 10.7004L15.8825 10.7004L15.547 11.0504ZM15.5614 11.7359L15.2114 11.4004L15.2114 11.4004L15.5614 11.7359ZM14.8614 11.0649L15.2114 11.4004L15.2114 11.4004L14.8614 11.0649ZM10.013 16.1222L9.66297 15.7867L9.66297 15.7867L10.013 16.1222ZM9.69129 16.4578L9.3413 16.1222L9.01962 16.4578L9.3413 16.7933L9.69129 16.4578ZM10.013 16.7933L9.66297 17.1288L10.013 16.7933ZM14.8614 21.8507L15.2114 21.5151L15.2114 21.5151L14.8614 21.8507ZM15.547 21.8651L15.8825 22.2151L15.8825 22.2151L15.547 21.8651ZM15.5614 21.1796L15.9114 20.8441L15.9114 20.8441L15.5614 21.1796ZM11.0346 16.4578L10.6846 16.1222L10.363 16.4578L10.6846 16.7933L11.0346 16.4578ZM15.2114 11.4004L15.2114 11.4004L15.9114 12.0715C16.282 11.6849 16.2691 11.071 15.8825 10.7004L15.2114 11.4004ZM15.2114 11.4004L15.2114 11.4004L15.8825 10.7004C15.4959 10.3298 14.8821 10.3427 14.5115 10.7293L15.2114 11.4004ZM10.363 16.4578L15.2114 11.4004L14.5115 10.7293L9.66297 15.7867L10.363 16.4578ZM10.0413 16.7933L10.363 16.4578L9.66297 15.7867L9.3413 16.1222L10.0413 16.7933ZM10.363 16.4578L10.0413 16.1222L9.3413 16.7933L9.66297 17.1288L10.363 16.4578ZM15.2114 21.5151L10.363 16.4578L9.66297 17.1288L14.5115 22.1862L15.2114 21.5151ZM15.2114 21.5151L15.2114 21.5151L14.5115 22.1862C14.8821 22.5728 15.4959 22.5858 15.8825 22.2151L15.2114 21.5151ZM15.2114 21.5151L15.2114 21.5151L15.8825 22.2151C16.2691 21.8445 16.282 21.2307 15.9114 20.8441L15.2114 21.5151ZM10.6846 16.7933L15.2114 21.5151L15.9114 20.8441L11.3846 16.1222L10.6846 16.7933ZM15.2114 11.4004L10.6846 16.1222L11.3846 16.7933L15.9114 12.0715L15.2114 11.4004ZM21.5152 16.4581L21.5152 17.4278C22.0507 17.4278 22.4848 16.9937 22.4848 16.4581L21.5152 16.4581ZM21.5152 16.4581L22.4848 16.4581C22.4848 15.9226 22.0507 15.4884 21.5152 15.4884L21.5152 16.4581ZM11.8182 16.4581L21.5152 16.4581L21.5152 15.4884L11.8182 15.4884L11.8182 16.4581ZM11.8182 16.4581L11.8182 16.4581L11.8182 15.4884C11.2826 15.4884 10.8485 15.9226 10.8485 16.4581L11.8182 16.4581ZM11.8182 16.4581L11.8182 16.4581L10.8485 16.4581C10.8485 16.9937 11.2826 17.4278 11.8182 17.4278L11.8182 16.4581ZM21.5152 16.4581L11.8182 16.4581L11.8182 17.4278L21.5152 17.4278L21.5152 16.4581Z"
|
|
446
|
+
fill="#4250F0"
|
|
447
|
+
/>
|
|
448
|
+
</svg>`}
|
|
449
|
+
|
|
450
|
+
<div
|
|
451
|
+
class="${props.genericData.viewStyle === ViewStyles.COMPACT
|
|
452
|
+
? styles.flowNameGroupCompact
|
|
453
|
+
: styles.flowNameGroup}"
|
|
454
|
+
>
|
|
455
|
+
<img
|
|
456
|
+
src=${props.genericData.brandingApp?.icon_url ||
|
|
457
|
+
getSelectedStep().selectedStep?.step.authorization_type.app
|
|
458
|
+
.icon_url ||
|
|
459
|
+
getSelectedStep().selectedStep?.step.activity.app.icon_url}
|
|
460
|
+
/>
|
|
461
|
+
<span> ${getContainerName()} </span>
|
|
462
|
+
</div>
|
|
463
|
+
`}
|
|
464
|
+
${!props.genericData.testMultipurpose &&
|
|
465
|
+
html` <svg
|
|
466
|
+
style="cursor: pointer;"
|
|
467
|
+
onclick=${() => {
|
|
468
|
+
props.resetTemplateFields();
|
|
469
|
+
}}
|
|
470
|
+
width="24"
|
|
471
|
+
height="24"
|
|
472
|
+
viewBox="0 0 33 33"
|
|
473
|
+
fill="none"
|
|
474
|
+
xmlns="http://www.w3.org/2000/svg"
|
|
475
|
+
>
|
|
476
|
+
<circle
|
|
477
|
+
cx="16.6758"
|
|
478
|
+
cy="16.5684"
|
|
479
|
+
r="15.5"
|
|
480
|
+
fill="white"
|
|
481
|
+
stroke="#4250f0"
|
|
482
|
+
/>
|
|
483
|
+
<path
|
|
484
|
+
d="M16.8975 11.3777L16.5547 11.7205L16.5547 11.7205L16.8975 11.3777ZM16.8975 12.0634L16.5547 11.7205L16.5547 11.7205L16.8975 12.0634ZM16.2119 11.3777L16.5547 11.7205L16.2119 11.3777ZM11.3634 16.2262L11.0205 15.8833L11.0205 15.8833L11.3634 16.2262ZM11.0205 16.569L10.6777
|
|
485
|
+
16.2262L10.3349 16.569L10.6777 16.9118L11.0205 16.569ZM11.3634 16.9118L11.0205 17.2547L11.0205 17.2547L11.3634 16.9118ZM16.2119 21.7603L16.5547 21.4175L16.5547 21.4175L16.2119 21.7603ZM16.8975 21.7603L16.5547 21.4175L16.5547 21.4175L16.8975 21.7603ZM16.8975 21.0747L16.5547 21.4175L16.5547 21.4175L16.8975 21.0747ZM12.3919 16.569L12.0491 16.2262L11.7062 16.569L12.0491 16.9118L12.3919 16.569ZM22.8574 17.0545L22.8574 17.5394L22.8574 17.0545ZM22.8574 16.0848L22.8574 16.5697L22.8574
|
|
486
|
+
16.0848ZM13.1605 16.0848L13.1605 15.6L13.1605 16.0848ZM13.1605 17.0545L13.1605 16.5697L13.1605 17.0545ZM16.5547 11.7205L16.5547 11.7205L17.2404 12.4062C17.6191 12.0275 17.6191 11.4135 17.2404 11.0348L16.5547 11.7205ZM16.5547 11.7205L17.2404 11.0348C16.8617 10.6562 16.2477 10.6562 15.869 11.0348L16.5547 11.7205ZM11.7062 16.569L16.5547 11.7205L15.869 11.0348L11.0205 15.8833L11.7062 16.569ZM11.3634 16.9118L11.7062 16.569L11.0205 15.8833L10.6777 16.2262L11.3634 16.9118ZM11.7062 16.569L11.3634 16.2262L10.6777
|
|
487
|
+
16.9118L11.0205 17.2547L11.7062 16.569ZM16.5547 21.4175L11.7062 16.569L11.0205 17.2547L15.869 22.1032L16.5547 21.4175ZM16.5547 21.4175L15.869 22.1032C16.2477 22.4819 16.8617 22.4819 17.2404 22.1032L16.5547 21.4175ZM16.5547 21.4175L16.5547
|
|
488
|
+
21.4175L17.2404 22.1032C17.6191 21.7245 17.6191 21.1105 17.2404 20.7318L16.5547 21.4175ZM12.0491 16.9118L16.5547 21.4175L17.2404 20.7318L12.7347 16.2262L12.0491 16.9118ZM16.5547 11.7205L12.0491 16.2262L12.7347 16.9118L17.2404 12.4062L16.5547 11.7205ZM22.8574 16.5697L22.8574 16.5697L22.8574 17.5394C23.393 17.5394 23.8271 17.1052 23.8271 16.5697L22.8574 16.5697ZM22.8574 16.5697L22.8574 16.5697L23.8271 16.5697C23.8271 16.0341 23.393 15.6 22.8574 15.6L22.8574
|
|
489
|
+
16.5697ZM13.1605 16.5697L22.8574 16.5697L22.8574 15.6L13.1605 15.6L13.1605 16.5697ZM13.1605 16.5697L13.1605 15.6C12.6249 15.6 12.1908 16.0341 12.1908 16.5697L13.1605 16.5697ZM13.1605 16.5697L12.1908 16.5697C12.1908 17.1052 12.6249 17.5394 13.1605 17.5394L13.1605 16.5697ZM22.8574 16.5697L13.1605 16.5697L13.1605 17.5394L22.8574 17.5394L22.8574 16.5697Z"
|
|
490
|
+
fill="#4250f0"
|
|
491
|
+
/>
|
|
492
|
+
</svg>
|
|
493
|
+
${getContainerName()}`}
|
|
494
|
+
</div>
|
|
495
|
+
<div class=${styles.flowAccountWrap}>
|
|
496
|
+
${props.stepState.currentStep?.type === 'CONFIGURATION' &&
|
|
497
|
+
(props.genericData.selfAppId !==
|
|
498
|
+
getSelectedStep().selectedStep?.step.activity.app.id ||
|
|
499
|
+
props.genericData.isPreviewMode) &&
|
|
500
|
+
getSelectedStep().selectedStep?.step.authorization_type.type !==
|
|
501
|
+
'NO_AUTH' &&
|
|
502
|
+
html` <${Authentication}
|
|
503
|
+
authorizations=${getStepAuthorizations(
|
|
504
|
+
props.stepMapping[props.stepState.currentStep.stepId]
|
|
505
|
+
?.authorizations || [],
|
|
506
|
+
)}
|
|
507
|
+
appData=${getSelectedStepApp(
|
|
508
|
+
getSelectedStep().selectedStep?.step,
|
|
509
|
+
)}
|
|
510
|
+
onAuthDelete=${(authId: number, appId: number) => {
|
|
511
|
+
deleteAuth(
|
|
512
|
+
authId,
|
|
513
|
+
Number(getSelectedStep().selectedStep?.step.id),
|
|
514
|
+
appId,
|
|
515
|
+
);
|
|
516
|
+
}}
|
|
517
|
+
onAuthenticationRecieved=${(
|
|
518
|
+
messageEvent: MessageEvent<AuthData>,
|
|
519
|
+
) => {
|
|
520
|
+
onAuthResponseReceived(
|
|
521
|
+
messageEvent,
|
|
522
|
+
Number(getSelectedStep().selectedStep?.step.id),
|
|
523
|
+
);
|
|
524
|
+
handleAuthSelected(
|
|
525
|
+
messageEvent.data.authorization_id,
|
|
526
|
+
Number(getSelectedStep().selectedStep?.step.id),
|
|
527
|
+
true,
|
|
528
|
+
false,
|
|
529
|
+
);
|
|
530
|
+
}}
|
|
531
|
+
onAuthVerify=${(authId: number, status: boolean) => {
|
|
532
|
+
handleAuthSelected(
|
|
533
|
+
authId,
|
|
534
|
+
Number(getSelectedStep().selectedStep?.step.id),
|
|
535
|
+
status,
|
|
536
|
+
false,
|
|
537
|
+
);
|
|
538
|
+
}}
|
|
539
|
+
hideAuthActions=${true}
|
|
540
|
+
stepId=${Number(getSelectedStep().selectedStep?.step.id)}
|
|
541
|
+
onAuthSelected=${(authId: number, status: boolean) => {
|
|
542
|
+
handleAuthSelected(
|
|
543
|
+
authId,
|
|
544
|
+
Number(getSelectedStep().selectedStep?.step.id),
|
|
545
|
+
status,
|
|
546
|
+
false,
|
|
547
|
+
);
|
|
548
|
+
}}
|
|
549
|
+
/>`}
|
|
550
|
+
</div>
|
|
551
|
+
<${FlowSetupContainer}
|
|
552
|
+
deploymentId=${props.deploymentId || props.genericData.deploymentId}
|
|
553
|
+
flowId=${props.genericData.templateId}
|
|
554
|
+
hideStepCount=${props.genericData.testMultipurpose}
|
|
555
|
+
hideStepNavigation=${props.genericData.testMultipurpose}
|
|
556
|
+
setupContainerStyle="${genericData.viewStyle === ViewStyles.COMPACT
|
|
557
|
+
? ''
|
|
558
|
+
: ''}"
|
|
559
|
+
stepContainerStyle="${genericData.viewStyle === ViewStyles.COMPACT
|
|
560
|
+
? 'padding: 0;'
|
|
561
|
+
: ''}"
|
|
562
|
+
params=${flowParams}
|
|
563
|
+
/>
|
|
564
|
+
<div
|
|
565
|
+
class=${styles.close}
|
|
566
|
+
onclick=${() => {
|
|
567
|
+
resetTemplateFields();
|
|
568
|
+
}}
|
|
569
|
+
>
|
|
570
|
+
<svg
|
|
571
|
+
width="20"
|
|
572
|
+
height="22"
|
|
573
|
+
viewBox="0 0 20 22"
|
|
574
|
+
fill="none"
|
|
575
|
+
xmlns="http://www.w3.org/2000/svg"
|
|
576
|
+
>
|
|
577
|
+
<path
|
|
578
|
+
d="M14.2426 16.1822L5.75732 6.86328"
|
|
579
|
+
stroke="#999999"
|
|
580
|
+
stroke-width="2"
|
|
581
|
+
stroke-linecap="round"
|
|
582
|
+
/>
|
|
583
|
+
<path
|
|
584
|
+
d="M14.2426 6.86328L5.75732 16.1822"
|
|
585
|
+
stroke="#999999"
|
|
586
|
+
stroke-width="2"
|
|
587
|
+
stroke-linecap="round"
|
|
588
|
+
/>
|
|
589
|
+
</svg>
|
|
590
|
+
</div>
|
|
591
|
+
</div>
|
|
592
|
+
`}
|
|
593
|
+
</div>
|
|
594
|
+
${renderMode === TemplateFormRenderModes.MODAL &&
|
|
595
|
+
html`
|
|
596
|
+
<${Modal}
|
|
597
|
+
isOpen=${props.showSetupModal}
|
|
598
|
+
onClose=${() => {
|
|
599
|
+
props.resetTemplateFields();
|
|
600
|
+
if (!props.genericData.isPreviewMode) {
|
|
601
|
+
props.setStoreState({
|
|
602
|
+
showFlowsListModal: false,
|
|
603
|
+
});
|
|
604
|
+
}
|
|
605
|
+
}}
|
|
606
|
+
isCompact=${genericData.viewStyle === ViewStyles.COMPACT}
|
|
607
|
+
CustomCloseElement=${() => html` <svg
|
|
608
|
+
style="cursor:pointer; position: absolute; right: 25px; top: 25px;"
|
|
609
|
+
width="14"
|
|
610
|
+
height="14"
|
|
611
|
+
viewBox="0 0 14 14"
|
|
612
|
+
fill="none"
|
|
613
|
+
xmlns="http://www.w3.org/2000/svg"
|
|
614
|
+
>
|
|
615
|
+
<path
|
|
616
|
+
d="M13 1L1 13"
|
|
617
|
+
stroke="#4F4F4F"
|
|
618
|
+
stroke-width="2"
|
|
619
|
+
stroke-linecap="round"
|
|
620
|
+
stroke-linejoin="round"
|
|
621
|
+
/>
|
|
622
|
+
<path
|
|
623
|
+
d="M1 1L13 13"
|
|
624
|
+
stroke="#4F4F4F"
|
|
625
|
+
stroke-width="2"
|
|
626
|
+
stroke-linecap="round"
|
|
627
|
+
stroke-linejoin="round"
|
|
628
|
+
/>
|
|
629
|
+
</svg>`}
|
|
630
|
+
>
|
|
631
|
+
<div class="integry-container__setup-form--modal" style="height: calc(100% - 85px);">
|
|
632
|
+
<div class=${
|
|
633
|
+
props.genericData.testMultipurpose
|
|
634
|
+
? styles.flowNameCompact
|
|
635
|
+
: styles.flowName
|
|
636
|
+
} style="${
|
|
637
|
+
props.genericData.viewStyle === ViewStyles.COMPACT
|
|
638
|
+
? 'padding-top: 16px; width: calc(100% - 60px);'
|
|
639
|
+
: props.genericData.testMultipurpose
|
|
640
|
+
? 'padding-top: 16px;'
|
|
641
|
+
: ''
|
|
642
|
+
}">
|
|
643
|
+
${
|
|
644
|
+
props.genericData.testMultipurpose &&
|
|
645
|
+
html`
|
|
646
|
+
${getSelectedStep().shouldShowBackButton &&
|
|
647
|
+
html`
|
|
648
|
+
<svg
|
|
649
|
+
style="cursor: pointer; z-index: 1;"
|
|
650
|
+
onclick=${() => {
|
|
651
|
+
if (getSelectedStep().shouldShowBackButton) {
|
|
652
|
+
const currentSelectedStep =
|
|
653
|
+
props.stepState?.steps[props.stepState?.stepIndex - 1];
|
|
654
|
+
if (currentSelectedStep.type === 'AUTH') {
|
|
655
|
+
props.resetTemplateFields();
|
|
656
|
+
} else {
|
|
657
|
+
props.gotoPreviousStep();
|
|
658
|
+
}
|
|
659
|
+
} else {
|
|
660
|
+
props.resetTemplateFields();
|
|
661
|
+
}
|
|
662
|
+
}}
|
|
663
|
+
xmlns="http://www.w3.org/2000/svg"
|
|
664
|
+
width="32"
|
|
665
|
+
height="32"
|
|
666
|
+
viewBox="0 0 32 32"
|
|
667
|
+
fill="none"
|
|
668
|
+
>
|
|
669
|
+
<circle
|
|
670
|
+
cx="16"
|
|
671
|
+
cy="16"
|
|
672
|
+
r="15.5"
|
|
673
|
+
fill="white"
|
|
674
|
+
stroke="#E0E0E0"
|
|
675
|
+
/>
|
|
676
|
+
<path
|
|
677
|
+
d="M15.547 11.0504L15.8825 10.7004L15.8825 10.7004L15.547 11.0504ZM15.5614 11.7359L15.2114 11.4004L15.2114 11.4004L15.5614 11.7359ZM14.8614 11.0649L15.2114 11.4004L15.2114 11.4004L14.8614 11.0649ZM10.013 16.1222L9.66297 15.7867L9.66297 15.7867L10.013 16.1222ZM9.69129 16.4578L9.3413 16.1222L9.01962 16.4578L9.3413 16.7933L9.69129 16.4578ZM10.013 16.7933L9.66297 17.1288L10.013 16.7933ZM14.8614 21.8507L15.2114 21.5151L15.2114 21.5151L14.8614 21.8507ZM15.547 21.8651L15.8825 22.2151L15.8825 22.2151L15.547 21.8651ZM15.5614 21.1796L15.9114 20.8441L15.9114 20.8441L15.5614 21.1796ZM11.0346 16.4578L10.6846 16.1222L10.363 16.4578L10.6846 16.7933L11.0346 16.4578ZM15.2114 11.4004L15.2114 11.4004L15.9114 12.0715C16.282 11.6849 16.2691 11.071 15.8825 10.7004L15.2114 11.4004ZM15.2114 11.4004L15.2114 11.4004L15.8825 10.7004C15.4959 10.3298 14.8821 10.3427 14.5115 10.7293L15.2114 11.4004ZM10.363 16.4578L15.2114 11.4004L14.5115 10.7293L9.66297 15.7867L10.363 16.4578ZM10.0413 16.7933L10.363 16.4578L9.66297 15.7867L9.3413 16.1222L10.0413 16.7933ZM10.363 16.4578L10.0413 16.1222L9.3413 16.7933L9.66297 17.1288L10.363 16.4578ZM15.2114 21.5151L10.363 16.4578L9.66297 17.1288L14.5115 22.1862L15.2114 21.5151ZM15.2114 21.5151L15.2114 21.5151L14.5115 22.1862C14.8821 22.5728 15.4959 22.5858 15.8825 22.2151L15.2114 21.5151ZM15.2114 21.5151L15.2114 21.5151L15.8825 22.2151C16.2691 21.8445 16.282 21.2307 15.9114 20.8441L15.2114 21.5151ZM10.6846 16.7933L15.2114 21.5151L15.9114 20.8441L11.3846 16.1222L10.6846 16.7933ZM15.2114 11.4004L10.6846 16.1222L11.3846 16.7933L15.9114 12.0715L15.2114 11.4004ZM21.5152 16.4581L21.5152 17.4278C22.0507 17.4278 22.4848 16.9937 22.4848 16.4581L21.5152 16.4581ZM21.5152 16.4581L22.4848 16.4581C22.4848 15.9226 22.0507 15.4884 21.5152 15.4884L21.5152 16.4581ZM11.8182 16.4581L21.5152 16.4581L21.5152 15.4884L11.8182 15.4884L11.8182 16.4581ZM11.8182 16.4581L11.8182 16.4581L11.8182 15.4884C11.2826 15.4884 10.8485 15.9226 10.8485 16.4581L11.8182 16.4581ZM11.8182 16.4581L11.8182 16.4581L10.8485 16.4581C10.8485 16.9937 11.2826 17.4278 11.8182 17.4278L11.8182 16.4581ZM21.5152 16.4581L11.8182 16.4581L11.8182 17.4278L21.5152 17.4278L21.5152 16.4581Z"
|
|
678
|
+
fill="#4250F0"
|
|
679
|
+
/>
|
|
680
|
+
</svg>
|
|
681
|
+
`}
|
|
682
|
+
<div
|
|
683
|
+
class="${props.genericData.viewStyle === ViewStyles.COMPACT
|
|
684
|
+
? styles.flowNameGroupCompact
|
|
685
|
+
: styles.flowNameGroup}"
|
|
686
|
+
>
|
|
687
|
+
<img
|
|
688
|
+
src=${props.genericData.brandingApp?.icon_url ||
|
|
689
|
+
getSelectedStep().selectedStep?.step.authorization_type.app
|
|
690
|
+
.icon_url ||
|
|
691
|
+
getSelectedStep().selectedStep?.step.activity.app.icon_url}
|
|
692
|
+
/>
|
|
693
|
+
<span>${getContainerName()}</span>
|
|
694
|
+
</div>
|
|
695
|
+
`
|
|
696
|
+
}
|
|
697
|
+
${
|
|
698
|
+
!props.genericData.testMultipurpose &&
|
|
699
|
+
html` <svg
|
|
700
|
+
style="cursor: pointer;"
|
|
701
|
+
onclick=${() => {
|
|
702
|
+
props.resetTemplateFields();
|
|
703
|
+
}}
|
|
704
|
+
width="24"
|
|
705
|
+
height="24"
|
|
706
|
+
viewBox="0 0 33 33"
|
|
707
|
+
fill="none"
|
|
708
|
+
xmlns="http://www.w3.org/2000/svg"
|
|
709
|
+
>
|
|
710
|
+
<circle
|
|
711
|
+
cx="16.6758"
|
|
712
|
+
cy="16.5684"
|
|
713
|
+
r="15.5"
|
|
714
|
+
fill="white"
|
|
715
|
+
stroke="#4250f0"
|
|
716
|
+
/>
|
|
717
|
+
<path
|
|
718
|
+
d="M16.8975 11.3777L16.5547 11.7205L16.5547 11.7205L16.8975 11.3777ZM16.8975 12.0634L16.5547 11.7205L16.5547 11.7205L16.8975 12.0634ZM16.2119 11.3777L16.5547 11.7205L16.2119 11.3777ZM11.3634 16.2262L11.0205 15.8833L11.0205 15.8833L11.3634 16.2262ZM11.0205 16.569L10.6777
|
|
719
|
+
16.2262L10.3349 16.569L10.6777 16.9118L11.0205 16.569ZM11.3634 16.9118L11.0205 17.2547L11.0205 17.2547L11.3634 16.9118ZM16.2119 21.7603L16.5547 21.4175L16.5547 21.4175L16.2119 21.7603ZM16.8975 21.7603L16.5547 21.4175L16.5547 21.4175L16.8975 21.7603ZM16.8975 21.0747L16.5547 21.4175L16.5547 21.4175L16.8975 21.0747ZM12.3919 16.569L12.0491 16.2262L11.7062 16.569L12.0491 16.9118L12.3919 16.569ZM22.8574 17.0545L22.8574 17.5394L22.8574 17.0545ZM22.8574 16.0848L22.8574 16.5697L22.8574
|
|
720
|
+
16.0848ZM13.1605 16.0848L13.1605 15.6L13.1605 16.0848ZM13.1605 17.0545L13.1605 16.5697L13.1605 17.0545ZM16.5547 11.7205L16.5547 11.7205L17.2404 12.4062C17.6191 12.0275 17.6191 11.4135 17.2404 11.0348L16.5547 11.7205ZM16.5547 11.7205L17.2404 11.0348C16.8617 10.6562 16.2477 10.6562 15.869 11.0348L16.5547 11.7205ZM11.7062 16.569L16.5547 11.7205L15.869 11.0348L11.0205 15.8833L11.7062 16.569ZM11.3634 16.9118L11.7062 16.569L11.0205 15.8833L10.6777 16.2262L11.3634 16.9118ZM11.7062 16.569L11.3634 16.2262L10.6777
|
|
721
|
+
16.9118L11.0205 17.2547L11.7062 16.569ZM16.5547 21.4175L11.7062 16.569L11.0205 17.2547L15.869 22.1032L16.5547 21.4175ZM16.5547 21.4175L15.869 22.1032C16.2477 22.4819 16.8617 22.4819 17.2404 22.1032L16.5547 21.4175ZM16.5547 21.4175L16.5547
|
|
722
|
+
21.4175L17.2404 22.1032C17.6191 21.7245 17.6191 21.1105 17.2404 20.7318L16.5547 21.4175ZM12.0491 16.9118L16.5547 21.4175L17.2404 20.7318L12.7347 16.2262L12.0491 16.9118ZM16.5547 11.7205L12.0491 16.2262L12.7347 16.9118L17.2404 12.4062L16.5547 11.7205ZM22.8574 16.5697L22.8574 16.5697L22.8574 17.5394C23.393 17.5394 23.8271 17.1052 23.8271 16.5697L22.8574 16.5697ZM22.8574 16.5697L22.8574 16.5697L23.8271 16.5697C23.8271 16.0341 23.393 15.6 22.8574 15.6L22.8574
|
|
723
|
+
16.5697ZM13.1605 16.5697L22.8574 16.5697L22.8574 15.6L13.1605 15.6L13.1605 16.5697ZM13.1605 16.5697L13.1605 15.6C12.6249 15.6 12.1908 16.0341 12.1908 16.5697L13.1605 16.5697ZM13.1605 16.5697L12.1908 16.5697C12.1908 17.1052 12.6249 17.5394 13.1605 17.5394L13.1605 16.5697ZM22.8574 16.5697L13.1605 16.5697L13.1605 17.5394L22.8574 17.5394L22.8574 16.5697Z"
|
|
724
|
+
fill="#4250f0"
|
|
725
|
+
/>
|
|
726
|
+
</svg>
|
|
727
|
+
${getContainerName()}`
|
|
728
|
+
}
|
|
729
|
+
</div>
|
|
730
|
+
<div class=${styles.flowAccountWrap}>
|
|
731
|
+
${
|
|
732
|
+
props.stepState.currentStep?.type === 'CONFIGURATION' &&
|
|
733
|
+
(props.genericData.selfAppId !==
|
|
734
|
+
getSelectedStep().selectedStep?.step.activity.app.id ||
|
|
735
|
+
props.genericData.isPreviewMode) &&
|
|
736
|
+
getSelectedStep().selectedStep?.step.authorization_type.type !==
|
|
737
|
+
'NO_AUTH' &&
|
|
738
|
+
html` <${Authentication}
|
|
739
|
+
authorizations=${getStepAuthorizations(
|
|
740
|
+
props.stepMapping[props.stepState.currentStep.stepId]
|
|
741
|
+
?.authorizations || [],
|
|
742
|
+
)}
|
|
743
|
+
appData=${getSelectedStepApp(
|
|
744
|
+
getSelectedStep().selectedStep?.step,
|
|
745
|
+
)}
|
|
746
|
+
onAuthDelete=${(authId: number, appId: number) => {
|
|
747
|
+
deleteAuth(
|
|
748
|
+
authId,
|
|
749
|
+
Number(getSelectedStep().selectedStep?.step.id),
|
|
750
|
+
appId,
|
|
751
|
+
);
|
|
752
|
+
}}
|
|
753
|
+
onAuthenticationRecieved=${(
|
|
754
|
+
messageEvent: MessageEvent<AuthData>,
|
|
755
|
+
) => {
|
|
756
|
+
onAuthResponseReceived(
|
|
757
|
+
messageEvent,
|
|
758
|
+
Number(getSelectedStep().selectedStep?.step.id),
|
|
759
|
+
);
|
|
760
|
+
handleAuthSelected(
|
|
761
|
+
messageEvent.data.authorization_id,
|
|
762
|
+
Number(getSelectedStep().selectedStep?.step.id),
|
|
763
|
+
true,
|
|
764
|
+
false,
|
|
765
|
+
);
|
|
766
|
+
}}
|
|
767
|
+
onAuthVerify=${(authId: number, status: boolean) => {
|
|
768
|
+
handleAuthSelected(
|
|
769
|
+
authId,
|
|
770
|
+
Number(getSelectedStep().selectedStep?.step.id),
|
|
771
|
+
status,
|
|
772
|
+
false,
|
|
773
|
+
);
|
|
774
|
+
}}
|
|
775
|
+
hideAuthActions=${true}
|
|
776
|
+
stepId=${Number(getSelectedStep().selectedStep?.step.id)}
|
|
777
|
+
onAuthSelected=${(authId: number, status: boolean) => {
|
|
778
|
+
handleAuthSelected(
|
|
779
|
+
authId,
|
|
780
|
+
Number(getSelectedStep().selectedStep?.step.id),
|
|
781
|
+
status,
|
|
782
|
+
false,
|
|
783
|
+
);
|
|
784
|
+
}}
|
|
785
|
+
/>`
|
|
786
|
+
}
|
|
787
|
+
</div>
|
|
788
|
+
<${FlowSetupContainer}
|
|
789
|
+
deploymentId=${props.deploymentId || props.genericData.deploymentId}
|
|
790
|
+
flowId=${props.genericData.templateId}
|
|
791
|
+
isInModal=${true}
|
|
792
|
+
hideStepCount=${props.genericData.testMultipurpose}
|
|
793
|
+
hideStepNavigation=${props.genericData.testMultipurpose}
|
|
794
|
+
params=${flowParams}
|
|
795
|
+
><//>
|
|
796
|
+
<//>
|
|
797
|
+
</div>
|
|
798
|
+
`}
|
|
799
|
+
`;
|
|
800
|
+
};
|
|
801
|
+
|
|
802
|
+
export default connect<ContainerProps, unknown, StoreType, unknown>(
|
|
803
|
+
[
|
|
804
|
+
'userConfig',
|
|
805
|
+
'integrations',
|
|
806
|
+
'templates',
|
|
807
|
+
'showSetupModal',
|
|
808
|
+
'genericData',
|
|
809
|
+
'showSetupInline',
|
|
810
|
+
'integrationIdToEdit',
|
|
811
|
+
'showFlowsListModal',
|
|
812
|
+
'stepMapping',
|
|
813
|
+
'stepState',
|
|
814
|
+
'stepDataMapping',
|
|
815
|
+
],
|
|
816
|
+
actionFunctions,
|
|
817
|
+
)(SDKContainer);
|