@bigbinary/neeto-integrations-frontend 1.5.0 → 2.1.0

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.
@@ -0,0 +1,344 @@
1
+ import React, { useState, useRef, useEffect } from 'react';
2
+ import { noop, isNotEmpty } from '@bigbinary/neeto-commons-frontend/pure';
3
+ import { Dropdown, Typography, Table, Alert, Button, Callout, Spinner } from '@bigbinary/neetoui';
4
+ import { isEmpty, isNotNil } from 'ramda';
5
+ import { useTranslation, Trans } from 'react-i18next';
6
+ import i18next from 'i18next';
7
+ import { timeFormat, copyToClipboard } from '@bigbinary/neeto-commons-frontend/utils';
8
+ import { MenuHorizontal, Copy } from '@bigbinary/neeto-icons';
9
+ import { Form, Input } from '@bigbinary/neetoui/formik';
10
+ import * as Yup from 'yup';
11
+
12
+ function _arrayWithHoles(arr) {
13
+ if (Array.isArray(arr)) return arr;
14
+ }
15
+
16
+ function _iterableToArrayLimit(arr, i) {
17
+ var _i = null == arr ? null : "undefined" != typeof Symbol && arr[Symbol.iterator] || arr["@@iterator"];
18
+ if (null != _i) {
19
+ var _s,
20
+ _e,
21
+ _x,
22
+ _r,
23
+ _arr = [],
24
+ _n = !0,
25
+ _d = !1;
26
+ try {
27
+ if (_x = (_i = _i.call(arr)).next, 0 === i) {
28
+ if (Object(_i) !== _i) return;
29
+ _n = !1;
30
+ } else for (; !(_n = (_s = _x.call(_i)).done) && (_arr.push(_s.value), _arr.length !== i); _n = !0);
31
+ } catch (err) {
32
+ _d = !0, _e = err;
33
+ } finally {
34
+ try {
35
+ if (!_n && null != _i["return"] && (_r = _i["return"](), Object(_r) !== _r)) return;
36
+ } finally {
37
+ if (_d) throw _e;
38
+ }
39
+ }
40
+ return _arr;
41
+ }
42
+ }
43
+
44
+ function _arrayLikeToArray(arr, len) {
45
+ if (len == null || len > arr.length) len = arr.length;
46
+ for (var i = 0, arr2 = new Array(len); i < len; i++) arr2[i] = arr[i];
47
+ return arr2;
48
+ }
49
+
50
+ function _unsupportedIterableToArray(o, minLen) {
51
+ if (!o) return;
52
+ if (typeof o === "string") return _arrayLikeToArray(o, minLen);
53
+ var n = Object.prototype.toString.call(o).slice(8, -1);
54
+ if (n === "Object" && o.constructor) n = o.constructor.name;
55
+ if (n === "Map" || n === "Set") return Array.from(o);
56
+ if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen);
57
+ }
58
+
59
+ function _nonIterableRest() {
60
+ throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.");
61
+ }
62
+
63
+ function _slicedToArray(arr, i) {
64
+ return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _unsupportedIterableToArray(arr, i) || _nonIterableRest();
65
+ }
66
+
67
+ function _typeof(obj) {
68
+ "@babel/helpers - typeof";
69
+
70
+ return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (obj) {
71
+ return typeof obj;
72
+ } : function (obj) {
73
+ return obj && "function" == typeof Symbol && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj;
74
+ }, _typeof(obj);
75
+ }
76
+
77
+ function _toPrimitive(input, hint) {
78
+ if (_typeof(input) !== "object" || input === null) return input;
79
+ var prim = input[Symbol.toPrimitive];
80
+ if (prim !== undefined) {
81
+ var res = prim.call(input, hint || "default");
82
+ if (_typeof(res) !== "object") return res;
83
+ throw new TypeError("@@toPrimitive must return a primitive value.");
84
+ }
85
+ return (hint === "string" ? String : Number)(input);
86
+ }
87
+
88
+ function _toPropertyKey(arg) {
89
+ var key = _toPrimitive(arg, "string");
90
+ return _typeof(key) === "symbol" ? key : String(key);
91
+ }
92
+
93
+ function _defineProperty(obj, key, value) {
94
+ key = _toPropertyKey(key);
95
+ if (key in obj) {
96
+ Object.defineProperty(obj, key, {
97
+ value: value,
98
+ enumerable: true,
99
+ configurable: true,
100
+ writable: true
101
+ });
102
+ } else {
103
+ obj[key] = value;
104
+ }
105
+ return obj;
106
+ }
107
+
108
+ var Menu = Dropdown.Menu,
109
+ MenuItem = Dropdown.MenuItem;
110
+ var Actions = function Actions(_ref) {
111
+ var apiKey = _ref.apiKey,
112
+ setApiKeyToDelete = _ref.setApiKeyToDelete;
113
+ var _useTranslation = useTranslation(),
114
+ t = _useTranslation.t;
115
+ return /*#__PURE__*/React.createElement(Dropdown, {
116
+ buttonStyle: "text",
117
+ icon: MenuHorizontal,
118
+ strategy: "fixed"
119
+ }, /*#__PURE__*/React.createElement(Menu, null, /*#__PURE__*/React.createElement(MenuItem.Button, {
120
+ "data-cy": "delete-apikey-button",
121
+ onClick: function onClick() {
122
+ return setApiKeyToDelete(apiKey);
123
+ }
124
+ }, t("neetoIntegrations.common.delete"))));
125
+ };
126
+
127
+ function ownKeys$1(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); enumerableOnly && (symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; }
128
+ function _objectSpread$1(target) { for (var i = 1; i < arguments.length; i++) { var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? ownKeys$1(Object(source), !0).forEach(function (key) { _defineProperty(target, key, source[key]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys$1(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } return target; }
129
+ var getApiKeysTableColumnData = function getApiKeysTableColumnData() {
130
+ return [{
131
+ title: i18next.t("neetoIntegrations.zapier.tableColumns.label"),
132
+ dataIndex: "options",
133
+ key: "options",
134
+ width: 272,
135
+ render: function render(options, _ref) {
136
+ var actions = _ref.actions;
137
+ return /*#__PURE__*/React.createElement("div", {
138
+ className: "flex items-center justify-between gap-x-3"
139
+ }, /*#__PURE__*/React.createElement(Typography, {
140
+ className: "w-4/5",
141
+ style: "body2"
142
+ }, options === null || options === void 0 ? void 0 : options.label), actions);
143
+ }
144
+ }, {
145
+ title: i18next.t("neetoIntegrations.zapier.tableColumns.createdAt"),
146
+ dataIndex: "createdAt",
147
+ key: "createdAt"
148
+ }];
149
+ };
150
+ var getApiKeysTableRowData = function getApiKeysTableRowData(_ref2) {
151
+ var apiKeys = _ref2.apiKeys,
152
+ setApiKeyToDelete = _ref2.setApiKeyToDelete;
153
+ return apiKeys.map(function (apiKey) {
154
+ return _objectSpread$1(_objectSpread$1({}, apiKey), {}, {
155
+ createdAt: timeFormat.fromNow(apiKey.createdAt),
156
+ actions: /*#__PURE__*/React.createElement(Actions, {
157
+ apiKey: apiKey,
158
+ setApiKeyToDelete: setApiKeyToDelete
159
+ })
160
+ });
161
+ });
162
+ };
163
+
164
+ var ApiKeysList = function ApiKeysList(_ref) {
165
+ var _apiKeyToDelete$optio;
166
+ var _ref$apiKeys = _ref.apiKeys,
167
+ apiKeys = _ref$apiKeys === void 0 ? [] : _ref$apiKeys,
168
+ _ref$deleteApiKey = _ref.deleteApiKey,
169
+ deleteApiKey = _ref$deleteApiKey === void 0 ? noop : _ref$deleteApiKey,
170
+ _ref$isDeleting = _ref.isDeleting,
171
+ isDeleting = _ref$isDeleting === void 0 ? false : _ref$isDeleting,
172
+ _ref$setNewlyCreatedA = _ref.setNewlyCreatedApiKey,
173
+ setNewlyCreatedApiKey = _ref$setNewlyCreatedA === void 0 ? noop : _ref$setNewlyCreatedA;
174
+ var _useState = useState(null),
175
+ _useState2 = _slicedToArray(_useState, 2),
176
+ apiKeyToDelete = _useState2[0],
177
+ setApiKeyToDelete = _useState2[1];
178
+ var _useTranslation = useTranslation(),
179
+ t = _useTranslation.t;
180
+ var closeAlert = function closeAlert() {
181
+ return setApiKeyToDelete(null);
182
+ };
183
+ var handleSubmit = function handleSubmit() {
184
+ deleteApiKey(apiKeyToDelete === null || apiKeyToDelete === void 0 ? void 0 : apiKeyToDelete.id, {
185
+ onSuccess: function onSuccess() {
186
+ closeAlert();
187
+ setNewlyCreatedApiKey("");
188
+ }
189
+ });
190
+ };
191
+ if (isEmpty(apiKeys)) return null;
192
+ return /*#__PURE__*/React.createElement(React.Fragment, null, /*#__PURE__*/React.createElement("div", {
193
+ className: "space-y-2"
194
+ }, /*#__PURE__*/React.createElement(Typography, {
195
+ style: "h3"
196
+ }, t("neetoIntegrations.zapier.tableTitle")), /*#__PURE__*/React.createElement(Table, {
197
+ fixedHeight: true,
198
+ allowRowClick: false,
199
+ columnData: getApiKeysTableColumnData(),
200
+ rowData: getApiKeysTableRowData({
201
+ apiKeys: apiKeys,
202
+ setApiKeyToDelete: setApiKeyToDelete
203
+ })
204
+ })), /*#__PURE__*/React.createElement(Alert, {
205
+ backdropClassName: "zapier-delete-alert",
206
+ isOpen: isNotNil(apiKeyToDelete),
207
+ isSubmitting: isDeleting,
208
+ submitButtonLabel: t("neetoIntegrations.common.delete"),
209
+ title: t("neetoIntegrations.zapier.deleteApiKey.title"),
210
+ message: /*#__PURE__*/React.createElement(Trans, {
211
+ i18nKey: "neetoIntegrations.zapier.deleteApiKey.message",
212
+ values: {
213
+ key: apiKeyToDelete === null || apiKeyToDelete === void 0 ? void 0 : (_apiKeyToDelete$optio = apiKeyToDelete.options) === null || _apiKeyToDelete$optio === void 0 ? void 0 : _apiKeyToDelete$optio.label
214
+ }
215
+ }),
216
+ onClose: closeAlert,
217
+ onSubmit: handleSubmit
218
+ }));
219
+ };
220
+
221
+ var GENERATE_API_KEY_VALIDATION = Yup.object({
222
+ label: Yup.string().required(i18next.t("neetoIntegrations.common.required"))
223
+ });
224
+ var GENERATE_API_KEY_FORMIK_PROPS = {
225
+ initialValues: {
226
+ label: ""
227
+ },
228
+ validationSchema: GENERATE_API_KEY_VALIDATION
229
+ };
230
+
231
+ function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); enumerableOnly && (symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; }
232
+ function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? ownKeys(Object(source), !0).forEach(function (key) { _defineProperty(target, key, source[key]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } return target; }
233
+ var GenerateKey = function GenerateKey(_ref) {
234
+ var handleSubmit = _ref.handleSubmit,
235
+ isLoading = _ref.isLoading;
236
+ var _useTranslation = useTranslation(),
237
+ t = _useTranslation.t;
238
+ var inputRef = useRef(null);
239
+ useEffect(function () {
240
+ if (inputRef.current) {
241
+ inputRef.current.focus();
242
+ }
243
+ }, []);
244
+ return /*#__PURE__*/React.createElement(Form, {
245
+ formikProps: _objectSpread(_objectSpread({}, GENERATE_API_KEY_FORMIK_PROPS), {}, {
246
+ onSubmit: handleSubmit
247
+ })
248
+ }, function (_ref2) {
249
+ var dirty = _ref2.dirty;
250
+ return /*#__PURE__*/React.createElement("div", {
251
+ className: "space-y-4"
252
+ }, /*#__PURE__*/React.createElement(Input, {
253
+ name: "label",
254
+ placeholder: t("neetoIntegrations.zapier.labelInputPlaceholder"),
255
+ ref: inputRef
256
+ }), /*#__PURE__*/React.createElement(Button, {
257
+ disabled: !dirty,
258
+ label: t("neetoIntegrations.zapier.generateApiKey"),
259
+ loading: isLoading,
260
+ type: "submit"
261
+ }));
262
+ });
263
+ };
264
+
265
+ var NewApiKeyCallout = function NewApiKeyCallout(_ref) {
266
+ var apiKey = _ref.apiKey;
267
+ var _useTranslation = useTranslation(),
268
+ t = _useTranslation.t;
269
+ return /*#__PURE__*/React.createElement("div", {
270
+ className: "mb-8 space-y-2"
271
+ }, /*#__PURE__*/React.createElement(Callout, null, t("neetoIntegrations.zapier.newApiKeyInstruction")), /*#__PURE__*/React.createElement(Callout, {
272
+ className: "flex justify-between",
273
+ style: "success"
274
+ }, apiKey, /*#__PURE__*/React.createElement(Button, {
275
+ icon: Copy,
276
+ style: "text",
277
+ tooltipProps: {
278
+ content: t("neetoIntegrations.zapier.copyApiKey")
279
+ },
280
+ onClick: function onClick() {
281
+ return copyToClipboard(apiKey);
282
+ }
283
+ })));
284
+ };
285
+
286
+ var ZapierForm = function ZapierForm(_ref) {
287
+ var _ref$newlyCreatedApiK = _ref.newlyCreatedApiKey,
288
+ newlyCreatedApiKey = _ref$newlyCreatedApiK === void 0 ? "" : _ref$newlyCreatedApiK,
289
+ _ref$videoUrl = _ref.videoUrl,
290
+ videoUrl = _ref$videoUrl === void 0 ? "" : _ref$videoUrl,
291
+ _ref$helpDocUrl = _ref.helpDocUrl,
292
+ helpDocUrl = _ref$helpDocUrl === void 0 ? "" : _ref$helpDocUrl,
293
+ _ref$apiKeys = _ref.apiKeys,
294
+ apiKeys = _ref$apiKeys === void 0 ? [] : _ref$apiKeys,
295
+ _ref$isGenerating = _ref.isGenerating,
296
+ isGenerating = _ref$isGenerating === void 0 ? false : _ref$isGenerating,
297
+ _ref$isLoading = _ref.isLoading,
298
+ isLoading = _ref$isLoading === void 0 ? true : _ref$isLoading,
299
+ _ref$isDeleting = _ref.isDeleting,
300
+ isDeleting = _ref$isDeleting === void 0 ? false : _ref$isDeleting,
301
+ _ref$deleteApiKey = _ref.deleteApiKey,
302
+ deleteApiKey = _ref$deleteApiKey === void 0 ? noop : _ref$deleteApiKey,
303
+ _ref$handleGenerateAp = _ref.handleGenerateApiKey,
304
+ handleGenerateApiKey = _ref$handleGenerateAp === void 0 ? noop : _ref$handleGenerateAp,
305
+ _ref$setNewlyCreatedA = _ref.setNewlyCreatedApiKey,
306
+ setNewlyCreatedApiKey = _ref$setNewlyCreatedA === void 0 ? noop : _ref$setNewlyCreatedA,
307
+ _ref$setIsDemoModalOp = _ref.setIsDemoModalOpen,
308
+ setIsDemoModalOpen = _ref$setIsDemoModalOp === void 0 ? noop : _ref$setIsDemoModalOp;
309
+ var _useTranslation = useTranslation(),
310
+ t = _useTranslation.t;
311
+ if (isLoading) return /*#__PURE__*/React.createElement(Spinner, null);
312
+ return /*#__PURE__*/React.createElement("div", {
313
+ className: "w-full max-w-xl space-y-6 p-10"
314
+ }, isNotEmpty(newlyCreatedApiKey) && /*#__PURE__*/React.createElement(NewApiKeyCallout, {
315
+ apiKey: newlyCreatedApiKey
316
+ }), /*#__PURE__*/React.createElement(Typography, {
317
+ style: "h2"
318
+ }, t("neetoIntegrations.zapier.apiKeys")), isEmpty(apiKeys) && /*#__PURE__*/React.createElement(Typography, {
319
+ style: "h4"
320
+ }, t("neetoIntegrations.zapier.emptyText")), /*#__PURE__*/React.createElement(GenerateKey, {
321
+ handleSubmit: handleGenerateApiKey,
322
+ isLoading: isGenerating
323
+ }), isNotEmpty(helpDocUrl) && /*#__PURE__*/React.createElement("div", null, /*#__PURE__*/React.createElement(Button, {
324
+ href: helpDocUrl,
325
+ label: t("neetoIntegrations.zapier.helpDoc"),
326
+ style: "link",
327
+ target: "_blank"
328
+ })), /*#__PURE__*/React.createElement(ApiKeysList, {
329
+ apiKeys: apiKeys,
330
+ deleteApiKey: deleteApiKey,
331
+ isDeleting: isDeleting,
332
+ setNewlyCreatedApiKey: setNewlyCreatedApiKey
333
+ }), isNotEmpty(videoUrl) && /*#__PURE__*/React.createElement(Button, {
334
+ className: "mb-6",
335
+ label: t("neetoIntegrations.zapier.walkthroughText"),
336
+ style: "link",
337
+ onClick: function onClick() {
338
+ return setIsDemoModalOpen(true);
339
+ }
340
+ }));
341
+ };
342
+
343
+ export { ZapierForm as default };
344
+ //# sourceMappingURL=ZapierForm.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"ZapierForm.js","sources":["../node_modules/@babel/runtime/helpers/esm/arrayWithHoles.js","../node_modules/@babel/runtime/helpers/esm/iterableToArrayLimit.js","../node_modules/@babel/runtime/helpers/esm/arrayLikeToArray.js","../node_modules/@babel/runtime/helpers/esm/unsupportedIterableToArray.js","../node_modules/@babel/runtime/helpers/esm/nonIterableRest.js","../node_modules/@babel/runtime/helpers/esm/slicedToArray.js","../node_modules/@babel/runtime/helpers/esm/typeof.js","../node_modules/@babel/runtime/helpers/esm/toPrimitive.js","../node_modules/@babel/runtime/helpers/esm/toPropertyKey.js","../node_modules/@babel/runtime/helpers/esm/defineProperty.js","../src/components/Integrations/ZapierForm/Actions.jsx","../src/components/Integrations/ZapierForm/utils.jsx","../src/components/Integrations/ZapierForm/ApiKeysList.jsx","../src/components/Integrations/ZapierForm/constants.js","../src/components/Integrations/ZapierForm/GenerateKey.jsx","../src/components/Integrations/ZapierForm/NewApiKeyCallout.jsx","../src/components/Integrations/ZapierForm/index.jsx"],"sourcesContent":["export default function _arrayWithHoles(arr) {\n if (Array.isArray(arr)) return arr;\n}","export default function _iterableToArrayLimit(arr, i) {\n var _i = null == arr ? null : \"undefined\" != typeof Symbol && arr[Symbol.iterator] || arr[\"@@iterator\"];\n if (null != _i) {\n var _s,\n _e,\n _x,\n _r,\n _arr = [],\n _n = !0,\n _d = !1;\n try {\n if (_x = (_i = _i.call(arr)).next, 0 === i) {\n if (Object(_i) !== _i) return;\n _n = !1;\n } else for (; !(_n = (_s = _x.call(_i)).done) && (_arr.push(_s.value), _arr.length !== i); _n = !0);\n } catch (err) {\n _d = !0, _e = err;\n } finally {\n try {\n if (!_n && null != _i[\"return\"] && (_r = _i[\"return\"](), Object(_r) !== _r)) return;\n } finally {\n if (_d) throw _e;\n }\n }\n return _arr;\n }\n}","export default function _arrayLikeToArray(arr, len) {\n if (len == null || len > arr.length) len = arr.length;\n for (var i = 0, arr2 = new Array(len); i < len; i++) arr2[i] = arr[i];\n return arr2;\n}","import arrayLikeToArray from \"./arrayLikeToArray.js\";\nexport default function _unsupportedIterableToArray(o, minLen) {\n if (!o) return;\n if (typeof o === \"string\") return arrayLikeToArray(o, minLen);\n var n = Object.prototype.toString.call(o).slice(8, -1);\n if (n === \"Object\" && o.constructor) n = o.constructor.name;\n if (n === \"Map\" || n === \"Set\") return Array.from(o);\n if (n === \"Arguments\" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return arrayLikeToArray(o, minLen);\n}","export default function _nonIterableRest() {\n throw new TypeError(\"Invalid attempt to destructure non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.\");\n}","import arrayWithHoles from \"./arrayWithHoles.js\";\nimport iterableToArrayLimit from \"./iterableToArrayLimit.js\";\nimport unsupportedIterableToArray from \"./unsupportedIterableToArray.js\";\nimport nonIterableRest from \"./nonIterableRest.js\";\nexport default function _slicedToArray(arr, i) {\n return arrayWithHoles(arr) || iterableToArrayLimit(arr, i) || unsupportedIterableToArray(arr, i) || nonIterableRest();\n}","export default function _typeof(obj) {\n \"@babel/helpers - typeof\";\n\n return _typeof = \"function\" == typeof Symbol && \"symbol\" == typeof Symbol.iterator ? function (obj) {\n return typeof obj;\n } : function (obj) {\n return obj && \"function\" == typeof Symbol && obj.constructor === Symbol && obj !== Symbol.prototype ? \"symbol\" : typeof obj;\n }, _typeof(obj);\n}","import _typeof from \"./typeof.js\";\nexport default function _toPrimitive(input, hint) {\n if (_typeof(input) !== \"object\" || input === null) return input;\n var prim = input[Symbol.toPrimitive];\n if (prim !== undefined) {\n var res = prim.call(input, hint || \"default\");\n if (_typeof(res) !== \"object\") return res;\n throw new TypeError(\"@@toPrimitive must return a primitive value.\");\n }\n return (hint === \"string\" ? String : Number)(input);\n}","import _typeof from \"./typeof.js\";\nimport toPrimitive from \"./toPrimitive.js\";\nexport default function _toPropertyKey(arg) {\n var key = toPrimitive(arg, \"string\");\n return _typeof(key) === \"symbol\" ? key : String(key);\n}","import toPropertyKey from \"./toPropertyKey.js\";\nexport default function _defineProperty(obj, key, value) {\n key = toPropertyKey(key);\n if (key in obj) {\n Object.defineProperty(obj, key, {\n value: value,\n enumerable: true,\n configurable: true,\n writable: true\n });\n } else {\n obj[key] = value;\n }\n return obj;\n}","import React from \"react\";\n\nimport { MenuHorizontal } from \"neetoicons\";\nimport { Dropdown } from \"neetoui\";\nimport { useTranslation } from \"react-i18next\";\n\nconst { Menu, MenuItem } = Dropdown;\n\nconst Actions = ({ apiKey, setApiKeyToDelete }) => {\n const { t } = useTranslation();\n\n return (\n <Dropdown buttonStyle=\"text\" icon={MenuHorizontal} strategy=\"fixed\">\n <Menu>\n <MenuItem.Button\n data-cy=\"delete-apikey-button\"\n onClick={() => setApiKeyToDelete(apiKey)}\n >\n {t(\"neetoIntegrations.common.delete\")}\n </MenuItem.Button>\n </Menu>\n </Dropdown>\n );\n};\n\nexport default Actions;\n","import React from \"react\";\n\nimport i18next from \"i18next\";\nimport { timeFormat } from \"neetocommons/utils\";\nimport { Typography } from \"neetoui\";\n\nimport Actions from \"./Actions\";\n\nexport const getApiKeysTableColumnData = () => [\n {\n title: i18next.t(\"neetoIntegrations.zapier.tableColumns.label\"),\n dataIndex: \"options\",\n key: \"options\",\n width: 272,\n render: (options, { actions }) => (\n <div className=\"flex items-center justify-between gap-x-3\">\n <Typography className=\"w-4/5\" style=\"body2\">\n {options?.label}\n </Typography>\n {actions}\n </div>\n ),\n },\n {\n title: i18next.t(\"neetoIntegrations.zapier.tableColumns.createdAt\"),\n dataIndex: \"createdAt\",\n key: \"createdAt\",\n },\n];\n\nexport const getApiKeysTableRowData = ({ apiKeys, setApiKeyToDelete }) =>\n apiKeys.map(apiKey => ({\n ...apiKey,\n createdAt: timeFormat.fromNow(apiKey.createdAt),\n actions: <Actions apiKey={apiKey} setApiKeyToDelete={setApiKeyToDelete} />,\n }));\n","import React, { useState } from \"react\";\n\nimport { noop } from \"neetocommons/pure\";\nimport { Alert, Table, Typography } from \"neetoui\";\nimport { isNotNil, isEmpty } from \"ramda\";\nimport { Trans, useTranslation } from \"react-i18next\";\n\nimport { getApiKeysTableColumnData, getApiKeysTableRowData } from \"./utils\";\n\nconst ApiKeysList = ({\n apiKeys = [],\n deleteApiKey = noop,\n isDeleting = false,\n setNewlyCreatedApiKey = noop,\n}) => {\n const [apiKeyToDelete, setApiKeyToDelete] = useState(null);\n\n const { t } = useTranslation();\n\n const closeAlert = () => setApiKeyToDelete(null);\n\n const handleSubmit = () => {\n deleteApiKey(apiKeyToDelete?.id, {\n onSuccess: () => {\n closeAlert();\n setNewlyCreatedApiKey(\"\");\n },\n });\n };\n\n if (isEmpty(apiKeys)) return null;\n\n return (\n <>\n <div className=\"space-y-2\">\n <Typography style=\"h3\">\n {t(\"neetoIntegrations.zapier.tableTitle\")}\n </Typography>\n <Table\n fixedHeight\n allowRowClick={false}\n columnData={getApiKeysTableColumnData()}\n rowData={getApiKeysTableRowData({ apiKeys, setApiKeyToDelete })}\n />\n </div>\n <Alert\n backdropClassName=\"zapier-delete-alert\"\n isOpen={isNotNil(apiKeyToDelete)}\n isSubmitting={isDeleting}\n submitButtonLabel={t(\"neetoIntegrations.common.delete\")}\n title={t(\"neetoIntegrations.zapier.deleteApiKey.title\")}\n message={\n <Trans\n i18nKey=\"neetoIntegrations.zapier.deleteApiKey.message\"\n values={{ key: apiKeyToDelete?.options?.label }}\n />\n }\n onClose={closeAlert}\n onSubmit={handleSubmit}\n />\n </>\n );\n};\n\nexport default ApiKeysList;\n","import i18next from \"i18next\";\nimport * as Yup from \"yup\";\n\nconst GENERATE_API_KEY_VALIDATION = Yup.object({\n label: Yup.string().required(i18next.t(\"neetoIntegrations.common.required\")),\n});\n\nexport const GENERATE_API_KEY_FORMIK_PROPS = {\n initialValues: { label: \"\" },\n validationSchema: GENERATE_API_KEY_VALIDATION,\n};\n","import React, { useEffect, useRef } from \"react\";\n\nimport { Button } from \"neetoui\";\nimport { Form, Input } from \"neetoui/formik\";\nimport { useTranslation } from \"react-i18next\";\n\nimport { GENERATE_API_KEY_FORMIK_PROPS } from \"./constants\";\n\nconst GenerateKey = ({ handleSubmit, isLoading }) => {\n const { t } = useTranslation();\n const inputRef = useRef(null);\n\n useEffect(() => {\n if (inputRef.current) {\n inputRef.current.focus();\n }\n }, []);\n\n return (\n <Form\n formikProps={{\n ...GENERATE_API_KEY_FORMIK_PROPS,\n onSubmit: handleSubmit,\n }}\n >\n {({ dirty }) => (\n <div className=\"space-y-4\">\n <Input\n name=\"label\"\n placeholder={t(\"neetoIntegrations.zapier.labelInputPlaceholder\")}\n ref={inputRef}\n />\n <Button\n disabled={!dirty}\n label={t(\"neetoIntegrations.zapier.generateApiKey\")}\n loading={isLoading}\n type=\"submit\"\n />\n </div>\n )}\n </Form>\n );\n};\n\nexport default GenerateKey;\n","import React from \"react\";\n\nimport { copyToClipboard } from \"neetocommons/utils\";\nimport { Copy } from \"neetoicons\";\nimport { Button, Callout } from \"neetoui\";\nimport { useTranslation } from \"react-i18next\";\n\nconst NewApiKeyCallout = ({ apiKey }) => {\n const { t } = useTranslation();\n\n return (\n <div className=\"mb-8 space-y-2\">\n <Callout>{t(\"neetoIntegrations.zapier.newApiKeyInstruction\")}</Callout>\n <Callout className=\"flex justify-between\" style=\"success\">\n {apiKey}\n <Button\n icon={Copy}\n style=\"text\"\n tooltipProps={{ content: t(\"neetoIntegrations.zapier.copyApiKey\") }}\n onClick={() => copyToClipboard(apiKey)}\n />\n </Callout>\n </div>\n );\n};\n\nexport default NewApiKeyCallout;\n","import React from \"react\";\n\nimport { isNotEmpty, noop } from \"neetocommons/pure\";\nimport { Button, Spinner, Typography } from \"neetoui\";\nimport { isEmpty } from \"ramda\";\nimport { useTranslation } from \"react-i18next\";\n\nimport ApiKeysList from \"./ApiKeysList\";\nimport GenerateKey from \"./GenerateKey\";\nimport NewApiKeyCallout from \"./NewApiKeyCallout\";\n\nconst ZapierForm = ({\n newlyCreatedApiKey = \"\",\n videoUrl = \"\",\n helpDocUrl = \"\",\n apiKeys = [],\n isGenerating = false,\n isLoading = true,\n isDeleting = false,\n deleteApiKey = noop,\n handleGenerateApiKey = noop,\n setNewlyCreatedApiKey = noop,\n setIsDemoModalOpen = noop,\n}) => {\n const { t } = useTranslation();\n\n if (isLoading) return <Spinner />;\n\n return (\n <div className=\"w-full max-w-xl space-y-6 p-10\">\n {isNotEmpty(newlyCreatedApiKey) && (\n <NewApiKeyCallout apiKey={newlyCreatedApiKey} />\n )}\n <Typography style=\"h2\">\n {t(\"neetoIntegrations.zapier.apiKeys\")}\n </Typography>\n {isEmpty(apiKeys) && (\n <Typography style=\"h4\">\n {t(\"neetoIntegrations.zapier.emptyText\")}\n </Typography>\n )}\n <GenerateKey\n handleSubmit={handleGenerateApiKey}\n isLoading={isGenerating}\n />\n {isNotEmpty(helpDocUrl) && (\n <div>\n <Button\n href={helpDocUrl}\n label={t(\"neetoIntegrations.zapier.helpDoc\")}\n style=\"link\"\n target=\"_blank\"\n />\n </div>\n )}\n <ApiKeysList\n apiKeys={apiKeys}\n deleteApiKey={deleteApiKey}\n isDeleting={isDeleting}\n setNewlyCreatedApiKey={setNewlyCreatedApiKey}\n />\n {isNotEmpty(videoUrl) && (\n <Button\n className=\"mb-6\"\n label={t(\"neetoIntegrations.zapier.walkthroughText\")}\n style=\"link\"\n onClick={() => setIsDemoModalOpen(true)}\n />\n )}\n </div>\n );\n};\n\nexport default ZapierForm;\n"],"names":["_arrayWithHoles","arr","Array","isArray","_iterableToArrayLimit","i","_i","Symbol","iterator","_s","_e","_x","_r","_arr","_n","_d","call","next","Object","done","push","value","length","err","_arrayLikeToArray","len","arr2","_unsupportedIterableToArray","o","minLen","arrayLikeToArray","n","prototype","toString","slice","constructor","name","from","test","_nonIterableRest","TypeError","_slicedToArray","arrayWithHoles","iterableToArrayLimit","unsupportedIterableToArray","nonIterableRest","_typeof","obj","_toPrimitive","input","hint","prim","toPrimitive","undefined","res","String","Number","_toPropertyKey","arg","key","_defineProperty","toPropertyKey","defineProperty","enumerable","configurable","writable","Menu","Dropdown","MenuItem","Actions","_ref","apiKey","setApiKeyToDelete","_useTranslation","useTranslation","t","React","createElement","buttonStyle","icon","MenuHorizontal","strategy","Button","onClick","getApiKeysTableColumnData","title","i18next","dataIndex","width","render","options","actions","className","Typography","style","label","getApiKeysTableRowData","_ref2","apiKeys","map","_objectSpread","createdAt","timeFormat","fromNow","ApiKeysList","_apiKeyToDelete$optio","_ref$apiKeys","_ref$deleteApiKey","deleteApiKey","noop","_ref$isDeleting","isDeleting","_ref$setNewlyCreatedA","setNewlyCreatedApiKey","_useState","useState","_useState2","apiKeyToDelete","closeAlert","handleSubmit","id","onSuccess","isEmpty","Fragment","Table","fixedHeight","allowRowClick","columnData","rowData","Alert","backdropClassName","isOpen","isNotNil","isSubmitting","submitButtonLabel","message","Trans","i18nKey","values","onClose","onSubmit","GENERATE_API_KEY_VALIDATION","Yup","object","string","required","GENERATE_API_KEY_FORMIK_PROPS","initialValues","validationSchema","GenerateKey","isLoading","inputRef","useRef","useEffect","current","focus","Form","formikProps","dirty","Input","placeholder","ref","disabled","loading","type","NewApiKeyCallout","Callout","Copy","tooltipProps","content","copyToClipboard","ZapierForm","_ref$newlyCreatedApiK","newlyCreatedApiKey","_ref$videoUrl","videoUrl","_ref$helpDocUrl","helpDocUrl","_ref$isGenerating","isGenerating","_ref$isLoading","_ref$handleGenerateAp","handleGenerateApiKey","_ref$setIsDemoModalOp","setIsDemoModalOpen","Spinner","isNotEmpty","href","target"],"mappings":";;;;;;;;;;;AAAe,SAASA,eAAeA,CAACC,GAAG,EAAE;EAC3C,IAAIC,KAAK,CAACC,OAAO,CAACF,GAAG,CAAC,EAAE,OAAOA,GAAG,CAAA;AACpC;;ACFe,SAASG,qBAAqBA,CAACH,GAAG,EAAEI,CAAC,EAAE;EACpD,IAAIC,EAAE,GAAG,IAAI,IAAIL,GAAG,GAAG,IAAI,GAAG,WAAW,IAAI,OAAOM,MAAM,IAAIN,GAAG,CAACM,MAAM,CAACC,QAAQ,CAAC,IAAIP,GAAG,CAAC,YAAY,CAAC,CAAA;EACvG,IAAI,IAAI,IAAIK,EAAE,EAAE;AACd,IAAA,IAAIG,EAAE;MACJC,EAAE;MACFC,EAAE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