@integry/sdk 4.7.39 → 4.7.41
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/dist/esm/index.csm.js +1 -1
- package/dist/umd/index.umd.js +1 -1
- package/package.json +6 -1
- package/.eslintignore +0 -1
- package/.vscode/launch.json +0 -17
- package/CHANGELOG_INTERNAL.md +0 -134
- package/README_INTERNAL.md +0 -176
- package/THIRD_PARTY_LICENSES +0 -525
- package/generateTests.js +0 -80
- package/jest.config.cjs +0 -10
- package/src/components/AddTagButton/index.ts +0 -23
- package/src/components/BasicSelect/index.ts +0 -123
- package/src/components/BasicSelect/styles.module.scss +0 -44
- package/src/components/Button/index.ts +0 -97
- package/src/components/Button/styles.module.scss +0 -152
- package/src/components/CheckboxGroup/Checkbox.ts +0 -104
- package/src/components/CheckboxGroup/index.ts +0 -190
- package/src/components/CheckboxGroup/styles.module.scss +0 -63
- package/src/components/CollapsedMenu/index.ts +0 -104
- package/src/components/CollapsedMenu/styles.module.scss +0 -46
- package/src/components/ConfigureFieldWrapper/index.ts +0 -85
- package/src/components/ConfigureFieldWrapper/styles.module.scss +0 -57
- package/src/components/EditableText/index.ts +0 -121
- package/src/components/EditableText/styles.module.scss +0 -38
- package/src/components/EditableTextArea/index.ts +0 -143
- package/src/components/EditableTextArea/styles.module.scss +0 -91
- package/src/components/ErrorMessage/index.ts +0 -16
- package/src/components/ErrorMessage/styles.module.scss +0 -19
- package/src/components/ErrorPage/index.ts +0 -42
- package/src/components/ErrorPage/styles.module.scss +0 -26
- package/src/components/Footer/index.ts +0 -41
- package/src/components/Footer/styles.module.scss +0 -40
- package/src/components/HTMLContent/index.tsx +0 -205
- package/src/components/HTMLContent/styles.module.scss +0 -3
- package/src/components/InfoBox/index.ts +0 -48
- package/src/components/InfoBox/styles.module.scss +0 -21
- package/src/components/Input/BaseInput/index.ts +0 -170
- package/src/components/Input/BaseInput/styles.module.scss +0 -95
- package/src/components/Input/DateInput/index.ts +0 -103
- package/src/components/Input/DateInput/styles.module.scss +0 -50
- package/src/components/Input/Input/index.ts +0 -225
- package/src/components/Input/Input/styles.module.scss +0 -16
- package/src/components/Input/PasswordInput/index.ts +0 -164
- package/src/components/Input/PasswordInput/styles.module.scss +0 -37
- package/src/components/Input/index.ts +0 -7
- package/src/components/Label/index.ts +0 -61
- package/src/components/Label/styles.module.scss +0 -41
- package/src/components/LargeLoader/index.ts +0 -25
- package/src/components/LargeLoader/styles.module.scss +0 -16
- package/src/components/Listbox/ListBoxItem.ts +0 -57
- package/src/components/Listbox/index.ts +0 -488
- package/src/components/Listbox/styles.module.scss +0 -197
- package/src/components/Loader/index.ts +0 -25
- package/src/components/Loader/styles.module.scss +0 -16
- package/src/components/MediaGallery/MediaGalleryModal.ts +0 -82
- package/src/components/MediaGallery/MediaSlider.ts +0 -76
- package/src/components/MediaGallery/index.ts +0 -92
- package/src/components/MediaGallery/styles.module.scss +0 -156
- package/src/components/MediaUpload/index.ts +0 -233
- package/src/components/MediaUpload/styles.module.scss +0 -118
- package/src/components/Modal/index.ts +0 -87
- package/src/components/Modal/styles.module.scss +0 -441
- package/src/components/MultipurposeField/Dropdown/ListBoxItem.tsx +0 -59
- package/src/components/MultipurposeField/Dropdown/index.tsx +0 -1202
- package/src/components/MultipurposeField/Dropdown/styles.module.scss +0 -215
- package/src/components/MultipurposeField/TagMenu/index.ts +0 -536
- package/src/components/MultipurposeField/TagMenu/styles.module.scss +0 -175
- package/src/components/MultipurposeField/TagOptions/index.tsx +0 -83
- package/src/components/MultipurposeField/TagOptions/styles.module.scss +0 -95
- package/src/components/MultipurposeField/index.tsx +0 -944
- package/src/components/MultipurposeField/styles.module.scss +0 -77
- package/src/components/NewModal/index.ts +0 -69
- package/src/components/NewModal/styles.module.scss +0 -70
- package/src/components/OverflowTooltip/index.tsx +0 -59
- package/src/components/PopUp/ConfirmationPopUp/index.ts +0 -58
- package/src/components/PopUp/ConfirmationPopUp/styles.module.scss +0 -49
- package/src/components/PopUp/SuccessPopUp/index.ts +0 -62
- package/src/components/PopUp/SuccessPopUp/styles.module.scss +0 -38
- package/src/components/RadioGroup/Radio.ts +0 -128
- package/src/components/RadioGroup/index.ts +0 -169
- package/src/components/RadioGroup/styles.module.scss +0 -81
- package/src/components/Search/index.ts +0 -69
- package/src/components/Search/styles.module.scss +0 -149
- package/src/components/TabBar/Tab.ts +0 -33
- package/src/components/TabBar/index.ts +0 -64
- package/src/components/TabBar/styles.module.scss +0 -43
- package/src/components/Tag/index.ts +0 -29
- package/src/components/Tag/styles.module.scss +0 -57
- package/src/components/TagsMenu/index.ts +0 -1697
- package/src/components/TagsMenu/styles.module.scss +0 -350
- package/src/components/TestComponent/index.ts +0 -71
- package/src/components/TestComponent/styles.module.scss +0 -152
- package/src/components/TextArea/index.ts +0 -172
- package/src/components/TextArea/styles.module.scss +0 -72
- package/src/components/TextContent/index.tsx +0 -128
- package/src/components/TextContent/styles.module.scss +0 -6
- package/src/components/ThreeDotLoader/index.ts +0 -39
- package/src/components/ThreeDotLoader/styles.module.scss +0 -41
- package/src/components/TimeInput/index.ts +0 -129
- package/src/components/TimeInput/styles.module.scss +0 -16
- package/src/components/Toggle/index.ts +0 -34
- package/src/components/Toggle/styles.module.scss +0 -56
- package/src/components/Toggle-v2/index.ts +0 -40
- package/src/components/Toggle-v2/styles.module.scss +0 -86
- package/src/components/Tooltip/index.ts +0 -271
- package/src/components/Tooltip/styles.module.scss +0 -105
- package/src/components/form/FunctionField/index.ts +0 -816
- package/src/components/form/FunctionField/styles.module.scss +0 -478
- package/src/components/form/ObjectField/__snapshots__/index.ts.test.tsx.snap +0 -3
- package/src/components/form/ObjectField/index.ts +0 -593
- package/src/components/form/ObjectField/index.ts.test.tsx +0 -213
- package/src/components/form/ObjectField/styles.module.scss +0 -103
- package/src/components/form/index.ts +0 -4
- package/src/contexts/AppContext.ts +0 -12
- package/src/declaration.d.ts +0 -7
- package/src/extensions/HMAC.ts +0 -25
- package/src/extensions/IntegryAPIError.ts +0 -19
- package/src/features/common/AccountDropdown/index.ts +0 -291
- package/src/features/common/AccountDropdown/styles.module.scss +0 -19
- package/src/features/common/ActionForm/index.ts +0 -2602
- package/src/features/common/ActionForm/styles.module.scss +0 -35
- package/src/features/common/AppCard/index.ts +0 -207
- package/src/features/common/AppCard/styles.module.scss +0 -117
- package/src/features/common/AppCardCompact/index.ts +0 -189
- package/src/features/common/AppCardCompact/styles.module.scss +0 -141
- package/src/features/common/AuthSelector/index.ts +0 -537
- package/src/features/common/AuthSelector/styles.module.scss +0 -161
- package/src/features/common/AuthSelectorCompact/index.ts +0 -706
- package/src/features/common/AuthSelectorCompact/styles.module.scss +0 -219
- package/src/features/common/AuthSelectorDropdown/index.ts +0 -704
- package/src/features/common/AuthSelectorDropdown/styles.module.scss +0 -361
- package/src/features/common/AuthSelectorV2/index.ts +0 -336
- package/src/features/common/AuthSelectorV2/styles.module.scss +0 -235
- package/src/features/common/DynamicField/index.ts +0 -402
- package/src/features/common/DynamicField/styles.module.scss +0 -266
- package/src/features/common/DynamicTypedField/index.ts +0 -504
- package/src/features/common/DynamicTypedField/styles.module.scss +0 -135
- package/src/features/common/FunctionForm/index.ts +0 -1095
- package/src/features/common/FunctionForm/styles.module.scss +0 -225
- package/src/features/common/MappingUI/index.ts +0 -649
- package/src/features/common/MappingUI/styles.module.scss +0 -121
- package/src/features/common/MarketplaceAppCard/index.ts +0 -279
- package/src/features/common/MarketplaceAppCard/styles.module.scss +0 -231
- package/src/features/common/MarketplaceAppCardCompact/index.ts +0 -283
- package/src/features/common/MarketplaceAppCardCompact/styles.module.scss +0 -255
- package/src/features/common/NewMappingUI/index.ts +0 -515
- package/src/features/common/NewMappingUI/styles.module.scss +0 -113
- package/src/features/common/RequestAppWidget/RequestAppModal/index.ts +0 -67
- package/src/features/common/RequestAppWidget/RequestAppModal/styles.module.scss +0 -23
- package/src/features/common/RequestAppWidget/index.ts +0 -48
- package/src/features/common/RequestAppWidget/request-app-form.ts +0 -89
- package/src/features/common/RequestAppWidget/styles.module.scss +0 -43
- package/src/features/common/SectionField/index.ts +0 -272
- package/src/features/common/SectionField/styles.module.scss +0 -67
- package/src/features/common/Step/index.ts +0 -827
- package/src/features/common/Step/styles.module.scss +0 -12
- package/src/features/common/StepNavigation/CollapsedSteps.ts +0 -131
- package/src/features/common/StepNavigation/NavItem.ts +0 -111
- package/src/features/common/StepNavigation/index.ts +0 -261
- package/src/features/common/StepNavigation/styles.module.scss +0 -117
- package/src/features/common/Steps/index.ts +0 -1140
- package/src/features/common/Steps/styles.module.scss +0 -314
- package/src/features/containers/AppFlowContainer/AppFlowListing/compactStyles.module.scss +0 -404
- package/src/features/containers/AppFlowContainer/AppFlowListing/flow-instance.tsx +0 -367
- package/src/features/containers/AppFlowContainer/AppFlowListing/flowCard.test.tsx +0 -58
- package/src/features/containers/AppFlowContainer/AppFlowListing/flowCard.tsx +0 -208
- package/src/features/containers/AppFlowContainer/AppFlowListing/flowCardCompact.test.tsx +0 -49
- package/src/features/containers/AppFlowContainer/AppFlowListing/flowCardCompact.tsx +0 -421
- package/src/features/containers/AppFlowContainer/AppFlowListing/flowInstanceCompact.tsx +0 -577
- package/src/features/containers/AppFlowContainer/AppFlowListing/index.tsx +0 -83
- package/src/features/containers/AppFlowContainer/AppFlowListing/styles.module.scss +0 -233
- package/src/features/containers/AppFlowContainer/AppFlowWrap/app-page-loader.tsx +0 -45
- package/src/features/containers/AppFlowContainer/AppFlowWrap/index.tsx +0 -1085
- package/src/features/containers/AppFlowContainer/AppFlowWrap/styles.module.scss +0 -465
- package/src/features/containers/AppFlowContainer/Authentication/index.ts +0 -610
- package/src/features/containers/AppFlowContainer/Authentication/styles.module.scss +0 -468
- package/src/features/containers/AppFlowContainer/index.ts +0 -114
- package/src/features/containers/AppPageContainer/AppPage/index.tsx +0 -262
- package/src/features/containers/AppPageContainer/AppPage/styles.module.scss +0 -120
- package/src/features/containers/AppPageContainer/IntegrationCard/index.ts +0 -165
- package/src/features/containers/AppPageContainer/IntegrationCard/styles.module.scss +0 -81
- package/src/features/containers/AppPageContainer/index.tsx +0 -93
- package/src/features/containers/AppPageContainer/styles.module.scss +0 -0
- package/src/features/containers/AppsForFlows/index.ts +0 -161
- package/src/features/containers/AppsForFlows/styles.module.scss +0 -280
- package/src/features/containers/AppsForFlowsCompact/index.ts +0 -161
- package/src/features/containers/AppsForFlowsCompact/styles.module.scss +0 -279
- package/src/features/containers/AuthSetupContainer/AppSelection.ts +0 -73
- package/src/features/containers/AuthSetupContainer/AuthTypeSelection.ts +0 -67
- package/src/features/containers/AuthSetupContainer/Footer.ts +0 -32
- package/src/features/containers/AuthSetupContainer/Header.ts +0 -39
- package/src/features/containers/AuthSetupContainer/PostAdditionPopup.ts +0 -27
- package/src/features/containers/AuthSetupContainer/index.ts +0 -349
- package/src/features/containers/AuthSetupContainer/styles.module.scss +0 -229
- package/src/features/containers/FlowSetupContainer/index.ts +0 -391
- package/src/features/containers/FlowSetupContainer/styles.module.scss +0 -18
- package/src/features/containers/MarkeplaceApps/index.ts +0 -583
- package/src/features/containers/MarkeplaceApps/styles.module.scss +0 -558
- package/src/features/containers/MarketplaceAppsCompact/index.ts +0 -585
- package/src/features/containers/MarketplaceAppsCompact/styles.module.scss +0 -563
- package/src/features/containers/MarketplaceAppsContainer/index.ts +0 -91
- package/src/features/containers/MarketplaceContainer/AppCard/index.ts +0 -91
- package/src/features/containers/MarketplaceContainer/AppCard/styles.module.scss +0 -66
- package/src/features/containers/MarketplaceContainer/AppListing/index.ts +0 -34
- package/src/features/containers/MarketplaceContainer/AppListing/styles.module.scss +0 -10
- package/src/features/containers/MarketplaceContainer/MarketplaceContentWrap/index.ts +0 -132
- package/src/features/containers/MarketplaceContainer/MarketplaceContentWrap/styles.module.scss +0 -117
- package/src/features/containers/MarketplaceContainer/index.ts +0 -242
- package/src/features/containers/MarketplaceContainer/styles.module.scss +0 -84
- package/src/features/containers/SDKContainer/index.ts +0 -817
- package/src/features/containers/SDKContainer/styles.module.scss +0 -266
- package/src/features/containers/SDKDebugContainer/index.ts +0 -137
- package/src/features/containers/SDKDebugContainer/styles.module.scss +0 -37
- package/src/features/containers/SDKFailedContainer/index.ts +0 -117
- package/src/features/containers/SDKFailedContainer/styles.module.scss +0 -57
- package/src/features/integrations/IntegrationRow/Icons.ts +0 -77
- package/src/features/integrations/IntegrationRow/index.ts +0 -129
- package/src/features/integrations/IntegrationRow/styles.module.scss +0 -62
- package/src/features/integrations/IntegrationsHeader/index.ts +0 -34
- package/src/features/integrations/IntegrationsHeader/styles.module.scss +0 -47
- package/src/features/integrations/IntegrationsList/index.ts +0 -252
- package/src/features/integrations/IntegrationsList/styles.module.scss +0 -67
- package/src/features/templates/Template/index.ts +0 -295
- package/src/features/templates/Template/styles.module.scss +0 -226
- package/src/features/templates/TemplatesView/index.ts +0 -368
- package/src/features/templates/TemplatesView/styles.module.scss +0 -71
- package/src/features/templates/TemplatesViewCompact/index.ts +0 -364
- package/src/features/templates/TemplatesViewCompact/styles.module.scss +0 -141
- package/src/hooks/useAutosizeTextArea.ts +0 -22
- package/src/hooks/useCustomRef.ts +0 -13
- package/src/hooks/useDebounce.ts +0 -17
- package/src/hooks/useElementResize.ts +0 -40
- package/src/hooks/useEventListener.ts +0 -42
- package/src/hooks/useHover.ts +0 -40
- package/src/hooks/useOnClickOutside.ts +0 -32
- package/src/index.ts +0 -2244
- package/src/index.umd.ts +0 -13
- package/src/interfaces/index.ts +0 -938
- package/src/modules/api/index.ts +0 -1325
- package/src/modules/api/responseHandler.ts +0 -38
- package/src/modules/event-emitter/index.ts +0 -72
- package/src/modules/event-emitter/runners/abstract.ts +0 -21
- package/src/modules/event-emitter/runners/default.ts +0 -11
- package/src/modules/event-emitter/runners/ntimes.ts +0 -28
- package/src/modules/event-emitter/types.ts +0 -34
- package/src/store/actionFunctions.ts +0 -1578
- package/src/store/index.ts +0 -17
- package/src/store/initialState.ts +0 -58
- package/src/types/index.ts +0 -320
- package/src/types/preact-compat.d.ts +0 -4
- package/src/types/store.ts +0 -366
- package/src/types/utils.ts +0 -19
- package/src/utils/ActivityOutputUtils.ts +0 -176
- package/src/utils/common.ts +0 -20
- package/src/utils/copyToClipboard.ts +0 -24
- package/src/utils/datetime.ts +0 -101
- package/src/utils/getUrlParam.ts +0 -11
- package/src/utils/isAuthMessage.ts +0 -16
- package/src/utils/isBrowser.ts +0 -1
- package/src/utils/jsonEncodeDecode.ts +0 -15
- package/src/utils/objectUtils.ts +0 -117
- package/src/utils/popup.ts +0 -30
- package/src/utils/searchJson.ts +0 -51
- package/src/utils/stepUtils.ts +0 -45
- package/src/utils/truncate.ts +0 -6
- package/test/setup.ts +0 -1
- package/vitest.config.ts +0 -16
|
@@ -1,577 +0,0 @@
|
|
|
1
|
-
/* eslint-disable import/no-cycle */
|
|
2
|
-
/* eslint-disable @typescript-eslint/quotes */
|
|
3
|
-
import { html } from 'htm/preact';
|
|
4
|
-
import AppContext from '@/contexts/AppContext';
|
|
5
|
-
import { useEffect, useContext, useState } from 'preact/hooks';
|
|
6
|
-
import { Hint } from '@/components/Tooltip';
|
|
7
|
-
import { Loader } from '@/components/Loader';
|
|
8
|
-
|
|
9
|
-
import { Instance } from '@/interfaces';
|
|
10
|
-
import { CollapsedMenu } from '@/components/CollapsedMenu';
|
|
11
|
-
import { EditableText } from '@/components/EditableText';
|
|
12
|
-
import { Toggle } from '@/components/Toggle-v2';
|
|
13
|
-
import { Tag } from '@/components/Tag';
|
|
14
|
-
|
|
15
|
-
import { convertDateToStandard } from '@/utils/datetime';
|
|
16
|
-
|
|
17
|
-
import styles from './compactStyles.module.scss';
|
|
18
|
-
|
|
19
|
-
interface FlowInstanceRowProps {
|
|
20
|
-
instance: Instance;
|
|
21
|
-
onEditInstance?: (instance: Instance) => void;
|
|
22
|
-
onDelete?: (instance: Instance) => void;
|
|
23
|
-
isCompact?: boolean;
|
|
24
|
-
hideLastRunTime?: boolean;
|
|
25
|
-
hideInfoIcon?: boolean;
|
|
26
|
-
hideContextMenu?: boolean;
|
|
27
|
-
hideIntegrationToggle?: boolean;
|
|
28
|
-
}
|
|
29
|
-
interface FlowInstanceProps {
|
|
30
|
-
instances: Instance[];
|
|
31
|
-
onEditInstance: FlowInstanceRowProps['onEditInstance'];
|
|
32
|
-
onDelete: FlowInstanceRowProps['onDelete'];
|
|
33
|
-
updateInstanceName: (instanceId: number, name: string) => void;
|
|
34
|
-
isCompact?: boolean;
|
|
35
|
-
}
|
|
36
|
-
|
|
37
|
-
export const MenuIcon = () =>
|
|
38
|
-
html`<svg
|
|
39
|
-
width="20"
|
|
40
|
-
height="20"
|
|
41
|
-
viewBox="0 0 20 20"
|
|
42
|
-
fill="none"
|
|
43
|
-
xmlns="http://www.w3.org/2000/svg"
|
|
44
|
-
>
|
|
45
|
-
<path
|
|
46
|
-
fill-rule="evenodd"
|
|
47
|
-
clip-rule="evenodd"
|
|
48
|
-
d="M4.5 11C5.32843 11 6 10.3284 6 9.5C6 8.67157 5.32843 8 4.5 8C3.67157 8 3 8.67157 3 9.5C3 10.3284 3.67157 11 4.5 11Z"
|
|
49
|
-
fill="#999999"
|
|
50
|
-
/>
|
|
51
|
-
<path
|
|
52
|
-
fill-rule="evenodd"
|
|
53
|
-
clip-rule="evenodd"
|
|
54
|
-
d="M9.5 11C10.3284 11 11 10.3284 11 9.5C11 8.67157 10.3284 8 9.5 8C8.67157 8 8 8.67157 8 9.5C8 10.3284 8.67157 11 9.5 11Z"
|
|
55
|
-
fill="#999999"
|
|
56
|
-
/>
|
|
57
|
-
<path
|
|
58
|
-
fill-rule="evenodd"
|
|
59
|
-
clip-rule="evenodd"
|
|
60
|
-
d="M14.5 11C15.3284 11 16 10.3284 16 9.5C16 8.67157 15.3284 8 14.5 8C13.6716 8 13 8.67157 13 9.5C13 10.3284 13.6716 11 14.5 11Z"
|
|
61
|
-
fill="#999999"
|
|
62
|
-
/>
|
|
63
|
-
</svg>`;
|
|
64
|
-
|
|
65
|
-
export const InstanceBlockedInfo = (props: { instance: Instance }) => {
|
|
66
|
-
const {
|
|
67
|
-
error_app_name,
|
|
68
|
-
first_error_received_at,
|
|
69
|
-
status,
|
|
70
|
-
usage_limit_reached_at,
|
|
71
|
-
error_code,
|
|
72
|
-
} = props.instance;
|
|
73
|
-
|
|
74
|
-
const convertedTime = first_error_received_at
|
|
75
|
-
? convertDateToStandard(first_error_received_at)
|
|
76
|
-
: '';
|
|
77
|
-
|
|
78
|
-
const getBlockedReason = () => {
|
|
79
|
-
switch (status) {
|
|
80
|
-
case 'AUTH_MISSING':
|
|
81
|
-
// return `Authentication failed. Try to re-authenticate your account and enable the instance.`;
|
|
82
|
-
return `Integration has been blocked because\nof failed authentication. User needs to\nre-authenticate their account and enable\nthe integration.`;
|
|
83
|
-
case 'BLOCKED':
|
|
84
|
-
if (usage_limit_reached_at) {
|
|
85
|
-
return `Integration has been blocked because\nthe user limit has been reached`;
|
|
86
|
-
return `User limit is reached`;
|
|
87
|
-
}
|
|
88
|
-
if (error_code >= 500 && error_code <= 599) {
|
|
89
|
-
return `Integration has been blocked because\nof too many server errors`;
|
|
90
|
-
return error_app_name && convertedTime
|
|
91
|
-
? `Too many server errors from ${error_app_name} since ${convertedTime}. \nYou can try enabling the instance.`
|
|
92
|
-
: `Too many server errors. You can try enabling the instance.`;
|
|
93
|
-
}
|
|
94
|
-
if (error_code >= 400 && error_code <= 499) {
|
|
95
|
-
return `Integration has been blocked because of too many data errors`;
|
|
96
|
-
return error_app_name && convertedTime
|
|
97
|
-
? `Too many errors from ${error_app_name} since ${convertedTime} \ndue to a configuration issue. Try creating a new instance.`
|
|
98
|
-
: `Too many errors due to a configuration issue. Try create a new instance.`;
|
|
99
|
-
}
|
|
100
|
-
return '';
|
|
101
|
-
default:
|
|
102
|
-
return '';
|
|
103
|
-
}
|
|
104
|
-
};
|
|
105
|
-
const blockedReason = getBlockedReason();
|
|
106
|
-
return blockedReason
|
|
107
|
-
? html`<${Hint}
|
|
108
|
-
dismissOnClick=${false}
|
|
109
|
-
deltaY=${12}
|
|
110
|
-
position="fixed"
|
|
111
|
-
style="display: flex; flex-direction: row; align-items: center; justify-content: center;margin-right:6px;"
|
|
112
|
-
template=${(content: string) => html`<div>${blockedReason}</div>`}
|
|
113
|
-
>
|
|
114
|
-
<svg
|
|
115
|
-
width="16"
|
|
116
|
-
height="16"
|
|
117
|
-
viewBox="0 0 24 24"
|
|
118
|
-
fill="none"
|
|
119
|
-
xmlns="http://www.w3.org/2000/svg"
|
|
120
|
-
>
|
|
121
|
-
<path
|
|
122
|
-
data-hint="${blockedReason}"
|
|
123
|
-
d="M0 12C0 18.6268 5.37184 24 12 24C18.6268 24 24 18.6268 24 12C24 5.37322 18.6282 3.05176e-05 12 3.05176e-05C5.37319 3.05176e-05 0 5.37187 0 12Z"
|
|
124
|
-
fill="#F05C42"
|
|
125
|
-
/>
|
|
126
|
-
<path
|
|
127
|
-
d="M13.185 16.9089C13.185 15.3294 10.8164 15.3294 10.8164 16.9089C10.8164 18.4884 13.185 18.4884 13.185 16.9089Z"
|
|
128
|
-
fill="white"
|
|
129
|
-
/>
|
|
130
|
-
<path
|
|
131
|
-
d="M11.1582 13.2688C11.1582 13.7326 11.5342 14.1087 11.9981 14.1087V14.1087C12.462 14.1087 12.838 13.7326 12.838 13.2688V6.74489C12.838 6.28101 12.462 5.90497 11.9981 5.90497V5.90497C11.5342 5.90497 11.1582 6.28102 11.1582 6.74489V13.2688Z"
|
|
132
|
-
fill="white"
|
|
133
|
-
/>
|
|
134
|
-
</svg>
|
|
135
|
-
<//>`
|
|
136
|
-
: '';
|
|
137
|
-
};
|
|
138
|
-
|
|
139
|
-
export const InstanceStatusPill = (props: {
|
|
140
|
-
instance: Instance;
|
|
141
|
-
flowType: 'ON_DEMAND' | 'AUTOMATIC';
|
|
142
|
-
executionBehaviour: 'SAVE_ONLY' | 'SAVE_AND_EXECUTE';
|
|
143
|
-
}) => {
|
|
144
|
-
const {
|
|
145
|
-
instance,
|
|
146
|
-
flowType = 'AUTOMATIC',
|
|
147
|
-
executionBehaviour = 'SAVE_AND_EXECUTE',
|
|
148
|
-
} = props;
|
|
149
|
-
const {
|
|
150
|
-
last_run_status = null,
|
|
151
|
-
last_run_start_time = null,
|
|
152
|
-
status,
|
|
153
|
-
} = instance;
|
|
154
|
-
const getTagData = () => {
|
|
155
|
-
if (!last_run_status && !last_run_start_time && status === 'ACTIVE') {
|
|
156
|
-
return {
|
|
157
|
-
type: 'grey',
|
|
158
|
-
label:
|
|
159
|
-
flowType === 'ON_DEMAND' && executionBehaviour === 'SAVE_AND_EXECUTE'
|
|
160
|
-
? 'Queued'
|
|
161
|
-
: // : "Hasn't Run",
|
|
162
|
-
// : "No runs as yet",
|
|
163
|
-
'',
|
|
164
|
-
};
|
|
165
|
-
}
|
|
166
|
-
switch (last_run_status) {
|
|
167
|
-
case 'failed':
|
|
168
|
-
return {
|
|
169
|
-
type: 'fail',
|
|
170
|
-
// label: 'Failed',
|
|
171
|
-
label: 'Blocked',
|
|
172
|
-
};
|
|
173
|
-
case 'running...':
|
|
174
|
-
return {
|
|
175
|
-
type: 'info',
|
|
176
|
-
label: 'Running...',
|
|
177
|
-
};
|
|
178
|
-
case 'running':
|
|
179
|
-
return {
|
|
180
|
-
type: 'info',
|
|
181
|
-
label: 'Running...',
|
|
182
|
-
};
|
|
183
|
-
case 'ok':
|
|
184
|
-
return {
|
|
185
|
-
type: 'success',
|
|
186
|
-
label: 'Completed',
|
|
187
|
-
};
|
|
188
|
-
default:
|
|
189
|
-
return null;
|
|
190
|
-
}
|
|
191
|
-
};
|
|
192
|
-
|
|
193
|
-
const tagData = getTagData();
|
|
194
|
-
return tagData && (tagData.label || '') !== ''
|
|
195
|
-
? html`<${Tag}
|
|
196
|
-
type="${tagData.type}"
|
|
197
|
-
label="${tagData.label}"
|
|
198
|
-
className="flow-instance"
|
|
199
|
-
/>`
|
|
200
|
-
: '';
|
|
201
|
-
};
|
|
202
|
-
|
|
203
|
-
const lastRunTooltip: any = {
|
|
204
|
-
failed: 'Last run was aborted',
|
|
205
|
-
'running...': 'The integration is running',
|
|
206
|
-
running: 'The integration is running',
|
|
207
|
-
ok: 'Last run was completed',
|
|
208
|
-
};
|
|
209
|
-
|
|
210
|
-
export const InstanceStatusCompactPill = (props: {
|
|
211
|
-
instance: Instance;
|
|
212
|
-
flowType: 'ON_DEMAND' | 'AUTOMATIC';
|
|
213
|
-
executionBehaviour: 'SAVE_ONLY' | 'SAVE_AND_EXECUTE';
|
|
214
|
-
}) => {
|
|
215
|
-
const {
|
|
216
|
-
instance,
|
|
217
|
-
flowType = 'AUTOMATIC',
|
|
218
|
-
executionBehaviour = 'SAVE_AND_EXECUTE',
|
|
219
|
-
} = props;
|
|
220
|
-
const {
|
|
221
|
-
last_run_status = null,
|
|
222
|
-
last_run_start_time = null,
|
|
223
|
-
status,
|
|
224
|
-
} = instance;
|
|
225
|
-
const getTagData = () => {
|
|
226
|
-
if (!last_run_status && !last_run_start_time && status === 'ACTIVE') {
|
|
227
|
-
return {
|
|
228
|
-
type: 'grey',
|
|
229
|
-
label:
|
|
230
|
-
flowType === 'ON_DEMAND' && executionBehaviour === 'SAVE_AND_EXECUTE'
|
|
231
|
-
? 'Queued'
|
|
232
|
-
: // : "Hasn't Run",
|
|
233
|
-
// : "No runs as yet",
|
|
234
|
-
'',
|
|
235
|
-
};
|
|
236
|
-
}
|
|
237
|
-
switch (last_run_status) {
|
|
238
|
-
case 'failed':
|
|
239
|
-
return {
|
|
240
|
-
type: 'fail',
|
|
241
|
-
// label: 'Failed',
|
|
242
|
-
label: 'Aborted',
|
|
243
|
-
icon: html`
|
|
244
|
-
<svg
|
|
245
|
-
width="12"
|
|
246
|
-
height="12"
|
|
247
|
-
viewBox="0 0 24 24"
|
|
248
|
-
fill="none"
|
|
249
|
-
xmlns="http://www.w3.org/2000/svg"
|
|
250
|
-
>
|
|
251
|
-
<circle
|
|
252
|
-
data-hint="${lastRunTooltip[last_run_status]}"
|
|
253
|
-
cx="12"
|
|
254
|
-
cy="12"
|
|
255
|
-
r="12"
|
|
256
|
-
fill="#FDEFEC"
|
|
257
|
-
/>
|
|
258
|
-
<path
|
|
259
|
-
d="M16 8L8 16"
|
|
260
|
-
stroke="#F05C42"
|
|
261
|
-
stroke-width="2"
|
|
262
|
-
stroke-linecap="round"
|
|
263
|
-
stroke-linejoin="round"
|
|
264
|
-
/>
|
|
265
|
-
<path
|
|
266
|
-
d="M8 8L16 16"
|
|
267
|
-
stroke="#F05C42"
|
|
268
|
-
stroke-width="2"
|
|
269
|
-
stroke-linecap="round"
|
|
270
|
-
stroke-linejoin="round"
|
|
271
|
-
/>
|
|
272
|
-
</svg>
|
|
273
|
-
`,
|
|
274
|
-
tooltip: `Last run was aborted`,
|
|
275
|
-
};
|
|
276
|
-
case 'running...':
|
|
277
|
-
return {
|
|
278
|
-
type: 'info',
|
|
279
|
-
label: 'Running...',
|
|
280
|
-
icon: html`
|
|
281
|
-
<svg
|
|
282
|
-
width="12"
|
|
283
|
-
height="12"
|
|
284
|
-
viewBox="0 0 24 24"
|
|
285
|
-
fill="none"
|
|
286
|
-
xmlns="http://www.w3.org/2000/svg"
|
|
287
|
-
>
|
|
288
|
-
<circle
|
|
289
|
-
data-hint="${lastRunTooltip[last_run_status]}"
|
|
290
|
-
cx="12"
|
|
291
|
-
cy="12"
|
|
292
|
-
r="12"
|
|
293
|
-
fill="#CAE1FC"
|
|
294
|
-
/>
|
|
295
|
-
<circle cx="6" cy="12" r="2" fill="#509CF6" />
|
|
296
|
-
<circle opacity="0.5" cx="12" cy="12" r="2" fill="#509CF6" />
|
|
297
|
-
<circle opacity="0.3" cx="18" cy="12" r="2" fill="#509CF6" />
|
|
298
|
-
</svg>
|
|
299
|
-
`,
|
|
300
|
-
tooltip: `The integration is running`,
|
|
301
|
-
};
|
|
302
|
-
case 'running':
|
|
303
|
-
return {
|
|
304
|
-
type: 'info',
|
|
305
|
-
label: 'Running...',
|
|
306
|
-
icon: html`
|
|
307
|
-
<svg
|
|
308
|
-
width="12"
|
|
309
|
-
height="12"
|
|
310
|
-
viewBox="0 0 24 24"
|
|
311
|
-
fill="none"
|
|
312
|
-
xmlns="http://www.w3.org/2000/svg"
|
|
313
|
-
>
|
|
314
|
-
<circle
|
|
315
|
-
data-hint="${lastRunTooltip[last_run_status]}"
|
|
316
|
-
cx="12"
|
|
317
|
-
cy="12"
|
|
318
|
-
r="12"
|
|
319
|
-
fill="#CAE1FC"
|
|
320
|
-
/>
|
|
321
|
-
<circle cx="6" cy="12" r="2" fill="#509CF6" />
|
|
322
|
-
<circle opacity="0.5" cx="12" cy="12" r="2" fill="#509CF6" />
|
|
323
|
-
<circle opacity="0.3" cx="18" cy="12" r="2" fill="#509CF6" />
|
|
324
|
-
</svg>
|
|
325
|
-
`,
|
|
326
|
-
tooltip: `The integration is running`,
|
|
327
|
-
};
|
|
328
|
-
case 'ok':
|
|
329
|
-
return {
|
|
330
|
-
type: 'success',
|
|
331
|
-
label: 'Completed',
|
|
332
|
-
icon: html`
|
|
333
|
-
<svg
|
|
334
|
-
width="12"
|
|
335
|
-
height="12"
|
|
336
|
-
viewBox="0 0 24 24"
|
|
337
|
-
fill="none"
|
|
338
|
-
xmlns="http://www.w3.org/2000/svg"
|
|
339
|
-
>
|
|
340
|
-
<circle
|
|
341
|
-
data-hint="${lastRunTooltip[last_run_status]}"
|
|
342
|
-
cx="12"
|
|
343
|
-
cy="12"
|
|
344
|
-
r="12"
|
|
345
|
-
fill="#C4E9D2"
|
|
346
|
-
/>
|
|
347
|
-
<path
|
|
348
|
-
d="M17 8L10.441 15.5L7 11.5653"
|
|
349
|
-
stroke="#3BB568"
|
|
350
|
-
stroke-width="2"
|
|
351
|
-
stroke-linecap="round"
|
|
352
|
-
/>
|
|
353
|
-
</svg>
|
|
354
|
-
`,
|
|
355
|
-
tooltip: `Last run was completed`,
|
|
356
|
-
};
|
|
357
|
-
default:
|
|
358
|
-
return null;
|
|
359
|
-
}
|
|
360
|
-
};
|
|
361
|
-
|
|
362
|
-
const tagData = getTagData();
|
|
363
|
-
return tagData && (tagData.label || '') !== ''
|
|
364
|
-
? // ? html`<${Hint} deltaY=${12} position="fixed" style="display: flex; flex-direction: row; align-items: center; justify-content: flex-start;" disabled=${!tagData.tooltip}>${tagData.icon}<//>`
|
|
365
|
-
html`${tagData.icon}`
|
|
366
|
-
: '';
|
|
367
|
-
};
|
|
368
|
-
|
|
369
|
-
export const FlowInstanceRow = (props: FlowInstanceRowProps) => {
|
|
370
|
-
const {
|
|
371
|
-
instance,
|
|
372
|
-
onEditInstance,
|
|
373
|
-
onDelete,
|
|
374
|
-
isCompact = false,
|
|
375
|
-
hideLastRunTime = false,
|
|
376
|
-
hideInfoIcon = false,
|
|
377
|
-
hideContextMenu = false,
|
|
378
|
-
hideIntegrationToggle = false,
|
|
379
|
-
} = props;
|
|
380
|
-
const context = useContext(AppContext);
|
|
381
|
-
const [instanceStatus, setInstanceStatus] = useState<Instance['status']>(
|
|
382
|
-
instance.status,
|
|
383
|
-
);
|
|
384
|
-
const [isDeleting, setIsDeleting] = useState(false);
|
|
385
|
-
|
|
386
|
-
useEffect(() => {
|
|
387
|
-
setInstanceStatus(instance.status);
|
|
388
|
-
}, [instance.status]);
|
|
389
|
-
|
|
390
|
-
const toggleIntegration = (instanceId: number, value: boolean) => {
|
|
391
|
-
setInstanceStatus(value ? 'ACTIVE' : 'INACTIVE'); // optimistic update
|
|
392
|
-
context?.apiHandler
|
|
393
|
-
.toggleIntegration(instanceId, value)
|
|
394
|
-
.catch((err: unknown) => {
|
|
395
|
-
console.error(err);
|
|
396
|
-
setInstanceStatus(instance.status);
|
|
397
|
-
});
|
|
398
|
-
};
|
|
399
|
-
const handleOptionSelect = (
|
|
400
|
-
option: { id: string; label: string },
|
|
401
|
-
selectedInstance: Instance,
|
|
402
|
-
) => {
|
|
403
|
-
switch (option.id) {
|
|
404
|
-
case 'edit':
|
|
405
|
-
if (onEditInstance) {
|
|
406
|
-
onEditInstance(selectedInstance);
|
|
407
|
-
}
|
|
408
|
-
break;
|
|
409
|
-
case 'delete':
|
|
410
|
-
setIsDeleting(true);
|
|
411
|
-
if (onDelete) onDelete(selectedInstance);
|
|
412
|
-
break;
|
|
413
|
-
default:
|
|
414
|
-
break;
|
|
415
|
-
}
|
|
416
|
-
};
|
|
417
|
-
|
|
418
|
-
return html`
|
|
419
|
-
${!hideLastRunTime &&
|
|
420
|
-
html` <${Hint} style="" position="fixed" deltaY=${14}>
|
|
421
|
-
<div
|
|
422
|
-
data-hint="${lastRunTooltip[instance.last_run_status]}"
|
|
423
|
-
class="${styles.flowInstanceColumn} ${styles.instanceRunTime}"
|
|
424
|
-
style="${isCompact
|
|
425
|
-
? 'display:flex;flex-direction:row;align-items:center;justify-content:flex-start;gap:4px;'
|
|
426
|
-
: 'flex: 1;'}"
|
|
427
|
-
>
|
|
428
|
-
${instance.last_run_start_time
|
|
429
|
-
? convertDateToStandard(instance.last_run_start_time)
|
|
430
|
-
: `No runs as yet`}
|
|
431
|
-
${isCompact &&
|
|
432
|
-
html`<${InstanceStatusCompactPill} instance=${instance} />`}
|
|
433
|
-
</div>
|
|
434
|
-
<//>`}
|
|
435
|
-
${!isCompact &&
|
|
436
|
-
html` <div
|
|
437
|
-
class="${styles.flowInstanceColumn}"
|
|
438
|
-
style="margin-right: 8px;display:flex;flex-direction:row;align-items:center;justify-content:center;"
|
|
439
|
-
>
|
|
440
|
-
${html`<${isCompact ? InstanceStatusCompactPill : InstanceStatusPill}
|
|
441
|
-
instance=${instance}
|
|
442
|
-
/>`}
|
|
443
|
-
</div>`}
|
|
444
|
-
<div
|
|
445
|
-
onClick=${(e: any) => {
|
|
446
|
-
e.stopPropagation();
|
|
447
|
-
}}
|
|
448
|
-
class="${styles.flowInstanceColumn} ${styles.instanceStatus}"
|
|
449
|
-
style="${'display: flex; flex-direction: row; align-items: center; justify-content: flex-end; gap: 0px; margin-top: -16.5px;'}"
|
|
450
|
-
>
|
|
451
|
-
${!hideInfoIcon &&
|
|
452
|
-
instanceStatus === 'BLOCKED' &&
|
|
453
|
-
html`<${InstanceBlockedInfo} instance=${instance} />`}
|
|
454
|
-
${!hideIntegrationToggle &&
|
|
455
|
-
html`<${Toggle}
|
|
456
|
-
id=${instance.id}
|
|
457
|
-
value=${isDeleting ? false : instanceStatus === 'ACTIVE'}
|
|
458
|
-
disabled=${isDeleting}
|
|
459
|
-
onChange=${(value: boolean) => {
|
|
460
|
-
if (!isDeleting) {
|
|
461
|
-
toggleIntegration(instance.id, value);
|
|
462
|
-
}
|
|
463
|
-
}}
|
|
464
|
-
size=${isCompact ? 'sm' : 'lg'}
|
|
465
|
-
/>`}
|
|
466
|
-
${isDeleting
|
|
467
|
-
? html`<div style="margin: 0 6px; margin-bottom: -3px;">
|
|
468
|
-
<${Loader} size="sm" />
|
|
469
|
-
</div>`
|
|
470
|
-
: !hideContextMenu &&
|
|
471
|
-
html` <${CollapsedMenu}
|
|
472
|
-
verticalIcon=${true}
|
|
473
|
-
className="instanceMenu"
|
|
474
|
-
options=${[
|
|
475
|
-
...(onEditInstance
|
|
476
|
-
? [
|
|
477
|
-
{
|
|
478
|
-
id: 'edit',
|
|
479
|
-
label: 'Edit',
|
|
480
|
-
},
|
|
481
|
-
]
|
|
482
|
-
: []),
|
|
483
|
-
...(onDelete
|
|
484
|
-
? [
|
|
485
|
-
{
|
|
486
|
-
id: 'delete',
|
|
487
|
-
label: 'Delete',
|
|
488
|
-
},
|
|
489
|
-
]
|
|
490
|
-
: []),
|
|
491
|
-
]}
|
|
492
|
-
onOptionSelect=${(option: { id: string; label: string }) =>
|
|
493
|
-
handleOptionSelect(option, instance)}
|
|
494
|
-
/>`}
|
|
495
|
-
</div>
|
|
496
|
-
<!--<div class="${styles.flowInstanceColumn}" style="display: flex; flex-direction: row; align-items: center; justify-content: flex-start;${isDeleting
|
|
497
|
-
? 'margin: 0 6px;'
|
|
498
|
-
: ''}">
|
|
499
|
-
</div>-->
|
|
500
|
-
`;
|
|
501
|
-
};
|
|
502
|
-
|
|
503
|
-
const FlowInstance = (props: FlowInstanceProps) => {
|
|
504
|
-
const {
|
|
505
|
-
instances,
|
|
506
|
-
onEditInstance,
|
|
507
|
-
updateInstanceName,
|
|
508
|
-
onDelete,
|
|
509
|
-
isCompact = false,
|
|
510
|
-
} = props;
|
|
511
|
-
const context = useContext(AppContext);
|
|
512
|
-
|
|
513
|
-
const onUpdateName = (instanceId: number, name: string) => {
|
|
514
|
-
const oldName =
|
|
515
|
-
instances.find((instance) => instance.id === instanceId)?.name || '';
|
|
516
|
-
updateInstanceName(instanceId, name);
|
|
517
|
-
context?.apiHandler
|
|
518
|
-
.renameIntegration(`${instanceId}`, name)
|
|
519
|
-
.then((integrationData) => {
|
|
520
|
-
if (!integrationData) {
|
|
521
|
-
updateInstanceName(instanceId, oldName);
|
|
522
|
-
throw new Error('Could not update integration name');
|
|
523
|
-
}
|
|
524
|
-
})
|
|
525
|
-
.catch((err) => {
|
|
526
|
-
console.error(err);
|
|
527
|
-
updateInstanceName(instanceId, oldName);
|
|
528
|
-
});
|
|
529
|
-
};
|
|
530
|
-
return html`
|
|
531
|
-
<div class="${styles.flowInstanceContainer}">
|
|
532
|
-
${instances.map(
|
|
533
|
-
(instance) => html`
|
|
534
|
-
<div class="${styles.flowInstancesContainer}">
|
|
535
|
-
<svg
|
|
536
|
-
xmlns="http://www.w3.org/2000/svg"
|
|
537
|
-
width="13"
|
|
538
|
-
height="15"
|
|
539
|
-
viewBox="0 0 13 15"
|
|
540
|
-
fill="none"
|
|
541
|
-
>
|
|
542
|
-
<path
|
|
543
|
-
d="M12.677 11.5703C12.8723 11.375 12.8723 11.0584 12.677 10.8632L9.49501 7.68121C9.29975 7.48595 8.98316 7.48595 8.7879 7.68121C8.59264 7.87647 8.59264 8.19306 8.7879 8.38832L11.6163 11.2167L8.78791 14.0452C8.59264 14.2404 8.59264 14.557 8.78791 14.7523C8.98317 14.9475 9.29975 14.9475 9.49501 14.7523L12.677 11.5703ZM1.00571 11.2167L0.505714 11.2167L0.505697 11.7168L1.00571 11.7167L1.00571 11.2167ZM0.506052 1.30357C0.506043 1.57971 0.729893 1.80358 1.00604 1.80358C1.28218 1.80359 1.50604 1.57974 1.50605 1.3036L0.506052 1.30357ZM1.50599 3.106C1.506 2.82985 1.28215 2.60599 1.00601 2.60598C0.729866 2.60597 0.506 2.82982 0.50599 3.10596L1.50599 3.106ZM0.505929 4.90836C0.505919 5.1845 0.729769 5.40836 1.00591 5.40837C1.28205 5.40838 1.50592 5.18453 1.50593 4.90839L0.505929 4.90836ZM1.50587 6.71078C1.50588 6.43464 1.28203 6.21077 1.00588 6.21077C0.729742 6.21076 0.505877 6.43461 0.505868 6.71075L1.50587 6.71078ZM0.505806 8.51314C0.505797 8.78928 0.729647 9.01315 1.00579 9.01316C1.28193 9.01317 1.5058 8.78932 1.50581 8.51318L0.505806 8.51314ZM1.50574 10.3156C1.50575 10.0394 1.2819 9.81556 1.00576 9.81555C0.72962 9.81554 0.505754 10.0394 0.505745 10.3155L1.50574 10.3156ZM1.94886 11.7167C2.225 11.7167 2.44886 11.4929 2.44886 11.2167C2.44886 10.9406 2.225 10.7167 1.94886 10.7167L1.94886 11.7167ZM3.83514 10.7167C3.559 10.7167 3.33514 10.9406 3.33514 11.2167C3.33515 11.4929 3.559 11.7167 3.83515 11.7167L3.83514 10.7167ZM5.72143 11.7167C5.99757 11.7167 6.22143 11.4929 6.22143 11.2167C6.22143 10.9406 5.99757 10.7167 5.72143 10.7167L5.72143 11.7167ZM7.60772 10.7167C7.33158 10.7167 7.10772 10.9406 7.10772 11.2167C7.10772 11.4929 7.33158 11.7167 7.60772 11.7167L7.60772 10.7167ZM9.49401 11.7167C9.77015 11.7167 9.99401 11.4929 9.99401 11.2167C9.99401 10.9406 9.77015 10.7167 9.49401 10.7167L9.49401 11.7167ZM11.3803 10.7167C11.1042 10.7167 10.8803 10.9406 10.8803 11.2167C10.8803 11.4929 11.1042 11.7167 11.3803 11.7167L11.3803 10.7167ZM0.506083 0.402371L0.506052 1.30357L1.50605 1.3036L1.50608 0.402405L0.506083 0.402371ZM0.50599 3.10596L0.505929 4.90836L1.50593 4.90839L1.50599 3.106L0.50599 3.10596ZM0.505868 6.71075L0.505806 8.51314L1.50581 8.51318L1.50587 6.71078L0.505868 6.71075ZM0.505745 10.3155L0.505714 11.2167L1.50571 11.2168L1.50574 10.3156L0.505745 10.3155ZM1.00571 11.7167L1.94886 11.7167L1.94886 10.7167L1.00571 10.7167L1.00571 11.7167ZM3.83515 11.7167L5.72143 11.7167L5.72143 10.7167L3.83514 10.7167L3.83515 11.7167ZM7.60772 11.7167L9.49401 11.7167L9.49401 10.7167L7.60772 10.7167L7.60772 11.7167ZM11.3803 11.7167L12.3234 11.7167L12.3234 10.7167L11.3803 10.7167L11.3803 11.7167Z"
|
|
544
|
-
fill="#D6D6D6"
|
|
545
|
-
/>
|
|
546
|
-
</svg>
|
|
547
|
-
<div
|
|
548
|
-
class="${styles.flowInstanceRow} ${styles.flowInstanceMultipleRow}"
|
|
549
|
-
key=${`instance-id-flow-row-${instance.id}`}
|
|
550
|
-
>
|
|
551
|
-
<${EditableText}
|
|
552
|
-
value=${instance.name}
|
|
553
|
-
handleChange=${(name: string) =>
|
|
554
|
-
onUpdateName(instance.id, name)}
|
|
555
|
-
wrapperClassName=${styles.editableTextWrapper}
|
|
556
|
-
customStyles=${{
|
|
557
|
-
wrapperClassName: styles.editableTextWrapper,
|
|
558
|
-
inputClassName: styles.inlineEditInput,
|
|
559
|
-
}}
|
|
560
|
-
/>
|
|
561
|
-
<div class=${styles.flowInstanceRowMeta}>
|
|
562
|
-
<${FlowInstanceRow}
|
|
563
|
-
instance=${instance}
|
|
564
|
-
onEditInstance=${onEditInstance}
|
|
565
|
-
onDelete=${onDelete}
|
|
566
|
-
isCompact=${isCompact}
|
|
567
|
-
/>
|
|
568
|
-
</div>
|
|
569
|
-
</div>
|
|
570
|
-
</div>
|
|
571
|
-
`,
|
|
572
|
-
)}
|
|
573
|
-
</div>
|
|
574
|
-
`;
|
|
575
|
-
};
|
|
576
|
-
|
|
577
|
-
export default FlowInstance;
|
|
@@ -1,83 +0,0 @@
|
|
|
1
|
-
import { Flow, Instance, UserConfig } from '@/interfaces';
|
|
2
|
-
import { actionFunctions } from '@/store';
|
|
3
|
-
import { MarketplaceRenderModes, ViewStyles } from '@/types';
|
|
4
|
-
import { StoreType } from '@/types/store';
|
|
5
|
-
import { html } from 'htm/preact';
|
|
6
|
-
import { useEffect } from 'preact/hooks';
|
|
7
|
-
import { connect } from 'unistore/preact';
|
|
8
|
-
import FlowCard from './flowCard';
|
|
9
|
-
import FlowCardCompact from './flowCardCompact';
|
|
10
|
-
|
|
11
|
-
import styles from './styles.module.scss';
|
|
12
|
-
|
|
13
|
-
interface WraperrProps extends StoreType {
|
|
14
|
-
marketplaceId: string;
|
|
15
|
-
userConfig?: UserConfig;
|
|
16
|
-
accountVerified: boolean;
|
|
17
|
-
renderMode: MarketplaceRenderModes;
|
|
18
|
-
onFlowSelect: (flowId: Flow, instance?: Instance) => void;
|
|
19
|
-
updateInstanceName: (
|
|
20
|
-
flowId: number,
|
|
21
|
-
instanceId: number,
|
|
22
|
-
name: string,
|
|
23
|
-
) => void;
|
|
24
|
-
appFlows: Flow[];
|
|
25
|
-
onDeleteInstance?: (instance: any) => void;
|
|
26
|
-
appData?: any;
|
|
27
|
-
}
|
|
28
|
-
|
|
29
|
-
const AppFlowListing = (props: WraperrProps) => {
|
|
30
|
-
const {
|
|
31
|
-
onFlowSelect,
|
|
32
|
-
updateInstanceName,
|
|
33
|
-
appFlows,
|
|
34
|
-
accountVerified,
|
|
35
|
-
renderMode,
|
|
36
|
-
onDeleteInstance,
|
|
37
|
-
genericData,
|
|
38
|
-
appData,
|
|
39
|
-
} = props;
|
|
40
|
-
|
|
41
|
-
useEffect(() => {
|
|
42
|
-
props.resetTemplateFields();
|
|
43
|
-
}, []);
|
|
44
|
-
|
|
45
|
-
return html`
|
|
46
|
-
<div
|
|
47
|
-
id="${`embed--flowCardContainer__${renderMode}`}"
|
|
48
|
-
class="${styles.flowCardContainer} ${styles.integryScrollbar} ${renderMode ===
|
|
49
|
-
MarketplaceRenderModes.INLINE
|
|
50
|
-
? styles.inlineFlowContainer
|
|
51
|
-
: ''}"
|
|
52
|
-
>
|
|
53
|
-
${appFlows.map(
|
|
54
|
-
(template: any) => html`
|
|
55
|
-
<${genericData.viewStyle === ViewStyles.COMPACT ? FlowCardCompact : FlowCard}
|
|
56
|
-
flow=${template}
|
|
57
|
-
flowIcon=${appData ? appData.icon_url : ""}
|
|
58
|
-
accountVerified=${accountVerified}
|
|
59
|
-
onFlowSelect=${onFlowSelect}
|
|
60
|
-
updateInstanceName=${updateInstanceName}
|
|
61
|
-
onDeleteInstance=${(instance: any) => {
|
|
62
|
-
if (onDeleteInstance) {
|
|
63
|
-
onDeleteInstance({...instance, template_detail: template});
|
|
64
|
-
}
|
|
65
|
-
}}
|
|
66
|
-
customStyle=${`max-width: 364px; width: 100%;`}
|
|
67
|
-
/>
|
|
68
|
-
`,
|
|
69
|
-
)}
|
|
70
|
-
</div>
|
|
71
|
-
`;
|
|
72
|
-
};
|
|
73
|
-
|
|
74
|
-
export default connect<WraperrProps, unknown, StoreType, unknown>(
|
|
75
|
-
[
|
|
76
|
-
'userConfig',
|
|
77
|
-
'genericData',
|
|
78
|
-
'showMarketplaceModal',
|
|
79
|
-
'showMarketplaceAppPageId',
|
|
80
|
-
'IUAccountsData',
|
|
81
|
-
],
|
|
82
|
-
actionFunctions,
|
|
83
|
-
)(AppFlowListing);
|