@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,1081 @@
|
|
|
1
|
+
/* eslint-disable @typescript-eslint/no-explicit-any */
|
|
2
|
+
/* eslint-disable no-use-before-define */
|
|
3
|
+
/* eslint-disable no-nested-ternary */
|
|
4
|
+
import { html } from 'htm/preact';
|
|
5
|
+
import {
|
|
6
|
+
useEffect,
|
|
7
|
+
useContext,
|
|
8
|
+
useState,
|
|
9
|
+
useCallback,
|
|
10
|
+
useRef,
|
|
11
|
+
} from 'preact/hooks';
|
|
12
|
+
import { connect } from 'unistore/preact';
|
|
13
|
+
import { Modal } from '@/components/Modal';
|
|
14
|
+
import Footer from '@/components/Footer';
|
|
15
|
+
import { actionFunctions } from '@/store';
|
|
16
|
+
import FlowSetupContainer from '@/features/containers/FlowSetupContainer';
|
|
17
|
+
import Authentication from '@/features/containers/AppFlowContainer/Authentication';
|
|
18
|
+
import AppContext from '@/contexts/AppContext';
|
|
19
|
+
import { StoreType } from '@/types/store';
|
|
20
|
+
import {
|
|
21
|
+
BrandingApp,
|
|
22
|
+
UserConfig,
|
|
23
|
+
Flow,
|
|
24
|
+
TemplateStep,
|
|
25
|
+
Instance,
|
|
26
|
+
Integration,
|
|
27
|
+
} from '@/interfaces';
|
|
28
|
+
import { AuthData, isAuthMessage } from '@/utils/isAuthMessage';
|
|
29
|
+
import { MarketplaceRenderModes, ViewStyles } from '@/types';
|
|
30
|
+
import AppFlowListing from '../AppFlowListing';
|
|
31
|
+
|
|
32
|
+
import styles from './styles.module.scss';
|
|
33
|
+
import AppPageLoader from './app-page-loader';
|
|
34
|
+
|
|
35
|
+
interface WraperrProps extends StoreType {
|
|
36
|
+
marketplaceId: string;
|
|
37
|
+
userConfig?: UserConfig;
|
|
38
|
+
renderMode?: MarketplaceRenderModes;
|
|
39
|
+
renderFlowSetupMode?: MarketplaceRenderModes;
|
|
40
|
+
onBackClick?: () => void;
|
|
41
|
+
isInModal?: boolean;
|
|
42
|
+
}
|
|
43
|
+
|
|
44
|
+
const RenderAppPage = (props: WraperrProps) => {
|
|
45
|
+
const [appData, setAppData] = useState<BrandingApp | null>(null);
|
|
46
|
+
const [isLoading, setIsloading] = useState<boolean>(false);
|
|
47
|
+
const [isReloadingFlowListing, setIsReloadingFlowListing] = useState<boolean>(
|
|
48
|
+
false,
|
|
49
|
+
);
|
|
50
|
+
const [selectedFlow, setSelectedFlow] = useState<{
|
|
51
|
+
flow: Flow;
|
|
52
|
+
instance: Instance | null;
|
|
53
|
+
} | null>(null);
|
|
54
|
+
const [appFlows, setAppFlows] = useState<Flow[] | []>([]);
|
|
55
|
+
const [skipAuth, setSkipAuth] = useState<boolean>(true);
|
|
56
|
+
const [accountVerified, setAccountVerified] = useState<boolean>(false);
|
|
57
|
+
const interval = useRef<null | ReturnType<typeof setTimeout>>(null);
|
|
58
|
+
// const [selectedAuthId, setSelectedAuthId] = useState<number>(0);
|
|
59
|
+
const context = useContext(AppContext);
|
|
60
|
+
const {
|
|
61
|
+
genericData,
|
|
62
|
+
renderMode,
|
|
63
|
+
renderFlowSetupMode,
|
|
64
|
+
isInModal = false,
|
|
65
|
+
} = props;
|
|
66
|
+
const { marketplaceId, app_id, keepBackButtonForFlows = false } = genericData;
|
|
67
|
+
let selectedAuthId = 0;
|
|
68
|
+
|
|
69
|
+
useEffect(() => {
|
|
70
|
+
setIsloading(true);
|
|
71
|
+
if (app_id) {
|
|
72
|
+
// eslint-disable-next-line no-use-before-define
|
|
73
|
+
getAppFlows();
|
|
74
|
+
}
|
|
75
|
+
return () => interval.current && clearInterval(interval.current);
|
|
76
|
+
}, [app_id]);
|
|
77
|
+
|
|
78
|
+
useEffect(() => {
|
|
79
|
+
if (app_id) {
|
|
80
|
+
context?.apiHandler.getAppInfo(app_id).then((data) => {
|
|
81
|
+
if (data) {
|
|
82
|
+
setAppData(data);
|
|
83
|
+
if (data.authorization_type) {
|
|
84
|
+
const { authorizations = [] } = data.authorization_type;
|
|
85
|
+
setSkipAuth(authorizations.length > 0);
|
|
86
|
+
emitDidAppLoadEvent(data);
|
|
87
|
+
}
|
|
88
|
+
} else {
|
|
89
|
+
console.error(`Failed to fetch app details`);
|
|
90
|
+
}
|
|
91
|
+
});
|
|
92
|
+
}
|
|
93
|
+
}, [app_id]);
|
|
94
|
+
|
|
95
|
+
const emitDidAppLoadEvent = useCallback((appInfo: BrandingApp) => {
|
|
96
|
+
if (appInfo && appInfo.authorization_type) {
|
|
97
|
+
const { authorizations = [] } = appInfo.authorization_type;
|
|
98
|
+
const currentAutObj =
|
|
99
|
+
authorizations.length > 0
|
|
100
|
+
? authorizations[authorizations.length - 1]
|
|
101
|
+
: null;
|
|
102
|
+
context?.eventEmitter.emit('did-app-load', {
|
|
103
|
+
appName: appInfo.name,
|
|
104
|
+
appId: appInfo.id,
|
|
105
|
+
appLogoUrl: appInfo.icon_url,
|
|
106
|
+
authorizationId: currentAutObj?.id || null,
|
|
107
|
+
});
|
|
108
|
+
}
|
|
109
|
+
}, []);
|
|
110
|
+
|
|
111
|
+
const pollApiWithExponentialBackoff = (
|
|
112
|
+
remainingTime = 600000, // 10 mins
|
|
113
|
+
currentDelay = 1000,
|
|
114
|
+
) => {
|
|
115
|
+
if (app_id && remainingTime > 0) {
|
|
116
|
+
const { userConfig } = props;
|
|
117
|
+
if (genericData.deploymentId && genericData.showTemplates) {
|
|
118
|
+
context?.apiHandler
|
|
119
|
+
.getAdminAppFlows({
|
|
120
|
+
appId: app_id,
|
|
121
|
+
bundleId: genericData.deploymentId,
|
|
122
|
+
})
|
|
123
|
+
.then((data) => {
|
|
124
|
+
if (data) {
|
|
125
|
+
setAppFlows(data.results);
|
|
126
|
+
interval.current = setTimeout(() => {
|
|
127
|
+
pollApiWithExponentialBackoff(
|
|
128
|
+
remainingTime - currentDelay,
|
|
129
|
+
currentDelay * 1.5,
|
|
130
|
+
);
|
|
131
|
+
}, currentDelay);
|
|
132
|
+
} else {
|
|
133
|
+
console.error(`Failed to fetch flows`);
|
|
134
|
+
}
|
|
135
|
+
});
|
|
136
|
+
} else {
|
|
137
|
+
const { tags = [] } = userConfig || {};
|
|
138
|
+
context?.apiHandler
|
|
139
|
+
.getAppFlows(app_id, tags, selectedAuthId)
|
|
140
|
+
.then((data) => {
|
|
141
|
+
if (data) {
|
|
142
|
+
setAppFlows(data.results);
|
|
143
|
+
interval.current = setTimeout(() => {
|
|
144
|
+
pollApiWithExponentialBackoff(
|
|
145
|
+
remainingTime - currentDelay,
|
|
146
|
+
currentDelay * 1.5,
|
|
147
|
+
);
|
|
148
|
+
}, currentDelay);
|
|
149
|
+
} else {
|
|
150
|
+
console.error(`Failed to fetch flows`);
|
|
151
|
+
}
|
|
152
|
+
});
|
|
153
|
+
}
|
|
154
|
+
}
|
|
155
|
+
};
|
|
156
|
+
|
|
157
|
+
const pollFlowStatus = (flows: Flow[]) => {
|
|
158
|
+
const shouldPoll = flows.some(
|
|
159
|
+
(flow) =>
|
|
160
|
+
flow.instances.length > 0 &&
|
|
161
|
+
flow.instances.some((instance) => instance.status === 'ACTIVE'),
|
|
162
|
+
);
|
|
163
|
+
if (shouldPoll) {
|
|
164
|
+
pollApiWithExponentialBackoff();
|
|
165
|
+
} else if (interval.current) {
|
|
166
|
+
clearInterval(interval.current);
|
|
167
|
+
}
|
|
168
|
+
};
|
|
169
|
+
|
|
170
|
+
const updateInstanceName = (
|
|
171
|
+
flowId: number,
|
|
172
|
+
instanceId: number,
|
|
173
|
+
name: string,
|
|
174
|
+
) => {
|
|
175
|
+
const updatedInstances = appFlows.map((flow) => {
|
|
176
|
+
if (flow.id === flowId) {
|
|
177
|
+
const updatedFlow = {
|
|
178
|
+
...flow,
|
|
179
|
+
instances: flow.instances.map((instance) => {
|
|
180
|
+
const updatedInstance = { ...instance };
|
|
181
|
+
if (instance.id === instanceId) {
|
|
182
|
+
updatedInstance.name = name;
|
|
183
|
+
}
|
|
184
|
+
return updatedInstance;
|
|
185
|
+
}),
|
|
186
|
+
};
|
|
187
|
+
return updatedFlow;
|
|
188
|
+
}
|
|
189
|
+
return flow;
|
|
190
|
+
});
|
|
191
|
+
setAppFlows(updatedInstances);
|
|
192
|
+
};
|
|
193
|
+
|
|
194
|
+
const handleDeleteInstance = (integration: Integration) => {
|
|
195
|
+
const {
|
|
196
|
+
id: integrationId,
|
|
197
|
+
name: integrationName,
|
|
198
|
+
template_detail,
|
|
199
|
+
} = integration;
|
|
200
|
+
props.setIntegrationLoadingState({
|
|
201
|
+
integrationId,
|
|
202
|
+
isLoading: true,
|
|
203
|
+
op: 'edit',
|
|
204
|
+
});
|
|
205
|
+
context?.apiHandler
|
|
206
|
+
.deleteIntegration(integrationId)
|
|
207
|
+
.then((res) => {
|
|
208
|
+
console.info(res);
|
|
209
|
+
props.setIntegrationLoadingState({
|
|
210
|
+
integrationId,
|
|
211
|
+
isLoading: false,
|
|
212
|
+
op: 'delete',
|
|
213
|
+
});
|
|
214
|
+
getAppFlows();
|
|
215
|
+
|
|
216
|
+
context?.eventEmitter.emit('did-delete-integration', {
|
|
217
|
+
flowId: template_detail.id,
|
|
218
|
+
flowName: template_detail.name,
|
|
219
|
+
flowDescription: template_detail.description,
|
|
220
|
+
integrationId,
|
|
221
|
+
integrationName,
|
|
222
|
+
});
|
|
223
|
+
})
|
|
224
|
+
.catch((err) => console.error(err));
|
|
225
|
+
};
|
|
226
|
+
|
|
227
|
+
const getAppFlows = (authId: any = null) => {
|
|
228
|
+
if (authId && selectedAuthId !== authId) {
|
|
229
|
+
setIsReloadingFlowListing(true);
|
|
230
|
+
selectedAuthId = authId;
|
|
231
|
+
}
|
|
232
|
+
if (interval.current) clearInterval(interval.current);
|
|
233
|
+
if (app_id) {
|
|
234
|
+
const { userConfig } = props;
|
|
235
|
+
if (genericData.deploymentId && genericData.showTemplates) {
|
|
236
|
+
context?.apiHandler
|
|
237
|
+
.getAdminAppFlows({
|
|
238
|
+
appId: app_id,
|
|
239
|
+
bundleId: genericData.deploymentId,
|
|
240
|
+
})
|
|
241
|
+
.then((data) => {
|
|
242
|
+
if (data) {
|
|
243
|
+
setAppFlows(data.results);
|
|
244
|
+
pollFlowStatus(data.results);
|
|
245
|
+
setIsloading(false);
|
|
246
|
+
setIsReloadingFlowListing(false);
|
|
247
|
+
context?.eventEmitter.emit('did-load-flows', {
|
|
248
|
+
flows: data.results,
|
|
249
|
+
});
|
|
250
|
+
} else {
|
|
251
|
+
console.error(`Failed to fetch flows`);
|
|
252
|
+
}
|
|
253
|
+
});
|
|
254
|
+
} else {
|
|
255
|
+
const { tags = [] } = userConfig || {};
|
|
256
|
+
context?.apiHandler.getAppFlows(app_id, tags, authId).then((data) => {
|
|
257
|
+
if (data) {
|
|
258
|
+
setAppFlows(data.results);
|
|
259
|
+
pollFlowStatus(data.results);
|
|
260
|
+
setIsloading(false);
|
|
261
|
+
setIsReloadingFlowListing(false);
|
|
262
|
+
context?.eventEmitter.emit('did-load-flows', {
|
|
263
|
+
flows: data.results,
|
|
264
|
+
});
|
|
265
|
+
} else {
|
|
266
|
+
console.error(`Failed to fetch flows`);
|
|
267
|
+
}
|
|
268
|
+
});
|
|
269
|
+
}
|
|
270
|
+
}
|
|
271
|
+
};
|
|
272
|
+
|
|
273
|
+
const emitAddAuthEvent = useCallback(
|
|
274
|
+
(messageEvent: MessageEvent<AuthData>) => {
|
|
275
|
+
if (isAuthMessage(messageEvent) && messageEvent.data.activity_name) {
|
|
276
|
+
const eventPayload = {
|
|
277
|
+
identity: messageEvent.data.user_identity,
|
|
278
|
+
authorizationId: Number(messageEvent.data.authorization_id),
|
|
279
|
+
flowId: null,
|
|
280
|
+
appId: messageEvent.data.app_id,
|
|
281
|
+
appName: appData?.name || '',
|
|
282
|
+
appIcon: appData?.icon_url || '',
|
|
283
|
+
alreadyExists: messageEvent.data.already_exists,
|
|
284
|
+
externalId: messageEvent.data.external_id,
|
|
285
|
+
};
|
|
286
|
+
context?.eventEmitter.emit('did-add-authorization', eventPayload);
|
|
287
|
+
}
|
|
288
|
+
},
|
|
289
|
+
[],
|
|
290
|
+
);
|
|
291
|
+
|
|
292
|
+
const emitDeleteAuthEvent = (authId: number, appId: number) => {
|
|
293
|
+
context?.eventEmitter.emit('did-remove-authorization', {
|
|
294
|
+
authorizationId: Number(authId),
|
|
295
|
+
appId,
|
|
296
|
+
});
|
|
297
|
+
};
|
|
298
|
+
|
|
299
|
+
const onFlowSelect = (flow: Flow, instance?: Instance) => {
|
|
300
|
+
setSelectedFlow({ flow, instance: instance || null });
|
|
301
|
+
if (!instance) {
|
|
302
|
+
props.setStoreState({
|
|
303
|
+
integrationIdToEdit: null,
|
|
304
|
+
showSetupModal: true,
|
|
305
|
+
});
|
|
306
|
+
props.setGenericData({
|
|
307
|
+
name: flow.name,
|
|
308
|
+
});
|
|
309
|
+
} else {
|
|
310
|
+
props.setStoreState({
|
|
311
|
+
integrationIdToEdit: instance.id,
|
|
312
|
+
showSetupModal: true,
|
|
313
|
+
});
|
|
314
|
+
props.setGenericData({
|
|
315
|
+
name: instance.name,
|
|
316
|
+
});
|
|
317
|
+
}
|
|
318
|
+
if (interval.current) {
|
|
319
|
+
clearInterval(interval.current);
|
|
320
|
+
}
|
|
321
|
+
};
|
|
322
|
+
|
|
323
|
+
const getSelectedStep = () => {
|
|
324
|
+
const { stepState, stepMapping } = props;
|
|
325
|
+
const { currentStep, stepIndex, steps } = stepState;
|
|
326
|
+
let selectedStep: {
|
|
327
|
+
step: TemplateStep;
|
|
328
|
+
selectedAuthId: number | null;
|
|
329
|
+
} | null = null;
|
|
330
|
+
let shouldShowLastStep = false;
|
|
331
|
+
let shouldShowBackButton = false;
|
|
332
|
+
let isStepValid = false;
|
|
333
|
+
let showStepValidation = false;
|
|
334
|
+
if (stepIndex > -1 && currentStep?.type !== 'CONFIRMATION') {
|
|
335
|
+
selectedStep = stepMapping[Number(currentStep?.stepId)];
|
|
336
|
+
shouldShowLastStep = false;
|
|
337
|
+
shouldShowBackButton = stepState.stepIndex > 0;
|
|
338
|
+
isStepValid = currentStep?.isValid ?? false;
|
|
339
|
+
showStepValidation = stepState.showValidation;
|
|
340
|
+
} else if (
|
|
341
|
+
currentStep?.type === 'CONFIRMATION' &&
|
|
342
|
+
stepIndex === steps.length
|
|
343
|
+
) {
|
|
344
|
+
shouldShowBackButton = true;
|
|
345
|
+
shouldShowLastStep = true;
|
|
346
|
+
}
|
|
347
|
+
return {
|
|
348
|
+
selectedStep,
|
|
349
|
+
isStepValid,
|
|
350
|
+
showStepValidation,
|
|
351
|
+
shouldShowBackButton,
|
|
352
|
+
shouldShowLastStep,
|
|
353
|
+
};
|
|
354
|
+
};
|
|
355
|
+
|
|
356
|
+
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
357
|
+
const getSelectedStepApp = (step: any): any => {
|
|
358
|
+
if (step && step.authorization_type) {
|
|
359
|
+
return {
|
|
360
|
+
id: step.authorization_type.app.id,
|
|
361
|
+
name: step.authorization_type.app.name,
|
|
362
|
+
icon_url: step.authorization_type.app.icon_url,
|
|
363
|
+
authorization_type: step.authorization_type,
|
|
364
|
+
};
|
|
365
|
+
}
|
|
366
|
+
return null;
|
|
367
|
+
};
|
|
368
|
+
|
|
369
|
+
const getStepAuthorizations = (authorizations: any) => {
|
|
370
|
+
const updateAuthorizations: any = [];
|
|
371
|
+
authorizations.forEach((auth: any) => {
|
|
372
|
+
updateAuthorizations.push({
|
|
373
|
+
id: auth.authorizationId,
|
|
374
|
+
user_identity: auth.userIdentity,
|
|
375
|
+
});
|
|
376
|
+
});
|
|
377
|
+
return updateAuthorizations;
|
|
378
|
+
};
|
|
379
|
+
|
|
380
|
+
const handleAuthSelected = (
|
|
381
|
+
authId: number,
|
|
382
|
+
stepId: number,
|
|
383
|
+
isVerified: boolean,
|
|
384
|
+
override: boolean,
|
|
385
|
+
) => {
|
|
386
|
+
const dependentSteps = props.stepMapping[stepId]?.step.template_fields
|
|
387
|
+
.filter((el) => el.activity_field && el.activity_field.is_dynamic)
|
|
388
|
+
.map((el) => el.id);
|
|
389
|
+
// reset all dynamic steps if auth changes
|
|
390
|
+
if (props.stepMapping[stepId]?.selectedAuthId !== authId) {
|
|
391
|
+
props.setStepAuthorization(
|
|
392
|
+
stepId,
|
|
393
|
+
authId,
|
|
394
|
+
isVerified,
|
|
395
|
+
dependentSteps,
|
|
396
|
+
override,
|
|
397
|
+
);
|
|
398
|
+
}
|
|
399
|
+
|
|
400
|
+
if (selectedFlow === null) {
|
|
401
|
+
props.setSelectedAuthByAppId({
|
|
402
|
+
appId: appData?.id || -1,
|
|
403
|
+
authId,
|
|
404
|
+
});
|
|
405
|
+
}
|
|
406
|
+
// selectedAuthId = authId;
|
|
407
|
+
getAppFlows(authId);
|
|
408
|
+
|
|
409
|
+
/* const isMainApp =
|
|
410
|
+
props.stepMapping[stepId]?.step.activity.app.id ===
|
|
411
|
+
(props.genericData.app_id || -1); */
|
|
412
|
+
// if (
|
|
413
|
+
// props.skipAuth &&
|
|
414
|
+
// currentStep?.type === 'AUTH' &&
|
|
415
|
+
// isMainApp &&
|
|
416
|
+
// isVerified
|
|
417
|
+
// ) {
|
|
418
|
+
// this.props.gotoNextStep();
|
|
419
|
+
// }
|
|
420
|
+
};
|
|
421
|
+
|
|
422
|
+
const deleteAuth = (authId: number, stepId: number, appId: number) => {
|
|
423
|
+
const auth = props.stepMapping[stepId].authorizations.filter(
|
|
424
|
+
// eslint-disable-next-line @typescript-eslint/no-shadow
|
|
425
|
+
(auth: any) => auth.authorizationId === authId,
|
|
426
|
+
)[0];
|
|
427
|
+
|
|
428
|
+
props.toggleDeleteAuthorizationFlag({
|
|
429
|
+
stepId,
|
|
430
|
+
authId: auth.authorizationId,
|
|
431
|
+
isDeleting: true,
|
|
432
|
+
error: '',
|
|
433
|
+
});
|
|
434
|
+
|
|
435
|
+
context?.eventEmitter.emit('did-begin-remove-authorization', {
|
|
436
|
+
authorizationId: Number(auth.authorizationId),
|
|
437
|
+
});
|
|
438
|
+
props.removeAuthorization({
|
|
439
|
+
stepId,
|
|
440
|
+
authId: auth.authorizationId,
|
|
441
|
+
});
|
|
442
|
+
context?.eventEmitter.emit('did-remove-authorization', {
|
|
443
|
+
authorizationId: Number(auth.authorizationId),
|
|
444
|
+
appId,
|
|
445
|
+
});
|
|
446
|
+
};
|
|
447
|
+
|
|
448
|
+
const onAuthResponseReceived = (
|
|
449
|
+
messageEvent: MessageEvent<AuthData>,
|
|
450
|
+
stepId: number,
|
|
451
|
+
) => {
|
|
452
|
+
if (isAuthMessage(messageEvent) && messageEvent.data.activity_name) {
|
|
453
|
+
console.info(messageEvent.data);
|
|
454
|
+
if (stepId) {
|
|
455
|
+
if (!messageEvent.data.already_exists) {
|
|
456
|
+
props.addAuthorization({
|
|
457
|
+
stepId,
|
|
458
|
+
authData: {
|
|
459
|
+
authorizationId: messageEvent.data.authorization_id,
|
|
460
|
+
userIdentity: messageEvent.data.user_identity,
|
|
461
|
+
disableLink: '',
|
|
462
|
+
authType: '',
|
|
463
|
+
isVerified: false,
|
|
464
|
+
didFetchStatus: false,
|
|
465
|
+
isVerifying: false,
|
|
466
|
+
isDeleting: false,
|
|
467
|
+
error: '',
|
|
468
|
+
},
|
|
469
|
+
});
|
|
470
|
+
} else {
|
|
471
|
+
props.setStepAuthId({
|
|
472
|
+
stepId,
|
|
473
|
+
authId: Number(messageEvent.data.authorization_id),
|
|
474
|
+
});
|
|
475
|
+
}
|
|
476
|
+
// context?.eventEmitter.emit('did-add-authorization', {
|
|
477
|
+
// identity: messageEvent.data.user_identity,
|
|
478
|
+
// authorizationId: Number(messageEvent.data.authorization_id),
|
|
479
|
+
// flowId: props.genericData.templateId,
|
|
480
|
+
// appId: appId || 0,
|
|
481
|
+
// appName: authApp?.name,
|
|
482
|
+
// appIcon: authApp?.icon_url,
|
|
483
|
+
// alreadyExists: messageEvent.data.already_exists,
|
|
484
|
+
// externalId: messageEvent.data.external_id,
|
|
485
|
+
// });
|
|
486
|
+
}
|
|
487
|
+
}
|
|
488
|
+
};
|
|
489
|
+
|
|
490
|
+
const handleGoBackToAppsCloseModal = () => {
|
|
491
|
+
setSelectedFlow(null);
|
|
492
|
+
getAppFlows();
|
|
493
|
+
props.setStoreState({
|
|
494
|
+
showSetupModal: false,
|
|
495
|
+
});
|
|
496
|
+
};
|
|
497
|
+
|
|
498
|
+
const handleGoBackToApps = () => {
|
|
499
|
+
if (!props.genericData.testMultipurpose) {
|
|
500
|
+
setSelectedFlow(null);
|
|
501
|
+
getAppFlows();
|
|
502
|
+
props.setStoreState({
|
|
503
|
+
showSetupModal: false,
|
|
504
|
+
});
|
|
505
|
+
} else if (getSelectedStep().shouldShowBackButton) {
|
|
506
|
+
const currentSelectedStep =
|
|
507
|
+
props.stepState?.steps[props.stepState?.stepIndex - 1];
|
|
508
|
+
if (currentSelectedStep.type === 'AUTH') {
|
|
509
|
+
setSelectedFlow(null);
|
|
510
|
+
getAppFlows();
|
|
511
|
+
props.setStoreState({
|
|
512
|
+
showSetupModal: false,
|
|
513
|
+
});
|
|
514
|
+
} else {
|
|
515
|
+
props.gotoPreviousStep();
|
|
516
|
+
}
|
|
517
|
+
} else {
|
|
518
|
+
setSelectedFlow(null);
|
|
519
|
+
getAppFlows();
|
|
520
|
+
props.setStoreState({
|
|
521
|
+
showSetupModal: false,
|
|
522
|
+
});
|
|
523
|
+
}
|
|
524
|
+
};
|
|
525
|
+
|
|
526
|
+
return isLoading
|
|
527
|
+
? html`<div
|
|
528
|
+
class="${genericData.viewStyle === ViewStyles.COMPACT
|
|
529
|
+
? styles['compact-view']
|
|
530
|
+
: ''}"
|
|
531
|
+
>
|
|
532
|
+
<${AppPageLoader} renderMode=${renderMode} />
|
|
533
|
+
</div>`
|
|
534
|
+
: html`
|
|
535
|
+
<div
|
|
536
|
+
id="appPageContainer-${genericData.viewStyle}--${renderMode}"
|
|
537
|
+
class="${styles.appPageContainer} ${'integry-container__app-page'} ${props
|
|
538
|
+
.genericData.testMultipurpose
|
|
539
|
+
? styles.appPageContainerCompact
|
|
540
|
+
: ''} ${genericData.viewStyle === ViewStyles.COMPACT
|
|
541
|
+
? styles['compact-view']
|
|
542
|
+
: ''}"
|
|
543
|
+
style="${renderMode === MarketplaceRenderModes.INLINE
|
|
544
|
+
? 'display: flex; flex-direction: column;'
|
|
545
|
+
: ''}
|
|
546
|
+
${genericData.viewStyle === ViewStyles.COMPACT &&
|
|
547
|
+
renderMode === MarketplaceRenderModes.INLINE
|
|
548
|
+
? 'height: calc(100%);'
|
|
549
|
+
: ''}
|
|
550
|
+
"
|
|
551
|
+
>
|
|
552
|
+
<div
|
|
553
|
+
class="${selectedFlow && props.genericData.testMultipurpose
|
|
554
|
+
? styles.headerCompact
|
|
555
|
+
: styles.header} ${'app-page__header'} ${genericData.viewStyle ===
|
|
556
|
+
ViewStyles.COMPACT && isInModal
|
|
557
|
+
? styles.headerCompactInModal
|
|
558
|
+
: ''}"
|
|
559
|
+
>
|
|
560
|
+
${props.genericData.testMultipurpose &&
|
|
561
|
+
html` <div class=${styles.appInfo}>
|
|
562
|
+
${selectedFlow &&
|
|
563
|
+
html`
|
|
564
|
+
<div class="${styles.flowSetupHeaderCompact}">
|
|
565
|
+
<svg
|
|
566
|
+
onclick=${handleGoBackToApps}
|
|
567
|
+
class=${styles.backLink}
|
|
568
|
+
xmlns="http://www.w3.org/2000/svg"
|
|
569
|
+
width="32"
|
|
570
|
+
height="32"
|
|
571
|
+
viewBox="0 0 32 32"
|
|
572
|
+
fill="none"
|
|
573
|
+
>
|
|
574
|
+
<circle
|
|
575
|
+
cx="16"
|
|
576
|
+
cy="16"
|
|
577
|
+
r="15.5"
|
|
578
|
+
fill="white"
|
|
579
|
+
stroke="#E0E0E0"
|
|
580
|
+
/>
|
|
581
|
+
<path
|
|
582
|
+
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"
|
|
583
|
+
fill="#4250F0"
|
|
584
|
+
/>
|
|
585
|
+
</svg>
|
|
586
|
+
<div
|
|
587
|
+
class="${styles.flowNameCompact}"
|
|
588
|
+
style="${genericData.viewStyle !== ViewStyles.COMPACT
|
|
589
|
+
? 'justify-content: flex-start;'
|
|
590
|
+
: ''}"
|
|
591
|
+
>
|
|
592
|
+
<img
|
|
593
|
+
class=${styles.flowNameCompactImg}
|
|
594
|
+
src=${appData?.icon_url}
|
|
595
|
+
alt=${appData?.name}
|
|
596
|
+
/>
|
|
597
|
+
<span>${selectedFlow?.flow.name}</span>
|
|
598
|
+
</div>
|
|
599
|
+
</div>
|
|
600
|
+
`}
|
|
601
|
+
${selectedFlow === null &&
|
|
602
|
+
html`${keepBackButtonForFlows &&
|
|
603
|
+
props.onBackClick &&
|
|
604
|
+
selectedFlow === null &&
|
|
605
|
+
html`
|
|
606
|
+
<svg
|
|
607
|
+
style="cursor: pointer;"
|
|
608
|
+
onclick=${props.onBackClick}
|
|
609
|
+
xmlns="http://www.w3.org/2000/svg"
|
|
610
|
+
width="32"
|
|
611
|
+
height="32"
|
|
612
|
+
viewBox="0 0 32 32"
|
|
613
|
+
fill="none"
|
|
614
|
+
>
|
|
615
|
+
<circle
|
|
616
|
+
cx="16"
|
|
617
|
+
cy="16"
|
|
618
|
+
r="15.5"
|
|
619
|
+
fill="white"
|
|
620
|
+
stroke="#E0E0E0"
|
|
621
|
+
/>
|
|
622
|
+
<path
|
|
623
|
+
d="M15.5477 11.0504L15.8832 10.7004L15.8832 10.7004L15.5477 11.0504ZM15.5622 11.7359L15.2122 11.4004L15.2122 11.4004L15.5622 11.7359ZM14.8622 11.0649L15.2122 11.4004L15.2122 11.4004L14.8622 11.0649ZM10.0137 16.1222L9.66371 15.7867L9.66371 15.7867L10.0137 16.1222ZM9.69202 16.4578L9.34203 16.1222L9.02036 16.4578L9.34203 16.7933L9.69202 16.4578ZM10.0137 16.7933L9.66371 17.1288L10.0137 16.7933ZM14.8622 21.8507L15.2122 21.5151L15.2122 21.5151L14.8622 21.8507ZM15.5477 21.8651L15.8832 22.2151L15.8832 22.2151L15.5477 21.8651ZM15.5622 21.1796L15.9122 20.8441L15.9122 20.8441L15.5622 21.1796ZM11.0354 16.4578L10.6854 16.1222L10.3637 16.4578L10.6854 16.7933L11.0354 16.4578ZM15.2122 11.4004L15.2122 11.4004L15.9122 12.0715C16.2828 11.6849 16.2698 11.071 15.8832 10.7004L15.2122 11.4004ZM15.2122 11.4004L15.2122 11.4004L15.8832 10.7004C15.4967 10.3298 14.8828 10.3427 14.5122 10.7293L15.2122 11.4004ZM10.3637 16.4578L15.2122 11.4004L14.5122 10.7293L9.66371 15.7867L10.3637 16.4578ZM10.042 16.7933L10.3637 16.4578L9.66371 15.7867L9.34203 16.1222L10.042 16.7933ZM10.3637 16.4578L10.042 16.1222L9.34203 16.7933L9.66371 17.1288L10.3637 16.4578ZM15.2122 21.5151L10.3637 16.4578L9.66371 17.1288L14.5122 22.1862L15.2122 21.5151ZM15.2122 21.5151L15.2122 21.5151L14.5122 22.1862C14.8828 22.5728 15.4967 22.5858 15.8832 22.2151L15.2122 21.5151ZM15.2122 21.5151L15.2122 21.5151L15.8832 22.2151C16.2698 21.8445 16.2828 21.2307 15.9122 20.8441L15.2122 21.5151ZM10.6854 16.7933L15.2122 21.5151L15.9122 20.8441L11.3853 16.1222L10.6854 16.7933ZM15.2122 11.4004L10.6854 16.1222L11.3853 16.7933L15.9122 12.0715L15.2122 11.4004ZM21.5152 16.4578L21.5152 16.4578L21.5152 17.4275C22.0507 17.4275 22.4848 16.9933 22.4848 16.4578L21.5152 16.4578ZM21.5152 16.4578L21.5152 16.4578L22.4848 16.4578C22.4848 15.9222 22.0507 15.4881 21.5152 15.4881L21.5152 16.4578ZM11.8182 16.4578L21.5152 16.4578L21.5152 15.4881L11.8182 15.4881L11.8182 16.4578ZM11.8182 16.4578L11.8182 15.4881C11.2826 15.4881 10.8485 15.9222 10.8485 16.4578L11.8182 16.4578ZM11.8182 16.4578L10.8485 16.4578C10.8485 16.9933 11.2826 17.4275 11.8182 17.4275L11.8182 16.4578ZM21.5152 16.4578L11.8182 16.4578L11.8182 17.4275L21.5152 17.4275L21.5152 16.4578Z"
|
|
624
|
+
fill="#4250F0"
|
|
625
|
+
/>
|
|
626
|
+
</svg>
|
|
627
|
+
`}
|
|
628
|
+
<img src=${appData?.icon_url} alt=${appData?.name} />
|
|
629
|
+
<div class="${styles.appName}">${appData?.name}</div>`}
|
|
630
|
+
</div>
|
|
631
|
+
<div class=${styles.flowAccountWrap}>
|
|
632
|
+
${props.stepState.currentStep?.type === 'CONFIGURATION' &&
|
|
633
|
+
getSelectedStep().selectedStep?.step.authorization_type.app
|
|
634
|
+
.id !== props.genericData.selfAppId &&
|
|
635
|
+
getSelectedStep().selectedStep?.step.authorization_type.type !==
|
|
636
|
+
'NO_AUTH' &&
|
|
637
|
+
html` <${Authentication}
|
|
638
|
+
authorizations=${getStepAuthorizations(
|
|
639
|
+
props.stepMapping[props.stepState.currentStep.stepId]
|
|
640
|
+
?.authorizations || [],
|
|
641
|
+
)}
|
|
642
|
+
appData=${getSelectedStepApp(
|
|
643
|
+
getSelectedStep().selectedStep?.step,
|
|
644
|
+
)}
|
|
645
|
+
onAuthDelete=${(authId: number, appId: number) => {
|
|
646
|
+
deleteAuth(
|
|
647
|
+
authId,
|
|
648
|
+
Number(getSelectedStep().selectedStep?.step.id),
|
|
649
|
+
appId,
|
|
650
|
+
);
|
|
651
|
+
}}
|
|
652
|
+
onAuthenticationRecieved=${(
|
|
653
|
+
messageEvent: MessageEvent<AuthData>,
|
|
654
|
+
) => {
|
|
655
|
+
onAuthResponseReceived(
|
|
656
|
+
messageEvent,
|
|
657
|
+
Number(getSelectedStep().selectedStep?.step.id),
|
|
658
|
+
);
|
|
659
|
+
handleAuthSelected(
|
|
660
|
+
messageEvent.data.authorization_id,
|
|
661
|
+
Number(getSelectedStep().selectedStep?.step.id),
|
|
662
|
+
true,
|
|
663
|
+
false,
|
|
664
|
+
);
|
|
665
|
+
}}
|
|
666
|
+
onAuthVerify=${(authId: number, status: boolean) => {
|
|
667
|
+
handleAuthSelected(
|
|
668
|
+
authId,
|
|
669
|
+
Number(getSelectedStep().selectedStep?.step.id),
|
|
670
|
+
status,
|
|
671
|
+
false,
|
|
672
|
+
);
|
|
673
|
+
}}
|
|
674
|
+
hideAuthActions=${true}
|
|
675
|
+
onAuthSelected=${(authId: number, status: boolean) => {
|
|
676
|
+
handleAuthSelected(
|
|
677
|
+
authId,
|
|
678
|
+
Number(getSelectedStep().selectedStep?.step.id),
|
|
679
|
+
status,
|
|
680
|
+
false,
|
|
681
|
+
);
|
|
682
|
+
}}
|
|
683
|
+
stepId=${Number(getSelectedStep().selectedStep?.step.id)}
|
|
684
|
+
initialAuthVerification=${true}
|
|
685
|
+
/>`}
|
|
686
|
+
</div>
|
|
687
|
+
${selectedFlow === null &&
|
|
688
|
+
appData?.authorization_type.type !== 'NO_AUTH' &&
|
|
689
|
+
html` <${Authentication}
|
|
690
|
+
authorizations=${appData?.authorization_type.authorizations ||
|
|
691
|
+
[]}
|
|
692
|
+
flows=${appFlows}
|
|
693
|
+
appData=${appData}
|
|
694
|
+
onAuthDelete=${(authId: number, appId: number) => {
|
|
695
|
+
setAccountVerified(false);
|
|
696
|
+
if (app_id) {
|
|
697
|
+
context?.apiHandler.getAppInfo(app_id).then((data) => {
|
|
698
|
+
if (data) {
|
|
699
|
+
setAppData(data);
|
|
700
|
+
if (data.authorization_type) {
|
|
701
|
+
const {
|
|
702
|
+
authorizations = [],
|
|
703
|
+
} = data.authorization_type;
|
|
704
|
+
setSkipAuth(authorizations.length > 0);
|
|
705
|
+
}
|
|
706
|
+
} else {
|
|
707
|
+
console.error(`Failed to fetch app details`);
|
|
708
|
+
}
|
|
709
|
+
});
|
|
710
|
+
}
|
|
711
|
+
getAppFlows();
|
|
712
|
+
setSelectedFlow(null);
|
|
713
|
+
emitDeleteAuthEvent(authId, appId);
|
|
714
|
+
}}
|
|
715
|
+
onAuthenticationRecieved=${(
|
|
716
|
+
messageEvent: MessageEvent<AuthData>,
|
|
717
|
+
) => {
|
|
718
|
+
setAccountVerified(false);
|
|
719
|
+
if (app_id) {
|
|
720
|
+
context?.apiHandler.getAppInfo(app_id).then((data) => {
|
|
721
|
+
if (data) {
|
|
722
|
+
setAppData(data);
|
|
723
|
+
if (data.authorization_type) {
|
|
724
|
+
const {
|
|
725
|
+
authorizations = [],
|
|
726
|
+
} = data.authorization_type;
|
|
727
|
+
setSkipAuth(authorizations.length > 0);
|
|
728
|
+
}
|
|
729
|
+
getAppFlows(messageEvent.data.authorization_id);
|
|
730
|
+
} else {
|
|
731
|
+
console.error(`Failed to fetch app details`);
|
|
732
|
+
}
|
|
733
|
+
});
|
|
734
|
+
} else {
|
|
735
|
+
getAppFlows();
|
|
736
|
+
}
|
|
737
|
+
emitAddAuthEvent(messageEvent);
|
|
738
|
+
}}
|
|
739
|
+
onAuthVerify=${(authId: number, staus: boolean) => {
|
|
740
|
+
setAccountVerified(staus);
|
|
741
|
+
}}
|
|
742
|
+
hideAuthActions=${selectedFlow !== null}
|
|
743
|
+
onAuthSelected=${(authId: number, status: boolean) => {
|
|
744
|
+
handleAuthSelected(
|
|
745
|
+
authId,
|
|
746
|
+
Number(getSelectedStep().selectedStep?.step.id),
|
|
747
|
+
status,
|
|
748
|
+
false,
|
|
749
|
+
);
|
|
750
|
+
}}
|
|
751
|
+
stepId=${Number(getSelectedStep().selectedStep?.step.id)}
|
|
752
|
+
initialAuthVerification=${true}
|
|
753
|
+
/>`}`}
|
|
754
|
+
${!props.genericData.testMultipurpose &&
|
|
755
|
+
html` <div class=${styles.appInfo}>
|
|
756
|
+
${keepBackButtonForFlows &&
|
|
757
|
+
props.onBackClick &&
|
|
758
|
+
selectedFlow === null &&
|
|
759
|
+
html`
|
|
760
|
+
<svg
|
|
761
|
+
style="cursor: pointer;"
|
|
762
|
+
onclick=${props.onBackClick}
|
|
763
|
+
xmlns="http://www.w3.org/2000/svg"
|
|
764
|
+
width="32"
|
|
765
|
+
height="32"
|
|
766
|
+
viewBox="0 0 32 32"
|
|
767
|
+
fill="none"
|
|
768
|
+
>
|
|
769
|
+
<circle
|
|
770
|
+
cx="16"
|
|
771
|
+
cy="16"
|
|
772
|
+
r="15.5"
|
|
773
|
+
fill="white"
|
|
774
|
+
stroke="#E0E0E0"
|
|
775
|
+
/>
|
|
776
|
+
<path
|
|
777
|
+
d="M15.5477 11.0504L15.8832 10.7004L15.8832 10.7004L15.5477 11.0504ZM15.5622 11.7359L15.2122 11.4004L15.2122 11.4004L15.5622 11.7359ZM14.8622 11.0649L15.2122 11.4004L15.2122 11.4004L14.8622 11.0649ZM10.0137 16.1222L9.66371 15.7867L9.66371 15.7867L10.0137 16.1222ZM9.69202 16.4578L9.34203 16.1222L9.02036 16.4578L9.34203 16.7933L9.69202 16.4578ZM10.0137 16.7933L9.66371 17.1288L10.0137 16.7933ZM14.8622 21.8507L15.2122 21.5151L15.2122 21.5151L14.8622 21.8507ZM15.5477 21.8651L15.8832 22.2151L15.8832 22.2151L15.5477 21.8651ZM15.5622 21.1796L15.9122 20.8441L15.9122 20.8441L15.5622 21.1796ZM11.0354 16.4578L10.6854 16.1222L10.3637 16.4578L10.6854 16.7933L11.0354 16.4578ZM15.2122 11.4004L15.2122 11.4004L15.9122 12.0715C16.2828 11.6849 16.2698 11.071 15.8832 10.7004L15.2122 11.4004ZM15.2122 11.4004L15.2122 11.4004L15.8832 10.7004C15.4967 10.3298 14.8828 10.3427 14.5122 10.7293L15.2122 11.4004ZM10.3637 16.4578L15.2122 11.4004L14.5122 10.7293L9.66371 15.7867L10.3637 16.4578ZM10.042 16.7933L10.3637 16.4578L9.66371 15.7867L9.34203 16.1222L10.042 16.7933ZM10.3637 16.4578L10.042 16.1222L9.34203 16.7933L9.66371 17.1288L10.3637 16.4578ZM15.2122 21.5151L10.3637 16.4578L9.66371 17.1288L14.5122 22.1862L15.2122 21.5151ZM15.2122 21.5151L15.2122 21.5151L14.5122 22.1862C14.8828 22.5728 15.4967 22.5858 15.8832 22.2151L15.2122 21.5151ZM15.2122 21.5151L15.2122 21.5151L15.8832 22.2151C16.2698 21.8445 16.2828 21.2307 15.9122 20.8441L15.2122 21.5151ZM10.6854 16.7933L15.2122 21.5151L15.9122 20.8441L11.3853 16.1222L10.6854 16.7933ZM15.2122 11.4004L10.6854 16.1222L11.3853 16.7933L15.9122 12.0715L15.2122 11.4004ZM21.5152 16.4578L21.5152 16.4578L21.5152 17.4275C22.0507 17.4275 22.4848 16.9933 22.4848 16.4578L21.5152 16.4578ZM21.5152 16.4578L21.5152 16.4578L22.4848 16.4578C22.4848 15.9222 22.0507 15.4881 21.5152 15.4881L21.5152 16.4578ZM11.8182 16.4578L21.5152 16.4578L21.5152 15.4881L11.8182 15.4881L11.8182 16.4578ZM11.8182 16.4578L11.8182 15.4881C11.2826 15.4881 10.8485 15.9222 10.8485 16.4578L11.8182 16.4578ZM11.8182 16.4578L10.8485 16.4578C10.8485 16.9933 11.2826 17.4275 11.8182 17.4275L11.8182 16.4578ZM21.5152 16.4578L11.8182 16.4578L11.8182 17.4275L21.5152 17.4275L21.5152 16.4578Z"
|
|
778
|
+
fill="#4250F0"
|
|
779
|
+
/>
|
|
780
|
+
</svg>
|
|
781
|
+
`}
|
|
782
|
+
<img src=${appData?.icon_url} alt=${appData?.name} />
|
|
783
|
+
<div class="${styles.appName}">${appData?.name}</div>
|
|
784
|
+
</div>
|
|
785
|
+
<${Authentication}
|
|
786
|
+
authorizations=${appData?.authorization_type.authorizations ||
|
|
787
|
+
[]}
|
|
788
|
+
flows=${appFlows}
|
|
789
|
+
appData=${appData}
|
|
790
|
+
onAuthDelete=${(authId: number, appId: number) => {
|
|
791
|
+
setAccountVerified(false);
|
|
792
|
+
if (app_id) {
|
|
793
|
+
context?.apiHandler.getAppInfo(app_id).then((data) => {
|
|
794
|
+
if (data) {
|
|
795
|
+
setAppData(data);
|
|
796
|
+
if (data.authorization_type) {
|
|
797
|
+
const {
|
|
798
|
+
authorizations = [],
|
|
799
|
+
} = data.authorization_type;
|
|
800
|
+
setSkipAuth(authorizations.length > 0);
|
|
801
|
+
}
|
|
802
|
+
} else {
|
|
803
|
+
console.error(`Failed to fetch app details`);
|
|
804
|
+
}
|
|
805
|
+
});
|
|
806
|
+
}
|
|
807
|
+
getAppFlows();
|
|
808
|
+
setSelectedFlow(null);
|
|
809
|
+
emitDeleteAuthEvent(authId, appId);
|
|
810
|
+
}}
|
|
811
|
+
onAuthenticationRecieved=${(
|
|
812
|
+
messageEvent: MessageEvent<AuthData>,
|
|
813
|
+
) => {
|
|
814
|
+
setAccountVerified(false);
|
|
815
|
+
if (app_id) {
|
|
816
|
+
context?.apiHandler.getAppInfo(app_id).then((data) => {
|
|
817
|
+
if (data) {
|
|
818
|
+
setAppData(data);
|
|
819
|
+
if (data.authorization_type) {
|
|
820
|
+
const {
|
|
821
|
+
authorizations = [],
|
|
822
|
+
} = data.authorization_type;
|
|
823
|
+
setSkipAuth(authorizations.length > 0);
|
|
824
|
+
}
|
|
825
|
+
getAppFlows(messageEvent.data.authorization_id);
|
|
826
|
+
} else {
|
|
827
|
+
console.error(`Failed to fetch app details`);
|
|
828
|
+
}
|
|
829
|
+
});
|
|
830
|
+
} else {
|
|
831
|
+
getAppFlows();
|
|
832
|
+
}
|
|
833
|
+
emitAddAuthEvent(messageEvent);
|
|
834
|
+
}}
|
|
835
|
+
onAuthVerify=${(authId: number, staus: boolean) => {
|
|
836
|
+
setAccountVerified(staus);
|
|
837
|
+
}}
|
|
838
|
+
hideAuthActions=${selectedFlow !== null}
|
|
839
|
+
onAuthSelected=${(authId: number, status: boolean) => {
|
|
840
|
+
handleAuthSelected(
|
|
841
|
+
authId,
|
|
842
|
+
Number(getSelectedStep().selectedStep?.step.id),
|
|
843
|
+
status,
|
|
844
|
+
false,
|
|
845
|
+
);
|
|
846
|
+
}}
|
|
847
|
+
stepId=${Number(getSelectedStep().selectedStep?.step.id)}
|
|
848
|
+
/>`}
|
|
849
|
+
</div>
|
|
850
|
+
|
|
851
|
+
<div
|
|
852
|
+
class="${renderMode === MarketplaceRenderModes.MODAL
|
|
853
|
+
? genericData.viewStyle === ViewStyles.COMPACT && isInModal
|
|
854
|
+
? styles.modalContentWrapCompact
|
|
855
|
+
: styles.modalContentWrap
|
|
856
|
+
: styles.inlineContentWrap} ${'integry-apps-flow-container'}"
|
|
857
|
+
style="${renderFlowSetupMode === MarketplaceRenderModes.MODAL &&
|
|
858
|
+
selectedFlow !== null
|
|
859
|
+
? 'overflow: hidden;'
|
|
860
|
+
: ''}"
|
|
861
|
+
>
|
|
862
|
+
${(selectedFlow === null ||
|
|
863
|
+
renderFlowSetupMode === MarketplaceRenderModes.MODAL) &&
|
|
864
|
+
html` ${isReloadingFlowListing &&
|
|
865
|
+
!isLoading &&
|
|
866
|
+
html`<div
|
|
867
|
+
class="${genericData.viewStyle === ViewStyles.COMPACT
|
|
868
|
+
? styles['compact-view']
|
|
869
|
+
: ''}"
|
|
870
|
+
>
|
|
871
|
+
<${AppPageLoader} renderMode=${renderMode} />
|
|
872
|
+
</div>`}
|
|
873
|
+
<${AppFlowListing}
|
|
874
|
+
marketplaceId=${marketplaceId}
|
|
875
|
+
onFlowSelect=${onFlowSelect}
|
|
876
|
+
updateInstanceName=${updateInstanceName}
|
|
877
|
+
appData=${appData}
|
|
878
|
+
appFlows=${appFlows}
|
|
879
|
+
accountVerified=${appData?.authorization_type.type === 'NO_AUTH'
|
|
880
|
+
? true
|
|
881
|
+
: accountVerified}
|
|
882
|
+
renderMode=${renderMode}
|
|
883
|
+
onDeleteInstance=${(instance: Integration) => {
|
|
884
|
+
handleDeleteInstance(instance);
|
|
885
|
+
}}
|
|
886
|
+
/>`}
|
|
887
|
+
${selectedFlow &&
|
|
888
|
+
(renderFlowSetupMode === MarketplaceRenderModes.INLINE
|
|
889
|
+
? html`
|
|
890
|
+
<div class="${styles.appFlowSetupForm}">
|
|
891
|
+
${
|
|
892
|
+
!props.genericData.testMultipurpose &&
|
|
893
|
+
html` <div class="${styles.flowSetupHeader}">
|
|
894
|
+
<div class="${styles.backLink}" onclick=${handleGoBackToApps}>
|
|
895
|
+
<svg
|
|
896
|
+
width="24"
|
|
897
|
+
height="24"
|
|
898
|
+
viewBox="0 0 33 33"
|
|
899
|
+
fill="none"
|
|
900
|
+
xmlns="http://www.w3.org/2000/svg"
|
|
901
|
+
>
|
|
902
|
+
<circle
|
|
903
|
+
cx="16.6758"
|
|
904
|
+
cy="16.5684"
|
|
905
|
+
r="15.5"
|
|
906
|
+
fill="white"
|
|
907
|
+
stroke="#4250f0"
|
|
908
|
+
/>
|
|
909
|
+
<path
|
|
910
|
+
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
|
|
911
|
+
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
|
|
912
|
+
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
|
|
913
|
+
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
|
|
914
|
+
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
|
|
915
|
+
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"
|
|
916
|
+
fill="#4250f0"
|
|
917
|
+
/>
|
|
918
|
+
</svg>
|
|
919
|
+
</div>
|
|
920
|
+
<div class="${styles.flowName}">${genericData.name}</div>
|
|
921
|
+
</div>`
|
|
922
|
+
}
|
|
923
|
+
<div id="${
|
|
924
|
+
renderMode === MarketplaceRenderModes.MODAL
|
|
925
|
+
? 'flowSetupWrapperModal'
|
|
926
|
+
: 'flowSetupWrapper'
|
|
927
|
+
}" class="${
|
|
928
|
+
renderMode === MarketplaceRenderModes.MODAL
|
|
929
|
+
? styles.flowSetupWrapperModal
|
|
930
|
+
: styles.flowSetupWrapper
|
|
931
|
+
} ${
|
|
932
|
+
genericData.viewStyle === ViewStyles.COMPACT &&
|
|
933
|
+
styles.flowSetupWrapperModalCompact
|
|
934
|
+
}">
|
|
935
|
+
<${FlowSetupContainer}
|
|
936
|
+
deploymentId=${
|
|
937
|
+
genericData.deploymentId || appData?.default_bundle_id
|
|
938
|
+
}
|
|
939
|
+
flowId=${selectedFlow?.flow.id}
|
|
940
|
+
key=${`flow-setup-${selectedFlow?.flow.id}-${selectedFlow?.instance?.id}`}
|
|
941
|
+
integrationId=${selectedFlow?.instance?.id || null}
|
|
942
|
+
hideStepNavigation=${true}
|
|
943
|
+
setupContainerClassName=${
|
|
944
|
+
renderMode === MarketplaceRenderModes.MODAL
|
|
945
|
+
? styles.setupContainer
|
|
946
|
+
: ''
|
|
947
|
+
}
|
|
948
|
+
stepsClassName=${
|
|
949
|
+
renderMode === MarketplaceRenderModes.MODAL
|
|
950
|
+
? { bottom: styles.stepsBottom }
|
|
951
|
+
: null
|
|
952
|
+
}
|
|
953
|
+
onUpdate=${handleGoBackToAppsCloseModal}
|
|
954
|
+
onFlowExecute=${getAppFlows}
|
|
955
|
+
onBackClick=${() => {
|
|
956
|
+
setSelectedFlow(null);
|
|
957
|
+
}}
|
|
958
|
+
skipAuth=${skipAuth}
|
|
959
|
+
hideStepCount=${true}
|
|
960
|
+
isInModal=${renderMode === MarketplaceRenderModes.MODAL}
|
|
961
|
+
|
|
962
|
+
></${FlowSetupContainer}>
|
|
963
|
+
</div>
|
|
964
|
+
</div>
|
|
965
|
+
`
|
|
966
|
+
: html`
|
|
967
|
+
<${Modal}
|
|
968
|
+
isOpen=${props.showSetupModal}
|
|
969
|
+
onClose=${handleGoBackToAppsCloseModal}
|
|
970
|
+
className="flowAppsModal"
|
|
971
|
+
isCompact=${genericData.viewStyle === ViewStyles.COMPACT}
|
|
972
|
+
>
|
|
973
|
+
<div class="${styles.appFlowSetupForm}">
|
|
974
|
+
${html` <div class="${styles.flowSetupHeader}">
|
|
975
|
+
<div
|
|
976
|
+
class="${styles.backLink}"
|
|
977
|
+
onclick=${handleGoBackToApps}
|
|
978
|
+
>
|
|
979
|
+
<svg
|
|
980
|
+
width="24"
|
|
981
|
+
height="24"
|
|
982
|
+
viewBox="0 0 33 33"
|
|
983
|
+
fill="none"
|
|
984
|
+
xmlns="http://www.w3.org/2000/svg"
|
|
985
|
+
>
|
|
986
|
+
<circle
|
|
987
|
+
cx="16.6758"
|
|
988
|
+
cy="16.5684"
|
|
989
|
+
r="15.5"
|
|
990
|
+
fill="white"
|
|
991
|
+
stroke="#4250f0"
|
|
992
|
+
/>
|
|
993
|
+
<path
|
|
994
|
+
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
|
|
995
|
+
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
|
|
996
|
+
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
|
|
997
|
+
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
|
|
998
|
+
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
|
|
999
|
+
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"
|
|
1000
|
+
fill="#4250f0"
|
|
1001
|
+
/>
|
|
1002
|
+
</svg>
|
|
1003
|
+
</div>
|
|
1004
|
+
<div
|
|
1005
|
+
class="${styles.flowName}"
|
|
1006
|
+
style="${genericData.viewStyle === ViewStyles.COMPACT &&
|
|
1007
|
+
renderFlowSetupMode === MarketplaceRenderModes.MODAL
|
|
1008
|
+
? 'width: 75%; text-align: center;'
|
|
1009
|
+
: ''}"
|
|
1010
|
+
>
|
|
1011
|
+
${genericData.name}
|
|
1012
|
+
</div>
|
|
1013
|
+
</div>`}
|
|
1014
|
+
${props.genericData.testMultipurpose && html``}
|
|
1015
|
+
|
|
1016
|
+
<div id="flowSetupWrapperModal" class=${
|
|
1017
|
+
styles.flowSetupWrapperModal
|
|
1018
|
+
}>
|
|
1019
|
+
<${FlowSetupContainer}
|
|
1020
|
+
deploymentId=${
|
|
1021
|
+
genericData.deploymentId || appData?.default_bundle_id
|
|
1022
|
+
}
|
|
1023
|
+
flowId=${selectedFlow?.flow.id}
|
|
1024
|
+
key=${`flow-setup-${selectedFlow?.flow.id}-${selectedFlow?.instance?.id}`}
|
|
1025
|
+
integrationId=${selectedFlow?.instance?.id || null}
|
|
1026
|
+
hideStepNavigation=${true}
|
|
1027
|
+
setupContainerClassName=${
|
|
1028
|
+
renderMode === MarketplaceRenderModes.MODAL
|
|
1029
|
+
? styles.setupContainer
|
|
1030
|
+
: renderFlowSetupMode === MarketplaceRenderModes.MODAL
|
|
1031
|
+
? styles.setupContainerModal
|
|
1032
|
+
: ''
|
|
1033
|
+
}
|
|
1034
|
+
stepsClassName=${
|
|
1035
|
+
renderMode === MarketplaceRenderModes.MODAL
|
|
1036
|
+
? { bottom: styles.stepsBottom }
|
|
1037
|
+
: null
|
|
1038
|
+
}
|
|
1039
|
+
onUpdate=${handleGoBackToAppsCloseModal}
|
|
1040
|
+
onFlowExecute=${getAppFlows}
|
|
1041
|
+
onBackClick=${() => {
|
|
1042
|
+
setSelectedFlow(null);
|
|
1043
|
+
}}
|
|
1044
|
+
skipAuth=${skipAuth}
|
|
1045
|
+
hideStepCount=${true}
|
|
1046
|
+
isInModal=${
|
|
1047
|
+
renderMode === MarketplaceRenderModes.MODAL ||
|
|
1048
|
+
renderFlowSetupMode === MarketplaceRenderModes.MODAL
|
|
1049
|
+
}
|
|
1050
|
+
></${FlowSetupContainer}>
|
|
1051
|
+
</div>
|
|
1052
|
+
</div>
|
|
1053
|
+
<//>
|
|
1054
|
+
`)}
|
|
1055
|
+
</div>
|
|
1056
|
+
${((renderMode === MarketplaceRenderModes.INLINE &&
|
|
1057
|
+
renderFlowSetupMode !== MarketplaceRenderModes.INLINE) ||
|
|
1058
|
+
!selectedFlow) &&
|
|
1059
|
+
html`<${Footer}
|
|
1060
|
+
style="${renderMode === MarketplaceRenderModes.MODAL
|
|
1061
|
+
? 'padding-top: 10px;'
|
|
1062
|
+
: ''}"
|
|
1063
|
+
/>`}
|
|
1064
|
+
</div>
|
|
1065
|
+
`;
|
|
1066
|
+
};
|
|
1067
|
+
|
|
1068
|
+
export default connect<WraperrProps, unknown, StoreType, unknown>(
|
|
1069
|
+
[
|
|
1070
|
+
'userConfig',
|
|
1071
|
+
'genericData',
|
|
1072
|
+
'showMarketplaceModal',
|
|
1073
|
+
'showMarketplaceAppPageId',
|
|
1074
|
+
'showSetupModal',
|
|
1075
|
+
'IUAccountsData',
|
|
1076
|
+
'incomingWebhookPayload',
|
|
1077
|
+
'stepState',
|
|
1078
|
+
'stepMapping',
|
|
1079
|
+
],
|
|
1080
|
+
actionFunctions,
|
|
1081
|
+
)(RenderAppPage);
|