@sparrowengg/integrations-templates-frontend 2.1.0-notion-release.33 → 2.1.0-notion-release.35
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/cjs/_virtual/index5.js +2 -2
- package/dist/cjs/_virtual/index8.js +2 -2
- package/dist/cjs/_virtual/index9.js +2 -2
- package/dist/cjs/commons/constants/index.js +0 -2
- package/dist/cjs/commons/constants/index.js.map +1 -1
- package/dist/cjs/contact-import/components/ContactImportHeader.js +27 -37
- package/dist/cjs/contact-import/components/ContactImportHeader.js.map +1 -1
- package/dist/cjs/contact-import/components/ContactImportModal.js +53 -54
- package/dist/cjs/contact-import/components/ContactImportModal.js.map +1 -1
- package/dist/cjs/contact-import/constants/ui-strings.js +18 -0
- package/dist/cjs/contact-import/constants/ui-strings.js.map +1 -0
- package/dist/cjs/contact-import/index.js +13 -230
- package/dist/cjs/contact-import/index.js.map +1 -1
- package/dist/cjs/contact-import/utils/validation.utils.js +18 -0
- package/dist/cjs/contact-import/utils/validation.utils.js.map +1 -0
- package/dist/cjs/dynamic-mapping/constants/ui-strings.js +52 -0
- package/dist/cjs/dynamic-mapping/constants/ui-strings.js.map +1 -0
- package/dist/cjs/dynamic-mapping/index.js +4 -3
- package/dist/cjs/dynamic-mapping/index.js.map +1 -1
- package/dist/cjs/index.js +10 -12
- package/dist/cjs/index.js.map +1 -1
- package/dist/cjs/integration-template/components/ConfigureTemplate.js +43 -31
- package/dist/cjs/integration-template/components/ConfigureTemplate.js.map +1 -1
- package/dist/cjs/integration-template/components/TemplateCard.js +2 -3
- package/dist/cjs/integration-template/components/TemplateCard.js.map +1 -1
- package/dist/cjs/integration-template/components/dashboard/DashboardItem.js +273 -0
- package/dist/cjs/integration-template/components/dashboard/DashboardItem.js.map +1 -0
- package/dist/cjs/integration-template/components/dashboard/DropdownItem.js +1 -2
- package/dist/cjs/integration-template/components/dashboard/DropdownItem.js.map +1 -1
- package/dist/cjs/integration-template/components/dashboard/EventComponent.js +1 -1
- package/dist/cjs/integration-template/components/dashboard/EventComponent.js.map +1 -1
- package/dist/cjs/integration-template/components/dashboard/MultiAccountFallback.js +4 -4
- package/dist/cjs/integration-template/components/dashboard/MultiAccountFallback.js.map +1 -1
- package/dist/cjs/integration-template/components/dashboard/SingleMappingChipWrapper.js +75 -0
- package/dist/cjs/integration-template/components/dashboard/SingleMappingChipWrapper.js.map +1 -0
- package/dist/cjs/integration-template/components/dashboard/SingleMappingDashboardItem.js +346 -0
- package/dist/cjs/integration-template/components/dashboard/SingleMappingDashboardItem.js.map +1 -0
- package/dist/cjs/integration-template/components/dashboard/SingleMappingEventWrapper.js +79 -0
- package/dist/cjs/integration-template/components/dashboard/SingleMappingEventWrapper.js.map +1 -0
- package/dist/cjs/integration-template/components/dashboard/TriggerDashboardItem.js +214 -0
- package/dist/cjs/integration-template/components/dashboard/TriggerDashboardItem.js.map +1 -0
- package/dist/cjs/integration-template/components/dashboard-constants.js +92 -0
- package/dist/cjs/integration-template/components/dashboard-constants.js.map +1 -0
- package/dist/cjs/integration-template/components/dashboard-utils.js +39 -0
- package/dist/cjs/integration-template/components/dashboard-utils.js.map +1 -0
- package/dist/cjs/integration-template/components/dashboard.js +55 -1195
- package/dist/cjs/integration-template/components/dashboard.js.map +1 -1
- package/dist/cjs/integration-template/constants/index.js +1 -41
- package/dist/cjs/integration-template/constants/index.js.map +1 -1
- package/dist/cjs/integration-template/constants/ui-strings.js +15 -0
- package/dist/cjs/integration-template/constants/ui-strings.js.map +1 -0
- package/dist/cjs/integration-template/index.js +155 -217
- package/dist/cjs/integration-template/index.js.map +1 -1
- package/dist/cjs/integration-template/utils/component.utils.js +22 -0
- package/dist/cjs/integration-template/utils/component.utils.js.map +1 -0
- package/dist/cjs/integration-template/utils/url.utils.js +16 -0
- package/dist/cjs/integration-template/utils/url.utils.js.map +1 -0
- package/dist/cjs/mapping/components/ConfigurationField.js +178 -0
- package/dist/cjs/mapping/components/ConfigurationField.js.map +1 -0
- package/dist/cjs/mapping/components/ConfigurationSetup.js +19 -16
- package/dist/cjs/mapping/components/ConfigurationSetup.js.map +1 -1
- package/dist/cjs/mapping/components/CustomAddNewSelect.js +64 -61
- package/dist/cjs/mapping/components/CustomAddNewSelect.js.map +1 -1
- package/dist/cjs/mapping/components/EventSetup.js +25 -22
- package/dist/cjs/mapping/components/EventSetup.js.map +1 -1
- package/dist/cjs/mapping/components/MappingHeader.js +24 -24
- package/dist/cjs/mapping/components/MappingHeader.js.map +1 -1
- package/dist/cjs/mapping/constants/index.js.map +1 -1
- package/dist/cjs/mapping/constants/ui-strings.js +39 -0
- package/dist/cjs/mapping/constants/ui-strings.js.map +1 -0
- package/dist/cjs/mapping/index.js +7 -612
- package/dist/cjs/mapping/index.js.map +1 -1
- package/dist/cjs/mapping/utils/validation.utils.js +32 -0
- package/dist/cjs/mapping/utils/validation.utils.js.map +1 -0
- package/dist/cjs/node_modules/domelementtype/lib/index.js +1 -1
- package/dist/cjs/node_modules/hoist-non-react-statics/node_modules/react-is/index.js +1 -1
- package/dist/cjs/node_modules/html-dom-parser/lib/server/html-to-dom.js +2 -2
- package/dist/cjs/node_modules/html-dom-parser/node_modules/dom-serializer/lib/index.js +1 -1
- package/dist/cjs/node_modules/html-dom-parser/node_modules/domhandler/lib/index.js +2 -2
- package/dist/cjs/node_modules/html-dom-parser/node_modules/domhandler/lib/node.js +1 -1
- package/dist/cjs/node_modules/html-dom-parser/node_modules/domutils/lib/helpers.js +1 -1
- package/dist/cjs/node_modules/html-dom-parser/node_modules/domutils/lib/index.js +1 -1
- package/dist/cjs/node_modules/html-dom-parser/node_modules/domutils/lib/legacy.js +1 -1
- package/dist/cjs/node_modules/html-dom-parser/node_modules/domutils/lib/querying.js +1 -1
- package/dist/cjs/node_modules/html-dom-parser/node_modules/domutils/lib/stringify.js +2 -2
- package/dist/cjs/node_modules/html-dom-parser/node_modules/domutils/lib/traversal.js +1 -1
- package/dist/cjs/node_modules/html-dom-parser/node_modules/htmlparser2/lib/index.js +3 -3
- package/dist/cjs/node_modules/html-react-parser/node_modules/domhandler/lib/index.js +1 -1
- package/dist/cjs/node_modules/html-react-parser/node_modules/domhandler/lib/node.js +1 -1
- package/dist/cjs/node_modules/style-to-js/cjs/index.js +1 -1
- package/dist/cjs/node_modules/style-to-object/cjs/index.js +1 -1
- package/dist/cjs/single-mapping/components/ConfigurationField.js +243 -0
- package/dist/cjs/single-mapping/components/ConfigurationField.js.map +1 -0
- package/dist/cjs/single-mapping/components/ConfigurationSetup.js +14 -13
- package/dist/cjs/single-mapping/components/ConfigurationSetup.js.map +1 -1
- package/dist/cjs/single-mapping/components/CustomDropdown.js +157 -228
- package/dist/cjs/single-mapping/components/CustomDropdown.js.map +1 -1
- package/dist/cjs/single-mapping/components/MappingHeader.js +67 -48
- package/dist/cjs/single-mapping/components/MappingHeader.js.map +1 -1
- package/dist/cjs/single-mapping/hooks/useEditState.js +58 -0
- package/dist/cjs/single-mapping/hooks/useEditState.js.map +1 -0
- package/dist/cjs/single-mapping/index.js +32 -940
- package/dist/cjs/single-mapping/index.js.map +1 -1
- package/dist/cjs/single-mapping/utils/validation.utils.js +36 -30
- package/dist/cjs/single-mapping/utils/validation.utils.js.map +1 -1
- package/dist/cjs/triggers/components/EventSetup.js +64 -58
- package/dist/cjs/triggers/components/EventSetup.js.map +1 -1
- package/dist/cjs/triggers/components/TriggerHeader.js +26 -30
- package/dist/cjs/triggers/components/TriggerHeader.js.map +1 -1
- package/dist/cjs/triggers/components/subcomponents.js +3 -3
- package/dist/cjs/triggers/components/subcomponents.js.map +1 -1
- package/dist/cjs/triggers/constants/index.js.map +1 -1
- package/dist/cjs/triggers/constants/ui-strings.js +28 -0
- package/dist/cjs/triggers/constants/ui-strings.js.map +1 -0
- package/dist/cjs/triggers/index.js +6 -252
- package/dist/cjs/triggers/index.js.map +1 -1
- package/dist/cjs/triggers/utils/validation.utils.js +36 -0
- package/dist/cjs/triggers/utils/validation.utils.js.map +1 -0
- package/dist/es/_virtual/index5.js +2 -2
- package/dist/es/_virtual/index8.js +2 -2
- package/dist/es/_virtual/index9.js +2 -2
- package/dist/es/commons/constants/index.js +1 -2
- package/dist/es/commons/constants/index.js.map +1 -1
- package/dist/es/contact-import/components/ContactImportHeader.js +30 -38
- package/dist/es/contact-import/components/ContactImportHeader.js.map +1 -1
- package/dist/es/contact-import/components/ContactImportModal.js +51 -50
- package/dist/es/contact-import/components/ContactImportModal.js.map +1 -1
- package/dist/es/contact-import/constants/ui-strings.js +16 -0
- package/dist/es/contact-import/constants/ui-strings.js.map +1 -0
- package/dist/es/contact-import/index.js +12 -229
- package/dist/es/contact-import/index.js.map +1 -1
- package/dist/es/contact-import/utils/validation.utils.js +15 -0
- package/dist/es/contact-import/utils/validation.utils.js.map +1 -0
- package/dist/es/dynamic-mapping/constants/ui-strings.js +50 -0
- package/dist/es/dynamic-mapping/constants/ui-strings.js.map +1 -0
- package/dist/es/dynamic-mapping/index.js +4 -3
- package/dist/es/dynamic-mapping/index.js.map +1 -1
- package/dist/es/index.js +0 -1
- package/dist/es/index.js.map +1 -1
- package/dist/es/integration-template/components/ConfigureTemplate.js +43 -31
- package/dist/es/integration-template/components/ConfigureTemplate.js.map +1 -1
- package/dist/es/integration-template/components/TemplateCard.js +2 -3
- package/dist/es/integration-template/components/TemplateCard.js.map +1 -1
- package/dist/es/integration-template/components/dashboard/DashboardItem.js +271 -0
- package/dist/es/integration-template/components/dashboard/DashboardItem.js.map +1 -0
- package/dist/es/integration-template/components/dashboard/DropdownItem.js +1 -2
- package/dist/es/integration-template/components/dashboard/DropdownItem.js.map +1 -1
- package/dist/es/integration-template/components/dashboard/EventComponent.js +1 -1
- package/dist/es/integration-template/components/dashboard/EventComponent.js.map +1 -1
- package/dist/es/integration-template/components/dashboard/MultiAccountFallback.js +4 -4
- package/dist/es/integration-template/components/dashboard/MultiAccountFallback.js.map +1 -1
- package/dist/es/integration-template/components/dashboard/SingleMappingChipWrapper.js +73 -0
- package/dist/es/integration-template/components/dashboard/SingleMappingChipWrapper.js.map +1 -0
- package/dist/es/integration-template/components/dashboard/SingleMappingDashboardItem.js +344 -0
- package/dist/es/integration-template/components/dashboard/SingleMappingDashboardItem.js.map +1 -0
- package/dist/es/integration-template/components/dashboard/SingleMappingEventWrapper.js +77 -0
- package/dist/es/integration-template/components/dashboard/SingleMappingEventWrapper.js.map +1 -0
- package/dist/es/integration-template/components/dashboard/TriggerDashboardItem.js +212 -0
- package/dist/es/integration-template/components/dashboard/TriggerDashboardItem.js.map +1 -0
- package/dist/es/integration-template/components/dashboard-constants.js +88 -0
- package/dist/es/integration-template/components/dashboard-constants.js.map +1 -0
- package/dist/es/integration-template/components/dashboard-utils.js +36 -0
- package/dist/es/integration-template/components/dashboard-utils.js.map +1 -0
- package/dist/es/integration-template/components/dashboard.js +43 -1183
- package/dist/es/integration-template/components/dashboard.js.map +1 -1
- package/dist/es/integration-template/constants/index.js +2 -36
- package/dist/es/integration-template/constants/index.js.map +1 -1
- package/dist/es/integration-template/constants/ui-strings.js +13 -0
- package/dist/es/integration-template/constants/ui-strings.js.map +1 -0
- package/dist/es/integration-template/index.js +154 -216
- package/dist/es/integration-template/index.js.map +1 -1
- package/dist/es/integration-template/utils/component.utils.js +18 -0
- package/dist/es/integration-template/utils/component.utils.js.map +1 -0
- package/dist/es/integration-template/utils/url.utils.js +13 -0
- package/dist/es/integration-template/utils/url.utils.js.map +1 -0
- package/dist/es/mapping/components/ConfigurationField.js +174 -0
- package/dist/es/mapping/components/ConfigurationField.js.map +1 -0
- package/dist/es/mapping/components/ConfigurationSetup.js +17 -16
- package/dist/es/mapping/components/ConfigurationSetup.js.map +1 -1
- package/dist/es/mapping/components/CustomAddNewSelect.js +62 -61
- package/dist/es/mapping/components/CustomAddNewSelect.js.map +1 -1
- package/dist/es/mapping/components/EventSetup.js +23 -22
- package/dist/es/mapping/components/EventSetup.js.map +1 -1
- package/dist/es/mapping/components/MappingHeader.js +23 -25
- package/dist/es/mapping/components/MappingHeader.js.map +1 -1
- package/dist/es/mapping/constants/index.js.map +1 -1
- package/dist/es/mapping/constants/ui-strings.js +37 -0
- package/dist/es/mapping/constants/ui-strings.js.map +1 -0
- package/dist/es/mapping/index.js +5 -610
- package/dist/es/mapping/index.js.map +1 -1
- package/dist/es/mapping/utils/validation.utils.js +28 -0
- package/dist/es/mapping/utils/validation.utils.js.map +1 -0
- package/dist/es/node_modules/domelementtype/lib/index.js +1 -1
- package/dist/es/node_modules/hoist-non-react-statics/node_modules/react-is/index.js +1 -1
- package/dist/es/node_modules/html-dom-parser/lib/server/html-to-dom.js +2 -2
- package/dist/es/node_modules/html-dom-parser/node_modules/dom-serializer/lib/index.js +1 -1
- package/dist/es/node_modules/html-dom-parser/node_modules/domhandler/lib/index.js +2 -2
- package/dist/es/node_modules/html-dom-parser/node_modules/domhandler/lib/node.js +1 -1
- package/dist/es/node_modules/html-dom-parser/node_modules/domutils/lib/helpers.js +1 -1
- package/dist/es/node_modules/html-dom-parser/node_modules/domutils/lib/index.js +1 -1
- package/dist/es/node_modules/html-dom-parser/node_modules/domutils/lib/legacy.js +1 -1
- package/dist/es/node_modules/html-dom-parser/node_modules/domutils/lib/querying.js +1 -1
- package/dist/es/node_modules/html-dom-parser/node_modules/domutils/lib/stringify.js +2 -2
- package/dist/es/node_modules/html-dom-parser/node_modules/domutils/lib/traversal.js +1 -1
- package/dist/es/node_modules/html-dom-parser/node_modules/htmlparser2/lib/index.js +3 -3
- package/dist/es/node_modules/html-react-parser/node_modules/domhandler/lib/index.js +1 -1
- package/dist/es/node_modules/html-react-parser/node_modules/domhandler/lib/node.js +1 -1
- package/dist/es/node_modules/style-to-js/cjs/index.js +1 -1
- package/dist/es/node_modules/style-to-object/cjs/index.js +1 -1
- package/dist/es/single-mapping/components/ConfigurationField.js +241 -0
- package/dist/es/single-mapping/components/ConfigurationField.js.map +1 -0
- package/dist/es/single-mapping/components/ConfigurationSetup.js +14 -13
- package/dist/es/single-mapping/components/ConfigurationSetup.js.map +1 -1
- package/dist/es/single-mapping/components/CustomDropdown.js +156 -227
- package/dist/es/single-mapping/components/CustomDropdown.js.map +1 -1
- package/dist/es/single-mapping/components/MappingHeader.js +68 -49
- package/dist/es/single-mapping/components/MappingHeader.js.map +1 -1
- package/dist/es/single-mapping/hooks/useEditState.js +56 -0
- package/dist/es/single-mapping/hooks/useEditState.js.map +1 -0
- package/dist/es/single-mapping/index.js +30 -941
- package/dist/es/single-mapping/index.js.map +1 -1
- package/dist/es/single-mapping/utils/validation.utils.js +31 -27
- package/dist/es/single-mapping/utils/validation.utils.js.map +1 -1
- package/dist/es/triggers/components/EventSetup.js +62 -58
- package/dist/es/triggers/components/EventSetup.js.map +1 -1
- package/dist/es/triggers/components/TriggerHeader.js +26 -32
- package/dist/es/triggers/components/TriggerHeader.js.map +1 -1
- package/dist/es/triggers/components/subcomponents.js +3 -3
- package/dist/es/triggers/components/subcomponents.js.map +1 -1
- package/dist/es/triggers/constants/index.js.map +1 -1
- package/dist/es/triggers/constants/ui-strings.js +26 -0
- package/dist/es/triggers/constants/ui-strings.js.map +1 -0
- package/dist/es/triggers/index.js +5 -251
- package/dist/es/triggers/index.js.map +1 -1
- package/dist/es/triggers/utils/validation.utils.js +30 -0
- package/dist/es/triggers/utils/validation.utils.js.map +1 -0
- package/dist/index.d.ts +216 -143
- package/package.json +1 -1
|
@@ -5,11 +5,12 @@ Object.defineProperty(exports, '__esModule', { value: true });
|
|
|
5
5
|
var React = require('react');
|
|
6
6
|
var cursor = require('../../commons/icons/cursor.js');
|
|
7
7
|
var mapping = require('../../commons/icons/mapping.js');
|
|
8
|
-
var
|
|
9
|
-
var
|
|
10
|
-
var
|
|
11
|
-
var
|
|
12
|
-
var
|
|
8
|
+
var dashboardConstants = require('./dashboard-constants.js');
|
|
9
|
+
var DropdownItem = require('./dashboard/DropdownItem.js');
|
|
10
|
+
var MultiAccountFallback = require('./dashboard/MultiAccountFallback.js');
|
|
11
|
+
var TriggerDashboardItem = require('./dashboard/TriggerDashboardItem.js');
|
|
12
|
+
var SingleMappingDashboardItem = require('./dashboard/SingleMappingDashboardItem.js');
|
|
13
|
+
var DashboardItem = require('./dashboard/DashboardItem.js');
|
|
13
14
|
var flex = require('../../node_modules/@sparrowengg/twigs-react/dist/es/flex/flex.js');
|
|
14
15
|
var box = require('../../node_modules/@sparrowengg/twigs-react/dist/es/box/box.js');
|
|
15
16
|
var heading = require('../../node_modules/@sparrowengg/twigs-react/dist/es/heading/heading.js');
|
|
@@ -20,24 +21,7 @@ var dropdown = require('../../node_modules/@sparrowengg/twigs-react/dist/es/drop
|
|
|
20
21
|
var tooltip = require('../../node_modules/@sparrowengg/twigs-react/dist/es/tooltip/tooltip.js');
|
|
21
22
|
var chevronDown = require('../../node_modules/@sparrowengg/twigs-react-icons/dist/es/icons/chevron-down.js');
|
|
22
23
|
var tabs = require('../../node_modules/@sparrowengg/twigs-react/dist/es/tabs/tabs.js');
|
|
23
|
-
var chevronRight = require('../../node_modules/@sparrowengg/twigs-react-icons/dist/es/icons/chevron-right.js');
|
|
24
|
-
var chip = require('../../node_modules/@sparrowengg/twigs-react/dist/es/chip/chip.js');
|
|
25
|
-
var _switch = require('../../node_modules/@sparrowengg/twigs-react/dist/es/switch/switch.js');
|
|
26
|
-
var iconButton = require('../../node_modules/@sparrowengg/twigs-react/dist/es/button/icon-button.js');
|
|
27
|
-
var ellipsisVertical = require('../../node_modules/@sparrowengg/twigs-react-icons/dist/es/icons/ellipsis-vertical.js');
|
|
28
|
-
var pencil = require('../../node_modules/@sparrowengg/twigs-react-icons/dist/es/icons/pencil.js');
|
|
29
|
-
var _delete = require('../../node_modules/@sparrowengg/twigs-react-icons/dist/es/icons/delete.js');
|
|
30
|
-
var table = require('../../node_modules/@sparrowengg/twigs-react/dist/es/table/table.js');
|
|
31
24
|
|
|
32
|
-
const trasformToPastTense = (value) => {
|
|
33
|
-
if (value.endsWith("e")) {
|
|
34
|
-
return value + "d";
|
|
35
|
-
} else if (value.endsWith("y")) {
|
|
36
|
-
return value.slice(0, -1) + "ied";
|
|
37
|
-
} else {
|
|
38
|
-
return value + "ed";
|
|
39
|
-
}
|
|
40
|
-
};
|
|
41
25
|
const Dashboard = ({
|
|
42
26
|
hasEditMapping,
|
|
43
27
|
onMappingEditHandler,
|
|
@@ -65,7 +49,7 @@ const Dashboard = ({
|
|
|
65
49
|
alignItems: "center"
|
|
66
50
|
},
|
|
67
51
|
/* @__PURE__ */ React.createElement(flex.Flex, { flexDirection: "column", gap: "$2" }, /* @__PURE__ */ React.createElement(heading.Heading, { size: "h5" }, integrationName), /* @__PURE__ */ React.createElement(text.Text, { size: "sm", css: { color: "$neutral700" } }, dashboardDescription)),
|
|
68
|
-
/* @__PURE__ */ React.createElement(flex.Flex, { alignItems: "center", gap: "$4" }, hasMultiAccounts && /* @__PURE__ */ React.createElement(button.Button, { size: "lg", color: "default", leftIcon: /* @__PURE__ */ React.createElement(plus.PlusIcon, null) },
|
|
52
|
+
/* @__PURE__ */ React.createElement(flex.Flex, { alignItems: "center", gap: "$4" }, hasMultiAccounts && /* @__PURE__ */ React.createElement(button.Button, { size: "lg", color: "default", leftIcon: /* @__PURE__ */ React.createElement(plus.PlusIcon, null) }, dashboardConstants.DASHBOARD_UI_STRINGS.ADD_ACCOUNT), hasDropdownComponents.mapping && !hasDropdownComponents.trigger ? /* @__PURE__ */ React.createElement(
|
|
69
53
|
button.Button,
|
|
70
54
|
{
|
|
71
55
|
size: "lg",
|
|
@@ -74,11 +58,11 @@ const Dashboard = ({
|
|
|
74
58
|
leftIcon: /* @__PURE__ */ React.createElement(plus.PlusIcon, null),
|
|
75
59
|
onClick: () => handleConfigurationType("MAPPING")
|
|
76
60
|
},
|
|
77
|
-
|
|
61
|
+
dashboardConstants.DASHBOARD_UI_STRINGS.NEW_MAPPING
|
|
78
62
|
) : null, hasDropdownComponents.trigger && hasDropdownComponents.mapping ? /* @__PURE__ */ React.createElement(dropdown.DropdownMenu, null, /* @__PURE__ */ React.createElement(
|
|
79
63
|
tooltip.Tooltip,
|
|
80
64
|
{
|
|
81
|
-
content: !triggerEnabled && !mappingEnabled ?
|
|
65
|
+
content: !triggerEnabled && !mappingEnabled ? dashboardConstants.DASHBOARD_UI_STRINGS.TRIGGER_MAPPING_LIMIT_REACHED : ""
|
|
82
66
|
},
|
|
83
67
|
/* @__PURE__ */ React.createElement(dropdown.DropdownMenuTrigger, { asChild: true }, /* @__PURE__ */ React.createElement(
|
|
84
68
|
button.Button,
|
|
@@ -87,7 +71,7 @@ const Dashboard = ({
|
|
|
87
71
|
disabled: !triggerEnabled && !mappingEnabled,
|
|
88
72
|
rightIcon: /* @__PURE__ */ React.createElement(chevronDown.ChevronDownIcon, null)
|
|
89
73
|
},
|
|
90
|
-
|
|
74
|
+
dashboardConstants.DASHBOARD_UI_STRINGS.ADD_NEW
|
|
91
75
|
))
|
|
92
76
|
), /* @__PURE__ */ React.createElement(
|
|
93
77
|
dropdown.DropdownMenuContent,
|
|
@@ -105,23 +89,23 @@ const Dashboard = ({
|
|
|
105
89
|
}
|
|
106
90
|
},
|
|
107
91
|
hasDropdownComponents.trigger ? /* @__PURE__ */ React.createElement(
|
|
108
|
-
DropdownItem,
|
|
92
|
+
DropdownItem.DropdownItem,
|
|
109
93
|
{
|
|
110
|
-
toolTipContent:
|
|
94
|
+
toolTipContent: dashboardConstants.DASHBOARD_UI_STRINGS.TRIGGER_LIMIT_REACHED,
|
|
111
95
|
isDisabled: !triggerEnabled,
|
|
112
96
|
icon: /* @__PURE__ */ React.createElement(cursor.default, { size: 24, color: "#6A6A6A" }),
|
|
113
|
-
heading:
|
|
114
|
-
description:
|
|
97
|
+
heading: dashboardConstants.DASHBOARD_UI_STRINGS.TRIGGER,
|
|
98
|
+
description: dashboardConstants.DASHBOARD_UI_STRINGS.TRIGGER_DESCRIPTION,
|
|
115
99
|
onClickHandler: () => handleConfigurationType("TRIGGER")
|
|
116
100
|
}
|
|
117
101
|
) : null,
|
|
118
102
|
hasDropdownComponents.mapping ? /* @__PURE__ */ React.createElement(
|
|
119
|
-
DropdownItem,
|
|
103
|
+
DropdownItem.DropdownItem,
|
|
120
104
|
{
|
|
121
105
|
isDisabled: !mappingEnabled,
|
|
122
|
-
toolTipContent:
|
|
106
|
+
toolTipContent: dashboardConstants.DASHBOARD_UI_STRINGS.MAPPING_LIMIT_REACHED,
|
|
123
107
|
icon: /* @__PURE__ */ React.createElement(mapping.default, { size: 24, color: "#6A6A6A" }),
|
|
124
|
-
heading:
|
|
108
|
+
heading: dashboardConstants.DASHBOARD_UI_STRINGS.MAPPING,
|
|
125
109
|
description: `Create/Update record in ${integrationName} from survey responses`,
|
|
126
110
|
onClickHandler: () => handleConfigurationType("MAPPING")
|
|
127
111
|
}
|
|
@@ -195,9 +179,9 @@ const MultiAccountDashboard = ({
|
|
|
195
179
|
"& button": { color: "$neutral900" }
|
|
196
180
|
}
|
|
197
181
|
},
|
|
198
|
-
/* @__PURE__ */ React.createElement(tabs.TabsTrigger, { value: "ALL" },
|
|
199
|
-
/* @__PURE__ */ React.createElement(tabs.TabsTrigger, { value: "TRIGGER" },
|
|
200
|
-
/* @__PURE__ */ React.createElement(tabs.TabsTrigger, { value: "MAPPING" },
|
|
182
|
+
/* @__PURE__ */ React.createElement(tabs.TabsTrigger, { value: "ALL" }, dashboardConstants.DASHBOARD_UI_STRINGS.ALL),
|
|
183
|
+
/* @__PURE__ */ React.createElement(tabs.TabsTrigger, { value: "TRIGGER" }, dashboardConstants.DASHBOARD_UI_STRINGS.TRIGGER),
|
|
184
|
+
/* @__PURE__ */ React.createElement(tabs.TabsTrigger, { value: "MAPPING" }, dashboardConstants.DASHBOARD_UI_STRINGS.MAPPING)
|
|
201
185
|
), /* @__PURE__ */ React.createElement(
|
|
202
186
|
tabs.TabsContent,
|
|
203
187
|
{
|
|
@@ -205,18 +189,18 @@ const MultiAccountDashboard = ({
|
|
|
205
189
|
css: { paddingBlock: "$12", paddingInline: 0 }
|
|
206
190
|
},
|
|
207
191
|
/* @__PURE__ */ React.createElement(flex.Flex, { flexDirection: "column", gap: "$8" }, !!(triggerFields == null ? void 0 : triggerFields.length) ? /* @__PURE__ */ React.createElement(React.Fragment, null, triggerFields == null ? void 0 : triggerFields.map((field) => {
|
|
208
|
-
var _a2, _b2, _c2
|
|
192
|
+
var _a2, _b2, _c2;
|
|
209
193
|
return /* @__PURE__ */ React.createElement(
|
|
210
|
-
DashboardItem,
|
|
194
|
+
DashboardItem.DashboardItem,
|
|
211
195
|
{
|
|
212
196
|
hasEditMapping,
|
|
213
197
|
key: field.id,
|
|
214
198
|
isDraft: (_a2 = field == null ? void 0 : field.isDraft) != null ? _a2 : false,
|
|
215
199
|
onMappingEditHandler,
|
|
216
200
|
icon: /* @__PURE__ */ React.createElement(cursor.default, { size: 32, color: "#56B0BB" }),
|
|
217
|
-
heading: (_c2 = (_b2 = field.domain) != null ? _b2 : field.email) != null ? _c2 :
|
|
201
|
+
heading: (_c2 = (_b2 = field.domain) != null ? _b2 : field.email) != null ? _c2 : dashboardConstants.DASHBOARD_UI_STRINGS.TRIGGER_HEADING,
|
|
218
202
|
id: field.id,
|
|
219
|
-
description:
|
|
203
|
+
description: dashboardConstants.getTriggerDescription(integrationName, field),
|
|
220
204
|
fields: field.fields,
|
|
221
205
|
mappingConditions: field.mappingConditions,
|
|
222
206
|
isEnabled: field.isEnabled,
|
|
@@ -230,18 +214,18 @@ const MultiAccountDashboard = ({
|
|
|
230
214
|
);
|
|
231
215
|
})) : null, !!((_a = mappingFields == null ? void 0 : mappingFields.fields) == null ? void 0 : _a.length) ? /* @__PURE__ */ React.createElement(React.Fragment, null, (_b = mappingFields == null ? void 0 : mappingFields.fields) == null ? void 0 : _b.map(
|
|
232
216
|
(field) => {
|
|
233
|
-
var _a2, _b2, _c2
|
|
217
|
+
var _a2, _b2, _c2;
|
|
234
218
|
return /* @__PURE__ */ React.createElement(React.Fragment, null, (mappingFields == null ? void 0 : mappingFields.type) === "MULTI_MAPPING" ? /* @__PURE__ */ React.createElement(
|
|
235
|
-
DashboardItem,
|
|
219
|
+
DashboardItem.DashboardItem,
|
|
236
220
|
{
|
|
237
221
|
hasEditMapping,
|
|
238
222
|
key: field.id,
|
|
239
223
|
isDraft: (_a2 = field == null ? void 0 : field.isDraft) != null ? _a2 : false,
|
|
240
224
|
onMappingEditHandler,
|
|
241
225
|
icon: /* @__PURE__ */ React.createElement(mapping.default, { size: 32, color: "#56B0BB" }),
|
|
242
|
-
heading: (_c2 = (_b2 = field.domain) != null ? _b2 : field.email) != null ? _c2 :
|
|
226
|
+
heading: (_c2 = (_b2 = field.domain) != null ? _b2 : field.email) != null ? _c2 : dashboardConstants.DASHBOARD_UI_STRINGS.MAPPING_HEADING,
|
|
243
227
|
id: field.id,
|
|
244
|
-
description: (field == null ? void 0 : field.mappingDescription) || `Sync survey responses to ${integrationName}
|
|
228
|
+
description: (field == null ? void 0 : field.mappingDescription) || `Sync survey responses to ${integrationName}`,
|
|
245
229
|
fields: field.fields,
|
|
246
230
|
isEnabled: field.isEnabled,
|
|
247
231
|
integrationName,
|
|
@@ -253,7 +237,7 @@ const MultiAccountDashboard = ({
|
|
|
253
237
|
deleteFieldHandler
|
|
254
238
|
}
|
|
255
239
|
) : /* @__PURE__ */ React.createElement(
|
|
256
|
-
SingleMappingDashboardItem,
|
|
240
|
+
SingleMappingDashboardItem.SingleMappingDashboardItem,
|
|
257
241
|
{
|
|
258
242
|
hasEditMapping,
|
|
259
243
|
key: field.id,
|
|
@@ -277,18 +261,18 @@ const MultiAccountDashboard = ({
|
|
|
277
261
|
css: { paddingBlock: "$12", paddingInline: 0 }
|
|
278
262
|
},
|
|
279
263
|
!!(triggerFields == null ? void 0 : triggerFields.length) ? /* @__PURE__ */ React.createElement(flex.Flex, { flexDirection: "column", gap: "$8" }, triggerFields == null ? void 0 : triggerFields.map((field) => {
|
|
280
|
-
var _a2
|
|
264
|
+
var _a2;
|
|
281
265
|
return /* @__PURE__ */ React.createElement(
|
|
282
|
-
DashboardItem,
|
|
266
|
+
DashboardItem.DashboardItem,
|
|
283
267
|
{
|
|
284
268
|
mappingConditions: field.mappingConditions,
|
|
285
269
|
key: field.id,
|
|
286
270
|
isDraft: (_a2 = field == null ? void 0 : field.isDraft) != null ? _a2 : false,
|
|
287
271
|
onMappingEditHandler,
|
|
288
272
|
icon: /* @__PURE__ */ React.createElement(cursor.default, { size: 32, color: "#56B0BB" }),
|
|
289
|
-
heading:
|
|
273
|
+
heading: dashboardConstants.DASHBOARD_UI_STRINGS.TRIGGER,
|
|
290
274
|
id: field.id,
|
|
291
|
-
description:
|
|
275
|
+
description: dashboardConstants.getTriggerDescription(integrationName, field),
|
|
292
276
|
fields: field.fields,
|
|
293
277
|
isEnabled: field.isEnabled,
|
|
294
278
|
integrationName,
|
|
@@ -300,9 +284,9 @@ const MultiAccountDashboard = ({
|
|
|
300
284
|
}
|
|
301
285
|
);
|
|
302
286
|
})) : /* @__PURE__ */ React.createElement(
|
|
303
|
-
MultiAccountFallback,
|
|
287
|
+
MultiAccountFallback.MultiAccountFallback,
|
|
304
288
|
{
|
|
305
|
-
title:
|
|
289
|
+
title: dashboardConstants.DASHBOARD_UI_STRINGS.TRIGGER,
|
|
306
290
|
onClickHandler: () => handleConfigurationType("TRIGGER")
|
|
307
291
|
}
|
|
308
292
|
)
|
|
@@ -314,18 +298,18 @@ const MultiAccountDashboard = ({
|
|
|
314
298
|
},
|
|
315
299
|
!!((_c = mappingFields == null ? void 0 : mappingFields.fields) == null ? void 0 : _c.length) ? /* @__PURE__ */ React.createElement(React.Fragment, null, /* @__PURE__ */ React.createElement(flex.Flex, { flexDirection: "column", gap: "$8" }, (_d = mappingFields == null ? void 0 : mappingFields.fields) == null ? void 0 : _d.map(
|
|
316
300
|
(field) => {
|
|
317
|
-
var _a2
|
|
301
|
+
var _a2;
|
|
318
302
|
return /* @__PURE__ */ React.createElement(React.Fragment, null, (mappingFields == null ? void 0 : mappingFields.type) === "MULTI_MAPPING" ? /* @__PURE__ */ React.createElement(
|
|
319
|
-
DashboardItem,
|
|
303
|
+
DashboardItem.DashboardItem,
|
|
320
304
|
{
|
|
321
305
|
mappingConditions: field.mappingConditions,
|
|
322
306
|
key: field.id,
|
|
323
307
|
isDraft: (_a2 = field == null ? void 0 : field.isDraft) != null ? _a2 : false,
|
|
324
308
|
onMappingEditHandler,
|
|
325
309
|
icon: /* @__PURE__ */ React.createElement(mapping.default, { size: 32, color: "#56B0BB" }),
|
|
326
|
-
heading: (field == null ? void 0 : field.mappingName) ||
|
|
310
|
+
heading: (field == null ? void 0 : field.mappingName) || dashboardConstants.DASHBOARD_UI_STRINGS.MAPPING,
|
|
327
311
|
id: field.id,
|
|
328
|
-
description: (field == null ? void 0 : field.mappingDescription) || `Sync survey responses to ${integrationName}
|
|
312
|
+
description: (field == null ? void 0 : field.mappingDescription) || `Sync survey responses to ${integrationName}`,
|
|
329
313
|
fields: field.fields,
|
|
330
314
|
isEnabled: field.isEnabled,
|
|
331
315
|
integrationName,
|
|
@@ -336,7 +320,7 @@ const MultiAccountDashboard = ({
|
|
|
336
320
|
deleteFieldHandler
|
|
337
321
|
}
|
|
338
322
|
) : /* @__PURE__ */ React.createElement(
|
|
339
|
-
SingleMappingDashboardItem,
|
|
323
|
+
SingleMappingDashboardItem.SingleMappingDashboardItem,
|
|
340
324
|
{
|
|
341
325
|
key: field.id,
|
|
342
326
|
field,
|
|
@@ -352,52 +336,14 @@ const MultiAccountDashboard = ({
|
|
|
352
336
|
));
|
|
353
337
|
}
|
|
354
338
|
))) : /* @__PURE__ */ React.createElement(
|
|
355
|
-
MultiAccountFallback,
|
|
339
|
+
MultiAccountFallback.MultiAccountFallback,
|
|
356
340
|
{
|
|
357
|
-
title:
|
|
341
|
+
title: dashboardConstants.DASHBOARD_UI_STRINGS.MAPPING,
|
|
358
342
|
onClickHandler: () => handleConfigurationType("MAPPING")
|
|
359
343
|
}
|
|
360
344
|
)
|
|
361
345
|
)));
|
|
362
346
|
};
|
|
363
|
-
const MultiAccountFallback = ({
|
|
364
|
-
title,
|
|
365
|
-
onClickHandler
|
|
366
|
-
}) => {
|
|
367
|
-
return /* @__PURE__ */ React.createElement(
|
|
368
|
-
flex.Flex,
|
|
369
|
-
{
|
|
370
|
-
justifyContent: "center",
|
|
371
|
-
flexDirection: "column",
|
|
372
|
-
alignItems: "center",
|
|
373
|
-
css: { paddingTop: 182 }
|
|
374
|
-
},
|
|
375
|
-
/* @__PURE__ */ React.createElement(heading.Heading, { size: "h5" }, `Zero ${title} Entries`),
|
|
376
|
-
/* @__PURE__ */ React.createElement(
|
|
377
|
-
text.Text,
|
|
378
|
-
{
|
|
379
|
-
css: {
|
|
380
|
-
textAlign: "center",
|
|
381
|
-
maxWidth: 400,
|
|
382
|
-
marginBlock: "$4 $12",
|
|
383
|
-
color: "$neutral800"
|
|
384
|
-
},
|
|
385
|
-
size: "md"
|
|
386
|
-
},
|
|
387
|
-
"Creating one is as easy as a breeze. Just a click away to get started."
|
|
388
|
-
),
|
|
389
|
-
/* @__PURE__ */ React.createElement(
|
|
390
|
-
button.Button,
|
|
391
|
-
{
|
|
392
|
-
size: "lg",
|
|
393
|
-
leftIcon: /* @__PURE__ */ React.createElement(plus.PlusIcon, null),
|
|
394
|
-
variant: "outline",
|
|
395
|
-
onClick: onClickHandler
|
|
396
|
-
},
|
|
397
|
-
`New ${title}`
|
|
398
|
-
)
|
|
399
|
-
);
|
|
400
|
-
};
|
|
401
347
|
const SingleAccountDashboard = ({
|
|
402
348
|
hasEditMapping,
|
|
403
349
|
syncMapping,
|
|
@@ -415,14 +361,14 @@ const SingleAccountDashboard = ({
|
|
|
415
361
|
}) => {
|
|
416
362
|
var _a, _b, _c, _d, _e, _f, _g, _h, _i;
|
|
417
363
|
return /* @__PURE__ */ React.createElement(React.Fragment, null, !!(triggerFields == null ? void 0 : triggerFields.length) ? /* @__PURE__ */ React.createElement(box.Box, { css: { marginTop: "$20" } }, triggerFields == null ? void 0 : triggerFields.map((field) => {
|
|
418
|
-
var _a2
|
|
364
|
+
var _a2;
|
|
419
365
|
return /* @__PURE__ */ React.createElement(
|
|
420
|
-
|
|
366
|
+
TriggerDashboardItem.TriggerDashboardItem,
|
|
421
367
|
{
|
|
422
368
|
isDraft: (_a2 = field == null ? void 0 : field.isDraft) != null ? _a2 : false,
|
|
423
369
|
fieldOptions,
|
|
424
370
|
field,
|
|
425
|
-
description:
|
|
371
|
+
description: dashboardConstants.getTriggerDescription(integrationName, field),
|
|
426
372
|
key: field.id,
|
|
427
373
|
integrationName,
|
|
428
374
|
icon: /* @__PURE__ */ React.createElement(cursor.default, { size: 32, color: "#56B0BB" }),
|
|
@@ -434,19 +380,19 @@ const SingleAccountDashboard = ({
|
|
|
434
380
|
);
|
|
435
381
|
})) : null, (mappingFields == null ? void 0 : mappingFields.type) === "DYNAMIC_MAPPING" ? /* @__PURE__ */ React.createElement(React.Fragment, null, !!((_a = mappingFields == null ? void 0 : mappingFields.fields) == null ? void 0 : _a.length) ? /* @__PURE__ */ React.createElement(box.Box, { css: { marginTop: !(triggerFields == null ? void 0 : triggerFields.length) ? "$20" : "$8" } }, (_b = mappingFields == null ? void 0 : mappingFields.fields) == null ? void 0 : _b.map(
|
|
436
382
|
(field) => {
|
|
437
|
-
var _a2
|
|
383
|
+
var _a2;
|
|
438
384
|
if ((field == null ? void 0 : field.type) === "MULTI_MAPPING") {
|
|
439
385
|
return /* @__PURE__ */ React.createElement(
|
|
440
|
-
DashboardItem,
|
|
386
|
+
DashboardItem.DashboardItem,
|
|
441
387
|
{
|
|
442
388
|
mappingConditions: field.mappingConditions,
|
|
443
389
|
hasEditMapping,
|
|
444
390
|
isDraft: (_a2 = field == null ? void 0 : field.isDraft) != null ? _a2 : false,
|
|
445
391
|
onMappingEditHandler,
|
|
446
392
|
icon: /* @__PURE__ */ React.createElement(mapping.default, { size: 32, color: "#56B0BB" }),
|
|
447
|
-
heading: (field == null ? void 0 : field.mappingName) ||
|
|
393
|
+
heading: (field == null ? void 0 : field.mappingName) || dashboardConstants.DASHBOARD_UI_STRINGS.MAPPING,
|
|
448
394
|
id: field.id,
|
|
449
|
-
description: (field == null ? void 0 : field.mappingDescription) || `Sync survey responses to ${integrationName}
|
|
395
|
+
description: (field == null ? void 0 : field.mappingDescription) || `Sync survey responses to ${integrationName}`,
|
|
450
396
|
fields: field.fields,
|
|
451
397
|
isEnabled: field.isEnabled,
|
|
452
398
|
integrationName,
|
|
@@ -459,7 +405,7 @@ const SingleAccountDashboard = ({
|
|
|
459
405
|
);
|
|
460
406
|
} else {
|
|
461
407
|
return /* @__PURE__ */ React.createElement(
|
|
462
|
-
SingleMappingDashboardItem,
|
|
408
|
+
SingleMappingDashboardItem.SingleMappingDashboardItem,
|
|
463
409
|
{
|
|
464
410
|
hasEditMapping,
|
|
465
411
|
onMappingEditHandler,
|
|
@@ -478,17 +424,17 @@ const SingleAccountDashboard = ({
|
|
|
478
424
|
}
|
|
479
425
|
)) : null) : /* @__PURE__ */ React.createElement(React.Fragment, null, !!((_c = mappingFields == null ? void 0 : mappingFields.fields) == null ? void 0 : _c.length) && (mappingFields == null ? void 0 : mappingFields.type) === "MULTI_MAPPING" ? /* @__PURE__ */ React.createElement(box.Box, { css: { marginTop: !(triggerFields == null ? void 0 : triggerFields.length) ? "$20" : "$8" } }, (_d = mappingFields == null ? void 0 : mappingFields.fields) == null ? void 0 : _d.map(
|
|
480
426
|
(field) => {
|
|
481
|
-
var _a2
|
|
427
|
+
var _a2;
|
|
482
428
|
return /* @__PURE__ */ React.createElement(
|
|
483
|
-
DashboardItem,
|
|
429
|
+
DashboardItem.DashboardItem,
|
|
484
430
|
{
|
|
485
431
|
mappingConditions: field.mappingConditions,
|
|
486
432
|
isDraft: (_a2 = field == null ? void 0 : field.isDraft) != null ? _a2 : false,
|
|
487
433
|
onMappingEditHandler,
|
|
488
434
|
icon: /* @__PURE__ */ React.createElement(mapping.default, { size: 32, color: "#56B0BB" }),
|
|
489
|
-
heading: (field == null ? void 0 : field.mappingName) ||
|
|
435
|
+
heading: (field == null ? void 0 : field.mappingName) || dashboardConstants.DASHBOARD_UI_STRINGS.MAPPING,
|
|
490
436
|
id: field.id,
|
|
491
|
-
description: (field == null ? void 0 : field.mappingDescription) || `Sync survey responses to ${integrationName}
|
|
437
|
+
description: (field == null ? void 0 : field.mappingDescription) || `Sync survey responses to ${integrationName}`,
|
|
492
438
|
fields: field.fields,
|
|
493
439
|
isEnabled: field.isEnabled,
|
|
494
440
|
integrationName,
|
|
@@ -503,7 +449,7 @@ const SingleAccountDashboard = ({
|
|
|
503
449
|
)) : null, ((_e = mappingFields == null ? void 0 : mappingFields.mappedFields) == null ? void 0 : _e.type) === "SINGLE_MAPPING" && !!((_g = (_f = mappingFields == null ? void 0 : mappingFields.mappedFields) == null ? void 0 : _f.fields) == null ? void 0 : _g.length) ? /* @__PURE__ */ React.createElement(box.Box, { css: { marginTop: !(triggerFields == null ? void 0 : triggerFields.length) ? "$20" : "$8" } }, (_i = (_h = mappingFields == null ? void 0 : mappingFields.mappedFields) == null ? void 0 : _h.fields) == null ? void 0 : _i.map(
|
|
504
450
|
(field, index) => {
|
|
505
451
|
return /* @__PURE__ */ React.createElement(
|
|
506
|
-
SingleMappingDashboardItem,
|
|
452
|
+
SingleMappingDashboardItem.SingleMappingDashboardItem,
|
|
507
453
|
{
|
|
508
454
|
onMappingEditHandler,
|
|
509
455
|
syncMapping,
|
|
@@ -520,1092 +466,6 @@ const SingleAccountDashboard = ({
|
|
|
520
466
|
}
|
|
521
467
|
)) : null));
|
|
522
468
|
};
|
|
523
|
-
const TriggerDasboardItem = ({
|
|
524
|
-
isDraft,
|
|
525
|
-
fieldOptions,
|
|
526
|
-
icon,
|
|
527
|
-
field,
|
|
528
|
-
description,
|
|
529
|
-
integrationName,
|
|
530
|
-
handleEditField,
|
|
531
|
-
handleDashboardPage,
|
|
532
|
-
toggleDashboardField,
|
|
533
|
-
deleteFieldHandler
|
|
534
|
-
}) => {
|
|
535
|
-
var _a, _b, _c, _d, _e, _f, _g, _h, _i, _j, _k, _l, _m, _n, _o, _p, _q, _r, _s, _t, _u;
|
|
536
|
-
const [isMappingDisplayed, setIsMappingDisplayed] = React.useState(false);
|
|
537
|
-
const [isDeleteModalOpen, setIsDeleteModalOpen] = React.useState(false);
|
|
538
|
-
const transformDataToString = (data) => {
|
|
539
|
-
const filterConditions = data.filters.map((filterGroup) => {
|
|
540
|
-
var _a2;
|
|
541
|
-
return (_a2 = filterGroup.filter.map((filter) => {
|
|
542
|
-
var _a3, _b2, _c2, _d2;
|
|
543
|
-
const field2 = filter.field;
|
|
544
|
-
const comparator = filter.comparator;
|
|
545
|
-
const value = filter.value;
|
|
546
|
-
const formattedComparator = ((_a3 = index$1.operatorOptions.find((option) => option.value === comparator)) == null ? void 0 : _a3.label) || comparator;
|
|
547
|
-
const fieldLabel = (_d2 = (_c2 = (_b2 = fieldOptions.find(
|
|
548
|
-
(options) => options.value === field2
|
|
549
|
-
)) == null ? void 0 : _b2.label) != null ? _c2 : field2 == null ? void 0 : field2.label) != null ? _d2 : field2;
|
|
550
|
-
return `${fieldLabel} ${formattedComparator === "NO_PREFERENCE" ? "has no preference" : formattedComparator} ${value}`;
|
|
551
|
-
})) == null ? void 0 : _a2.join(
|
|
552
|
-
` <span style="color: #6A6A6A;font-weight: 600;">${filterGroup.condition.toLowerCase()}</span> `
|
|
553
|
-
);
|
|
554
|
-
}).join(
|
|
555
|
-
`<br /> <span style="color: #6A6A6A;font-weight: 600;">${data.condition.toLowerCase() === "or" ? "Or" : "And"} When,</span> `
|
|
556
|
-
);
|
|
557
|
-
return `<p style="font-family: 'DM Sans'; font-size: 13.33px; font-weight: 400;line-height: 30px; color: #848484;"><span style="color: #6A6A6A;font-weight: 600;">When</span> ${filterConditions}</p>`;
|
|
558
|
-
};
|
|
559
|
-
return /* @__PURE__ */ React.createElement(React.Fragment, null, /* @__PURE__ */ React.createElement(
|
|
560
|
-
flex.Flex,
|
|
561
|
-
{
|
|
562
|
-
flexDirection: "column",
|
|
563
|
-
css: {
|
|
564
|
-
width: "100%",
|
|
565
|
-
height: "100%",
|
|
566
|
-
overflow: "auto",
|
|
567
|
-
marginTop: "$8"
|
|
568
|
-
}
|
|
569
|
-
},
|
|
570
|
-
/* @__PURE__ */ React.createElement(
|
|
571
|
-
flex.Flex,
|
|
572
|
-
{
|
|
573
|
-
css: {
|
|
574
|
-
border: isMappingDisplayed ? "$borderWidths$xs solid $black400" : "$borderWidths$xs solid $neutral200",
|
|
575
|
-
borderRadius: isMappingDisplayed ? "$2xl $2xl 0 0" : "$2xl",
|
|
576
|
-
padding: "$10 $12",
|
|
577
|
-
width: "100%",
|
|
578
|
-
backgroundColor: isMappingDisplayed ? "rgba(100, 116, 139, 0.04)" : "$white900"
|
|
579
|
-
},
|
|
580
|
-
justifyContent: "space-between",
|
|
581
|
-
alignItems: "center"
|
|
582
|
-
},
|
|
583
|
-
/* @__PURE__ */ React.createElement(
|
|
584
|
-
flex.Flex,
|
|
585
|
-
{
|
|
586
|
-
alignItems: "center",
|
|
587
|
-
gap: "$4",
|
|
588
|
-
css: { cursor: "pointer" },
|
|
589
|
-
onClick: () => setIsMappingDisplayed(!isMappingDisplayed)
|
|
590
|
-
},
|
|
591
|
-
isMappingDisplayed ? /* @__PURE__ */ React.createElement(chevronDown.ChevronDownIcon, { size: 40, color: "#848484" }) : /* @__PURE__ */ React.createElement(chevronRight.ChevronRightIcon, { size: 40, color: "#848484" }),
|
|
592
|
-
/* @__PURE__ */ React.createElement(flex.Flex, { alignItems: "center", gap: "$4" }, icon, /* @__PURE__ */ React.createElement(flex.Flex, { gap: "$1", flexDirection: "column" }, /* @__PURE__ */ React.createElement(text.Text, { size: "md", weight: "bold" }, (_a = field == null ? void 0 : field.email) != null ? _a : "Trigger"), /* @__PURE__ */ React.createElement(text.Text, { size: "sm", css: { color: "$neutral600" } }, description != null ? description : `Trigger survey when an event happens in ${integrationName}`)))
|
|
593
|
-
),
|
|
594
|
-
/* @__PURE__ */ React.createElement(flex.Flex, { alignItems: "center", gap: "$12" }, isDraft && /* @__PURE__ */ React.createElement(flex.Flex, { alignItems: "center", gap: "$12" }, /* @__PURE__ */ React.createElement(chip.Chip, { rounded: "full", size: "sm" }, /* @__PURE__ */ React.createElement(
|
|
595
|
-
box.Box,
|
|
596
|
-
{
|
|
597
|
-
css: {
|
|
598
|
-
background: "$neutral500",
|
|
599
|
-
borderRadius: "50%",
|
|
600
|
-
marginRight: "$1",
|
|
601
|
-
width: "$4",
|
|
602
|
-
height: "$4"
|
|
603
|
-
}
|
|
604
|
-
}
|
|
605
|
-
), /* @__PURE__ */ React.createElement(
|
|
606
|
-
text.Text,
|
|
607
|
-
{
|
|
608
|
-
size: "sm",
|
|
609
|
-
weight: "bold",
|
|
610
|
-
css: {
|
|
611
|
-
color: "$neutral800"
|
|
612
|
-
}
|
|
613
|
-
},
|
|
614
|
-
"DRAFT"
|
|
615
|
-
)), /* @__PURE__ */ React.createElement(
|
|
616
|
-
box.Box,
|
|
617
|
-
{
|
|
618
|
-
css: {
|
|
619
|
-
width: "1px",
|
|
620
|
-
height: "20px",
|
|
621
|
-
background: "#64748B20"
|
|
622
|
-
}
|
|
623
|
-
}
|
|
624
|
-
)), /* @__PURE__ */ React.createElement(
|
|
625
|
-
_switch.Switch,
|
|
626
|
-
{
|
|
627
|
-
size: "md",
|
|
628
|
-
checked: field.isEnabled,
|
|
629
|
-
onChange: (value) => toggleDashboardField == null ? void 0 : toggleDashboardField(field.id, value)
|
|
630
|
-
}
|
|
631
|
-
), /* @__PURE__ */ React.createElement(dropdown.DropdownMenu, null, /* @__PURE__ */ React.createElement(dropdown.DropdownMenuTrigger, { asChild: true }, /* @__PURE__ */ React.createElement(
|
|
632
|
-
iconButton.IconButton,
|
|
633
|
-
{
|
|
634
|
-
variant: "ghost",
|
|
635
|
-
color: "default",
|
|
636
|
-
size: "lg",
|
|
637
|
-
icon: /* @__PURE__ */ React.createElement(ellipsisVertical.EllipsisVerticalIcon, null)
|
|
638
|
-
}
|
|
639
|
-
)), /* @__PURE__ */ React.createElement(
|
|
640
|
-
dropdown.DropdownMenuContent,
|
|
641
|
-
{
|
|
642
|
-
className: "dm-sans",
|
|
643
|
-
css: {
|
|
644
|
-
minWidth: 180,
|
|
645
|
-
zIndex: 10,
|
|
646
|
-
"& p": {
|
|
647
|
-
margin: "0 !important",
|
|
648
|
-
padding: "0 !important"
|
|
649
|
-
}
|
|
650
|
-
},
|
|
651
|
-
sideOffset: 4,
|
|
652
|
-
align: "end"
|
|
653
|
-
},
|
|
654
|
-
/* @__PURE__ */ React.createElement(
|
|
655
|
-
dropdown.DropdownMenuItem,
|
|
656
|
-
{
|
|
657
|
-
css: {
|
|
658
|
-
cursor: "pointer"
|
|
659
|
-
},
|
|
660
|
-
onClick: () => {
|
|
661
|
-
handleEditField({
|
|
662
|
-
type: "TRIGGER",
|
|
663
|
-
values: field,
|
|
664
|
-
id: field.id
|
|
665
|
-
});
|
|
666
|
-
handleDashboardPage(false, "TRIGGER");
|
|
667
|
-
}
|
|
668
|
-
},
|
|
669
|
-
/* @__PURE__ */ React.createElement(flex.Flex, { alignItems: "center", gap: "$2" }, /* @__PURE__ */ React.createElement(pencil.PencilIcon, { color: "#6A6A6A", size: 20 }), /* @__PURE__ */ React.createElement(text.Text, { size: "sm" }, "Edit"))
|
|
670
|
-
),
|
|
671
|
-
/* @__PURE__ */ React.createElement(
|
|
672
|
-
dropdown.DropdownMenuItem,
|
|
673
|
-
{
|
|
674
|
-
onClick: () => setIsDeleteModalOpen(true),
|
|
675
|
-
css: {
|
|
676
|
-
cursor: "pointer"
|
|
677
|
-
}
|
|
678
|
-
},
|
|
679
|
-
/* @__PURE__ */ React.createElement(flex.Flex, { alignItems: "center", gap: "$2" }, /* @__PURE__ */ React.createElement(_delete.DeleteIcon, { color: "#6A6A6A", size: 20 }), /* @__PURE__ */ React.createElement(text.Text, { size: "sm" }, "Delete"))
|
|
680
|
-
)
|
|
681
|
-
)))
|
|
682
|
-
),
|
|
683
|
-
isMappingDisplayed && /* @__PURE__ */ React.createElement(
|
|
684
|
-
box.Box,
|
|
685
|
-
{
|
|
686
|
-
css: {
|
|
687
|
-
borderInline: "$borderWidths$xs solid $black400",
|
|
688
|
-
maxHeight: 734,
|
|
689
|
-
height: "100%",
|
|
690
|
-
position: "relative",
|
|
691
|
-
overflow: "auto",
|
|
692
|
-
padding: "$16 $36"
|
|
693
|
-
}
|
|
694
|
-
},
|
|
695
|
-
/* @__PURE__ */ React.createElement(SingleMappingEventWrapper, { isTrigger: true, field }),
|
|
696
|
-
((_c = (_b = field.fields) == null ? void 0 : _b.filters) == null ? void 0 : _c.length) ? /* @__PURE__ */ React.createElement(React.Fragment, null, /* @__PURE__ */ React.createElement(
|
|
697
|
-
flex.Flex,
|
|
698
|
-
{
|
|
699
|
-
flexDirection: "column",
|
|
700
|
-
gap: "$6",
|
|
701
|
-
css: { paddingBlock: "$8" }
|
|
702
|
-
},
|
|
703
|
-
/* @__PURE__ */ React.createElement(
|
|
704
|
-
text.Text,
|
|
705
|
-
{
|
|
706
|
-
size: "sm",
|
|
707
|
-
weight: "bold",
|
|
708
|
-
css: { textTransform: "uppercase" }
|
|
709
|
-
},
|
|
710
|
-
"CONDITION"
|
|
711
|
-
),
|
|
712
|
-
index.default(transformDataToString(field.fields))
|
|
713
|
-
), /* @__PURE__ */ React.createElement(
|
|
714
|
-
box.Box,
|
|
715
|
-
{
|
|
716
|
-
css: {
|
|
717
|
-
marginBlock: "$4",
|
|
718
|
-
height: "1px",
|
|
719
|
-
background: "$neutral100"
|
|
720
|
-
}
|
|
721
|
-
}
|
|
722
|
-
)) : null,
|
|
723
|
-
((_g = (_f = (_e = (_d = field == null ? void 0 : field.triggerDetails) == null ? void 0 : _d.variables) == null ? void 0 : _e.filter) == null ? void 0 : _f.call(_e, (variable) => variable.isEnabled)) == null ? void 0 : _g.length) ? /* @__PURE__ */ React.createElement(
|
|
724
|
-
SingleMappingChipWrapper,
|
|
725
|
-
{
|
|
726
|
-
heading: ((_i = (_h = field == null ? void 0 : field.triggerDetails) == null ? void 0 : _h.variables) == null ? void 0 : _i.length) > 1 ? "PASSING VARIABLES TO SURVEY" : "PASSING VARIABLE TO SURVEY",
|
|
727
|
-
fields: field.triggerDetails.variables,
|
|
728
|
-
backgroundColor: "$positive100"
|
|
729
|
-
}
|
|
730
|
-
) : null,
|
|
731
|
-
/* @__PURE__ */ React.createElement(React.Fragment, null, /* @__PURE__ */ React.createElement(
|
|
732
|
-
flex.Flex,
|
|
733
|
-
{
|
|
734
|
-
flexDirection: "column",
|
|
735
|
-
gap: "$6",
|
|
736
|
-
css: { paddingBlock: "$8" }
|
|
737
|
-
},
|
|
738
|
-
/* @__PURE__ */ React.createElement(text.Text, { size: "sm", weight: "bold" }, "SEND SURVEY"),
|
|
739
|
-
/* @__PURE__ */ React.createElement(flex.Flex, { alignItems: "center" }, ((_k = (_j = field == null ? void 0 : field.triggerDetails) == null ? void 0 : _j.shareType) == null ? void 0 : _k.value) ? /* @__PURE__ */ React.createElement(
|
|
740
|
-
EventComponent,
|
|
741
|
-
{
|
|
742
|
-
heading: "Share Type:",
|
|
743
|
-
description: (_m = (_l = field == null ? void 0 : field.triggerDetails) == null ? void 0 : _l.shareType) == null ? void 0 : _m.label
|
|
744
|
-
}
|
|
745
|
-
) : null, ((_o = (_n = field == null ? void 0 : field.triggerDetails) == null ? void 0 : _n.shareRecipient) == null ? void 0 : _o.value) ? /* @__PURE__ */ React.createElement(
|
|
746
|
-
EventComponent,
|
|
747
|
-
{
|
|
748
|
-
heading: "Recipient:",
|
|
749
|
-
hasBorder: true,
|
|
750
|
-
description: (_q = (_p = field == null ? void 0 : field.triggerDetails) == null ? void 0 : _p.shareRecipient) == null ? void 0 : _q.label
|
|
751
|
-
}
|
|
752
|
-
) : null, ((_s = (_r = field == null ? void 0 : field.triggerDetails) == null ? void 0 : _r.shareChannel) == null ? void 0 : _s.value) ? /* @__PURE__ */ React.createElement(
|
|
753
|
-
EventComponent,
|
|
754
|
-
{
|
|
755
|
-
hasBorder: true,
|
|
756
|
-
heading: "Share Channel:",
|
|
757
|
-
description: (_u = (_t = field == null ? void 0 : field.triggerDetails) == null ? void 0 : _t.shareChannel) == null ? void 0 : _u.label
|
|
758
|
-
}
|
|
759
|
-
) : null)
|
|
760
|
-
))
|
|
761
|
-
),
|
|
762
|
-
isMappingDisplayed && /* @__PURE__ */ React.createElement(
|
|
763
|
-
box.Box,
|
|
764
|
-
{
|
|
765
|
-
css: {
|
|
766
|
-
padding: "$8 $32",
|
|
767
|
-
border: "$borderWidths$xs solid $black400",
|
|
768
|
-
borderTop: "$borderWidths$xs solid $neutral200",
|
|
769
|
-
borderRadius: "0 0 $2xl $2xl",
|
|
770
|
-
height: "100%"
|
|
771
|
-
}
|
|
772
|
-
},
|
|
773
|
-
/* @__PURE__ */ React.createElement(
|
|
774
|
-
button.Button,
|
|
775
|
-
{
|
|
776
|
-
size: "sm",
|
|
777
|
-
leftIcon: /* @__PURE__ */ React.createElement(pencil.PencilIcon, null),
|
|
778
|
-
color: "primary",
|
|
779
|
-
variant: "ghost",
|
|
780
|
-
onClick: () => {
|
|
781
|
-
handleEditField({
|
|
782
|
-
type: "TRIGGER",
|
|
783
|
-
values: field,
|
|
784
|
-
id: field.id
|
|
785
|
-
});
|
|
786
|
-
handleDashboardPage(false, "TRIGGER");
|
|
787
|
-
}
|
|
788
|
-
},
|
|
789
|
-
"Edit Trigger"
|
|
790
|
-
)
|
|
791
|
-
)
|
|
792
|
-
), isDeleteModalOpen && /* @__PURE__ */ React.createElement(
|
|
793
|
-
confirmationModal.default,
|
|
794
|
-
{
|
|
795
|
-
name: "Delete Trigger?",
|
|
796
|
-
description: `Are you sure you want to delete the trigger? This action cannot be undone.`,
|
|
797
|
-
onConfirm: () => deleteFieldHandler == null ? void 0 : deleteFieldHandler(field.id),
|
|
798
|
-
onCancel: () => setIsDeleteModalOpen(false)
|
|
799
|
-
}
|
|
800
|
-
));
|
|
801
|
-
};
|
|
802
|
-
const SingleMappingDashboardItem = ({
|
|
803
|
-
hasEditMapping,
|
|
804
|
-
fieldOptions,
|
|
805
|
-
icon,
|
|
806
|
-
field,
|
|
807
|
-
handleEditField,
|
|
808
|
-
handleDashboardPage,
|
|
809
|
-
toggleDashboardField,
|
|
810
|
-
deleteFieldHandler,
|
|
811
|
-
syncMapping,
|
|
812
|
-
integrationName,
|
|
813
|
-
onMappingEditHandler
|
|
814
|
-
}) => {
|
|
815
|
-
var _a, _b, _c, _d, _e, _f, _g, _h, _i, _j, _k, _l, _m, _n, _o, _p, _q, _r, _s, _t, _u, _v, _w, _x, _y, _z, _A, _B, _C, _D, _E, _F, _G, _H, _I, _J, _K, _L, _M, _N, _O, _P, _Q, _R, _S, _T, _U, _V, _W, _X, _Y, _Z, __, _$;
|
|
816
|
-
const [isMappingDisplayed, setIsMappingDisplayed] = React.useState(false);
|
|
817
|
-
const [isDeleteModalOpen, setIsDeleteModalOpen] = React.useState(false);
|
|
818
|
-
const [isSyncing, setIsSyncing] = React.useState(null);
|
|
819
|
-
return /* @__PURE__ */ React.createElement(React.Fragment, null, /* @__PURE__ */ React.createElement(
|
|
820
|
-
flex.Flex,
|
|
821
|
-
{
|
|
822
|
-
flexDirection: "column",
|
|
823
|
-
css: {
|
|
824
|
-
width: "100%",
|
|
825
|
-
height: "100%",
|
|
826
|
-
overflow: "auto",
|
|
827
|
-
marginTop: "$8"
|
|
828
|
-
}
|
|
829
|
-
},
|
|
830
|
-
/* @__PURE__ */ React.createElement(
|
|
831
|
-
flex.Flex,
|
|
832
|
-
{
|
|
833
|
-
css: {
|
|
834
|
-
border: isMappingDisplayed ? "$borderWidths$xs solid $black400" : "$borderWidths$xs solid $neutral200",
|
|
835
|
-
borderRadius: isMappingDisplayed ? "$2xl $2xl 0 0" : "$2xl",
|
|
836
|
-
padding: (field == null ? void 0 : field.mappingName) || (field == null ? void 0 : field.mappingDescription) ? "$10 $12" : "15px $12",
|
|
837
|
-
width: "100%",
|
|
838
|
-
backgroundColor: isMappingDisplayed ? "rgba(100, 116, 139, 0.04)" : "$white900"
|
|
839
|
-
},
|
|
840
|
-
justifyContent: "space-between",
|
|
841
|
-
alignItems: "center"
|
|
842
|
-
},
|
|
843
|
-
/* @__PURE__ */ React.createElement(
|
|
844
|
-
flex.Flex,
|
|
845
|
-
{
|
|
846
|
-
alignItems: "center",
|
|
847
|
-
gap: "$4",
|
|
848
|
-
css: { cursor: "pointer" },
|
|
849
|
-
onClick: () => setIsMappingDisplayed(!isMappingDisplayed)
|
|
850
|
-
},
|
|
851
|
-
isMappingDisplayed ? /* @__PURE__ */ React.createElement(chevronDown.ChevronDownIcon, { size: 40, color: "#848484" }) : /* @__PURE__ */ React.createElement(chevronRight.ChevronRightIcon, { size: 40, color: "#848484" }),
|
|
852
|
-
/* @__PURE__ */ React.createElement(flex.Flex, { alignItems: "center", gap: "$4" }, (() => (field == null ? void 0 : field.isEnabled) !== null && (field == null ? void 0 : field.isEnabled) !== void 0)() ? icon : null, /* @__PURE__ */ React.createElement(flex.Flex, { gap: "$1", flexDirection: "column" }, /* @__PURE__ */ React.createElement(text.Text, { size: "md", weight: "bold" }, (field == null ? void 0 : field.mappingName) ? field == null ? void 0 : field.mappingName : (_d = (_c = (_b = (_a = field == null ? void 0 : field.configurationFields) == null ? void 0 : _a.account) == null ? void 0 : _b.value) == null ? void 0 : _c.label) != null ? _d : "Mapping"), (field == null ? void 0 : field.mappingDescription) && /* @__PURE__ */ React.createElement(
|
|
853
|
-
text.Text,
|
|
854
|
-
{
|
|
855
|
-
size: "sm",
|
|
856
|
-
css: {
|
|
857
|
-
"& span": {
|
|
858
|
-
fontFamily: "'DM Sans', sans-serif !important"
|
|
859
|
-
},
|
|
860
|
-
color: "$neutral600",
|
|
861
|
-
"& b": {
|
|
862
|
-
fontWeight: "$6 !important",
|
|
863
|
-
fontFamily: "'DM Sans', sans-serif !important"
|
|
864
|
-
}
|
|
865
|
-
},
|
|
866
|
-
dangerouslySetInnerHTML: {
|
|
867
|
-
__html: (field == null ? void 0 : field.mappingDescription) ? field == null ? void 0 : field.mappingDescription : `Sync survey responses to ${integrationName} when ${(_g = (_f = (_e = field == null ? void 0 : field.mappingConfiguration) == null ? void 0 : _e.events) == null ? void 0 : _f.label) == null ? void 0 : _g.toLowerCase()} is ${trasformToPastTense(`${(_j = (_i = (_h = field == null ? void 0 : field.mappingConfiguration) == null ? void 0 : _h.action) == null ? void 0 : _i.label) == null ? void 0 : _j.toLowerCase()}`)}`
|
|
868
|
-
}
|
|
869
|
-
}
|
|
870
|
-
)))
|
|
871
|
-
),
|
|
872
|
-
/* @__PURE__ */ React.createElement(flex.Flex, { alignItems: "center", gap: "$12" }, syncMapping ? /* @__PURE__ */ React.createElement(tooltip.Tooltip, { content: "Sync", className: "dm-sans" }, /* @__PURE__ */ React.createElement(
|
|
873
|
-
button.Button,
|
|
874
|
-
{
|
|
875
|
-
variant: "ghost",
|
|
876
|
-
size: "lg",
|
|
877
|
-
color: "default",
|
|
878
|
-
css: {
|
|
879
|
-
width: "40px !important",
|
|
880
|
-
height: "40px !important",
|
|
881
|
-
marginInlineEnd: "$3"
|
|
882
|
-
}
|
|
883
|
-
},
|
|
884
|
-
/* @__PURE__ */ React.createElement(
|
|
885
|
-
flex.Flex,
|
|
886
|
-
{
|
|
887
|
-
className: `rotating-div ${isSyncing === field.id ? "rotate" : ""}`,
|
|
888
|
-
justifyContent: "center",
|
|
889
|
-
alignItems: "center",
|
|
890
|
-
onClick: async () => {
|
|
891
|
-
setIsSyncing(field.id);
|
|
892
|
-
setTimeout(async () => {
|
|
893
|
-
await (syncMapping == null ? void 0 : syncMapping(field.id));
|
|
894
|
-
setIsSyncing(null);
|
|
895
|
-
}, 2e3);
|
|
896
|
-
}
|
|
897
|
-
},
|
|
898
|
-
/* @__PURE__ */ React.createElement(sync.default, null)
|
|
899
|
-
)
|
|
900
|
-
)) : null, (() => (field == null ? void 0 : field.isEnabled) !== null && (field == null ? void 0 : field.isEnabled) !== void 0 && syncMapping)() ? /* @__PURE__ */ React.createElement(
|
|
901
|
-
box.Box,
|
|
902
|
-
{
|
|
903
|
-
css: {
|
|
904
|
-
width: "1px",
|
|
905
|
-
height: "20px",
|
|
906
|
-
background: "#64748B33"
|
|
907
|
-
}
|
|
908
|
-
}
|
|
909
|
-
) : null, (() => (field == null ? void 0 : field.isEnabled) !== null && (field == null ? void 0 : field.isEnabled) !== void 0)() ? /* @__PURE__ */ React.createElement(
|
|
910
|
-
_switch.Switch,
|
|
911
|
-
{
|
|
912
|
-
size: "md",
|
|
913
|
-
checked: field.isEnabled,
|
|
914
|
-
onChange: (value) => toggleDashboardField == null ? void 0 : toggleDashboardField(field.id, value)
|
|
915
|
-
}
|
|
916
|
-
) : null, /* @__PURE__ */ React.createElement(dropdown.DropdownMenu, null, /* @__PURE__ */ React.createElement(tooltip.Tooltip, { content: "More", className: "dm-sans" }, /* @__PURE__ */ React.createElement(dropdown.DropdownMenuTrigger, { asChild: true }, /* @__PURE__ */ React.createElement(
|
|
917
|
-
iconButton.IconButton,
|
|
918
|
-
{
|
|
919
|
-
variant: "ghost",
|
|
920
|
-
color: "default",
|
|
921
|
-
size: "lg",
|
|
922
|
-
icon: /* @__PURE__ */ React.createElement(ellipsisVertical.EllipsisVerticalIcon, null)
|
|
923
|
-
}
|
|
924
|
-
))), /* @__PURE__ */ React.createElement(
|
|
925
|
-
dropdown.DropdownMenuContent,
|
|
926
|
-
{
|
|
927
|
-
className: "dm-sans",
|
|
928
|
-
css: {
|
|
929
|
-
minWidth: 180,
|
|
930
|
-
zIndex: 10,
|
|
931
|
-
"& p": {
|
|
932
|
-
margin: "0 !important",
|
|
933
|
-
padding: "0 !important"
|
|
934
|
-
}
|
|
935
|
-
},
|
|
936
|
-
sideOffset: 4,
|
|
937
|
-
align: "end"
|
|
938
|
-
},
|
|
939
|
-
hasEditMapping === void 0 || hasEditMapping ? /* @__PURE__ */ React.createElement(
|
|
940
|
-
dropdown.DropdownMenuItem,
|
|
941
|
-
{
|
|
942
|
-
css: {
|
|
943
|
-
cursor: "pointer"
|
|
944
|
-
},
|
|
945
|
-
onClick: () => {
|
|
946
|
-
onMappingEditHandler(field.id);
|
|
947
|
-
handleEditField({
|
|
948
|
-
type: "MAPPING",
|
|
949
|
-
values: field,
|
|
950
|
-
id: field.id
|
|
951
|
-
});
|
|
952
|
-
handleDashboardPage(false, "MAPPING");
|
|
953
|
-
}
|
|
954
|
-
},
|
|
955
|
-
/* @__PURE__ */ React.createElement(flex.Flex, { alignItems: "center", gap: "$2" }, /* @__PURE__ */ React.createElement(pencil.PencilIcon, { color: "#6A6A6A", size: 20 }), /* @__PURE__ */ React.createElement(text.Text, { size: "sm" }, "Edit"))
|
|
956
|
-
) : null,
|
|
957
|
-
/* @__PURE__ */ React.createElement(
|
|
958
|
-
dropdown.DropdownMenuItem,
|
|
959
|
-
{
|
|
960
|
-
onClick: () => setIsDeleteModalOpen(true),
|
|
961
|
-
css: {
|
|
962
|
-
cursor: "pointer"
|
|
963
|
-
}
|
|
964
|
-
},
|
|
965
|
-
/* @__PURE__ */ React.createElement(flex.Flex, { alignItems: "center", gap: "$2" }, /* @__PURE__ */ React.createElement(_delete.DeleteIcon, { color: "#6A6A6A", size: 20 }), /* @__PURE__ */ React.createElement(text.Text, { size: "sm" }, "Delete"))
|
|
966
|
-
)
|
|
967
|
-
)))
|
|
968
|
-
),
|
|
969
|
-
isMappingDisplayed ? /* @__PURE__ */ React.createElement(box.Box, null, /* @__PURE__ */ React.createElement(
|
|
970
|
-
box.Box,
|
|
971
|
-
{
|
|
972
|
-
css: {
|
|
973
|
-
borderInline: "$borderWidths$xs solid $black400",
|
|
974
|
-
maxHeight: 734,
|
|
975
|
-
height: "100%",
|
|
976
|
-
position: "relative",
|
|
977
|
-
overflow: "auto",
|
|
978
|
-
padding: "$16 $36"
|
|
979
|
-
}
|
|
980
|
-
},
|
|
981
|
-
/* @__PURE__ */ React.createElement(SingleMappingEventWrapper, { field }),
|
|
982
|
-
!!((_n = (_m = (_l = (_k = field == null ? void 0 : field.mappedFields) == null ? void 0 : _k.questions) == null ? void 0 : _l.filter) == null ? void 0 : _m.call(_l, (question) => question.isEnabled)) == null ? void 0 : _n.length) ? /* @__PURE__ */ React.createElement(
|
|
983
|
-
SingleMappingChipWrapper,
|
|
984
|
-
{
|
|
985
|
-
heading: "Questions",
|
|
986
|
-
fields: (_q = (_p = (_o = field == null ? void 0 : field.mappedFields) == null ? void 0 : _o.questions) == null ? void 0 : _p.filter) == null ? void 0 : _q.call(_p, (question) => question.isEnabled),
|
|
987
|
-
backgroundColor: "#E5F2FF"
|
|
988
|
-
}
|
|
989
|
-
) : null,
|
|
990
|
-
!!((_u = (_t = (_s = (_r = field == null ? void 0 : field.mappedFields) == null ? void 0 : _r.derivedQuestions) == null ? void 0 : _s.filter) == null ? void 0 : _t.call(
|
|
991
|
-
_s,
|
|
992
|
-
(derivedQuestion) => derivedQuestion.isEnabled
|
|
993
|
-
)) == null ? void 0 : _u.length) ? /* @__PURE__ */ React.createElement(
|
|
994
|
-
SingleMappingChipWrapper,
|
|
995
|
-
{
|
|
996
|
-
heading: "Enrich",
|
|
997
|
-
fields: (_x = (_w = (_v = field == null ? void 0 : field.mappedFields) == null ? void 0 : _v.derivedQuestions) == null ? void 0 : _w.filter) == null ? void 0 : _x.call(
|
|
998
|
-
_w,
|
|
999
|
-
(derivedQuestion) => derivedQuestion.isEnabled
|
|
1000
|
-
),
|
|
1001
|
-
backgroundColor: "#E5F2FF"
|
|
1002
|
-
}
|
|
1003
|
-
) : null,
|
|
1004
|
-
!!((_B = (_A = (_z = (_y = field == null ? void 0 : field.mappedFields) == null ? void 0 : _y.variables) == null ? void 0 : _z.filter) == null ? void 0 : _A.call(_z, (variable) => variable.isEnabled)) == null ? void 0 : _B.length) ? /* @__PURE__ */ React.createElement(
|
|
1005
|
-
SingleMappingChipWrapper,
|
|
1006
|
-
{
|
|
1007
|
-
heading: "Variables",
|
|
1008
|
-
fields: (_E = (_D = (_C = field == null ? void 0 : field.mappedFields) == null ? void 0 : _C.variables) == null ? void 0 : _D.filter) == null ? void 0 : _E.call(_D, (variable) => variable.isEnabled),
|
|
1009
|
-
backgroundColor: "$positive100"
|
|
1010
|
-
}
|
|
1011
|
-
) : null,
|
|
1012
|
-
!!((_I = (_H = (_G = (_F = field == null ? void 0 : field.mappedFields) == null ? void 0 : _F.contactProperties) == null ? void 0 : _G.filter) == null ? void 0 : _H.call(_G, (property) => property.isEnabled)) == null ? void 0 : _I.length) ? /* @__PURE__ */ React.createElement(
|
|
1013
|
-
SingleMappingChipWrapper,
|
|
1014
|
-
{
|
|
1015
|
-
heading: "Contacts",
|
|
1016
|
-
fields: (_L = (_K = (_J = field == null ? void 0 : field.mappedFields) == null ? void 0 : _J.contactProperties) == null ? void 0 : _K.filter) == null ? void 0 : _L.call(_K, (property) => property.isEnabled),
|
|
1017
|
-
backgroundColor: "$negative100"
|
|
1018
|
-
}
|
|
1019
|
-
) : null,
|
|
1020
|
-
!!((_P = (_O = (_N = (_M = field == null ? void 0 : field.mappedFields) == null ? void 0 : _M.expressions) == null ? void 0 : _N.filter) == null ? void 0 : _O.call(_N, (expression) => expression.isEnabled)) == null ? void 0 : _P.length) ? /* @__PURE__ */ React.createElement(
|
|
1021
|
-
SingleMappingChipWrapper,
|
|
1022
|
-
{
|
|
1023
|
-
heading: "Expression",
|
|
1024
|
-
backgroundColor: "$neutral100",
|
|
1025
|
-
fields: (_S = (_R = (_Q = field == null ? void 0 : field.mappedFields) == null ? void 0 : _Q.expressions) == null ? void 0 : _R.filter) == null ? void 0 : _S.call(_R, (expression) => expression.isEnabled)
|
|
1026
|
-
}
|
|
1027
|
-
) : null,
|
|
1028
|
-
!!((_W = (_V = (_U = (_T = field == null ? void 0 : field.mappedFields) == null ? void 0 : _T.property) == null ? void 0 : _U.filter) == null ? void 0 : _V.call(_U, (property) => property.isEnabled)) == null ? void 0 : _W.length) ? /* @__PURE__ */ React.createElement(
|
|
1029
|
-
SingleMappingChipWrapper,
|
|
1030
|
-
{
|
|
1031
|
-
heading: "Property",
|
|
1032
|
-
hideBorder: true,
|
|
1033
|
-
fields: (_Z = (_Y = (_X = field == null ? void 0 : field.mappedFields) == null ? void 0 : _X.property) == null ? void 0 : _Y.filter) == null ? void 0 : _Z.call(_Y, (property) => property.isEnabled),
|
|
1034
|
-
backgroundColor: "rgba(74, 156, 166, 0.15)"
|
|
1035
|
-
}
|
|
1036
|
-
) : null
|
|
1037
|
-
), isMappingDisplayed && /* @__PURE__ */ React.createElement(
|
|
1038
|
-
box.Box,
|
|
1039
|
-
{
|
|
1040
|
-
css: {
|
|
1041
|
-
padding: "$8 $32",
|
|
1042
|
-
border: "$borderWidths$xs solid $black400",
|
|
1043
|
-
borderTop: hasEditMapping === void 0 || hasEditMapping ? "$borderWidths$xs solid $neutral200" : "none",
|
|
1044
|
-
borderRadius: "0 0 $2xl $2xl",
|
|
1045
|
-
height: "100%"
|
|
1046
|
-
}
|
|
1047
|
-
},
|
|
1048
|
-
((_$ = (__ = field == null ? void 0 : field.mappingConditions) == null ? void 0 : __.filterGroups) == null ? void 0 : _$.length) ? /* @__PURE__ */ React.createElement(flex.Flex, { flexDirection: "column", justifyContent: "center" }, /* @__PURE__ */ React.createElement(text.Text, { className: "dm-sans", size: "sm", weight: "bold", css: { textTransform: "uppercase", color: "$neutral900", fontFamily: "DM Sans !important", paddingLeft: "$4" } }, "CONDITION"), /* @__PURE__ */ React.createElement(flex.Flex, { css: {
|
|
1049
|
-
marginTop: "$2 !important"
|
|
1050
|
-
} }, /* @__PURE__ */ React.createElement(
|
|
1051
|
-
conditionDescriptionBuilder.ConditionCard,
|
|
1052
|
-
{
|
|
1053
|
-
isEditable: false,
|
|
1054
|
-
conditionsData: field == null ? void 0 : field.mappingConditions,
|
|
1055
|
-
showMoreMenu: false
|
|
1056
|
-
}
|
|
1057
|
-
))) : null,
|
|
1058
|
-
/* @__PURE__ */ React.createElement(
|
|
1059
|
-
button.Button,
|
|
1060
|
-
{
|
|
1061
|
-
size: "sm",
|
|
1062
|
-
leftIcon: /* @__PURE__ */ React.createElement(pencil.PencilIcon, null),
|
|
1063
|
-
color: "primary",
|
|
1064
|
-
variant: "ghost",
|
|
1065
|
-
css: {
|
|
1066
|
-
display: hasEditMapping === void 0 || hasEditMapping ? "flex" : "none"
|
|
1067
|
-
},
|
|
1068
|
-
onClick: () => {
|
|
1069
|
-
onMappingEditHandler(field.id);
|
|
1070
|
-
handleEditField({
|
|
1071
|
-
type: "SINGLE_MAPPING",
|
|
1072
|
-
values: field,
|
|
1073
|
-
id: field.id
|
|
1074
|
-
});
|
|
1075
|
-
handleDashboardPage(false, "MAPPING");
|
|
1076
|
-
}
|
|
1077
|
-
},
|
|
1078
|
-
"Edit Mapping"
|
|
1079
|
-
)
|
|
1080
|
-
)) : null
|
|
1081
|
-
), isDeleteModalOpen && /* @__PURE__ */ React.createElement(
|
|
1082
|
-
confirmationModal.default,
|
|
1083
|
-
{
|
|
1084
|
-
name: "Delete Mapping?",
|
|
1085
|
-
description: `Are you sure you want to delete the mapping? This action cannot be undone.`,
|
|
1086
|
-
onConfirm: () => deleteFieldHandler == null ? void 0 : deleteFieldHandler(field.id),
|
|
1087
|
-
onCancel: () => setIsDeleteModalOpen(false)
|
|
1088
|
-
}
|
|
1089
|
-
));
|
|
1090
|
-
};
|
|
1091
|
-
const EventComponent = ({
|
|
1092
|
-
heading,
|
|
1093
|
-
description,
|
|
1094
|
-
hasBorder,
|
|
1095
|
-
hasLink = ""
|
|
1096
|
-
}) => {
|
|
1097
|
-
return /* @__PURE__ */ React.createElement(flex.Flex, { alignItems: "center" }, hasBorder && /* @__PURE__ */ React.createElement(box.Box, { css: { paddingInline: "$3" } }, /* @__PURE__ */ React.createElement(
|
|
1098
|
-
box.Box,
|
|
1099
|
-
{
|
|
1100
|
-
css: {
|
|
1101
|
-
height: "$3",
|
|
1102
|
-
width: "1px",
|
|
1103
|
-
background: "$neutral200",
|
|
1104
|
-
marginInline: "$4"
|
|
1105
|
-
}
|
|
1106
|
-
}
|
|
1107
|
-
)), /* @__PURE__ */ React.createElement(flex.Flex, { gap: "$2" }, /* @__PURE__ */ React.createElement(text.Text, { size: "sm", css: { color: "$neutral700" } }, heading), !!hasLink ? /* @__PURE__ */ React.createElement(
|
|
1108
|
-
text.Text,
|
|
1109
|
-
{
|
|
1110
|
-
size: "sm",
|
|
1111
|
-
weight: "medium",
|
|
1112
|
-
css: {
|
|
1113
|
-
color: "$primary500",
|
|
1114
|
-
textDecoration: "underline",
|
|
1115
|
-
cursor: "pointer",
|
|
1116
|
-
"&:hover": {
|
|
1117
|
-
color: "$primary600 !important"
|
|
1118
|
-
}
|
|
1119
|
-
},
|
|
1120
|
-
onClick: () => window.open(`${hasLink}`, "_blank")
|
|
1121
|
-
},
|
|
1122
|
-
description
|
|
1123
|
-
) : /* @__PURE__ */ React.createElement(text.Text, { size: "sm", weight: "medium", css: { color: "$neutral800" } }, description)));
|
|
1124
|
-
};
|
|
1125
|
-
const SingleMappingEventWrapper = ({
|
|
1126
|
-
field,
|
|
1127
|
-
isTrigger
|
|
1128
|
-
}) => {
|
|
1129
|
-
var _a, _b, _c, _d, _e, _f, _g, _h, _i, _j, _k, _l, _m, _n, _o, _p, _q, _r, _s, _t, _u, _v, _w, _x, _y, _z, _A, _B, _C, _D, _E, _F, _G, _H, _I, _J, _K, _L;
|
|
1130
|
-
const hasEventSection = !!((_c = (_b = (_a = field == null ? void 0 : field.configurationFields) == null ? void 0 : _a.account) == null ? void 0 : _b.value) == null ? void 0 : _c.label) || !!field.action || !!field.exisitingSheet || !!(field == null ? void 0 : field.configurationFields) || !!field.object && isTrigger;
|
|
1131
|
-
return /* @__PURE__ */ React.createElement(React.Fragment, null, hasEventSection ? /* @__PURE__ */ React.createElement(flex.Flex, { flexDirection: "column", gap: "$6" }, /* @__PURE__ */ React.createElement(text.Text, { size: "sm", weight: "bold", css: { textTransform: "uppercase" } }, "Event"), /* @__PURE__ */ React.createElement(flex.Flex, { alignItems: "center" }, /* @__PURE__ */ React.createElement(flex.Flex, { alignItems: "center", gap: "$20" }, !!(field == null ? void 0 : field.object) ? /* @__PURE__ */ React.createElement(
|
|
1132
|
-
EventComponent,
|
|
1133
|
-
{
|
|
1134
|
-
heading: "Object:",
|
|
1135
|
-
description: field == null ? void 0 : field.object
|
|
1136
|
-
}
|
|
1137
|
-
) : null, !!(field == null ? void 0 : field.action) ? /* @__PURE__ */ React.createElement(
|
|
1138
|
-
EventComponent,
|
|
1139
|
-
{
|
|
1140
|
-
heading: "Action:",
|
|
1141
|
-
description: Array.isArray(field == null ? void 0 : field.action) ? (_d = field == null ? void 0 : field.action) == null ? void 0 : _d.map((action) => action).join(", ") : field == null ? void 0 : field.action
|
|
1142
|
-
}
|
|
1143
|
-
) : null), !!((_g = (_f = (_e = field == null ? void 0 : field.configurationFields) == null ? void 0 : _e.account) == null ? void 0 : _f.value) == null ? void 0 : _g.label) ? /* @__PURE__ */ React.createElement(
|
|
1144
|
-
EventComponent,
|
|
1145
|
-
{
|
|
1146
|
-
heading: "Account:",
|
|
1147
|
-
description: (_j = (_i = (_h = field == null ? void 0 : field.configurationFields) == null ? void 0 : _h.account) == null ? void 0 : _i.value) == null ? void 0 : _j.label
|
|
1148
|
-
}
|
|
1149
|
-
) : null, !!((_m = (_l = (_k = field == null ? void 0 : field.configurationFields) == null ? void 0 : _k.object) == null ? void 0 : _l.value) == null ? void 0 : _m.label) ? /* @__PURE__ */ React.createElement(
|
|
1150
|
-
EventComponent,
|
|
1151
|
-
{
|
|
1152
|
-
heading: "Object:",
|
|
1153
|
-
description: (_q = (_p = (_o = (_n = field == null ? void 0 : field.configurationFields) == null ? void 0 : _n.object) == null ? void 0 : _o.value) == null ? void 0 : _p.label) == null ? void 0 : _q.replace(/^./, (char) => char == null ? void 0 : char.toUpperCase())
|
|
1154
|
-
}
|
|
1155
|
-
) : null, !!((_s = (_r = field == null ? void 0 : field.configurationFields) == null ? void 0 : _r.action) == null ? void 0 : _s.hasAction) ? /* @__PURE__ */ React.createElement(
|
|
1156
|
-
EventComponent,
|
|
1157
|
-
{
|
|
1158
|
-
hasBorder: true,
|
|
1159
|
-
heading: "Action:",
|
|
1160
|
-
description: (_v = (_u = (_t = field == null ? void 0 : field.configurationFields) == null ? void 0 : _t.action) == null ? void 0 : _u.value) == null ? void 0 : _v.label
|
|
1161
|
-
}
|
|
1162
|
-
) : null, !!((_x = (_w = field == null ? void 0 : field.configurationFields) == null ? void 0 : _w.spreadsheet) == null ? void 0 : _x.value) ? /* @__PURE__ */ React.createElement(
|
|
1163
|
-
EventComponent,
|
|
1164
|
-
{
|
|
1165
|
-
hasLink: (_y = field == null ? void 0 : field.configurationFields) == null ? void 0 : _y.sheetURL,
|
|
1166
|
-
hasBorder: true,
|
|
1167
|
-
heading: "Sheet:",
|
|
1168
|
-
description: typeof ((_z = field == null ? void 0 : field.configurationFields) == null ? void 0 : _z.spreadsheet) === "object" ? (_C = (_B = (_A = field == null ? void 0 : field.configurationFields) == null ? void 0 : _A.spreadsheet) == null ? void 0 : _B.value) == null ? void 0 : _C.label : (_E = (_D = field == null ? void 0 : field.configurationFields) == null ? void 0 : _D.spreadsheet) == null ? void 0 : _E.value
|
|
1169
|
-
}
|
|
1170
|
-
) : null, !!((_F = field == null ? void 0 : field.configurationFields) == null ? void 0 : _F.reference) ? /* @__PURE__ */ React.createElement(
|
|
1171
|
-
EventComponent,
|
|
1172
|
-
{
|
|
1173
|
-
hasLink: (_H = (_G = field == null ? void 0 : field.configurationFields) == null ? void 0 : _G.reference) == null ? void 0 : _H.referenceURL,
|
|
1174
|
-
hasBorder: false,
|
|
1175
|
-
heading: (_J = (_I = field == null ? void 0 : field.configurationFields) == null ? void 0 : _I.reference) == null ? void 0 : _J.title,
|
|
1176
|
-
description: (_L = (_K = field == null ? void 0 : field.configurationFields) == null ? void 0 : _K.reference) == null ? void 0 : _L.description
|
|
1177
|
-
}
|
|
1178
|
-
) : null), /* @__PURE__ */ React.createElement(
|
|
1179
|
-
box.Box,
|
|
1180
|
-
{
|
|
1181
|
-
css: {
|
|
1182
|
-
marginBlock: "$4",
|
|
1183
|
-
height: "1px",
|
|
1184
|
-
background: "$neutral100"
|
|
1185
|
-
}
|
|
1186
|
-
}
|
|
1187
|
-
)) : null);
|
|
1188
|
-
};
|
|
1189
|
-
const SingleMappingChipWrapper = ({
|
|
1190
|
-
heading,
|
|
1191
|
-
fields,
|
|
1192
|
-
hideBorder,
|
|
1193
|
-
placeholder,
|
|
1194
|
-
backgroundColor
|
|
1195
|
-
}) => {
|
|
1196
|
-
const modifiedFields = fields.filter(
|
|
1197
|
-
(field) => field.id !== "ALL"
|
|
1198
|
-
);
|
|
1199
|
-
return /* @__PURE__ */ React.createElement(React.Fragment, null, /* @__PURE__ */ React.createElement(flex.Flex, { flexDirection: "column", gap: "$6", css: { paddingBlock: "$8" } }, /* @__PURE__ */ React.createElement(text.Text, { size: "sm", weight: "bold", css: { textTransform: "uppercase" } }, heading), /* @__PURE__ */ React.createElement(
|
|
1200
|
-
flex.Flex,
|
|
1201
|
-
{
|
|
1202
|
-
wrap: "wrap",
|
|
1203
|
-
css: {
|
|
1204
|
-
columnGap: "$2",
|
|
1205
|
-
rowGap: "$4",
|
|
1206
|
-
"& > * ": {
|
|
1207
|
-
fontFamily: "'Roboto Mono', monospace !important",
|
|
1208
|
-
fontWeight: "$4 !important"
|
|
1209
|
-
}
|
|
1210
|
-
}
|
|
1211
|
-
},
|
|
1212
|
-
modifiedFields.map((field) => {
|
|
1213
|
-
var _a, _b;
|
|
1214
|
-
const chipRef = React.useRef(null);
|
|
1215
|
-
const name = `${!!placeholder ? placeholder : ""}${(_a = field == null ? void 0 : field.name) != null ? _a : field == null ? void 0 : field.label}`;
|
|
1216
|
-
(_b = chipRef.current) == null ? void 0 : _b.offsetWidth;
|
|
1217
|
-
return /* @__PURE__ */ React.createElement(
|
|
1218
|
-
tooltip.Tooltip,
|
|
1219
|
-
{
|
|
1220
|
-
delayDuration: 300,
|
|
1221
|
-
content: (name == null ? void 0 : name.length) > 52 ? name : "",
|
|
1222
|
-
size: "md",
|
|
1223
|
-
sideOffset: 4,
|
|
1224
|
-
className: "dm-sans"
|
|
1225
|
-
},
|
|
1226
|
-
/* @__PURE__ */ React.createElement(
|
|
1227
|
-
chip.Chip,
|
|
1228
|
-
{
|
|
1229
|
-
ref: chipRef,
|
|
1230
|
-
size: "md",
|
|
1231
|
-
css: {
|
|
1232
|
-
background: backgroundColor,
|
|
1233
|
-
borderRadius: "4px !important",
|
|
1234
|
-
span: {
|
|
1235
|
-
textAlign: "center !important",
|
|
1236
|
-
alignContent: "center !important",
|
|
1237
|
-
display: "block",
|
|
1238
|
-
maxWidth: "230px",
|
|
1239
|
-
overflow: "hidden",
|
|
1240
|
-
fontFamily: "'Roboto Mono', monospace !important",
|
|
1241
|
-
fontWeight: "$4 !important",
|
|
1242
|
-
textOverflow: "ellipsis",
|
|
1243
|
-
whiteSpace: "nowrap"
|
|
1244
|
-
}
|
|
1245
|
-
}
|
|
1246
|
-
},
|
|
1247
|
-
"$" + name
|
|
1248
|
-
)
|
|
1249
|
-
);
|
|
1250
|
-
})
|
|
1251
|
-
)), !hideBorder && /* @__PURE__ */ React.createElement(
|
|
1252
|
-
box.Box,
|
|
1253
|
-
{
|
|
1254
|
-
css: { marginBlock: "$4", height: "1px", background: "$neutral100" }
|
|
1255
|
-
}
|
|
1256
|
-
));
|
|
1257
|
-
};
|
|
1258
|
-
const DashboardItem = ({
|
|
1259
|
-
hasEditMapping,
|
|
1260
|
-
isDraft,
|
|
1261
|
-
onMappingEditHandler,
|
|
1262
|
-
icon,
|
|
1263
|
-
heading,
|
|
1264
|
-
description,
|
|
1265
|
-
fields,
|
|
1266
|
-
integrationName,
|
|
1267
|
-
isEnabled,
|
|
1268
|
-
handleEditField,
|
|
1269
|
-
id,
|
|
1270
|
-
handleDashboardPage,
|
|
1271
|
-
type,
|
|
1272
|
-
toggleDashboardField,
|
|
1273
|
-
deleteFieldHandler,
|
|
1274
|
-
mappingConditions
|
|
1275
|
-
}) => {
|
|
1276
|
-
var _a;
|
|
1277
|
-
const [isMappingDisplayed, setIsMappingDisplayed] = React.useState(false);
|
|
1278
|
-
const [isDeleteModalOpen, setIsDeleteModalOpen] = React.useState(false);
|
|
1279
|
-
const getDefaultFieldValue = (defaultValue) => {
|
|
1280
|
-
var _a2;
|
|
1281
|
-
let field = "--";
|
|
1282
|
-
switch (defaultValue == null ? void 0 : defaultValue.type) {
|
|
1283
|
-
case "DATE_TIME": {
|
|
1284
|
-
field = defaultValue == null ? void 0 : defaultValue.value;
|
|
1285
|
-
break;
|
|
1286
|
-
}
|
|
1287
|
-
case "STRING": {
|
|
1288
|
-
field = defaultValue == null ? void 0 : defaultValue.value;
|
|
1289
|
-
break;
|
|
1290
|
-
}
|
|
1291
|
-
default: {
|
|
1292
|
-
field = ((_a2 = defaultValue == null ? void 0 : defaultValue.value) == null ? void 0 : _a2.label) || "--";
|
|
1293
|
-
break;
|
|
1294
|
-
}
|
|
1295
|
-
}
|
|
1296
|
-
return field;
|
|
1297
|
-
};
|
|
1298
|
-
return /* @__PURE__ */ React.createElement(React.Fragment, null, /* @__PURE__ */ React.createElement(
|
|
1299
|
-
flex.Flex,
|
|
1300
|
-
{
|
|
1301
|
-
flexDirection: "column",
|
|
1302
|
-
css: {
|
|
1303
|
-
marginTop: "$8"
|
|
1304
|
-
}
|
|
1305
|
-
},
|
|
1306
|
-
/* @__PURE__ */ React.createElement(
|
|
1307
|
-
flex.Flex,
|
|
1308
|
-
{
|
|
1309
|
-
css: {
|
|
1310
|
-
border: isMappingDisplayed ? "$borderWidths$xs solid $black400" : "$borderWidths$xs solid $neutral200",
|
|
1311
|
-
borderRadius: isMappingDisplayed ? "$2xl $2xl 0 0" : "$2xl",
|
|
1312
|
-
padding: "$10 $12",
|
|
1313
|
-
width: "100%",
|
|
1314
|
-
backgroundColor: isMappingDisplayed ? "rgba(100, 116, 139, 0.04)" : "$white900"
|
|
1315
|
-
},
|
|
1316
|
-
justifyContent: "space-between",
|
|
1317
|
-
alignItems: "center"
|
|
1318
|
-
},
|
|
1319
|
-
/* @__PURE__ */ React.createElement(
|
|
1320
|
-
flex.Flex,
|
|
1321
|
-
{
|
|
1322
|
-
alignItems: "center",
|
|
1323
|
-
gap: "$4",
|
|
1324
|
-
css: { cursor: "pointer" },
|
|
1325
|
-
onClick: () => setIsMappingDisplayed(!isMappingDisplayed)
|
|
1326
|
-
},
|
|
1327
|
-
isMappingDisplayed ? /* @__PURE__ */ React.createElement(chevronDown.ChevronDownIcon, { size: 40, color: "#848484" }) : /* @__PURE__ */ React.createElement(chevronRight.ChevronRightIcon, { size: 40, color: "#848484" }),
|
|
1328
|
-
/* @__PURE__ */ React.createElement(flex.Flex, { alignItems: "center", gap: "$4" }, icon, /* @__PURE__ */ React.createElement(flex.Flex, { gap: "$1", flexDirection: "column" }, /* @__PURE__ */ React.createElement(text.Text, { size: "md", weight: "bold" }, heading), /* @__PURE__ */ React.createElement(
|
|
1329
|
-
text.Text,
|
|
1330
|
-
{
|
|
1331
|
-
size: "sm",
|
|
1332
|
-
css: {
|
|
1333
|
-
"& span": {
|
|
1334
|
-
fontFamily: "'DM Sans', sans-serif !important"
|
|
1335
|
-
},
|
|
1336
|
-
color: "$neutral600",
|
|
1337
|
-
"& b": {
|
|
1338
|
-
fontWeight: "$6 !important",
|
|
1339
|
-
fontFamily: "'DM Sans', sans-serif !important"
|
|
1340
|
-
}
|
|
1341
|
-
},
|
|
1342
|
-
dangerouslySetInnerHTML: { __html: description }
|
|
1343
|
-
}
|
|
1344
|
-
)))
|
|
1345
|
-
),
|
|
1346
|
-
/* @__PURE__ */ React.createElement(flex.Flex, { alignItems: "center", gap: "$12" }, isDraft && /* @__PURE__ */ React.createElement(flex.Flex, { alignItems: "center", gap: "$12" }, /* @__PURE__ */ React.createElement(chip.Chip, { rounded: "full", size: "sm" }, /* @__PURE__ */ React.createElement(
|
|
1347
|
-
box.Box,
|
|
1348
|
-
{
|
|
1349
|
-
css: {
|
|
1350
|
-
background: "$neutral500",
|
|
1351
|
-
borderRadius: "50%",
|
|
1352
|
-
marginRight: "$1",
|
|
1353
|
-
width: "$4",
|
|
1354
|
-
height: "$4"
|
|
1355
|
-
}
|
|
1356
|
-
}
|
|
1357
|
-
), /* @__PURE__ */ React.createElement(
|
|
1358
|
-
text.Text,
|
|
1359
|
-
{
|
|
1360
|
-
size: "sm",
|
|
1361
|
-
weight: "bold",
|
|
1362
|
-
css: {
|
|
1363
|
-
color: "$neutral800"
|
|
1364
|
-
}
|
|
1365
|
-
},
|
|
1366
|
-
"DRAFT"
|
|
1367
|
-
)), /* @__PURE__ */ React.createElement(
|
|
1368
|
-
box.Box,
|
|
1369
|
-
{
|
|
1370
|
-
css: {
|
|
1371
|
-
width: "1px",
|
|
1372
|
-
height: "20px",
|
|
1373
|
-
background: "#64748B20"
|
|
1374
|
-
}
|
|
1375
|
-
}
|
|
1376
|
-
)), /* @__PURE__ */ React.createElement(
|
|
1377
|
-
_switch.Switch,
|
|
1378
|
-
{
|
|
1379
|
-
size: "md",
|
|
1380
|
-
checked: isEnabled,
|
|
1381
|
-
onChange: (value) => toggleDashboardField(id, value)
|
|
1382
|
-
}
|
|
1383
|
-
), /* @__PURE__ */ React.createElement(dropdown.DropdownMenu, null, /* @__PURE__ */ React.createElement(dropdown.DropdownMenuTrigger, { asChild: true }, /* @__PURE__ */ React.createElement(
|
|
1384
|
-
iconButton.IconButton,
|
|
1385
|
-
{
|
|
1386
|
-
variant: "ghost",
|
|
1387
|
-
color: "default",
|
|
1388
|
-
size: "lg",
|
|
1389
|
-
icon: /* @__PURE__ */ React.createElement(ellipsisVertical.EllipsisVerticalIcon, null)
|
|
1390
|
-
}
|
|
1391
|
-
)), /* @__PURE__ */ React.createElement(
|
|
1392
|
-
dropdown.DropdownMenuContent,
|
|
1393
|
-
{
|
|
1394
|
-
className: "dm-sans",
|
|
1395
|
-
css: {
|
|
1396
|
-
minWidth: 180,
|
|
1397
|
-
zIndex: 10,
|
|
1398
|
-
"& p": {
|
|
1399
|
-
margin: "0 !important",
|
|
1400
|
-
padding: "0 !important"
|
|
1401
|
-
}
|
|
1402
|
-
},
|
|
1403
|
-
sideOffset: 4,
|
|
1404
|
-
align: "end"
|
|
1405
|
-
},
|
|
1406
|
-
hasEditMapping === void 0 || hasEditMapping ? /* @__PURE__ */ React.createElement(
|
|
1407
|
-
dropdown.DropdownMenuItem,
|
|
1408
|
-
{
|
|
1409
|
-
css: {
|
|
1410
|
-
cursor: "pointer"
|
|
1411
|
-
},
|
|
1412
|
-
onClick: () => {
|
|
1413
|
-
onMappingEditHandler(id);
|
|
1414
|
-
handleEditField({
|
|
1415
|
-
type,
|
|
1416
|
-
values: fields,
|
|
1417
|
-
id
|
|
1418
|
-
});
|
|
1419
|
-
handleDashboardPage(false, type);
|
|
1420
|
-
}
|
|
1421
|
-
},
|
|
1422
|
-
/* @__PURE__ */ React.createElement(flex.Flex, { alignItems: "center", gap: "$2" }, /* @__PURE__ */ React.createElement(pencil.PencilIcon, { color: "#6A6A6A", size: 20 }), /* @__PURE__ */ React.createElement(text.Text, { size: "sm" }, "Edit"))
|
|
1423
|
-
) : null,
|
|
1424
|
-
/* @__PURE__ */ React.createElement(
|
|
1425
|
-
dropdown.DropdownMenuItem,
|
|
1426
|
-
{
|
|
1427
|
-
onClick: () => setIsDeleteModalOpen(true),
|
|
1428
|
-
css: {
|
|
1429
|
-
cursor: "pointer"
|
|
1430
|
-
}
|
|
1431
|
-
},
|
|
1432
|
-
/* @__PURE__ */ React.createElement(flex.Flex, { alignItems: "center", gap: "$2" }, /* @__PURE__ */ React.createElement(_delete.DeleteIcon, { color: "#6A6A6A", size: 20 }), /* @__PURE__ */ React.createElement(text.Text, { size: "sm" }, "Delete"))
|
|
1433
|
-
)
|
|
1434
|
-
)))
|
|
1435
|
-
),
|
|
1436
|
-
/* @__PURE__ */ React.createElement(
|
|
1437
|
-
box.Box,
|
|
1438
|
-
{
|
|
1439
|
-
css: {
|
|
1440
|
-
height: isMappingDisplayed ? "100%" : 0
|
|
1441
|
-
}
|
|
1442
|
-
},
|
|
1443
|
-
/* @__PURE__ */ React.createElement(
|
|
1444
|
-
box.Box,
|
|
1445
|
-
{
|
|
1446
|
-
css: {
|
|
1447
|
-
borderInline: "$borderWidths$xs solid $black400",
|
|
1448
|
-
maxHeight: 432,
|
|
1449
|
-
height: "100%",
|
|
1450
|
-
position: "relative",
|
|
1451
|
-
overflow: "auto"
|
|
1452
|
-
}
|
|
1453
|
-
},
|
|
1454
|
-
(fields == null ? void 0 : fields.length) ? /* @__PURE__ */ React.createElement(table.Table, { css: { borderCollapse: "collapse", width: "100%" } }, /* @__PURE__ */ React.createElement(
|
|
1455
|
-
table.Thead,
|
|
1456
|
-
{
|
|
1457
|
-
css: {
|
|
1458
|
-
background: "$white900",
|
|
1459
|
-
"& th": {
|
|
1460
|
-
padding: "$7 $8",
|
|
1461
|
-
fontSize: "$sm",
|
|
1462
|
-
lineHeight: "$sm",
|
|
1463
|
-
textAlign: "left",
|
|
1464
|
-
borderInline: "none"
|
|
1465
|
-
},
|
|
1466
|
-
borderBottom: "$borderWidths$xs solid $neutral100",
|
|
1467
|
-
position: "sticky",
|
|
1468
|
-
top: 0,
|
|
1469
|
-
zIndex: 10
|
|
1470
|
-
}
|
|
1471
|
-
},
|
|
1472
|
-
/* @__PURE__ */ React.createElement(table.Th, { css: { paddingLeft: "$38 !important" } }, "Type"),
|
|
1473
|
-
/* @__PURE__ */ React.createElement(table.Th, null, "SurveySparrow Field"),
|
|
1474
|
-
/* @__PURE__ */ React.createElement(table.Th, null, `${integrationName} Field`),
|
|
1475
|
-
/* @__PURE__ */ React.createElement(table.Th, { css: { paddingRight: "$20 !important" } }, "Default Value")
|
|
1476
|
-
), /* @__PURE__ */ React.createElement(
|
|
1477
|
-
table.Tbody,
|
|
1478
|
-
{
|
|
1479
|
-
css: {
|
|
1480
|
-
"& tr:last-child": {
|
|
1481
|
-
borderBottom: 0,
|
|
1482
|
-
"& td": {
|
|
1483
|
-
borderBottom: 0
|
|
1484
|
-
}
|
|
1485
|
-
}
|
|
1486
|
-
}
|
|
1487
|
-
},
|
|
1488
|
-
fields.map((field) => {
|
|
1489
|
-
var _a2, _b, _c, _d, _e, _f, _g;
|
|
1490
|
-
return /* @__PURE__ */ React.createElement(
|
|
1491
|
-
table.Tr,
|
|
1492
|
-
{
|
|
1493
|
-
css: {
|
|
1494
|
-
borderBottom: "$borderWidths$xs solid $neutral100",
|
|
1495
|
-
"& td": {
|
|
1496
|
-
padding: "$7 $8",
|
|
1497
|
-
fontSize: "$sm",
|
|
1498
|
-
lineHeight: "$sm",
|
|
1499
|
-
borderInline: "none"
|
|
1500
|
-
},
|
|
1501
|
-
"&:hover": {
|
|
1502
|
-
background: "none !important"
|
|
1503
|
-
},
|
|
1504
|
-
"& td:first-child": {
|
|
1505
|
-
paddingLeft: "$38 !important"
|
|
1506
|
-
},
|
|
1507
|
-
"& td:last-child": {
|
|
1508
|
-
paddingRight: "$20 !important"
|
|
1509
|
-
}
|
|
1510
|
-
}
|
|
1511
|
-
},
|
|
1512
|
-
/* @__PURE__ */ React.createElement(table.Td, null, (_b = (_a2 = field.mappedType) == null ? void 0 : _a2.label) != null ? _b : "--"),
|
|
1513
|
-
/* @__PURE__ */ React.createElement(table.Td, null, (_d = (_c = field.surveySparrowField) == null ? void 0 : _c.label) != null ? _d : "--"),
|
|
1514
|
-
/* @__PURE__ */ React.createElement(table.Td, null, (_f = (_e = field.integrationField) == null ? void 0 : _e.label) != null ? _f : "--"),
|
|
1515
|
-
/* @__PURE__ */ React.createElement(table.Td, null, (_g = getDefaultFieldValue(field.defaultValue)) != null ? _g : "--")
|
|
1516
|
-
);
|
|
1517
|
-
})
|
|
1518
|
-
)) : null
|
|
1519
|
-
),
|
|
1520
|
-
isMappingDisplayed && /* @__PURE__ */ React.createElement(
|
|
1521
|
-
box.Box,
|
|
1522
|
-
{
|
|
1523
|
-
css: {
|
|
1524
|
-
padding: "$8 $32",
|
|
1525
|
-
border: "$borderWidths$xs solid $black400",
|
|
1526
|
-
borderTop: hasEditMapping === void 0 || hasEditMapping ? "$borderWidths$xs solid $neutral200" : "none",
|
|
1527
|
-
borderRadius: "0 0 $2xl $2xl",
|
|
1528
|
-
height: "100%"
|
|
1529
|
-
}
|
|
1530
|
-
},
|
|
1531
|
-
((_a = mappingConditions == null ? void 0 : mappingConditions.filterGroups) == null ? void 0 : _a.length) ? /* @__PURE__ */ React.createElement(flex.Flex, { flexDirection: "column", justifyContent: "center" }, /* @__PURE__ */ React.createElement(text.Text, { className: "dm-sans", size: "sm", weight: "bold", css: { textTransform: "uppercase", color: "$neutral900", fontFamily: "DM Sans !important", paddingLeft: "$4" } }, "CONDITION"), /* @__PURE__ */ React.createElement(flex.Flex, { css: {
|
|
1532
|
-
marginTop: "$2 !important"
|
|
1533
|
-
} }, /* @__PURE__ */ React.createElement(
|
|
1534
|
-
conditionDescriptionBuilder.ConditionCard,
|
|
1535
|
-
{
|
|
1536
|
-
isEditable: false,
|
|
1537
|
-
conditionsData: mappingConditions,
|
|
1538
|
-
showMoreMenu: false
|
|
1539
|
-
}
|
|
1540
|
-
))) : null,
|
|
1541
|
-
/* @__PURE__ */ React.createElement(
|
|
1542
|
-
button.Button,
|
|
1543
|
-
{
|
|
1544
|
-
size: "sm",
|
|
1545
|
-
onClick: () => {
|
|
1546
|
-
onMappingEditHandler(id);
|
|
1547
|
-
handleEditField({
|
|
1548
|
-
type,
|
|
1549
|
-
values: fields,
|
|
1550
|
-
id
|
|
1551
|
-
});
|
|
1552
|
-
handleDashboardPage(false, type);
|
|
1553
|
-
},
|
|
1554
|
-
css: {
|
|
1555
|
-
visibility: hasEditMapping === void 0 || hasEditMapping ? "visible" : "hidden"
|
|
1556
|
-
},
|
|
1557
|
-
leftIcon: /* @__PURE__ */ React.createElement(pencil.PencilIcon, null),
|
|
1558
|
-
color: "primary",
|
|
1559
|
-
variant: "ghost"
|
|
1560
|
-
},
|
|
1561
|
-
`Edit ${heading}`
|
|
1562
|
-
)
|
|
1563
|
-
)
|
|
1564
|
-
)
|
|
1565
|
-
), isDeleteModalOpen && /* @__PURE__ */ React.createElement(
|
|
1566
|
-
confirmationModal.default,
|
|
1567
|
-
{
|
|
1568
|
-
name: "Delete Mapping?",
|
|
1569
|
-
description: `Are you sure you want to delete the mapping? This action cannot be undone.`,
|
|
1570
|
-
onConfirm: () => {
|
|
1571
|
-
deleteFieldHandler(id);
|
|
1572
|
-
setIsDeleteModalOpen(false);
|
|
1573
|
-
},
|
|
1574
|
-
onCancel: () => {
|
|
1575
|
-
setIsDeleteModalOpen(false);
|
|
1576
|
-
}
|
|
1577
|
-
}
|
|
1578
|
-
));
|
|
1579
|
-
};
|
|
1580
|
-
const DropdownItem = ({
|
|
1581
|
-
icon,
|
|
1582
|
-
heading,
|
|
1583
|
-
description,
|
|
1584
|
-
onClickHandler,
|
|
1585
|
-
isDisabled,
|
|
1586
|
-
toolTipContent
|
|
1587
|
-
}) => {
|
|
1588
|
-
return /* @__PURE__ */ React.createElement(
|
|
1589
|
-
tooltip.Tooltip,
|
|
1590
|
-
{
|
|
1591
|
-
content: isDisabled ? toolTipContent : "",
|
|
1592
|
-
css: {
|
|
1593
|
-
zIndex: "99999999",
|
|
1594
|
-
minWidth: "280px",
|
|
1595
|
-
textAlign: "center"
|
|
1596
|
-
}
|
|
1597
|
-
},
|
|
1598
|
-
/* @__PURE__ */ React.createElement(flex.Flex, null, /* @__PURE__ */ React.createElement(
|
|
1599
|
-
dropdown.DropdownMenuItem,
|
|
1600
|
-
{
|
|
1601
|
-
css: { cursor: isDisabled ? "not-allowed !important" : "pointer" },
|
|
1602
|
-
onClick: onClickHandler,
|
|
1603
|
-
disabled: isDisabled
|
|
1604
|
-
},
|
|
1605
|
-
/* @__PURE__ */ React.createElement(flex.Flex, { alignItems: "flex-start", gap: "$4" }, /* @__PURE__ */ React.createElement(box.Box, { css: { width: "$6" } }, icon), /* @__PURE__ */ React.createElement(flex.Flex, { flexDirection: "column" }, /* @__PURE__ */ React.createElement(text.Text, { size: "md" }, heading), /* @__PURE__ */ React.createElement(text.Text, { size: "sm", css: { color: "$neutral700" } }, description)))
|
|
1606
|
-
))
|
|
1607
|
-
);
|
|
1608
|
-
};
|
|
1609
469
|
|
|
1610
470
|
exports.default = Dashboard;
|
|
1611
471
|
//# sourceMappingURL=dashboard.js.map
|