@bigbinary/neeto-integrations-frontend 2.1.1 → 2.2.0-beta1
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/README.md +146 -81
- package/app/javascript/src/translations/en.json +128 -0
- package/dist/Daily.cjs.js +913 -0
- package/dist/Daily.cjs.js.map +1 -0
- package/dist/Daily.js +872 -0
- package/dist/Daily.js.map +1 -0
- package/dist/GoogleCalender.cjs.js +1080 -0
- package/dist/GoogleCalender.cjs.js.map +1 -0
- package/dist/GoogleCalender.js +1037 -0
- package/dist/GoogleCalender.js.map +1 -0
- package/dist/Twilio.cjs.js +425 -0
- package/dist/Twilio.cjs.js.map +1 -0
- package/dist/Twilio.js +395 -0
- package/dist/Twilio.js.map +1 -0
- package/dist/ZapierForm.cjs.js +222 -178
- package/dist/ZapierForm.cjs.js.map +1 -1
- package/dist/ZapierForm.js +205 -169
- package/dist/ZapierForm.js.map +1 -1
- package/dist/Zoom.cjs.js +1011 -0
- package/dist/Zoom.cjs.js.map +1 -0
- package/dist/Zoom.js +970 -0
- package/dist/Zoom.js.map +1 -0
- package/dist/index.cjs.js +1233 -387
- package/dist/index.cjs.js.map +1 -1
- package/dist/index.js +1195 -382
- package/dist/index.js.map +1 -1
- package/package.json +148 -104
- package/types.d.ts +41 -3
- package/src/translations/en.json +0 -50
- /package/{src → app/javascript/src}/translations/index.js +0 -0
package/dist/ZapierForm.cjs.js
CHANGED
|
@@ -1,15 +1,26 @@
|
|
|
1
1
|
'use strict';
|
|
2
2
|
|
|
3
|
-
var
|
|
4
|
-
var
|
|
5
|
-
var
|
|
3
|
+
var react = require('react');
|
|
4
|
+
var neetoCist = require('@bigbinary/neeto-cist');
|
|
5
|
+
var Button = require('@bigbinary/neetoui/Button');
|
|
6
|
+
var Spinner = require('@bigbinary/neetoui/Spinner');
|
|
7
|
+
var Typography = require('@bigbinary/neetoui/Typography');
|
|
6
8
|
var ramda = require('ramda');
|
|
7
9
|
var reactI18next = require('react-i18next');
|
|
10
|
+
var constants = require('@bigbinary/neeto-commons-frontend/constants');
|
|
11
|
+
var Alert = require('@bigbinary/neetoui/Alert');
|
|
12
|
+
var Table = require('@bigbinary/neetoui/Table');
|
|
8
13
|
var i18next = require('i18next');
|
|
9
14
|
var utils = require('@bigbinary/neeto-commons-frontend/utils');
|
|
10
|
-
var
|
|
11
|
-
var formik = require('@bigbinary/neetoui/formik');
|
|
15
|
+
var MoreDropdown = require('@bigbinary/neeto-molecules/MoreDropdown');
|
|
12
16
|
var Yup = require('yup');
|
|
17
|
+
var jsxRuntime = require('react/jsx-runtime');
|
|
18
|
+
var ActionBlock = require('@bigbinary/neetoui/formik/ActionBlock');
|
|
19
|
+
var Form = require('@bigbinary/neetoui/formik/Form');
|
|
20
|
+
var Input = require('@bigbinary/neetoui/formik/Input');
|
|
21
|
+
var reactRouterDom = require('react-router-dom');
|
|
22
|
+
var reactUtils = require('@bigbinary/neeto-commons-frontend/react-utils');
|
|
23
|
+
var CopyToClipboardButton = require('@bigbinary/neeto-molecules/CopyToClipboardButton');
|
|
13
24
|
|
|
14
25
|
function _interopDefaultLegacy (e) { return e && typeof e === 'object' && 'default' in e ? e : { 'default': e }; }
|
|
15
26
|
|
|
@@ -31,39 +42,47 @@ function _interopNamespace(e) {
|
|
|
31
42
|
return Object.freeze(n);
|
|
32
43
|
}
|
|
33
44
|
|
|
34
|
-
var
|
|
35
|
-
var
|
|
45
|
+
var Button__default = /*#__PURE__*/_interopDefaultLegacy(Button);
|
|
46
|
+
var Spinner__default = /*#__PURE__*/_interopDefaultLegacy(Spinner);
|
|
47
|
+
var Typography__default = /*#__PURE__*/_interopDefaultLegacy(Typography);
|
|
48
|
+
var Alert__default = /*#__PURE__*/_interopDefaultLegacy(Alert);
|
|
49
|
+
var Table__default = /*#__PURE__*/_interopDefaultLegacy(Table);
|
|
50
|
+
var MoreDropdown__default = /*#__PURE__*/_interopDefaultLegacy(MoreDropdown);
|
|
36
51
|
var Yup__namespace = /*#__PURE__*/_interopNamespace(Yup);
|
|
52
|
+
var ActionBlock__default = /*#__PURE__*/_interopDefaultLegacy(ActionBlock);
|
|
53
|
+
var Form__default = /*#__PURE__*/_interopDefaultLegacy(Form);
|
|
54
|
+
var Input__default = /*#__PURE__*/_interopDefaultLegacy(Input);
|
|
55
|
+
var CopyToClipboardButton__default = /*#__PURE__*/_interopDefaultLegacy(CopyToClipboardButton);
|
|
37
56
|
|
|
38
57
|
function _arrayWithHoles(arr) {
|
|
39
58
|
if (Array.isArray(arr)) return arr;
|
|
40
59
|
}
|
|
41
60
|
|
|
42
|
-
function _iterableToArrayLimit(
|
|
43
|
-
var
|
|
44
|
-
if (null !=
|
|
45
|
-
var
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
61
|
+
function _iterableToArrayLimit(r, l) {
|
|
62
|
+
var t = null == r ? null : "undefined" != typeof Symbol && r[Symbol.iterator] || r["@@iterator"];
|
|
63
|
+
if (null != t) {
|
|
64
|
+
var e,
|
|
65
|
+
n,
|
|
66
|
+
i,
|
|
67
|
+
u,
|
|
68
|
+
a = [],
|
|
69
|
+
f = !0,
|
|
70
|
+
o = !1;
|
|
52
71
|
try {
|
|
53
|
-
if (
|
|
54
|
-
if (Object(
|
|
55
|
-
|
|
56
|
-
} else for (; !(
|
|
57
|
-
} catch (
|
|
58
|
-
|
|
72
|
+
if (i = (t = t.call(r)).next, 0 === l) {
|
|
73
|
+
if (Object(t) !== t) return;
|
|
74
|
+
f = !1;
|
|
75
|
+
} else for (; !(f = (e = i.call(t)).done) && (a.push(e.value), a.length !== l); f = !0);
|
|
76
|
+
} catch (r) {
|
|
77
|
+
o = !0, n = r;
|
|
59
78
|
} finally {
|
|
60
79
|
try {
|
|
61
|
-
if (!
|
|
80
|
+
if (!f && null != t["return"] && (u = t["return"](), Object(u) !== u)) return;
|
|
62
81
|
} finally {
|
|
63
|
-
if (
|
|
82
|
+
if (o) throw n;
|
|
64
83
|
}
|
|
65
84
|
}
|
|
66
|
-
return
|
|
85
|
+
return a;
|
|
67
86
|
}
|
|
68
87
|
}
|
|
69
88
|
|
|
@@ -90,14 +109,14 @@ function _slicedToArray(arr, i) {
|
|
|
90
109
|
return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _unsupportedIterableToArray(arr, i) || _nonIterableRest();
|
|
91
110
|
}
|
|
92
111
|
|
|
93
|
-
function _typeof(
|
|
112
|
+
function _typeof(o) {
|
|
94
113
|
"@babel/helpers - typeof";
|
|
95
114
|
|
|
96
|
-
return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (
|
|
97
|
-
return typeof
|
|
98
|
-
} : function (
|
|
99
|
-
return
|
|
100
|
-
}, _typeof(
|
|
115
|
+
return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (o) {
|
|
116
|
+
return typeof o;
|
|
117
|
+
} : function (o) {
|
|
118
|
+
return o && "function" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? "symbol" : typeof o;
|
|
119
|
+
}, _typeof(o);
|
|
101
120
|
}
|
|
102
121
|
|
|
103
122
|
function _toPrimitive(input, hint) {
|
|
@@ -131,57 +150,71 @@ function _defineProperty(obj, key, value) {
|
|
|
131
150
|
return obj;
|
|
132
151
|
}
|
|
133
152
|
|
|
134
|
-
var
|
|
135
|
-
|
|
136
|
-
|
|
153
|
+
var GENERATE_API_KEY_VALIDATION = Yup__namespace.object({
|
|
154
|
+
label: Yup__namespace.string().trim(i18next.t("neetoIntegrations.zapier.label.noBlankSpaces")).required(i18next.t("neetoIntegrations.zapier.label.required")).strict()
|
|
155
|
+
});
|
|
156
|
+
var GENERATE_API_KEY_FORMIK_PROPS = {
|
|
157
|
+
initialValues: {
|
|
158
|
+
label: ""
|
|
159
|
+
},
|
|
160
|
+
validationSchema: GENERATE_API_KEY_VALIDATION,
|
|
161
|
+
validateOnBlur: false
|
|
162
|
+
};
|
|
163
|
+
var MENU_ITEMS = {
|
|
164
|
+
DELETE: "delete"
|
|
165
|
+
};
|
|
166
|
+
|
|
167
|
+
function ownKeys$1(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }
|
|
168
|
+
function _objectSpread$1(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys$1(Object(t), !0).forEach(function (r) { _defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys$1(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }
|
|
169
|
+
var getMenuItems = function getMenuItems(_ref) {
|
|
137
170
|
var apiKey = _ref.apiKey,
|
|
138
171
|
setApiKeyToDelete = _ref.setApiKeyToDelete;
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
return /*#__PURE__*/React__default["default"].createElement(neetoui.Dropdown, {
|
|
142
|
-
buttonStyle: "text",
|
|
143
|
-
icon: neetoIcons.MenuHorizontal,
|
|
144
|
-
strategy: "fixed"
|
|
145
|
-
}, /*#__PURE__*/React__default["default"].createElement(Menu, null, /*#__PURE__*/React__default["default"].createElement(MenuItem.Button, {
|
|
172
|
+
return [{
|
|
173
|
+
key: MENU_ITEMS.DELETE,
|
|
146
174
|
"data-cy": "delete-apikey-button",
|
|
175
|
+
label: i18next.t("neetoIntegrations.common.delete"),
|
|
147
176
|
onClick: function onClick() {
|
|
148
177
|
return setApiKeyToDelete(apiKey);
|
|
149
178
|
}
|
|
150
|
-
}
|
|
179
|
+
}];
|
|
151
180
|
};
|
|
152
|
-
|
|
153
|
-
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; }
|
|
154
|
-
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; }
|
|
155
181
|
var getApiKeysTableColumnData = function getApiKeysTableColumnData() {
|
|
156
182
|
return [{
|
|
157
|
-
title:
|
|
183
|
+
title: i18next.t("neetoIntegrations.zapier.tableColumns.label"),
|
|
158
184
|
dataIndex: "options",
|
|
159
185
|
key: "options",
|
|
160
186
|
width: 272,
|
|
161
|
-
render: function render(options,
|
|
162
|
-
var actions =
|
|
163
|
-
return /*#__PURE__*/
|
|
164
|
-
className: "flex items-center justify-between gap-x-3"
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
187
|
+
render: function render(options, _ref2) {
|
|
188
|
+
var actions = _ref2.actions;
|
|
189
|
+
return /*#__PURE__*/jsxRuntime.jsxs("div", {
|
|
190
|
+
className: "flex items-center justify-between gap-x-3",
|
|
191
|
+
children: [/*#__PURE__*/jsxRuntime.jsx(Typography__default["default"], {
|
|
192
|
+
className: "w-4/5",
|
|
193
|
+
style: "body2",
|
|
194
|
+
children: options === null || options === void 0 ? void 0 : options.label
|
|
195
|
+
}), actions]
|
|
196
|
+
});
|
|
169
197
|
}
|
|
170
198
|
}, {
|
|
171
|
-
title:
|
|
199
|
+
title: i18next.t("neetoIntegrations.zapier.tableColumns.createdAt"),
|
|
172
200
|
dataIndex: "createdAt",
|
|
173
201
|
key: "createdAt"
|
|
174
202
|
}];
|
|
175
203
|
};
|
|
176
|
-
var getApiKeysTableRowData = function getApiKeysTableRowData(
|
|
177
|
-
var apiKeys =
|
|
178
|
-
setApiKeyToDelete =
|
|
204
|
+
var getApiKeysTableRowData = function getApiKeysTableRowData(_ref3) {
|
|
205
|
+
var apiKeys = _ref3.apiKeys,
|
|
206
|
+
setApiKeyToDelete = _ref3.setApiKeyToDelete;
|
|
179
207
|
return apiKeys.map(function (apiKey) {
|
|
180
208
|
return _objectSpread$1(_objectSpread$1({}, apiKey), {}, {
|
|
181
209
|
createdAt: utils.timeFormat.fromNow(apiKey.createdAt),
|
|
182
|
-
actions: /*#__PURE__*/
|
|
183
|
-
|
|
184
|
-
|
|
210
|
+
actions: /*#__PURE__*/jsxRuntime.jsx(MoreDropdown__default["default"], {
|
|
211
|
+
dropdownProps: {
|
|
212
|
+
strategy: "fixed"
|
|
213
|
+
},
|
|
214
|
+
menuItems: getMenuItems({
|
|
215
|
+
apiKey: apiKey,
|
|
216
|
+
setApiKeyToDelete: setApiKeyToDelete
|
|
217
|
+
})
|
|
185
218
|
})
|
|
186
219
|
});
|
|
187
220
|
});
|
|
@@ -192,15 +225,19 @@ var ApiKeysList = function ApiKeysList(_ref) {
|
|
|
192
225
|
var _ref$apiKeys = _ref.apiKeys,
|
|
193
226
|
apiKeys = _ref$apiKeys === void 0 ? [] : _ref$apiKeys,
|
|
194
227
|
_ref$deleteApiKey = _ref.deleteApiKey,
|
|
195
|
-
deleteApiKey = _ref$deleteApiKey === void 0 ?
|
|
228
|
+
deleteApiKey = _ref$deleteApiKey === void 0 ? neetoCist.noop : _ref$deleteApiKey,
|
|
196
229
|
_ref$isDeleting = _ref.isDeleting,
|
|
197
230
|
isDeleting = _ref$isDeleting === void 0 ? false : _ref$isDeleting,
|
|
198
231
|
_ref$setNewlyCreatedA = _ref.setNewlyCreatedApiKey,
|
|
199
|
-
setNewlyCreatedApiKey = _ref$setNewlyCreatedA === void 0 ?
|
|
200
|
-
var _useState =
|
|
232
|
+
setNewlyCreatedApiKey = _ref$setNewlyCreatedA === void 0 ? neetoCist.noop : _ref$setNewlyCreatedA;
|
|
233
|
+
var _useState = react.useState(null),
|
|
201
234
|
_useState2 = _slicedToArray(_useState, 2),
|
|
202
235
|
apiKeyToDelete = _useState2[0],
|
|
203
236
|
setApiKeyToDelete = _useState2[1];
|
|
237
|
+
var _useState3 = react.useState(constants.DEFAULT_PAGE_INDEX),
|
|
238
|
+
_useState4 = _slicedToArray(_useState3, 2),
|
|
239
|
+
currentPageNumber = _useState4[0],
|
|
240
|
+
setCurrentPageNumber = _useState4[1];
|
|
204
241
|
var _useTranslation = reactI18next.useTranslation(),
|
|
205
242
|
t = _useTranslation.t;
|
|
206
243
|
var closeAlert = function closeAlert() {
|
|
@@ -215,99 +252,104 @@ var ApiKeysList = function ApiKeysList(_ref) {
|
|
|
215
252
|
});
|
|
216
253
|
};
|
|
217
254
|
if (ramda.isEmpty(apiKeys)) return null;
|
|
218
|
-
return /*#__PURE__*/
|
|
219
|
-
|
|
220
|
-
|
|
221
|
-
|
|
222
|
-
|
|
223
|
-
|
|
224
|
-
|
|
225
|
-
|
|
226
|
-
|
|
227
|
-
|
|
228
|
-
|
|
229
|
-
|
|
230
|
-
|
|
231
|
-
|
|
232
|
-
|
|
233
|
-
|
|
234
|
-
|
|
235
|
-
|
|
236
|
-
|
|
237
|
-
|
|
238
|
-
|
|
239
|
-
|
|
240
|
-
|
|
241
|
-
|
|
242
|
-
|
|
243
|
-
|
|
244
|
-
|
|
245
|
-
|
|
246
|
-
|
|
247
|
-
|
|
248
|
-
|
|
249
|
-
|
|
250
|
-
|
|
251
|
-
|
|
252
|
-
label: ""
|
|
253
|
-
},
|
|
254
|
-
validationSchema: GENERATE_API_KEY_VALIDATION
|
|
255
|
+
return /*#__PURE__*/jsxRuntime.jsxs(jsxRuntime.Fragment, {
|
|
256
|
+
children: [/*#__PURE__*/jsxRuntime.jsxs("div", {
|
|
257
|
+
className: "space-y-2",
|
|
258
|
+
children: [/*#__PURE__*/jsxRuntime.jsx(Typography__default["default"], {
|
|
259
|
+
style: "h3",
|
|
260
|
+
children: t("neetoIntegrations.zapier.tableTitle")
|
|
261
|
+
}), /*#__PURE__*/jsxRuntime.jsx(Table__default["default"], {
|
|
262
|
+
currentPageNumber: currentPageNumber,
|
|
263
|
+
fixedHeight: true,
|
|
264
|
+
allowRowClick: false,
|
|
265
|
+
columnData: getApiKeysTableColumnData(),
|
|
266
|
+
defaultPageSize: constants.DEFAULT_PAGE_SIZE,
|
|
267
|
+
handlePageChange: setCurrentPageNumber,
|
|
268
|
+
rowData: getApiKeysTableRowData({
|
|
269
|
+
apiKeys: apiKeys,
|
|
270
|
+
setApiKeyToDelete: setApiKeyToDelete
|
|
271
|
+
})
|
|
272
|
+
})]
|
|
273
|
+
}), /*#__PURE__*/jsxRuntime.jsx(Alert__default["default"], {
|
|
274
|
+
backdropClassName: "zapier-delete-alert",
|
|
275
|
+
isOpen: ramda.isNotNil(apiKeyToDelete),
|
|
276
|
+
isSubmitting: isDeleting,
|
|
277
|
+
submitButtonLabel: t("neetoIntegrations.common.delete"),
|
|
278
|
+
title: t("neetoIntegrations.zapier.deleteApiKey.title"),
|
|
279
|
+
message: /*#__PURE__*/jsxRuntime.jsx(reactI18next.Trans, {
|
|
280
|
+
i18nKey: "neetoIntegrations.zapier.deleteApiKey.message",
|
|
281
|
+
values: {
|
|
282
|
+
key: apiKeyToDelete === null || apiKeyToDelete === void 0 || (_apiKeyToDelete$optio = apiKeyToDelete.options) === null || _apiKeyToDelete$optio === void 0 ? void 0 : _apiKeyToDelete$optio.label
|
|
283
|
+
}
|
|
284
|
+
}),
|
|
285
|
+
onClose: closeAlert,
|
|
286
|
+
onSubmit: handleSubmit
|
|
287
|
+
})]
|
|
288
|
+
});
|
|
255
289
|
};
|
|
256
290
|
|
|
257
|
-
function ownKeys(
|
|
258
|
-
function _objectSpread(
|
|
291
|
+
function ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }
|
|
292
|
+
function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys(Object(t), !0).forEach(function (r) { _defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }
|
|
259
293
|
var GenerateKey = function GenerateKey(_ref) {
|
|
260
294
|
var handleSubmit = _ref.handleSubmit,
|
|
261
295
|
isLoading = _ref.isLoading;
|
|
262
296
|
var _useTranslation = reactI18next.useTranslation(),
|
|
263
297
|
t = _useTranslation.t;
|
|
264
|
-
var inputRef =
|
|
265
|
-
|
|
266
|
-
|
|
267
|
-
|
|
268
|
-
|
|
298
|
+
var inputRef = react.useRef(null);
|
|
299
|
+
var history = reactRouterDom.useHistory();
|
|
300
|
+
react.useEffect(function () {
|
|
301
|
+
if (!inputRef.current) return;
|
|
302
|
+
inputRef.current.focus();
|
|
269
303
|
}, []);
|
|
270
|
-
return /*#__PURE__*/
|
|
304
|
+
return /*#__PURE__*/jsxRuntime.jsx(Form__default["default"], {
|
|
271
305
|
formikProps: _objectSpread(_objectSpread({}, GENERATE_API_KEY_FORMIK_PROPS), {}, {
|
|
272
306
|
onSubmit: handleSubmit
|
|
307
|
+
}),
|
|
308
|
+
children: /*#__PURE__*/jsxRuntime.jsxs("div", {
|
|
309
|
+
className: "space-y-3",
|
|
310
|
+
children: [/*#__PURE__*/jsxRuntime.jsx(Input__default["default"], {
|
|
311
|
+
name: "label",
|
|
312
|
+
placeholder: t("neetoIntegrations.zapier.labelInputPlaceholder"),
|
|
313
|
+
ref: inputRef
|
|
314
|
+
}), /*#__PURE__*/jsxRuntime.jsx(ActionBlock__default["default"], {
|
|
315
|
+
cancelButtonProps: {
|
|
316
|
+
onClick: function onClick() {
|
|
317
|
+
return history.goBack();
|
|
318
|
+
}
|
|
319
|
+
},
|
|
320
|
+
isSubmitting: isLoading,
|
|
321
|
+
submitButtonProps: {
|
|
322
|
+
label: t("neetoIntegrations.zapier.generateApiKey")
|
|
323
|
+
}
|
|
324
|
+
})]
|
|
273
325
|
})
|
|
274
|
-
}, function (_ref2) {
|
|
275
|
-
var dirty = _ref2.dirty;
|
|
276
|
-
return /*#__PURE__*/React__default["default"].createElement("div", {
|
|
277
|
-
className: "space-y-4"
|
|
278
|
-
}, /*#__PURE__*/React__default["default"].createElement(formik.Input, {
|
|
279
|
-
name: "label",
|
|
280
|
-
placeholder: t("neetoIntegrations.zapier.labelInputPlaceholder"),
|
|
281
|
-
ref: inputRef
|
|
282
|
-
}), /*#__PURE__*/React__default["default"].createElement(neetoui.Button, {
|
|
283
|
-
disabled: !dirty,
|
|
284
|
-
label: t("neetoIntegrations.zapier.generateApiKey"),
|
|
285
|
-
loading: isLoading,
|
|
286
|
-
type: "submit"
|
|
287
|
-
}));
|
|
288
326
|
});
|
|
289
327
|
};
|
|
290
328
|
|
|
291
|
-
var
|
|
292
|
-
var
|
|
293
|
-
|
|
294
|
-
|
|
295
|
-
|
|
296
|
-
|
|
297
|
-
|
|
298
|
-
|
|
299
|
-
|
|
300
|
-
|
|
301
|
-
|
|
302
|
-
|
|
303
|
-
|
|
304
|
-
|
|
305
|
-
|
|
306
|
-
|
|
307
|
-
|
|
308
|
-
|
|
309
|
-
|
|
310
|
-
|
|
329
|
+
var NewApiKeyInfo = reactUtils.withT(function (_ref) {
|
|
330
|
+
var t = _ref.t,
|
|
331
|
+
apiKey = _ref.apiKey;
|
|
332
|
+
return /*#__PURE__*/jsxRuntime.jsxs("div", {
|
|
333
|
+
className: "space-y-2",
|
|
334
|
+
children: [/*#__PURE__*/jsxRuntime.jsx(Typography__default["default"], {
|
|
335
|
+
classname: "neeto-ui-text-gray-700",
|
|
336
|
+
style: "body2",
|
|
337
|
+
weight: "normal",
|
|
338
|
+
children: t("neetoIntegrations.zapier.newApiKeyInstruction")
|
|
339
|
+
}), /*#__PURE__*/jsxRuntime.jsxs("div", {
|
|
340
|
+
className: "flex justify-between",
|
|
341
|
+
children: [/*#__PURE__*/jsxRuntime.jsx(Typography__default["default"], {
|
|
342
|
+
className: "neeto-ui-text-gray-800 my-auto",
|
|
343
|
+
style: "h5",
|
|
344
|
+
weight: "semibold",
|
|
345
|
+
children: apiKey
|
|
346
|
+
}), /*#__PURE__*/jsxRuntime.jsx(CopyToClipboardButton__default["default"], {
|
|
347
|
+
label: t("neetoIntegrations.zapier.copyApiKey"),
|
|
348
|
+
value: apiKey
|
|
349
|
+
})]
|
|
350
|
+
})]
|
|
351
|
+
});
|
|
352
|
+
});
|
|
311
353
|
|
|
312
354
|
var ZapierForm = function ZapierForm(_ref) {
|
|
313
355
|
var _ref$newlyCreatedApiK = _ref.newlyCreatedApiKey,
|
|
@@ -325,45 +367,47 @@ var ZapierForm = function ZapierForm(_ref) {
|
|
|
325
367
|
_ref$isDeleting = _ref.isDeleting,
|
|
326
368
|
isDeleting = _ref$isDeleting === void 0 ? false : _ref$isDeleting,
|
|
327
369
|
_ref$deleteApiKey = _ref.deleteApiKey,
|
|
328
|
-
deleteApiKey = _ref$deleteApiKey === void 0 ?
|
|
370
|
+
deleteApiKey = _ref$deleteApiKey === void 0 ? neetoCist.noop : _ref$deleteApiKey,
|
|
329
371
|
_ref$handleGenerateAp = _ref.handleGenerateApiKey,
|
|
330
|
-
handleGenerateApiKey = _ref$handleGenerateAp === void 0 ?
|
|
372
|
+
handleGenerateApiKey = _ref$handleGenerateAp === void 0 ? neetoCist.noop : _ref$handleGenerateAp,
|
|
331
373
|
_ref$setNewlyCreatedA = _ref.setNewlyCreatedApiKey,
|
|
332
|
-
setNewlyCreatedApiKey = _ref$setNewlyCreatedA === void 0 ?
|
|
374
|
+
setNewlyCreatedApiKey = _ref$setNewlyCreatedA === void 0 ? neetoCist.noop : _ref$setNewlyCreatedA,
|
|
333
375
|
_ref$setIsDemoModalOp = _ref.setIsDemoModalOpen,
|
|
334
|
-
setIsDemoModalOpen = _ref$setIsDemoModalOp === void 0 ?
|
|
376
|
+
setIsDemoModalOpen = _ref$setIsDemoModalOp === void 0 ? neetoCist.noop : _ref$setIsDemoModalOp;
|
|
335
377
|
var _useTranslation = reactI18next.useTranslation(),
|
|
336
378
|
t = _useTranslation.t;
|
|
337
|
-
if (isLoading) return /*#__PURE__*/
|
|
338
|
-
return /*#__PURE__*/
|
|
339
|
-
className: "w-full max-w-
|
|
340
|
-
|
|
341
|
-
|
|
342
|
-
|
|
343
|
-
|
|
344
|
-
|
|
345
|
-
|
|
346
|
-
|
|
347
|
-
|
|
348
|
-
|
|
349
|
-
|
|
350
|
-
|
|
351
|
-
|
|
352
|
-
|
|
353
|
-
|
|
354
|
-
|
|
355
|
-
|
|
356
|
-
|
|
357
|
-
|
|
358
|
-
|
|
359
|
-
|
|
360
|
-
|
|
361
|
-
|
|
362
|
-
|
|
363
|
-
|
|
364
|
-
|
|
365
|
-
|
|
366
|
-
|
|
379
|
+
if (isLoading) return /*#__PURE__*/jsxRuntime.jsx(Spinner__default["default"], {});
|
|
380
|
+
return /*#__PURE__*/jsxRuntime.jsxs("div", {
|
|
381
|
+
className: "flex w-full max-w-3xl flex-col items-start space-y-6",
|
|
382
|
+
children: [/*#__PURE__*/jsxRuntime.jsx(Typography__default["default"], {
|
|
383
|
+
style: "h2",
|
|
384
|
+
children: t("neetoIntegrations.zapier.apiKeys")
|
|
385
|
+
}), ramda.isEmpty(apiKeys) && /*#__PURE__*/jsxRuntime.jsx(Typography__default["default"], {
|
|
386
|
+
style: "h4",
|
|
387
|
+
children: t("neetoIntegrations.zapier.emptyText")
|
|
388
|
+
}), /*#__PURE__*/jsxRuntime.jsx(GenerateKey, {
|
|
389
|
+
handleSubmit: handleGenerateApiKey,
|
|
390
|
+
isLoading: isGenerating
|
|
391
|
+
}), neetoCist.isNotEmpty(newlyCreatedApiKey) && /*#__PURE__*/jsxRuntime.jsx(NewApiKeyInfo, {
|
|
392
|
+
apiKey: newlyCreatedApiKey
|
|
393
|
+
}), neetoCist.isNotEmpty(helpDocUrl) && /*#__PURE__*/jsxRuntime.jsx(Button__default["default"], {
|
|
394
|
+
href: helpDocUrl,
|
|
395
|
+
label: t("neetoIntegrations.zapier.helpDoc"),
|
|
396
|
+
style: "link",
|
|
397
|
+
target: "_blank"
|
|
398
|
+
}), neetoCist.isNotEmpty(videoUrl) && /*#__PURE__*/jsxRuntime.jsx(Button__default["default"], {
|
|
399
|
+
label: t("neetoIntegrations.zapier.walkthroughText"),
|
|
400
|
+
style: "link",
|
|
401
|
+
onClick: function onClick() {
|
|
402
|
+
return setIsDemoModalOpen(true);
|
|
403
|
+
}
|
|
404
|
+
}), /*#__PURE__*/jsxRuntime.jsx(ApiKeysList, {
|
|
405
|
+
apiKeys: apiKeys,
|
|
406
|
+
deleteApiKey: deleteApiKey,
|
|
407
|
+
isDeleting: isDeleting,
|
|
408
|
+
setNewlyCreatedApiKey: setNewlyCreatedApiKey
|
|
409
|
+
})]
|
|
410
|
+
});
|
|
367
411
|
};
|
|
368
412
|
|
|
369
413
|
module.exports = ZapierForm;
|