@bigbinary/neeto-integrations-frontend 3.2.0 → 4.0.1
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 +40 -25
- package/app/javascript/src/translations/en.json +5 -6
- package/dist/Connect.js +16 -15
- package/dist/Connect.js.map +1 -1
- package/dist/Daily.js +18 -9
- package/dist/Daily.js.map +1 -1
- package/dist/DailyForm.js +10 -7
- package/dist/DailyForm.js.map +1 -1
- package/dist/Demo.js +11 -18
- package/dist/Demo.js.map +1 -1
- package/dist/DisconnectAlert.js +38 -0
- package/dist/DisconnectAlert.js.map +1 -0
- package/dist/Finish.js +13 -12
- package/dist/Finish.js.map +1 -1
- package/dist/{Form-be2e5595.js → Form-CPYZSV18.js} +57 -74
- package/dist/Form-CPYZSV18.js.map +1 -0
- package/dist/{Form-5be03668.js → Form-DY3ljixO.js} +44 -46
- package/dist/Form-DY3ljixO.js.map +1 -0
- package/dist/GoogleCalendar.js +5 -19
- package/dist/GoogleCalendar.js.map +1 -1
- package/dist/Manage.js +69 -64
- package/dist/Manage.js.map +1 -1
- package/dist/Modal.js +4 -4
- package/dist/Modal.js.map +1 -1
- package/dist/Twilio.js +20 -21
- package/dist/Twilio.js.map +1 -1
- package/dist/WalkthroughModal.js +51 -0
- package/dist/WalkthroughModal.js.map +1 -0
- package/dist/ZapierForm.js +72 -56
- package/dist/ZapierForm.js.map +1 -1
- package/dist/Zoom.js +14 -6
- package/dist/Zoom.js.map +1 -1
- package/dist/cjs/Connect.js +20 -24
- package/dist/cjs/Connect.js.map +1 -1
- package/dist/cjs/Daily.js +22 -20
- package/dist/cjs/Daily.js.map +1 -1
- package/dist/cjs/DailyForm.js +10 -7
- package/dist/cjs/DailyForm.js.map +1 -1
- package/dist/cjs/Demo.js +11 -23
- package/dist/cjs/Demo.js.map +1 -1
- package/dist/cjs/DisconnectAlert.js +40 -0
- package/dist/cjs/DisconnectAlert.js.map +1 -0
- package/dist/cjs/Finish.js +19 -23
- package/dist/cjs/Finish.js.map +1 -1
- package/dist/cjs/GoogleCalendar.js +12 -34
- package/dist/cjs/GoogleCalendar.js.map +1 -1
- package/dist/cjs/Manage.js +73 -77
- package/dist/cjs/Manage.js.map +1 -1
- package/dist/cjs/Modal.js +9 -15
- package/dist/cjs/Modal.js.map +1 -1
- package/dist/cjs/Twilio.js +37 -47
- package/dist/cjs/Twilio.js.map +1 -1
- package/dist/cjs/WalkthroughModal.js +53 -0
- package/dist/cjs/WalkthroughModal.js.map +1 -0
- package/dist/cjs/ZapierForm.js +87 -84
- package/dist/cjs/ZapierForm.js.map +1 -1
- package/dist/cjs/Zoom.js +18 -16
- package/dist/cjs/Zoom.js.map +1 -1
- package/dist/cjs/index.js +15 -11
- package/dist/cjs/index.js.map +1 -1
- package/dist/{index-4bda54e6.js → index-MS1ts-9f.js} +1 -1
- package/dist/{index-4bda54e6.js.map → index-MS1ts-9f.js.map} +1 -1
- package/dist/{index-2f3a953b.js → index-dxk7jTL7.js} +1 -1
- package/dist/{index-2f3a953b.js.map → index-dxk7jTL7.js.map} +1 -1
- package/dist/index.js +13 -9
- package/dist/index.js.map +1 -1
- package/dist/{query-62fcdf0a.js → query-D2CcgTB0.js} +2 -2
- package/dist/{query-62fcdf0a.js.map → query-D2CcgTB0.js.map} +1 -1
- package/dist/{query-4f9552ab.js → query-MCAJv0II.js} +1 -1
- package/dist/{query-4f9552ab.js.map → query-MCAJv0II.js.map} +1 -1
- package/package.json +119 -94
- package/types.d.ts +17 -0
- package/dist/Form-5be03668.js.map +0 -1
- package/dist/Form-be2e5595.js.map +0 -1
- package/dist/defineProperty-e90a259c.js +0 -43
- package/dist/defineProperty-e90a259c.js.map +0 -1
- package/dist/defineProperty-f3094d6c.js +0 -45
- package/dist/defineProperty-f3094d6c.js.map +0 -1
- package/dist/slicedToArray-b4278ecd.js +0 -57
- package/dist/slicedToArray-b4278ecd.js.map +0 -1
- package/dist/slicedToArray-f320d9e7.js +0 -61
- package/dist/slicedToArray-f320d9e7.js.map +0 -1
package/dist/ZapierForm.js
CHANGED
|
@@ -1,20 +1,22 @@
|
|
|
1
1
|
import { noop, isNotEmpty } from '@bigbinary/neeto-cist';
|
|
2
2
|
import Button from '@bigbinary/neetoui/Button';
|
|
3
3
|
import Spinner from '@bigbinary/neetoui/Spinner';
|
|
4
|
-
import Typography from '@bigbinary/neetoui/Typography';
|
|
5
|
-
import { isEmpty, isNotNil } from 'ramda';
|
|
6
4
|
import { useTranslation, Trans } from 'react-i18next';
|
|
7
|
-
import
|
|
5
|
+
import _slicedToArray from '@babel/runtime/helpers/slicedToArray';
|
|
8
6
|
import { useState, useRef, useEffect } from 'react';
|
|
9
7
|
import { DEFAULT_PAGE_INDEX, DEFAULT_PAGE_SIZE } from '@bigbinary/neeto-commons-frontend/constants';
|
|
8
|
+
import TableWrapper from '@bigbinary/neeto-molecules/TableWrapper';
|
|
10
9
|
import Alert from '@bigbinary/neetoui/Alert';
|
|
11
10
|
import Table from '@bigbinary/neetoui/Table';
|
|
12
|
-
import
|
|
11
|
+
import Typography from '@bigbinary/neetoui/Typography';
|
|
12
|
+
import { isEmpty, isNotNil } from 'ramda';
|
|
13
|
+
import _defineProperty from '@babel/runtime/helpers/defineProperty';
|
|
13
14
|
import { t } from 'i18next';
|
|
14
15
|
import { timeFormat } from '@bigbinary/neeto-commons-frontend/utils';
|
|
15
16
|
import MoreDropdown from '@bigbinary/neeto-molecules/MoreDropdown';
|
|
16
17
|
import * as yup from 'yup';
|
|
17
18
|
import { jsxs, jsx, Fragment } from 'react/jsx-runtime';
|
|
19
|
+
import CardLayout from '@bigbinary/neeto-molecules/CardLayout';
|
|
18
20
|
import ActionBlock from '@bigbinary/neetoui/formik/ActionBlock';
|
|
19
21
|
import FormikForm from '@bigbinary/neetoui/formik/Form';
|
|
20
22
|
import Input from '@bigbinary/neetoui/formik/Input';
|
|
@@ -70,7 +72,8 @@ var getApiKeysTableColumnData = function getApiKeysTableColumnData() {
|
|
|
70
72
|
}, {
|
|
71
73
|
title: t("neetoIntegrations.zapier.tableColumns.createdAt"),
|
|
72
74
|
dataIndex: "createdAt",
|
|
73
|
-
key: "createdAt"
|
|
75
|
+
key: "createdAt",
|
|
76
|
+
width: 200
|
|
74
77
|
}];
|
|
75
78
|
};
|
|
76
79
|
var getApiKeysTableRowData = function getApiKeysTableRowData(_ref3) {
|
|
@@ -126,20 +129,22 @@ var ApiKeysList = function ApiKeysList(_ref) {
|
|
|
126
129
|
if (isEmpty(apiKeys)) return null;
|
|
127
130
|
return /*#__PURE__*/jsxs(Fragment, {
|
|
128
131
|
children: [/*#__PURE__*/jsxs("div", {
|
|
129
|
-
className: "space-y-
|
|
132
|
+
className: "max-w-full space-y-3",
|
|
130
133
|
children: [/*#__PURE__*/jsx(Typography, {
|
|
131
134
|
style: "h3",
|
|
132
135
|
children: t("neetoIntegrations.zapier.tableTitle")
|
|
133
|
-
}), /*#__PURE__*/jsx(
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
136
|
+
}), /*#__PURE__*/jsx(TableWrapper, {
|
|
137
|
+
children: /*#__PURE__*/jsx(Table, {
|
|
138
|
+
currentPageNumber: currentPageNumber,
|
|
139
|
+
fixedHeight: true,
|
|
140
|
+
allowRowClick: false,
|
|
141
|
+
columnData: getApiKeysTableColumnData(),
|
|
142
|
+
defaultPageSize: DEFAULT_PAGE_SIZE,
|
|
143
|
+
handlePageChange: setCurrentPageNumber,
|
|
144
|
+
rowData: getApiKeysTableRowData({
|
|
145
|
+
apiKeys: apiKeys,
|
|
146
|
+
setApiKeyToDelete: setApiKeyToDelete
|
|
147
|
+
})
|
|
143
148
|
})
|
|
144
149
|
})]
|
|
145
150
|
}), /*#__PURE__*/jsx(Alert, {
|
|
@@ -164,7 +169,8 @@ function ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbol
|
|
|
164
169
|
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; }
|
|
165
170
|
var GenerateKey = function GenerateKey(_ref) {
|
|
166
171
|
var handleSubmit = _ref.handleSubmit,
|
|
167
|
-
isLoading = _ref.isLoading
|
|
172
|
+
isLoading = _ref.isLoading,
|
|
173
|
+
helpDocUrl = _ref.helpDocUrl;
|
|
168
174
|
var _useTranslation = useTranslation(),
|
|
169
175
|
t = _useTranslation.t;
|
|
170
176
|
var inputRef = useRef(null);
|
|
@@ -174,16 +180,13 @@ var GenerateKey = function GenerateKey(_ref) {
|
|
|
174
180
|
inputRef.current.focus();
|
|
175
181
|
}, []);
|
|
176
182
|
return /*#__PURE__*/jsx(FormikForm, {
|
|
183
|
+
className: "w-full",
|
|
177
184
|
formikProps: _objectSpread(_objectSpread({}, GENERATE_API_KEY_FORMIK_PROPS), {}, {
|
|
178
185
|
onSubmit: handleSubmit
|
|
179
186
|
}),
|
|
180
|
-
children: /*#__PURE__*/
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
name: "label",
|
|
184
|
-
placeholder: t("neetoIntegrations.zapier.labelInputPlaceholder"),
|
|
185
|
-
ref: inputRef
|
|
186
|
-
}), /*#__PURE__*/jsx(ActionBlock, {
|
|
187
|
+
children: /*#__PURE__*/jsx(CardLayout, {
|
|
188
|
+
title: t("neetoIntegrations.zapier.apiKeys"),
|
|
189
|
+
actionBlock: /*#__PURE__*/jsx(ActionBlock, {
|
|
187
190
|
cancelButtonProps: {
|
|
188
191
|
onClick: function onClick() {
|
|
189
192
|
return history.goBack();
|
|
@@ -193,7 +196,20 @@ var GenerateKey = function GenerateKey(_ref) {
|
|
|
193
196
|
submitButtonProps: {
|
|
194
197
|
label: t("neetoIntegrations.zapier.generateApiKey")
|
|
195
198
|
}
|
|
196
|
-
})
|
|
199
|
+
}),
|
|
200
|
+
description: /*#__PURE__*/jsxs(Fragment, {
|
|
201
|
+
children: [t("neetoIntegrations.zapier.emptyText"), " ", isNotEmpty(helpDocUrl) && /*#__PURE__*/jsx(Button, {
|
|
202
|
+
href: helpDocUrl,
|
|
203
|
+
label: t("neetoIntegrations.zapier.learnMore"),
|
|
204
|
+
style: "link",
|
|
205
|
+
target: "_blank"
|
|
206
|
+
})]
|
|
207
|
+
}),
|
|
208
|
+
children: /*#__PURE__*/jsx(Input, {
|
|
209
|
+
name: "label",
|
|
210
|
+
placeholder: t("neetoIntegrations.zapier.labelInputPlaceholder"),
|
|
211
|
+
ref: inputRef
|
|
212
|
+
})
|
|
197
213
|
})
|
|
198
214
|
});
|
|
199
215
|
};
|
|
@@ -202,21 +218,19 @@ var NewApiKeyInfo = withT(function (_ref) {
|
|
|
202
218
|
var t = _ref.t,
|
|
203
219
|
apiKey = _ref.apiKey;
|
|
204
220
|
return /*#__PURE__*/jsxs("div", {
|
|
205
|
-
className: "space-y-
|
|
221
|
+
className: "space-y-3",
|
|
206
222
|
children: [/*#__PURE__*/jsx(Typography, {
|
|
207
|
-
classname: "neeto-ui-text-gray-700",
|
|
208
223
|
style: "body2",
|
|
209
224
|
weight: "normal",
|
|
210
225
|
children: t("neetoIntegrations.zapier.newApiKeyInstruction")
|
|
211
226
|
}), /*#__PURE__*/jsxs("div", {
|
|
212
|
-
className: "flex
|
|
227
|
+
className: "flex gap-2",
|
|
213
228
|
children: [/*#__PURE__*/jsx(Typography, {
|
|
214
|
-
className: "neeto-ui-
|
|
215
|
-
style: "
|
|
216
|
-
weight: "
|
|
229
|
+
className: "neeto-ui-bg-gray-50 neeto-ui-border-gray-300 neeto-ui-rounded min-w-96 border px-2 py-1",
|
|
230
|
+
style: "body2",
|
|
231
|
+
weight: "medium",
|
|
217
232
|
children: apiKey
|
|
218
233
|
}), /*#__PURE__*/jsx(CopyToClipboardButton, {
|
|
219
|
-
label: t("neetoIntegrations.zapier.copyApiKey"),
|
|
220
234
|
value: apiKey
|
|
221
235
|
})]
|
|
222
236
|
})]
|
|
@@ -248,31 +262,33 @@ var ZapierForm = function ZapierForm(_ref) {
|
|
|
248
262
|
setIsDemoModalOpen = _ref$setIsDemoModalOp === void 0 ? noop : _ref$setIsDemoModalOp;
|
|
249
263
|
var _useTranslation = useTranslation(),
|
|
250
264
|
t = _useTranslation.t;
|
|
251
|
-
if (isLoading)
|
|
265
|
+
if (isLoading) {
|
|
266
|
+
return /*#__PURE__*/jsx("div", {
|
|
267
|
+
className: "flex h-full w-full items-center justify-center",
|
|
268
|
+
children: /*#__PURE__*/jsx(Spinner, {})
|
|
269
|
+
});
|
|
270
|
+
}
|
|
252
271
|
return /*#__PURE__*/jsxs("div", {
|
|
253
|
-
className: "flex w-full max-w-3xl flex-col items-start space-y-6",
|
|
254
|
-
children: [/*#__PURE__*/
|
|
255
|
-
|
|
256
|
-
children:
|
|
257
|
-
|
|
258
|
-
|
|
259
|
-
|
|
260
|
-
|
|
261
|
-
|
|
262
|
-
|
|
263
|
-
|
|
264
|
-
|
|
265
|
-
|
|
266
|
-
|
|
267
|
-
|
|
268
|
-
|
|
269
|
-
|
|
270
|
-
|
|
271
|
-
|
|
272
|
-
|
|
273
|
-
onClick: function onClick() {
|
|
274
|
-
return setIsDemoModalOpen(true);
|
|
275
|
-
}
|
|
272
|
+
className: "mx-auto flex w-full max-w-3xl flex-col items-start space-y-6",
|
|
273
|
+
children: [/*#__PURE__*/jsxs("div", {
|
|
274
|
+
className: "w-full",
|
|
275
|
+
children: [/*#__PURE__*/jsx(GenerateKey, {
|
|
276
|
+
helpDocUrl: helpDocUrl,
|
|
277
|
+
videoUrl: videoUrl,
|
|
278
|
+
handleSubmit: handleGenerateApiKey,
|
|
279
|
+
isLoading: isGenerating
|
|
280
|
+
}), /*#__PURE__*/jsxs("div", {
|
|
281
|
+
className: "space-y-4",
|
|
282
|
+
children: [isNotEmpty(newlyCreatedApiKey) && /*#__PURE__*/jsx(NewApiKeyInfo, {
|
|
283
|
+
apiKey: newlyCreatedApiKey
|
|
284
|
+
}), isNotEmpty(videoUrl) && /*#__PURE__*/jsx(Button, {
|
|
285
|
+
label: t("neetoIntegrations.zapier.walkthroughText"),
|
|
286
|
+
style: "link",
|
|
287
|
+
onClick: function onClick() {
|
|
288
|
+
return setIsDemoModalOpen(true);
|
|
289
|
+
}
|
|
290
|
+
})]
|
|
291
|
+
})]
|
|
276
292
|
}), /*#__PURE__*/jsx(ApiKeysList, {
|
|
277
293
|
apiKeys: apiKeys,
|
|
278
294
|
deleteApiKey: deleteApiKey,
|
package/dist/ZapierForm.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ZapierForm.js","sources":["../app/javascript/src/components/Integrations/ZapierForm/constants.js","../app/javascript/src/components/Integrations/ZapierForm/utils.jsx","../app/javascript/src/components/Integrations/ZapierForm/ApiKeysList.jsx","../app/javascript/src/components/Integrations/ZapierForm/GenerateKey.jsx","../app/javascript/src/components/Integrations/ZapierForm/NewApiKeyInfo.jsx","../app/javascript/src/components/Integrations/ZapierForm/index.jsx"],"sourcesContent":["import { t } from \"i18next\";\nimport * as Yup from \"yup\";\n\nconst GENERATE_API_KEY_VALIDATION = Yup.object({\n label: Yup.string()\n .trim(t(\"neetoIntegrations.zapier.label.noBlankSpaces\"))\n .required(t(\"neetoIntegrations.zapier.label.required\"))\n .strict(),\n});\n\nexport const GENERATE_API_KEY_FORMIK_PROPS = {\n initialValues: { label: \"\" },\n validationSchema: GENERATE_API_KEY_VALIDATION,\n validateOnBlur: false,\n};\n\nexport const MENU_ITEMS = { DELETE: \"delete\" };\n","import { t } from \"i18next\";\nimport { timeFormat } from \"neetocommons/utils\";\nimport MoreDropdown from \"neetomolecules/MoreDropdown\";\nimport { Typography } from \"neetoui\";\n\nimport { MENU_ITEMS } from \"./constants\";\n\nconst getMenuItems = ({ apiKey, setApiKeyToDelete }) => [\n {\n key: MENU_ITEMS.DELETE,\n \"data-cy\": \"delete-apikey-button\",\n label: t(\"neetoIntegrations.common.delete\"),\n onClick: () => setApiKeyToDelete(apiKey),\n },\n];\n\nexport const getApiKeysTableColumnData = () => [\n {\n title: 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: 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: (\n <MoreDropdown\n dropdownProps={{ strategy: \"fixed\" }}\n menuItems={getMenuItems({ apiKey, setApiKeyToDelete })}\n />\n ),\n }));\n","import { useState } from \"react\";\n\nimport { noop } from \"neetocist\";\nimport { DEFAULT_PAGE_SIZE, DEFAULT_PAGE_INDEX } from \"neetocommons/constants\";\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 const [currentPageNumber, setCurrentPageNumber] =\n useState(DEFAULT_PAGE_INDEX);\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 {...{ currentPageNumber }}\n fixedHeight\n allowRowClick={false}\n columnData={getApiKeysTableColumnData()}\n defaultPageSize={DEFAULT_PAGE_SIZE}\n handlePageChange={setCurrentPageNumber}\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 { useEffect, useRef } from \"react\";\n\nimport { ActionBlock, Form, Input } from \"neetoui/formik\";\nimport { useTranslation } from \"react-i18next\";\nimport { useHistory } from \"react-router-dom\";\n\nimport { GENERATE_API_KEY_FORMIK_PROPS } from \"./constants\";\n\nconst GenerateKey = ({ handleSubmit, isLoading }) => {\n const { t } = useTranslation();\n const inputRef = useRef(null);\n const history = useHistory();\n\n useEffect(() => {\n if (!inputRef.current) return;\n inputRef.current.focus();\n }, []);\n\n return (\n <Form\n formikProps={{\n ...GENERATE_API_KEY_FORMIK_PROPS,\n onSubmit: handleSubmit,\n }}\n >\n <div className=\"space-y-3\">\n <Input\n name=\"label\"\n placeholder={t(\"neetoIntegrations.zapier.labelInputPlaceholder\")}\n ref={inputRef}\n />\n <ActionBlock\n cancelButtonProps={{ onClick: () => history.goBack() }}\n isSubmitting={isLoading}\n submitButtonProps={{\n label: t(\"neetoIntegrations.zapier.generateApiKey\"),\n }}\n />\n </div>\n </Form>\n );\n};\n\nexport default GenerateKey;\n","import { withT } from \"neetocommons/react-utils\";\nimport CopyToClipboardButton from \"neetomolecules/CopyToClipboardButton\";\nimport { Typography } from \"neetoui\";\n\nconst NewApiKeyInfo = withT(({ t, apiKey }) => (\n <div className=\"space-y-2\">\n <Typography\n classname=\"neeto-ui-text-gray-700\"\n style=\"body2\"\n weight=\"normal\"\n >\n {t(\"neetoIntegrations.zapier.newApiKeyInstruction\")}\n </Typography>\n <div className=\"flex justify-between\">\n <Typography\n className=\"neeto-ui-text-gray-800 my-auto\"\n style=\"h5\"\n weight=\"semibold\"\n >\n {apiKey}\n </Typography>\n <CopyToClipboardButton\n label={t(\"neetoIntegrations.zapier.copyApiKey\")}\n value={apiKey}\n />\n </div>\n </div>\n));\n\nexport default NewApiKeyInfo;\n","import { isNotEmpty, noop } from \"neetocist\";\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 NewApiKeyInfo from \"./NewApiKeyInfo\";\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=\"flex w-full max-w-3xl flex-col items-start space-y-6\">\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(newlyCreatedApiKey) && (\n <NewApiKeyInfo apiKey={newlyCreatedApiKey} />\n )}\n {isNotEmpty(helpDocUrl) && (\n <Button\n href={helpDocUrl}\n label={t(\"neetoIntegrations.zapier.helpDoc\")}\n style=\"link\"\n target=\"_blank\"\n />\n )}\n {isNotEmpty(videoUrl) && (\n <Button\n label={t(\"neetoIntegrations.zapier.walkthroughText\")}\n style=\"link\"\n onClick={() => setIsDemoModalOpen(true)}\n />\n )}\n <ApiKeysList\n {...{ apiKeys, deleteApiKey, isDeleting, setNewlyCreatedApiKey }}\n />\n </div>\n );\n};\n\nexport default ZapierForm;\n"],"names":["GENERATE_API_KEY_VALIDATION","Yup","object","label","string","trim","t","required","strict","GENERATE_API_KEY_FORMIK_PROPS","initialValues","validationSchema","validateOnBlur","MENU_ITEMS","DELETE","getMenuItems","_ref","apiKey","setApiKeyToDelete","key","onClick","getApiKeysTableColumnData","title","dataIndex","width","render","options","_ref2","actions","_jsxs","className","children","_jsx","Typography","style","getApiKeysTableRowData","_ref3","apiKeys","map","_objectSpread","createdAt","timeFormat","fromNow","MoreDropdown","dropdownProps","strategy","menuItems","ApiKeysList","_apiKeyToDelete$optio","_ref$apiKeys","_ref$deleteApiKey","deleteApiKey","noop","_ref$isDeleting","isDeleting","_ref$setNewlyCreatedA","setNewlyCreatedApiKey","_useState","useState","_useState2","_slicedToArray","apiKeyToDelete","_useState3","DEFAULT_PAGE_INDEX","_useState4","currentPageNumber","setCurrentPageNumber","_useTranslation","useTranslation","closeAlert","handleSubmit","id","onSuccess","isEmpty","_Fragment","Table","fixedHeight","allowRowClick","columnData","defaultPageSize","DEFAULT_PAGE_SIZE","handlePageChange","rowData","Alert","backdropClassName","isOpen","isNotNil","isSubmitting","submitButtonLabel","message","Trans","i18nKey","values","onClose","onSubmit","GenerateKey","isLoading","inputRef","useRef","history","useHistory","useEffect","current","focus","Form","formikProps","Input","name","placeholder","ref","ActionBlock","cancelButtonProps","goBack","submitButtonProps","NewApiKeyInfo","withT","classname","weight","CopyToClipboardButton","value","ZapierForm","_ref$newlyCreatedApiK","newlyCreatedApiKey","_ref$videoUrl","videoUrl","_ref$helpDocUrl","helpDocUrl","_ref$isGenerating","isGenerating","_ref$isLoading","_ref$handleGenerateAp","handleGenerateApiKey","_ref$setIsDemoModalOp","setIsDemoModalOpen","Spinner","isNotEmpty","Button","href","target"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;AAGA,IAAMA,2BAA2B,GAAGC,GAAG,CAACC,MAAM,CAAC;EAC7CC,KAAK,EAAEF,GAAG,CAACG,MAAM,EAAE,CAChBC,IAAI,CAACC,CAAC,CAAC,8CAA8C,CAAC,CAAC,CACvDC,QAAQ,CAACD,CAAC,CAAC,yCAAyC,CAAC,CAAC,CACtDE,MAAM,EAAC;AACZ,CAAC,CAAC,CAAA;AAEK,IAAMC,6BAA6B,GAAG;AAC3CC,EAAAA,aAAa,EAAE;AAAEP,IAAAA,KAAK,EAAE,EAAA;GAAI;AAC5BQ,EAAAA,gBAAgB,EAAEX,2BAA2B;AAC7CY,EAAAA,cAAc,EAAE,KAAA;AAClB,CAAC,CAAA;AAEM,IAAMC,UAAU,GAAG;AAAEC,EAAAA,MAAM,EAAE,QAAA;AAAS,CAAC;;;;ACT9C,IAAMC,YAAY,GAAG,SAAfA,YAAYA,CAAAC,IAAA,EAAA;AAAA,EAAA,IAAMC,MAAM,GAAAD,IAAA,CAANC,MAAM;IAAEC,iBAAiB,GAAAF,IAAA,CAAjBE,iBAAiB,CAAA;AAAA,EAAA,OAAO,CACtD;IACEC,GAAG,EAAEN,UAAU,CAACC,MAAM;AACtB,IAAA,SAAS,EAAE,sBAAsB;AACjCX,IAAAA,KAAK,EAAEG,CAAC,CAAC,iCAAiC,CAAC;IAC3Cc,OAAO,EAAE,SAAAA,OAAA,GAAA;MAAA,OAAMF,iBAAiB,CAACD,MAAM,CAAC,CAAA;AAAA,KAAA;AAC1C,GAAC,CACF,CAAA;AAAA,CAAA,CAAA;AAEM,IAAMI,yBAAyB,GAAG,SAA5BA,yBAAyB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EE,MAAAA,qBAAqB,EAArBA,qBAAAA;AAAqB,KAC/D,CAAC,CAAA;AAAA,GACC,CAAC,CAAA;AAEV;;;;"}
|
|
1
|
+
{"version":3,"file":"ZapierForm.js","sources":["../app/javascript/src/components/Integrations/ZapierForm/constants.js","../app/javascript/src/components/Integrations/ZapierForm/utils.jsx","../app/javascript/src/components/Integrations/ZapierForm/ApiKeysList.jsx","../app/javascript/src/components/Integrations/ZapierForm/GenerateKey.jsx","../app/javascript/src/components/Integrations/ZapierForm/NewApiKeyInfo.jsx","../app/javascript/src/components/Integrations/ZapierForm/index.jsx"],"sourcesContent":["import { t } from \"i18next\";\nimport * as Yup from \"yup\";\n\nconst GENERATE_API_KEY_VALIDATION = Yup.object({\n label: Yup.string()\n .trim(t(\"neetoIntegrations.zapier.label.noBlankSpaces\"))\n .required(t(\"neetoIntegrations.zapier.label.required\"))\n .strict(),\n});\n\nexport const GENERATE_API_KEY_FORMIK_PROPS = {\n initialValues: { label: \"\" },\n validationSchema: GENERATE_API_KEY_VALIDATION,\n validateOnBlur: false,\n};\n\nexport const MENU_ITEMS = { DELETE: \"delete\" };\n","import { t } from \"i18next\";\nimport { timeFormat } from \"neetocommons/utils\";\nimport MoreDropdown from \"neetomolecules/MoreDropdown\";\nimport { Typography } from \"neetoui\";\n\nimport { MENU_ITEMS } from \"./constants\";\n\nconst getMenuItems = ({ apiKey, setApiKeyToDelete }) => [\n {\n key: MENU_ITEMS.DELETE,\n \"data-cy\": \"delete-apikey-button\",\n label: t(\"neetoIntegrations.common.delete\"),\n onClick: () => setApiKeyToDelete(apiKey),\n },\n];\n\nexport const getApiKeysTableColumnData = () => [\n {\n title: 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: t(\"neetoIntegrations.zapier.tableColumns.createdAt\"),\n dataIndex: \"createdAt\",\n key: \"createdAt\",\n width: 200,\n },\n];\n\nexport const getApiKeysTableRowData = ({ apiKeys, setApiKeyToDelete }) =>\n apiKeys.map(apiKey => ({\n ...apiKey,\n createdAt: timeFormat.fromNow(apiKey.createdAt),\n actions: (\n <MoreDropdown\n dropdownProps={{ strategy: \"fixed\" }}\n menuItems={getMenuItems({ apiKey, setApiKeyToDelete })}\n />\n ),\n }));\n","import { useState } from \"react\";\n\nimport { noop } from \"neetocist\";\nimport { DEFAULT_PAGE_SIZE, DEFAULT_PAGE_INDEX } from \"neetocommons/constants\";\nimport TableWrapper from \"neetomolecules/TableWrapper\";\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 const [currentPageNumber, setCurrentPageNumber] =\n useState(DEFAULT_PAGE_INDEX);\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=\"max-w-full space-y-3\">\n <Typography style=\"h3\">\n {t(\"neetoIntegrations.zapier.tableTitle\")}\n </Typography>\n <TableWrapper>\n <Table\n {...{ currentPageNumber }}\n fixedHeight\n allowRowClick={false}\n columnData={getApiKeysTableColumnData()}\n defaultPageSize={DEFAULT_PAGE_SIZE}\n handlePageChange={setCurrentPageNumber}\n rowData={getApiKeysTableRowData({ apiKeys, setApiKeyToDelete })}\n />\n </TableWrapper>\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 { useEffect, useRef } from \"react\";\n\nimport { isNotEmpty } from \"neetocist\";\nimport CardLayout from \"neetomolecules/CardLayout\";\nimport { Button } from \"neetoui\";\nimport { ActionBlock, Form, Input } from \"neetoui/formik\";\nimport { useTranslation } from \"react-i18next\";\nimport { useHistory } from \"react-router-dom\";\n\nimport { GENERATE_API_KEY_FORMIK_PROPS } from \"./constants\";\n\nconst GenerateKey = ({ handleSubmit, isLoading, helpDocUrl }) => {\n const { t } = useTranslation();\n const inputRef = useRef(null);\n const history = useHistory();\n\n useEffect(() => {\n if (!inputRef.current) return;\n inputRef.current.focus();\n }, []);\n\n return (\n <Form\n className=\"w-full\"\n formikProps={{\n ...GENERATE_API_KEY_FORMIK_PROPS,\n onSubmit: handleSubmit,\n }}\n >\n <CardLayout\n title={t(\"neetoIntegrations.zapier.apiKeys\")}\n actionBlock={\n <ActionBlock\n cancelButtonProps={{ onClick: () => history.goBack() }}\n isSubmitting={isLoading}\n submitButtonProps={{\n label: t(\"neetoIntegrations.zapier.generateApiKey\"),\n }}\n />\n }\n description={\n <>\n {t(\"neetoIntegrations.zapier.emptyText\")}{\" \"}\n {isNotEmpty(helpDocUrl) && (\n <Button\n href={helpDocUrl}\n label={t(\"neetoIntegrations.zapier.learnMore\")}\n style=\"link\"\n target=\"_blank\"\n />\n )}\n </>\n }\n >\n <Input\n name=\"label\"\n placeholder={t(\"neetoIntegrations.zapier.labelInputPlaceholder\")}\n ref={inputRef}\n />\n </CardLayout>\n </Form>\n );\n};\n\nexport default GenerateKey;\n","import { withT } from \"neetocommons/react-utils\";\nimport CopyToClipboardButton from \"neetomolecules/CopyToClipboardButton\";\nimport { Typography } from \"neetoui\";\n\nconst NewApiKeyInfo = withT(({ t, apiKey }) => (\n <div className=\"space-y-3\">\n <Typography style=\"body2\" weight=\"normal\">\n {t(\"neetoIntegrations.zapier.newApiKeyInstruction\")}\n </Typography>\n <div className=\"flex gap-2\">\n <Typography\n className=\"neeto-ui-bg-gray-50 neeto-ui-border-gray-300 neeto-ui-rounded min-w-96 border px-2 py-1\"\n style=\"body2\"\n weight=\"medium\"\n >\n {apiKey}\n </Typography>\n <CopyToClipboardButton value={apiKey} />\n </div>\n </div>\n));\n\nexport default NewApiKeyInfo;\n","import { isNotEmpty, noop } from \"neetocist\";\nimport { Button, Spinner } from \"neetoui\";\nimport { useTranslation } from \"react-i18next\";\n\nimport ApiKeysList from \"./ApiKeysList\";\nimport GenerateKey from \"./GenerateKey\";\nimport NewApiKeyInfo from \"./NewApiKeyInfo\";\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) {\n return (\n <div className=\"flex h-full w-full items-center justify-center\">\n <Spinner />\n </div>\n );\n }\n\n return (\n <div className=\"mx-auto flex w-full max-w-3xl flex-col items-start space-y-6\">\n <div className=\"w-full\">\n <GenerateKey\n {...{ helpDocUrl, videoUrl }}\n handleSubmit={handleGenerateApiKey}\n isLoading={isGenerating}\n />\n <div className=\"space-y-4\">\n {isNotEmpty(newlyCreatedApiKey) && (\n <NewApiKeyInfo apiKey={newlyCreatedApiKey} />\n )}\n {isNotEmpty(videoUrl) && (\n <Button\n label={t(\"neetoIntegrations.zapier.walkthroughText\")}\n style=\"link\"\n onClick={() => setIsDemoModalOpen(true)}\n />\n )}\n </div>\n </div>\n <ApiKeysList\n {...{ apiKeys, deleteApiKey, isDeleting, setNewlyCreatedApiKey }}\n />\n </div>\n );\n};\n\nexport default ZapierForm;\n"],"names":["GENERATE_API_KEY_VALIDATION","Yup","object","label","string","trim","t","required","strict","GENERATE_API_KEY_FORMIK_PROPS","initialValues","validationSchema","validateOnBlur","MENU_ITEMS","DELETE","getMenuItems","_ref","apiKey","setApiKeyToDelete","key","onClick","getApiKeysTableColumnData","title","dataIndex","width","render","options","_ref2","actions","_jsxs","className","children","_jsx","Typography","style","getApiKeysTableRowData","_ref3","apiKeys","map","_objectSpread","createdAt","timeFormat","fromNow","MoreDropdown","dropdownProps","strategy","menuItems","ApiKeysList","_apiKeyToDelete$optio","_ref$apiKeys","_ref$deleteApiKey","deleteApiKey","noop","_ref$isDeleting","isDeleting","_ref$setNewlyCreatedA","setNewlyCreatedApiKey","_useState","useState","_useState2","_slicedToArray","apiKeyToDelete","_useState3","DEFAULT_PAGE_INDEX","_useState4","currentPageNumber","setCurrentPageNumber","_useTranslation","useTranslation","closeAlert","handleSubmit","id","onSuccess","isEmpty","_Fragment","TableWrapper","Table","fixedHeight","allowRowClick","columnData","defaultPageSize","DEFAULT_PAGE_SIZE","handlePageChange","rowData","Alert","backdropClassName","isOpen","isNotNil","isSubmitting","submitButtonLabel","message","Trans","i18nKey","values","onClose","onSubmit","GenerateKey","isLoading","helpDocUrl","inputRef","useRef","history","useHistory","useEffect","current","focus","Form","formikProps","CardLayout","actionBlock","ActionBlock","cancelButtonProps","goBack","submitButtonProps","description","isNotEmpty","Button","href","target","Input","name","placeholder","ref","NewApiKeyInfo","withT","weight","CopyToClipboardButton","value","ZapierForm","_ref$newlyCreatedApiK","newlyCreatedApiKey","_ref$videoUrl","videoUrl","_ref$helpDocUrl","_ref$isGenerating","isGenerating","_ref$isLoading","_ref$handleGenerateAp","handleGenerateApiKey","_ref$setIsDemoModalOp","setIsDemoModal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,8DAA8D;AAAAC,IAAAA,QAAA,gBAC3EF,IAAA,CAAA,KAAA,EAAA;AAAKC,MAAAA,SAAS,EAAC,QAAQ;MAAAC,QAAA,EAAA,cACrBC,GAAA,CAACgE,WAAW,EAAA;AACJE,QAAAA,UAAU,EAAVA,UAAU;AAAEkC,QAAAA,QAAQ,EAARA,QAAQ;AAC1B9D,QAAAA,YAAY,EAAEoE,oBAAqB;AACnCzC,QAAAA,SAAS,EAAEsC;OACZ,CAAC,eACF1G,IAAA,CAAA,KAAA,EAAA;AAAKC,QAAAA,SAAS,EAAC,WAAW;QAAAC,QAAA,EAAA,CACvBoF,UAAU,CAACe,kBAAkB,CAAC,iBAC7BlG,GAAA,CAAC2F,aAAa,EAAA;AAAC1G,UAAAA,MAAM,EAAEiH;SAAqB,CAC7C,EACAf,UAAU,CAACiB,QAAQ,CAAC,iBACnBpG,GAAA,CAACoF,MAAM,EAAA;AACLjH,UAAAA,KAAK,EAAEG,CAAC,CAAC,0CAA0C,CAAE;AACrD4B,UAAAA,KAAK,EAAC,MAAM;UACZd,OAAO,EAAE,SAATA,OAAOA,GAAA;YAAA,OAAQwH,kBAAkB,CAAC,IAAI,CAAC;AAAA;AAAC,SACzC,CACF;AAAA,OACE,CAAC;AAAA,KACH,CAAC,eACN5G,GAAA,CAACe,WAAW,EAAA;AACJV,MAAAA,OAAO,EAAPA,OAAO;AAAEc,MAAAA,YAAY,EAAZA,YAAY;AAAEG,MAAAA,UAAU,EAAVA,UAAU;AAAEE,MAAAA,qBAAqB,EAArBA;AAAqB,KAC/D,CAAC;AAAA,GACC,CAAC;AAEV;;;;"}
|
package/dist/Zoom.js
CHANGED
|
@@ -1,23 +1,26 @@
|
|
|
1
|
-
import
|
|
1
|
+
import _slicedToArray from '@babel/runtime/helpers/slicedToArray';
|
|
2
2
|
import { useState } from 'react';
|
|
3
3
|
import { isPresent, noop } from '@bigbinary/neeto-cist';
|
|
4
4
|
import ZoomIcon from '@bigbinary/neeto-icons/misc/Zoom';
|
|
5
|
-
import
|
|
5
|
+
import Spinner from '@bigbinary/neetoui/Spinner';
|
|
6
6
|
import { useTranslation, Trans } from 'react-i18next';
|
|
7
7
|
import Manage from './Manage.js';
|
|
8
8
|
import { useQuery } from '@tanstack/react-query';
|
|
9
9
|
import { DEFAULT_STALE_TIME } from '@bigbinary/neeto-commons-frontend/constants';
|
|
10
10
|
import { useMutationWithInvalidation } from '@bigbinary/neeto-commons-frontend/react-utils';
|
|
11
11
|
import axios from 'axios';
|
|
12
|
-
import {
|
|
12
|
+
import { I as INTEGRATION_DETAILS_URL, a as INTEGRATIONS_ENGINE_ZOOM_URL, Q as QUERY_KEYS } from './query-D2CcgTB0.js';
|
|
13
13
|
import { jsx } from 'react/jsx-runtime';
|
|
14
|
-
import '
|
|
14
|
+
import '@babel/runtime/helpers/defineProperty';
|
|
15
15
|
import 'classnames';
|
|
16
16
|
import '@bigbinary/neeto-icons/Check';
|
|
17
|
-
import '@bigbinary/neeto-molecules/IntegrationDisconnectAlert';
|
|
18
17
|
import '@bigbinary/neetoui/Button';
|
|
19
18
|
import '@bigbinary/neetoui/Tooltip';
|
|
20
19
|
import '@bigbinary/neetoui/Typography';
|
|
20
|
+
import './DisconnectAlert.js';
|
|
21
|
+
import '@babel/runtime/helpers/objectWithoutProperties';
|
|
22
|
+
import '@bigbinary/neeto-commons-frontend/react-utils/withT';
|
|
23
|
+
import '@bigbinary/neetoui/Alert';
|
|
21
24
|
|
|
22
25
|
var show = function show() {
|
|
23
26
|
return axios.get(INTEGRATION_DETAILS_URL, {
|
|
@@ -85,7 +88,12 @@ var Zoom = function Zoom(_ref) {
|
|
|
85
88
|
var handleDisconnect = function handleDisconnect() {
|
|
86
89
|
return destroyIntegration("zoom");
|
|
87
90
|
};
|
|
88
|
-
if (isLoading)
|
|
91
|
+
if (isLoading) {
|
|
92
|
+
return /*#__PURE__*/jsx("div", {
|
|
93
|
+
className: "flex h-full w-full items-center justify-center",
|
|
94
|
+
children: /*#__PURE__*/jsx(Spinner, {})
|
|
95
|
+
});
|
|
96
|
+
}
|
|
89
97
|
return /*#__PURE__*/jsx(Manage, {
|
|
90
98
|
connectUrl: connectUrl,
|
|
91
99
|
isConnected: isConnected,
|
package/dist/Zoom.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Zoom.js","sources":["../app/javascript/src/apis/zoom.js","../app/javascript/src/hooks/reactQuery/useZoomApi.js","../app/javascript/src/components/Integrations/Zoom/index.jsx"],"sourcesContent":["import axios from \"axios\";\n\nimport {\n INTEGRATIONS_ENGINE_ZOOM_URL,\n INTEGRATION_DETAILS_URL,\n} from \"src/constants/urls\";\n\nconst show = () =>\n axios.get(INTEGRATION_DETAILS_URL, {\n params: { serviceName: \"Zoom\", integrableType: \"User\" },\n });\n\nconst destroy = () => axios.delete(`${INTEGRATIONS_ENGINE_ZOOM_URL}/oauth`);\n\nconst zoomApi = { show, destroy };\n\nexport default zoomApi;\n","import { useQuery } from \"@tanstack/react-query\";\nimport { DEFAULT_STALE_TIME } from \"neetocommons/constants\";\nimport { useMutationWithInvalidation } from \"neetocommons/react-utils\";\n\nimport zoomApi from \"apis/zoom\";\nimport { QUERY_KEYS } from \"src/constants/query\";\n\nexport const useShowZoom = () =>\n useQuery({\n queryKey: [QUERY_KEYS.ZOOM_DETAILS],\n queryFn: zoomApi.show,\n staleTime: DEFAULT_STALE_TIME,\n });\nexport const useDestroyZoom = ({ onSuccess }) =>\n useMutationWithInvalidation(zoomApi.destroy, {\n keysToInvalidate: [[QUERY_KEYS.ZOOM_DETAILS]],\n onSuccess: () => onSuccess?.(),\n });\n","import { useState } from \"react\";\n\nimport { isPresent, noop } from \"neetocist\";\nimport { Zoom as ZoomIcon } from \"neetoicons/misc\";\nimport
|
|
1
|
+
{"version":3,"file":"Zoom.js","sources":["../app/javascript/src/apis/zoom.js","../app/javascript/src/hooks/reactQuery/useZoomApi.js","../app/javascript/src/components/Integrations/Zoom/index.jsx"],"sourcesContent":["import axios from \"axios\";\n\nimport {\n INTEGRATIONS_ENGINE_ZOOM_URL,\n INTEGRATION_DETAILS_URL,\n} from \"src/constants/urls\";\n\nconst show = () =>\n axios.get(INTEGRATION_DETAILS_URL, {\n params: { serviceName: \"Zoom\", integrableType: \"User\" },\n });\n\nconst destroy = () => axios.delete(`${INTEGRATIONS_ENGINE_ZOOM_URL}/oauth`);\n\nconst zoomApi = { show, destroy };\n\nexport default zoomApi;\n","import { useQuery } from \"@tanstack/react-query\";\nimport { DEFAULT_STALE_TIME } from \"neetocommons/constants\";\nimport { useMutationWithInvalidation } from \"neetocommons/react-utils\";\n\nimport zoomApi from \"apis/zoom\";\nimport { QUERY_KEYS } from \"src/constants/query\";\n\nexport const useShowZoom = () =>\n useQuery({\n queryKey: [QUERY_KEYS.ZOOM_DETAILS],\n queryFn: zoomApi.show,\n staleTime: DEFAULT_STALE_TIME,\n });\nexport const useDestroyZoom = ({ onSuccess }) =>\n useMutationWithInvalidation(zoomApi.destroy, {\n keysToInvalidate: [[QUERY_KEYS.ZOOM_DETAILS]],\n onSuccess: () => onSuccess?.(),\n });\n","import { useState } from \"react\";\n\nimport { isPresent, noop } from \"neetocist\";\nimport { Zoom as ZoomIcon } from \"neetoicons/misc\";\nimport { Spinner } from \"neetoui\";\nimport { Trans, useTranslation } from \"react-i18next\";\n\nimport ManageIntegrations from \"components/commons/Manage\";\nimport { useDestroyZoom, useShowZoom } from \"hooks/reactQuery/useZoomApi\";\n\nconst Zoom = ({ connectUrl = \"\", description = \"\", onDisconnect = noop }) => {\n const { t } = useTranslation();\n\n const [isDisconnectAlertOpen, setIsDisconnectAlertOpen] = useState(false);\n\n const { data: { metadata: { email = \"\" } = {} } = {}, isLoading } =\n useShowZoom();\n\n const { mutate: destroyIntegration, isPending: isDisconnecting } =\n useDestroyZoom({\n onSuccess: () => {\n setIsDisconnectAlertOpen(false);\n onDisconnect?.();\n },\n });\n\n const isConnected = isPresent(email);\n\n const handleDisconnect = () => destroyIntegration(\"zoom\");\n\n if (isLoading) {\n return (\n <div className=\"flex h-full w-full items-center justify-center\">\n <Spinner />\n </div>\n );\n }\n\n return (\n <ManageIntegrations\n {...{\n connectUrl,\n isConnected,\n isDisconnectAlertOpen,\n isDisconnecting,\n setIsDisconnectAlertOpen,\n }}\n Icon={ZoomIcon}\n integration=\"zoom\"\n description={\n isConnected ? (\n <Trans\n components={{ underline: <u className=\"font-medium\" /> }}\n i18nKey=\"neetoIntegrations.zoom.account\"\n values={{ email }}\n />\n ) : (\n description\n )\n }\n title={\n isConnected\n ? t(\"neetoIntegrations.zoom.connected\")\n : t(\"neetoIntegrations.zoom.connect\")\n }\n onClose={() => setIsDisconnectAlertOpen(false)}\n onDisconnect={() => handleDisconnect()}\n />\n );\n};\n\nexport default Zoom;\n"],"names":["show","axios","get","INTEGRATION_DETAILS_URL","params","serviceName","integrableType","destroy","concat","INTEGRATIONS_ENGINE_ZOOM_URL","zoomApi","useShowZoom","useQuery","queryKey","QUERY_KEYS","ZOOM_DETAILS","queryFn","staleTime","DEFAULT_STALE_TIME","useDestroyZoom","_ref","onSuccess","useMutationWithInvalidation","keysToInvalidate","Zoom","_ref$connectUrl","connectUrl","_ref$description","description","_ref$onDisconnect","onDisconnect","noop","_useTranslation","useTranslation","t","_useState","useState","_useState2","_slicedToArray","isDisconnectAlertOpen","setIsDisconnectAlertOpen","_useShowZoom","_useShowZoom$data","data","_useShowZoom$data2","_useShowZoom$data2$me","metadata","_useShowZoom$data2$me2","_useShowZoom$data2$me3","email","isLoading","_useDestroyZoom","destroyIntegration","mutate","isDisconnecting","isPending","isConnected","isPresent","handleDisconnect","_jsx","className","children","Spinner","ManageIntegrations","Icon","ZoomIcon","integration","Trans","components","underline","i18nKey","values","title","onClose"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;AAOA,IAAMA,IAAI,GAAG,SAAPA,IAAIA,GAAA;AAAA,EAAA,OACRC,KAAK,CAACC,GAAG,CAACC,uBAAuB,EAAE;AACjCC,IAAAA,MAAM,EAAE;AA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,GAAA;MAAA,OAAQ4B,gBAAgB,EAAE;AAAA;AAAC,GACxC,CAAC;AAEN;;;;"}
|
package/dist/cjs/Connect.js
CHANGED
|
@@ -1,21 +1,17 @@
|
|
|
1
1
|
'use strict';
|
|
2
2
|
|
|
3
|
-
var
|
|
3
|
+
var _defineProperty = require('@babel/runtime/helpers/defineProperty');
|
|
4
4
|
var neetoCist = require('@bigbinary/neeto-cist');
|
|
5
5
|
var reactUtils = require('@bigbinary/neeto-commons-frontend/react-utils');
|
|
6
|
+
var CardLayout = require('@bigbinary/neeto-molecules/CardLayout');
|
|
6
7
|
var Typography = require('@bigbinary/neetoui/Typography');
|
|
7
8
|
var Button = require('@bigbinary/neetoui/Button');
|
|
8
|
-
var index = require('../index-
|
|
9
|
+
var index = require('../index-dxk7jTL7.js');
|
|
9
10
|
var reactI18next = require('react-i18next');
|
|
10
11
|
var jsxRuntime = require('react/jsx-runtime');
|
|
11
12
|
|
|
12
|
-
function _interopDefaultLegacy (e) { return e && typeof e === 'object' && 'default' in e ? e : { 'default': e }; }
|
|
13
|
-
|
|
14
|
-
var Typography__default = /*#__PURE__*/_interopDefaultLegacy(Typography);
|
|
15
|
-
var Button__default = /*#__PURE__*/_interopDefaultLegacy(Button);
|
|
16
|
-
|
|
17
13
|
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; }
|
|
18
|
-
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) {
|
|
14
|
+
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; }
|
|
19
15
|
var Connect = reactUtils.withT(function (_ref) {
|
|
20
16
|
var t = _ref.t,
|
|
21
17
|
Icon = _ref.Icon,
|
|
@@ -35,28 +31,36 @@ var Connect = reactUtils.withT(function (_ref) {
|
|
|
35
31
|
onConnect = _ref$onConnect === void 0 ? neetoCist.noop : _ref$onConnect,
|
|
36
32
|
children = _ref.children,
|
|
37
33
|
secondaryButtonProps = _ref.secondaryButtonProps;
|
|
38
|
-
return /*#__PURE__*/jsxRuntime.jsxs(
|
|
39
|
-
|
|
34
|
+
return /*#__PURE__*/jsxRuntime.jsxs(CardLayout, {
|
|
35
|
+
actionBlock: /*#__PURE__*/jsxRuntime.jsxs("div", {
|
|
36
|
+
className: "flex w-full flex-wrap items-center gap-2",
|
|
37
|
+
children: [/*#__PURE__*/jsxRuntime.jsx(Button, _objectSpread({
|
|
38
|
+
label: t("neetoIntegrations.common.connect"),
|
|
39
|
+
onClick: onConnect
|
|
40
|
+
}, buttonProps)), secondaryButtonProps && /*#__PURE__*/jsxRuntime.jsx(Button, _objectSpread({
|
|
41
|
+
style: "secondary"
|
|
42
|
+
}, secondaryButtonProps))]
|
|
43
|
+
}),
|
|
40
44
|
children: [/*#__PURE__*/jsxRuntime.jsxs("div", {
|
|
41
|
-
className: "
|
|
45
|
+
className: "flex flex-col gap-y-2",
|
|
42
46
|
children: [/*#__PURE__*/jsxRuntime.jsx(Icon, {
|
|
43
47
|
size: 48
|
|
44
48
|
}), /*#__PURE__*/jsxRuntime.jsxs("div", {
|
|
45
49
|
className: "flex flex-col gap-y-1",
|
|
46
|
-
children: [/*#__PURE__*/jsxRuntime.jsx(
|
|
50
|
+
children: [/*#__PURE__*/jsxRuntime.jsx(Typography, {
|
|
47
51
|
style: "h2",
|
|
48
52
|
children: title
|
|
49
|
-
}), /*#__PURE__*/jsxRuntime.jsx(
|
|
53
|
+
}), /*#__PURE__*/jsxRuntime.jsx(Typography, {
|
|
50
54
|
style: "body2",
|
|
51
55
|
children: description
|
|
52
56
|
})]
|
|
53
57
|
})]
|
|
54
58
|
}), helpDocUrl && /*#__PURE__*/jsxRuntime.jsx("div", {
|
|
55
|
-
className: "
|
|
59
|
+
className: "w-full",
|
|
56
60
|
children: /*#__PURE__*/jsxRuntime.jsx(reactI18next.Trans, {
|
|
57
61
|
i18nKey: "neetoIntegrations.common.helpDocUrl",
|
|
58
62
|
components: {
|
|
59
|
-
helpLink: /*#__PURE__*/jsxRuntime.jsx(
|
|
63
|
+
helpLink: /*#__PURE__*/jsxRuntime.jsx(Button, {
|
|
60
64
|
className: "text-xs",
|
|
61
65
|
href: helpDocUrl,
|
|
62
66
|
size: "small",
|
|
@@ -68,15 +72,7 @@ var Connect = reactUtils.withT(function (_ref) {
|
|
|
68
72
|
integration: integrationName || neetoCist.humanize(integration)
|
|
69
73
|
}
|
|
70
74
|
})
|
|
71
|
-
}), children
|
|
72
|
-
className: "flex w-full items-center gap-x-3",
|
|
73
|
-
children: [/*#__PURE__*/jsxRuntime.jsx(Button__default["default"], _objectSpread({
|
|
74
|
-
label: t("neetoIntegrations.common.connect"),
|
|
75
|
-
onClick: onConnect
|
|
76
|
-
}, buttonProps)), secondaryButtonProps && /*#__PURE__*/jsxRuntime.jsx(Button__default["default"], _objectSpread({
|
|
77
|
-
style: "secondary"
|
|
78
|
-
}, secondaryButtonProps))]
|
|
79
|
-
})]
|
|
75
|
+
}), children]
|
|
80
76
|
});
|
|
81
77
|
});
|
|
82
78
|
Connect.prototypes = {
|
package/dist/cjs/Connect.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Connect.js","sources":["../../app/javascript/src/components/Steps/Connect.jsx"],"sourcesContent":["import { humanize, noop } from \"neetocist\";\nimport { withT } from \"neetocommons/react-utils\";\nimport { Typography, Button } from \"neetoui\";\nimport PropTypes from \"prop-types\";\nimport { Trans } from \"react-i18next\";\n\nconst Connect = withT(\n ({\n t,\n Icon,\n title = \"\",\n description = \"\",\n integration = \"\",\n integrationName = \"\",\n helpDocUrl = \"\",\n buttonProps = {},\n onConnect = noop,\n children,\n secondaryButtonProps,\n }) => (\n <div className=\"
|
|
1
|
+
{"version":3,"file":"Connect.js","sources":["../../app/javascript/src/components/Steps/Connect.jsx"],"sourcesContent":["import { humanize, noop } from \"neetocist\";\nimport { withT } from \"neetocommons/react-utils\";\nimport CardLayout from \"neetomolecules/CardLayout\";\nimport { Typography, Button } from \"neetoui\";\nimport PropTypes from \"prop-types\";\nimport { Trans } from \"react-i18next\";\n\nconst Connect = withT(\n ({\n t,\n Icon,\n title = \"\",\n description = \"\",\n integration = \"\",\n integrationName = \"\",\n helpDocUrl = \"\",\n buttonProps = {},\n onConnect = noop,\n children,\n secondaryButtonProps,\n }) => (\n <CardLayout\n actionBlock={\n <div className=\"flex w-full flex-wrap items-center gap-2\">\n <Button\n label={t(\"neetoIntegrations.common.connect\")}\n onClick={onConnect}\n {...buttonProps}\n />\n {secondaryButtonProps && (\n <Button style=\"secondary\" {...secondaryButtonProps} />\n )}\n </div>\n }\n >\n <div className=\"flex flex-col gap-y-2\">\n <Icon size={48} />\n <div className=\"flex flex-col gap-y-1\">\n <Typography style=\"h2\">{title}</Typography>\n <Typography style=\"body2\">{description}</Typography>\n </div>\n </div>\n {helpDocUrl && (\n <div className=\"w-full\">\n <Trans\n i18nKey=\"neetoIntegrations.common.helpDocUrl\"\n components={{\n helpLink: (\n <Button\n className=\"text-xs\"\n href={helpDocUrl}\n size=\"small\"\n style=\"link\"\n target=\"_blank\"\n />\n ),\n }}\n values={{\n integration: integrationName || humanize(integration),\n }}\n />\n </div>\n )}\n {children}\n </CardLayout>\n )\n);\n\nConnect.prototypes = {\n /**\n * To specify the Icon to be shown\n */\n Icon: PropTypes.node,\n /**\n * To specify the title of the connect component\n */\n title: PropTypes.string,\n /**\n * To specify the description for connect component\n */\n description: PropTypes.string,\n /**\n * To specify the props for the connect button\n */\n buttonProps: PropTypes.object,\n /**\n * Handler function that is triggered when the connect button is clicked.\n */\n onConnect: PropTypes.func,\n};\n\nexport default Connect;\n"],"names":["Connect","withT","_ref","t","Icon","_ref$title","title","_ref$description","description","_ref$integration","integration","_ref$integrationName","integrationName","_ref$helpDocUrl","helpDocUrl","_ref$buttonProps","buttonProps","_ref$onConnect","onConnect","noop","children","secondaryButtonProps","_jsxs","CardLayout","actionBlock","className","_jsx","Button","_objectSpread","label","onClick","style","size","Typography","Trans","i18nKey","components","helpLink","href","target","values","humanize","prototypes","PropTypes","node","string","object","func"],"mappings":";;;;;;;;;;;;;;AAOA,IAAMA,OAAO,GAAGC,gBAAK,CACnB,UAAAC,IAAA,EAAA;AAAA,EAAA,IACEC,CAAC,GAAAD,IAAA,CAADC,CAAC;IACDC,IAAI,GAAAF,IAAA,CAAJE,IAAI;IAAAC,UAAA,GAAAH,IAAA,CACJI,KAAK;AAALA,IAAAA,KAAK,GAAAD,UAAA,KAAG,KAAA,CAAA,GAAA,EAAE,GAAAA,UAAA;IAAAE,gBAAA,GAAAL,IAAA,CACVM,WAAW;AAAXA,IAAAA,WAAW,GAAAD,gBAAA,KAAG,KAAA,CAAA,GAAA,EAAE,GAAAA,gBAAA;IAAAE,gBAAA,GAAAP,IAAA,CAChBQ,WAAW;AAAXA,IAAAA,WAAW,GAAAD,gBAAA,KAAG,KAAA,CAAA,GAAA,EAAE,GAAAA,gBAAA;IAAAE,oBAAA,GAAAT,IAAA,CAChBU,eAAe;AAAfA,IAAAA,eAAe,GAAAD,oBAAA,KAAG,KAAA,CAAA,GAAA,EAAE,GAAAA,oBAAA;IAAAE,eAAA,GAAAX,IAAA,CACpBY,UAAU;AAAVA,IAAAA,UAAU,GAAAD,eAAA,KAAG,KAAA,CAAA,GAAA,EAAE,GAAAA,eAAA;IAAAE,gBAAA,GAAAb,IAAA,CACfc,WAAW;AAAXA,IAAAA,WAAW,GAAAD,gBAAA,KAAA,KAAA,CA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