@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,295 +0,0 @@
|
|
|
1
|
-
/* eslint-disable import/no-cycle */
|
|
2
|
-
/* eslint-disable no-nested-ternary */
|
|
3
|
-
import { html } from 'htm/preact';
|
|
4
|
-
import { connect } from 'unistore/preact';
|
|
5
|
-
import {
|
|
6
|
-
useEffect,
|
|
7
|
-
useState,
|
|
8
|
-
} from 'preact/hooks';
|
|
9
|
-
import { InstanceStatusPill, MenuIcon } from '@/features/containers/AppFlowContainer/AppFlowListing/flow-instance';
|
|
10
|
-
import { Toggle } from '@/components/Toggle-v2';
|
|
11
|
-
import { CollapsedMenu } from '@/components/CollapsedMenu';
|
|
12
|
-
import { EditableText } from '@/components/EditableText';
|
|
13
|
-
|
|
14
|
-
import { StoreType } from '@/types/store';
|
|
15
|
-
import { actionFunctions } from '@/store';
|
|
16
|
-
import { TemplateListingRenderModes } from '@/types';
|
|
17
|
-
import { convertDateToStandard } from '@/utils/datetime';
|
|
18
|
-
import { Instance, Integration, Template as TemplateType } from '@/interfaces';
|
|
19
|
-
|
|
20
|
-
import style from './styles.module.scss';
|
|
21
|
-
|
|
22
|
-
export type FlowCardProps = {
|
|
23
|
-
id: number | string;
|
|
24
|
-
imgUrl: string;
|
|
25
|
-
name: string;
|
|
26
|
-
description: string;
|
|
27
|
-
tags: string;
|
|
28
|
-
layout: TemplateListingRenderModes;
|
|
29
|
-
handleClick: () => void;
|
|
30
|
-
apiHandler?: any;
|
|
31
|
-
app?: {
|
|
32
|
-
id: number;
|
|
33
|
-
}
|
|
34
|
-
onEdit?: (instance: Instance) => void;
|
|
35
|
-
onDelete?: (instance: Instance) => void;
|
|
36
|
-
onEditName?: ({
|
|
37
|
-
instance,
|
|
38
|
-
newName
|
|
39
|
-
}: {
|
|
40
|
-
instance: Instance;
|
|
41
|
-
newName: string;
|
|
42
|
-
}) => void;
|
|
43
|
-
dFlag?: string;
|
|
44
|
-
templateObj?: TemplateType | any;
|
|
45
|
-
};
|
|
46
|
-
|
|
47
|
-
type State = {
|
|
48
|
-
loading: boolean;
|
|
49
|
-
filteredTemplates: TemplateType[];
|
|
50
|
-
error: string | null;
|
|
51
|
-
query: string;
|
|
52
|
-
};
|
|
53
|
-
|
|
54
|
-
const Template = (props: FlowCardProps) => {
|
|
55
|
-
|
|
56
|
-
const { apiHandler, app, id, onEdit, onDelete, dFlag } = props;
|
|
57
|
-
const [maxInstanceNameSize, setMaxInstanceNameSize] = useState(150);
|
|
58
|
-
// const [spliceName, setSpliceName] = useState(0);
|
|
59
|
-
const [template, setTemplateMeta] = useState({
|
|
60
|
-
id,
|
|
61
|
-
name: props.name,
|
|
62
|
-
description: props.description,
|
|
63
|
-
execution_type: 'AUTOMATIC',
|
|
64
|
-
instances: [],
|
|
65
|
-
});
|
|
66
|
-
|
|
67
|
-
const getTextWidth = (text: string, font: string): number => {
|
|
68
|
-
const canvas = document.createElement('canvas');
|
|
69
|
-
const canvasContext = canvas.getContext('2d');
|
|
70
|
-
if (!canvasContext) {
|
|
71
|
-
return 150;
|
|
72
|
-
}
|
|
73
|
-
canvasContext.font = font;
|
|
74
|
-
const metrics = canvasContext.measureText(text);
|
|
75
|
-
return Math.round(metrics.width) + 8;
|
|
76
|
-
}
|
|
77
|
-
|
|
78
|
-
const handleInstanceGridWidth = (templateMeta: any) => {
|
|
79
|
-
// get maximum name size from integrations and convet to px
|
|
80
|
-
let maxNameSize = maxInstanceNameSize;
|
|
81
|
-
|
|
82
|
-
templateMeta.instances.forEach((instance: any) => {
|
|
83
|
-
const nameLengthInPX = getTextWidth(instance.name, '12px Inter');
|
|
84
|
-
if (nameLengthInPX > maxNameSize) {
|
|
85
|
-
maxNameSize = nameLengthInPX;
|
|
86
|
-
}
|
|
87
|
-
});
|
|
88
|
-
|
|
89
|
-
if (maxNameSize > maxInstanceNameSize) {
|
|
90
|
-
// if (maxNameSize < 290) {
|
|
91
|
-
// setMaxInstanceNameSize(maxNameSize + 10)
|
|
92
|
-
// } else {
|
|
93
|
-
// setSpliceName(maxNameSize - 310);
|
|
94
|
-
// setMaxInstanceNameSize(300);
|
|
95
|
-
// }
|
|
96
|
-
setMaxInstanceNameSize(maxNameSize + 10)
|
|
97
|
-
}
|
|
98
|
-
};
|
|
99
|
-
|
|
100
|
-
const getAppFlows = () => {
|
|
101
|
-
if (app) {
|
|
102
|
-
apiHandler.getAppFlows(app.id).then((data: any) => {
|
|
103
|
-
const { results = []} = data;
|
|
104
|
-
results.forEach((flow: any) => {
|
|
105
|
-
if (flow.id === id) {
|
|
106
|
-
const { instances = [] } = flow;
|
|
107
|
-
let tempInstances = [];
|
|
108
|
-
if (instances.length > 0) {
|
|
109
|
-
tempInstances = instances.map((instance: any) => ({
|
|
110
|
-
...instance,
|
|
111
|
-
id: instance.id,
|
|
112
|
-
name: `${instance.name}`,
|
|
113
|
-
status: instance.status,
|
|
114
|
-
last_run_start_time: instance.last_run_start_time,
|
|
115
|
-
}))
|
|
116
|
-
}
|
|
117
|
-
setTemplateMeta({
|
|
118
|
-
id,
|
|
119
|
-
...flow,
|
|
120
|
-
instances: tempInstances,
|
|
121
|
-
})
|
|
122
|
-
handleInstanceGridWidth(
|
|
123
|
-
{
|
|
124
|
-
id,
|
|
125
|
-
...flow,
|
|
126
|
-
instances: tempInstances,
|
|
127
|
-
}
|
|
128
|
-
);
|
|
129
|
-
}
|
|
130
|
-
});
|
|
131
|
-
});
|
|
132
|
-
}
|
|
133
|
-
};
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
const pollGetAppFlows= (frequency: number, pollInstances = 1, currentPolInstace = 0) => {
|
|
137
|
-
if (currentPolInstace < pollInstances) {
|
|
138
|
-
getAppFlows();
|
|
139
|
-
setTimeout(() => {
|
|
140
|
-
pollGetAppFlows(frequency, pollInstances, currentPolInstace + 1);
|
|
141
|
-
}, frequency);
|
|
142
|
-
}
|
|
143
|
-
}
|
|
144
|
-
|
|
145
|
-
const toggleIntegration = (instanceId: number, value: boolean) => {
|
|
146
|
-
apiHandler
|
|
147
|
-
.toggleIntegration(instanceId, value)
|
|
148
|
-
.catch((err: unknown) => {
|
|
149
|
-
console.error(err);
|
|
150
|
-
})
|
|
151
|
-
.finally(() => {
|
|
152
|
-
getAppFlows();
|
|
153
|
-
});
|
|
154
|
-
};
|
|
155
|
-
|
|
156
|
-
const handleOptionSelect = (option: { id: string; label: string }, instance: Instance) => {
|
|
157
|
-
switch (option.id) {
|
|
158
|
-
case 'edit':
|
|
159
|
-
if(onEdit) onEdit(instance);
|
|
160
|
-
break;
|
|
161
|
-
case 'delete':
|
|
162
|
-
if(onDelete) onDelete(instance);
|
|
163
|
-
break;
|
|
164
|
-
default:
|
|
165
|
-
break;
|
|
166
|
-
}
|
|
167
|
-
};
|
|
168
|
-
|
|
169
|
-
const onUpdateName = (integration: Integration, name: string) => {
|
|
170
|
-
apiHandler
|
|
171
|
-
.renameIntegration(`${integration.id}`, name)
|
|
172
|
-
.then((integrationData: any) => {
|
|
173
|
-
if (!integrationData) {
|
|
174
|
-
throw new Error('Could not update integration name');
|
|
175
|
-
}
|
|
176
|
-
})
|
|
177
|
-
.catch((err: any) => console.error(err));
|
|
178
|
-
};
|
|
179
|
-
|
|
180
|
-
const handleOnEditName = (newName: string, instance: Integration) => {
|
|
181
|
-
const tempInstances: any = template.instances.map((el: Instance) => {
|
|
182
|
-
if (el.id === instance.id) {
|
|
183
|
-
return {
|
|
184
|
-
...el,
|
|
185
|
-
name: newName,
|
|
186
|
-
}
|
|
187
|
-
}
|
|
188
|
-
return el;
|
|
189
|
-
})
|
|
190
|
-
setTemplateMeta({
|
|
191
|
-
...template,
|
|
192
|
-
instances: tempInstances,
|
|
193
|
-
});
|
|
194
|
-
handleInstanceGridWidth(
|
|
195
|
-
{
|
|
196
|
-
...template,
|
|
197
|
-
instances: tempInstances,
|
|
198
|
-
}
|
|
199
|
-
);
|
|
200
|
-
onUpdateName(instance, newName);
|
|
201
|
-
}
|
|
202
|
-
|
|
203
|
-
useEffect(() => {
|
|
204
|
-
// pollGetAppFlows(1000, 5, 0);
|
|
205
|
-
const { templateObj } = props;
|
|
206
|
-
setTemplateMeta(templateObj);
|
|
207
|
-
}, [dFlag, props.templateObj, props.templateObj.instances.length]);
|
|
208
|
-
const getLastRunStart = (dateTimeString: string): string => {
|
|
209
|
-
if (!dateTimeString) {
|
|
210
|
-
// return 'Never';
|
|
211
|
-
return 'No runs as yet';
|
|
212
|
-
}
|
|
213
|
-
|
|
214
|
-
return convertDateToStandard(dateTimeString);
|
|
215
|
-
}
|
|
216
|
-
|
|
217
|
-
const integrations = template.instances || [];
|
|
218
|
-
return html`
|
|
219
|
-
<div class="${props.layout === TemplateListingRenderModes.LIST
|
|
220
|
-
? style.template_list_view
|
|
221
|
-
: style.template_grid_view} ${'integry-container__flow-card'}"
|
|
222
|
-
>
|
|
223
|
-
<div class=${style.titleContainer}>
|
|
224
|
-
<img src=${props.imgUrl} />
|
|
225
|
-
<div class=${style.title}>
|
|
226
|
-
<p class=${style.name}>${props.name}</p>
|
|
227
|
-
<p class=${style.description}>${props.description}</p>
|
|
228
|
-
</div>
|
|
229
|
-
</div>
|
|
230
|
-
${false && props.tags.length > 0 &&
|
|
231
|
-
html`
|
|
232
|
-
<div class=${style.tags}>
|
|
233
|
-
${props.tags
|
|
234
|
-
.split(',')
|
|
235
|
-
.map((el) => html` <div class=${style.tag}>${el}</div> `)}
|
|
236
|
-
</div>
|
|
237
|
-
`}
|
|
238
|
-
${integrations.length > 0 && html`<div class=${style.divider}></div>`}
|
|
239
|
-
${integrations.length > 0 ? html`
|
|
240
|
-
<div class=${style.integrations}>
|
|
241
|
-
<div class=${style.integrationsHeader} style="grid-template-columns: ${maxInstanceNameSize}px 1fr;">
|
|
242
|
-
<span style="flex: 1;" class=${style.th}>Instance</span>
|
|
243
|
-
<span style="width: 309px;" class=${style.th}>Last run start</span>
|
|
244
|
-
</div>
|
|
245
|
-
${integrations.map((instance: any) => html`
|
|
246
|
-
<div key=${`instance-${template.id}-${instance.id}`} class=${style.integration}>
|
|
247
|
-
<span>
|
|
248
|
-
<${EditableText} value=${instance.name} handleChange=${(newNameValue: string) => {
|
|
249
|
-
handleOnEditName(newNameValue, instance);
|
|
250
|
-
}} //>
|
|
251
|
-
</span>
|
|
252
|
-
<span>${getLastRunStart(instance.last_run_start_time)} ${html`<${InstanceStatusPill} instance=${instance} />`}</span>
|
|
253
|
-
<div>
|
|
254
|
-
${html`<${Toggle}
|
|
255
|
-
id=${instance.id}
|
|
256
|
-
value=${instance.status === 'ACTIVE'}
|
|
257
|
-
onChange=${(value: boolean) => toggleIntegration(instance.id, value)}
|
|
258
|
-
/>`}
|
|
259
|
-
</div>
|
|
260
|
-
<div>
|
|
261
|
-
<${CollapsedMenu}
|
|
262
|
-
icon=${MenuIcon}
|
|
263
|
-
options=${[
|
|
264
|
-
{
|
|
265
|
-
id: 'edit',
|
|
266
|
-
label: 'Edit',
|
|
267
|
-
},
|
|
268
|
-
{
|
|
269
|
-
id: 'delete',
|
|
270
|
-
label: 'Delete',
|
|
271
|
-
},
|
|
272
|
-
]}
|
|
273
|
-
onOptionSelect=${(option: { id: string; label: string }) =>
|
|
274
|
-
handleOptionSelect(option, instance)}
|
|
275
|
-
/>
|
|
276
|
-
</div>
|
|
277
|
-
</div>
|
|
278
|
-
`)}
|
|
279
|
-
</div>
|
|
280
|
-
` : html`<div class=${style.noIntegrations}></div>`}
|
|
281
|
-
<div class=${style.actions}>
|
|
282
|
-
<button class=${style.button} onclick=${props.handleClick}>${template.execution_type === 'AUTOMATIC' ? (integrations.length > 0 ? 'Setup another' : 'Setup and enable') : 'Setup and run'}</button>
|
|
283
|
-
</div>
|
|
284
|
-
</div>
|
|
285
|
-
`;
|
|
286
|
-
}
|
|
287
|
-
|
|
288
|
-
// export { Template };
|
|
289
|
-
|
|
290
|
-
const connectedTemplate = connect<FlowCardProps, State, StoreType, unknown>(
|
|
291
|
-
[],
|
|
292
|
-
actionFunctions,
|
|
293
|
-
)(Template);
|
|
294
|
-
|
|
295
|
-
export { connectedTemplate as Template };
|
|
@@ -1,226 +0,0 @@
|
|
|
1
|
-
.name {
|
|
2
|
-
margin-bottom: 0.5rem;
|
|
3
|
-
--tw-text-opacity: 1;
|
|
4
|
-
color: rgba(31, 41, 55, var(--tw-text-opacity));
|
|
5
|
-
}
|
|
6
|
-
|
|
7
|
-
.description {
|
|
8
|
-
font-size: 0.875rem;
|
|
9
|
-
line-height: 1.25rem;
|
|
10
|
-
--tw-text-opacity: 1;
|
|
11
|
-
color: rgba(107, 114, 128, var(--tw-text-opacity));
|
|
12
|
-
}
|
|
13
|
-
|
|
14
|
-
.tags {
|
|
15
|
-
margin-top: 0.5rem;
|
|
16
|
-
margin-bottom: -0.5rem;
|
|
17
|
-
display: flex;
|
|
18
|
-
flex-wrap: wrap;
|
|
19
|
-
.tag {
|
|
20
|
-
margin-right: 0.5rem;
|
|
21
|
-
margin-bottom: 0.5rem;
|
|
22
|
-
border-radius: 0.75rem;
|
|
23
|
-
--tw-bg-opacity: 1;
|
|
24
|
-
background-color: rgba(229, 231, 235, var(--tw-bg-opacity));
|
|
25
|
-
padding: 0.25rem;
|
|
26
|
-
padding-left: 0.5rem;
|
|
27
|
-
padding-right: 0.5rem;
|
|
28
|
-
font-size: 0.75rem;
|
|
29
|
-
line-height: 1rem;
|
|
30
|
-
--tw-text-opacity: 1;
|
|
31
|
-
color: rgba(107, 114, 128, var(--tw-text-opacity));
|
|
32
|
-
}
|
|
33
|
-
}
|
|
34
|
-
|
|
35
|
-
.template_list_view {
|
|
36
|
-
display: flex;
|
|
37
|
-
// cursor: pointer;
|
|
38
|
-
flex-direction: column;
|
|
39
|
-
// justify-content: space-between;
|
|
40
|
-
justify-content: flex-start;
|
|
41
|
-
align-items: flex-start;
|
|
42
|
-
border-radius: 0.25rem;
|
|
43
|
-
border-width: 1px;
|
|
44
|
-
border-style: solid;
|
|
45
|
-
--tw-border-opacity: 1;
|
|
46
|
-
border-color: rgba(229, 231, 235, var(--tw-border-opacity));
|
|
47
|
-
padding-left: 1rem;
|
|
48
|
-
padding-right: 1rem;
|
|
49
|
-
padding-top: 1.25rem;
|
|
50
|
-
padding-bottom: 1.25rem;
|
|
51
|
-
transition: border-color 0.2s;
|
|
52
|
-
|
|
53
|
-
border-radius: 4px;
|
|
54
|
-
border: 1px solid var(--gray-5, #E0E0E0);
|
|
55
|
-
background: #FFF;
|
|
56
|
-
box-shadow: 0px 0px 12px 0px rgba(0, 0, 0, 0.08);
|
|
57
|
-
padding: 0;
|
|
58
|
-
|
|
59
|
-
img {
|
|
60
|
-
margin-bottom: 0.75rem;
|
|
61
|
-
height: 2.5rem;
|
|
62
|
-
width: 2.5rem;
|
|
63
|
-
}
|
|
64
|
-
&:hover {
|
|
65
|
-
// border-color: #a8a8a8;
|
|
66
|
-
}
|
|
67
|
-
|
|
68
|
-
.titleContainer {
|
|
69
|
-
display: flex;
|
|
70
|
-
flex-direction: row;
|
|
71
|
-
align-items: center;
|
|
72
|
-
justify-content: flex-start;
|
|
73
|
-
gap: 8px;
|
|
74
|
-
padding: 16px;
|
|
75
|
-
|
|
76
|
-
img {
|
|
77
|
-
width: 24px;
|
|
78
|
-
height: 24px;
|
|
79
|
-
border-radius: 50%;
|
|
80
|
-
object-fit: contain;
|
|
81
|
-
margin: 0;
|
|
82
|
-
}
|
|
83
|
-
|
|
84
|
-
.title {
|
|
85
|
-
p {
|
|
86
|
-
margin: 0;
|
|
87
|
-
}
|
|
88
|
-
|
|
89
|
-
.name {
|
|
90
|
-
color: var(--black-and-grey-title-and-desc, #333);
|
|
91
|
-
font-family: Inter;
|
|
92
|
-
font-size: 14px;
|
|
93
|
-
font-style: normal;
|
|
94
|
-
font-weight: 400;
|
|
95
|
-
line-height: 18px; /* 128.571% */
|
|
96
|
-
}
|
|
97
|
-
|
|
98
|
-
.description {
|
|
99
|
-
color: var(--black-and-grey-draft-and-tooltip-desc, #999);
|
|
100
|
-
font-family: Inter;
|
|
101
|
-
font-size: 12px;
|
|
102
|
-
font-style: normal;
|
|
103
|
-
font-weight: 400;
|
|
104
|
-
line-height: normal;
|
|
105
|
-
}
|
|
106
|
-
}
|
|
107
|
-
}
|
|
108
|
-
|
|
109
|
-
.actions {
|
|
110
|
-
padding: 0 24px;
|
|
111
|
-
padding-bottom: 16px;
|
|
112
|
-
|
|
113
|
-
button {
|
|
114
|
-
border-radius: 5px;
|
|
115
|
-
border: 1px solid var(--theme-accent-blue-1, #4250F0);
|
|
116
|
-
background: var(--theme-accent-blue-1, #4250F0);
|
|
117
|
-
color: #FFF;
|
|
118
|
-
font-family: Inter;
|
|
119
|
-
font-size: 13px;
|
|
120
|
-
font-style: normal;
|
|
121
|
-
font-weight: 400;
|
|
122
|
-
line-height: normal;
|
|
123
|
-
padding: 4.5px 10px;
|
|
124
|
-
cursor: pointer;
|
|
125
|
-
|
|
126
|
-
&:hover {
|
|
127
|
-
background: var(--theme-accent-blue-2, #3A46D5);
|
|
128
|
-
border: 1px solid var(--theme-accent-blue-2, #3A46D5);
|
|
129
|
-
}
|
|
130
|
-
}
|
|
131
|
-
}
|
|
132
|
-
}
|
|
133
|
-
|
|
134
|
-
.template_grid_view {
|
|
135
|
-
display: flex;
|
|
136
|
-
cursor: pointer;
|
|
137
|
-
flex-direction: column;
|
|
138
|
-
justify-content: space-between;
|
|
139
|
-
border-radius: 0.25rem;
|
|
140
|
-
border-width: 1px;
|
|
141
|
-
border-style: solid;
|
|
142
|
-
--tw-border-opacity: 1;
|
|
143
|
-
border-color: rgba(229, 231, 235, var(--tw-border-opacity));
|
|
144
|
-
padding-left: 1rem;
|
|
145
|
-
padding-right: 1rem;
|
|
146
|
-
padding-top: 1.25rem;
|
|
147
|
-
padding-bottom: 1.25rem;
|
|
148
|
-
transition: border-color 0.2s;
|
|
149
|
-
img {
|
|
150
|
-
margin-bottom: 0.75rem;
|
|
151
|
-
height: 2.5rem;
|
|
152
|
-
width: 2.5rem;
|
|
153
|
-
}
|
|
154
|
-
&:hover {
|
|
155
|
-
border-color: #a8a8a8;
|
|
156
|
-
}
|
|
157
|
-
}
|
|
158
|
-
|
|
159
|
-
.noIntegrations {
|
|
160
|
-
padding: 3px;
|
|
161
|
-
}
|
|
162
|
-
|
|
163
|
-
.integrations {
|
|
164
|
-
padding: 16px 24px;
|
|
165
|
-
display: flex;
|
|
166
|
-
flex-direction: column;
|
|
167
|
-
align-items: flex-start;
|
|
168
|
-
justify-content: flex-start;
|
|
169
|
-
gap: 8px;
|
|
170
|
-
// width: calc(100% - 48px);
|
|
171
|
-
width: calc(100%);
|
|
172
|
-
box-sizing: border-box;
|
|
173
|
-
|
|
174
|
-
p, span {
|
|
175
|
-
color: var(--black-and-grey-title-and-desc, #333);
|
|
176
|
-
font-feature-settings: 'clig' off, 'liga' off;
|
|
177
|
-
font-family: Inter;
|
|
178
|
-
font-size: 12px;
|
|
179
|
-
font-style: normal;
|
|
180
|
-
font-weight: 400;
|
|
181
|
-
line-height: normal;
|
|
182
|
-
margin: 0;
|
|
183
|
-
|
|
184
|
-
display: flex;
|
|
185
|
-
flex-direction: row;
|
|
186
|
-
align-items: center;
|
|
187
|
-
justify-content: flex-start;
|
|
188
|
-
gap: 6px;
|
|
189
|
-
}
|
|
190
|
-
|
|
191
|
-
.integrationsHeader {
|
|
192
|
-
display: grid;
|
|
193
|
-
grid-template-columns: 150px 1fr;
|
|
194
|
-
padding: 0 16px;
|
|
195
|
-
gap: 16px;
|
|
196
|
-
display: flex;
|
|
197
|
-
flex-direction: row;
|
|
198
|
-
align-items: center;
|
|
199
|
-
justify-content: flex-start;
|
|
200
|
-
width: 100%;
|
|
201
|
-
box-sizing: border-box;
|
|
202
|
-
|
|
203
|
-
* {
|
|
204
|
-
user-select: none;
|
|
205
|
-
}
|
|
206
|
-
}
|
|
207
|
-
|
|
208
|
-
.integration {
|
|
209
|
-
display: grid;
|
|
210
|
-
grid-template-columns: 1fr 207px 50px 20px;
|
|
211
|
-
gap: 16px;
|
|
212
|
-
border-radius: 4px;
|
|
213
|
-
border: 1px solid var(--gray-5, #E0E0E0);
|
|
214
|
-
background: #FFF;
|
|
215
|
-
padding: 12px 16px;
|
|
216
|
-
// width: calc(100% - 32px);
|
|
217
|
-
width: calc(100%);
|
|
218
|
-
box-sizing: border-box;
|
|
219
|
-
}
|
|
220
|
-
}
|
|
221
|
-
|
|
222
|
-
.divider {
|
|
223
|
-
background: #EDEDED;
|
|
224
|
-
width: 100%;
|
|
225
|
-
height: 1px;
|
|
226
|
-
}
|