@bigbinary/neeto-integrations-frontend 4.0.24 → 4.0.26
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/.ready +1 -1
- package/dist/Form-Bm37EVs6.js +189 -0
- package/dist/Form-Bm37EVs6.js.map +1 -0
- package/dist/Form-DbbEVp56.js +166 -0
- package/dist/Form-DbbEVp56.js.map +1 -0
- package/dist/cjs/v2/Connect.js +86 -0
- package/dist/cjs/v2/Connect.js.map +1 -0
- package/dist/cjs/v2/Daily.js +144 -0
- package/dist/cjs/v2/Daily.js.map +1 -0
- package/dist/cjs/v2/DailyForm.js +29 -0
- package/dist/cjs/v2/DailyForm.js.map +1 -0
- package/dist/cjs/v2/Demo.js +76 -0
- package/dist/cjs/v2/Demo.js.map +1 -0
- package/dist/cjs/v2/DisconnectAlert.js +40 -0
- package/dist/cjs/v2/DisconnectAlert.js.map +1 -0
- package/dist/cjs/v2/DisconnectedIntegrationsRibbon.js +109 -0
- package/dist/cjs/v2/DisconnectedIntegrationsRibbon.js.map +1 -0
- package/dist/cjs/v2/Finish.js +96 -0
- package/dist/cjs/v2/Finish.js.map +1 -0
- package/dist/cjs/v2/GoogleCalendar.js +112 -0
- package/dist/cjs/v2/GoogleCalendar.js.map +1 -0
- package/dist/cjs/v2/Manage.js +170 -0
- package/dist/cjs/v2/Manage.js.map +1 -0
- package/dist/cjs/v2/Modal.js +87 -0
- package/dist/cjs/v2/Modal.js.map +1 -0
- package/dist/cjs/v2/Telnyx.js +237 -0
- package/dist/cjs/v2/Telnyx.js.map +1 -0
- package/dist/cjs/v2/Twilio.js +309 -0
- package/dist/cjs/v2/Twilio.js.map +1 -0
- package/dist/cjs/v2/WalkthroughModal.js +51 -0
- package/dist/cjs/v2/WalkthroughModal.js.map +1 -0
- package/dist/cjs/v2/ZapierForm.js +316 -0
- package/dist/cjs/v2/ZapierForm.js.map +1 -0
- package/dist/cjs/v2/Zoom.js +125 -0
- package/dist/cjs/v2/Zoom.js.map +1 -0
- package/dist/query-BADHOzBP.js +21 -0
- package/dist/query-BADHOzBP.js.map +1 -0
- package/dist/query-BijkeV_r.js +31 -0
- package/dist/query-BijkeV_r.js.map +1 -0
- package/dist/v2/Connect.js +84 -0
- package/dist/v2/Connect.js.map +1 -0
- package/dist/v2/Daily.js +142 -0
- package/dist/v2/Daily.js.map +1 -0
- package/dist/v2/DailyForm.js +23 -0
- package/dist/v2/DailyForm.js.map +1 -0
- package/dist/v2/Demo.js +74 -0
- package/dist/v2/Demo.js.map +1 -0
- package/dist/v2/DisconnectAlert.js +38 -0
- package/dist/v2/DisconnectAlert.js.map +1 -0
- package/dist/v2/DisconnectedIntegrationsRibbon.js +107 -0
- package/dist/v2/DisconnectedIntegrationsRibbon.js.map +1 -0
- package/dist/v2/Finish.js +75 -0
- package/dist/v2/Finish.js.map +1 -0
- package/dist/v2/GoogleCalendar.js +110 -0
- package/dist/v2/GoogleCalendar.js.map +1 -0
- package/dist/v2/Manage.js +168 -0
- package/dist/v2/Manage.js.map +1 -0
- package/dist/v2/Modal.js +85 -0
- package/dist/v2/Modal.js.map +1 -0
- package/dist/v2/Telnyx.js +216 -0
- package/dist/v2/Telnyx.js.map +1 -0
- package/dist/v2/Twilio.js +288 -0
- package/dist/v2/Twilio.js.map +1 -0
- package/dist/v2/WalkthroughModal.js +49 -0
- package/dist/v2/WalkthroughModal.js.map +1 -0
- package/dist/v2/ZapierForm.js +295 -0
- package/dist/v2/ZapierForm.js.map +1 -0
- package/dist/v2/Zoom.js +123 -0
- package/dist/v2/Zoom.js.map +1 -0
- package/package.json +23 -13
- package/typeTemplates-v2/index.d.ts +180 -0
|
@@ -0,0 +1,49 @@
|
|
|
1
|
+
import { Dialog, Typography, Button } from '@bigbinary/neeto-atoms';
|
|
2
|
+
import { noop } from '@bigbinary/neeto-cist';
|
|
3
|
+
import withT from '@bigbinary/neeto-commons-frontend/react-utils/withT';
|
|
4
|
+
import { jsxs, jsx } from 'react/jsx-runtime';
|
|
5
|
+
|
|
6
|
+
var WalkthroughModal = withT(function (_ref) {
|
|
7
|
+
var t = _ref.t,
|
|
8
|
+
_ref$isOpen = _ref.isOpen,
|
|
9
|
+
isOpen = _ref$isOpen === void 0 ? false : _ref$isOpen,
|
|
10
|
+
_ref$onClose = _ref.onClose,
|
|
11
|
+
onClose = _ref$onClose === void 0 ? noop : _ref$onClose,
|
|
12
|
+
_ref$videoUrl = _ref.videoUrl,
|
|
13
|
+
videoUrl = _ref$videoUrl === void 0 ? "" : _ref$videoUrl,
|
|
14
|
+
children = _ref.children;
|
|
15
|
+
return /*#__PURE__*/jsxs(Dialog, {
|
|
16
|
+
isOpen: isOpen,
|
|
17
|
+
onClose: onClose,
|
|
18
|
+
size: "large",
|
|
19
|
+
children: [/*#__PURE__*/jsx(Dialog.Header, {
|
|
20
|
+
children: /*#__PURE__*/jsx(Typography, {
|
|
21
|
+
variant: "h2",
|
|
22
|
+
weight: "semibold",
|
|
23
|
+
children: t("neetoIntegrations.walkthroughModal.header")
|
|
24
|
+
})
|
|
25
|
+
}), /*#__PURE__*/jsx(Dialog.Body, {
|
|
26
|
+
children: /*#__PURE__*/jsxs("div", {
|
|
27
|
+
className: "w-full py-6",
|
|
28
|
+
children: [/*#__PURE__*/jsx("video", {
|
|
29
|
+
autoPlay: true,
|
|
30
|
+
controls: true,
|
|
31
|
+
muted: true,
|
|
32
|
+
className: "w-full cursor-pointer rounded-md",
|
|
33
|
+
id: "walkthrough-video",
|
|
34
|
+
children: /*#__PURE__*/jsx("source", {
|
|
35
|
+
src: videoUrl
|
|
36
|
+
})
|
|
37
|
+
}), children]
|
|
38
|
+
})
|
|
39
|
+
}), /*#__PURE__*/jsx(Dialog.Footer, {
|
|
40
|
+
children: /*#__PURE__*/jsx(Button, {
|
|
41
|
+
label: t("neetoIntegrations.walkthroughModal.continue"),
|
|
42
|
+
onClick: onClose
|
|
43
|
+
})
|
|
44
|
+
})]
|
|
45
|
+
});
|
|
46
|
+
});
|
|
47
|
+
|
|
48
|
+
export { WalkthroughModal as default };
|
|
49
|
+
//# sourceMappingURL=WalkthroughModal.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"WalkthroughModal.js","sources":["../../app/javascript/src/components/v2/WalkthroughModal/index.jsx"],"sourcesContent":["import { Dialog, Button, Typography } from \"@bigbinary/neeto-atoms\";\nimport { noop } from \"neetocist\";\nimport withT from \"neetocommons/react-utils/withT\";\n\nconst WalkthroughModal = withT(\n ({ t, isOpen = false, onClose = noop, videoUrl = \"\", children }) => (\n <Dialog {...{ isOpen, onClose }} size=\"large\">\n <Dialog.Header>\n <Typography variant=\"h2\" weight=\"semibold\">\n {t(\"neetoIntegrations.walkthroughModal.header\")}\n </Typography>\n </Dialog.Header>\n <Dialog.Body>\n <div className=\"w-full py-6\">\n <video\n autoPlay\n controls\n muted\n className=\"w-full cursor-pointer rounded-md\"\n id=\"walkthrough-video\"\n >\n <source src={videoUrl} />\n </video>\n {children}\n </div>\n </Dialog.Body>\n <Dialog.Footer>\n <Button\n label={t(\"neetoIntegrations.walkthroughModal.continue\")}\n onClick={onClose}\n />\n </Dialog.Footer>\n </Dialog>\n )\n);\n\nexport default WalkthroughModal;\n"],"names":["WalkthroughModal","withT","_ref","t","_ref$isOpen","isOpen","_ref$onClose","onClose","noop","_ref$videoUrl","videoUrl","children","_jsxs","Dialog","size","_jsx","Header","Typography","variant","weight","Body","className","autoPlay","controls","muted","id","src","Footer","Button","label","onClick"],"mappings":";;;;;AAIA,IAAMA,gBAAgB,GAAGC,KAAK,CAC5B,UAAAC,IAAA,EAAA;AAAA,EAAA,IAAGC,CAAC,GAAAD,IAAA,CAADC,CAAC;IAAAC,WAAA,GAAAF,IAAA,CAAEG,MAAM;AAANA,IAAAA,MAAM,GAAAD,WAAA,KAAA,MAAA,GAAG,KAAK,GAAAA,WAAA;IAAAE,YAAA,GAAAJ,IAAA,CAAEK,OAAO;AAAPA,IAAAA,OAAO,GAAAD,YAAA,KAAA,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C;AAAA,CAEb;;;;"}
|
|
@@ -0,0 +1,295 @@
|
|
|
1
|
+
import { Typography, DataTable, Alert, Button, Spinner } from '@bigbinary/neeto-atoms';
|
|
2
|
+
import { noop, isNotEmpty } from '@bigbinary/neeto-cist';
|
|
3
|
+
import { useTranslation, Trans } from 'react-i18next';
|
|
4
|
+
import _slicedToArray from '@babel/runtime/helpers/slicedToArray';
|
|
5
|
+
import { useState, useRef, useEffect } from 'react';
|
|
6
|
+
import { DEFAULT_PAGE_INDEX, DEFAULT_PAGE_SIZE } from '@bigbinary/neeto-commons-frontend/constants';
|
|
7
|
+
import TableWrapper from '@bigbinary/neeto-molecules/v2/TableWrapper';
|
|
8
|
+
import { isEmpty, isNotNil } from 'ramda';
|
|
9
|
+
import _defineProperty from '@babel/runtime/helpers/defineProperty';
|
|
10
|
+
import { t } from 'i18next';
|
|
11
|
+
import { timeFormat } from '@bigbinary/neeto-commons-frontend/utils';
|
|
12
|
+
import MoreDropdown from '@bigbinary/neeto-molecules/v2/MoreDropdown';
|
|
13
|
+
import * as yup from 'yup';
|
|
14
|
+
import { jsx, jsxs, Fragment } from 'react/jsx-runtime';
|
|
15
|
+
import { Form, Input, ActionBlock } from '@bigbinary/neeto-atoms/formik';
|
|
16
|
+
import CardLayout from '@bigbinary/neeto-molecules/v2/CardLayout';
|
|
17
|
+
import { useHistory } from 'react-router-dom';
|
|
18
|
+
import { withT } from '@bigbinary/neeto-commons-frontend/react-utils';
|
|
19
|
+
import CopyToClipboardButton from '@bigbinary/neeto-molecules/v2/CopyToClipboardButton';
|
|
20
|
+
|
|
21
|
+
var GENERATE_API_KEY_VALIDATION = yup.object({
|
|
22
|
+
label: yup.string().trim(t("neetoIntegrations.zapier.label.noBlankSpaces")).required(t("neetoIntegrations.zapier.label.required")).strict()
|
|
23
|
+
});
|
|
24
|
+
var GENERATE_API_KEY_FORMIK_PROPS = {
|
|
25
|
+
initialValues: {
|
|
26
|
+
label: ""
|
|
27
|
+
},
|
|
28
|
+
validationSchema: GENERATE_API_KEY_VALIDATION,
|
|
29
|
+
validateOnBlur: false
|
|
30
|
+
};
|
|
31
|
+
var MENU_ITEMS = {
|
|
32
|
+
DELETE: "delete"
|
|
33
|
+
};
|
|
34
|
+
|
|
35
|
+
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; }
|
|
36
|
+
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), true).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; }
|
|
37
|
+
var getMenuItems = function getMenuItems(_ref) {
|
|
38
|
+
var apiKey = _ref.apiKey,
|
|
39
|
+
setApiKeyToDelete = _ref.setApiKeyToDelete;
|
|
40
|
+
return [{
|
|
41
|
+
key: MENU_ITEMS.DELETE,
|
|
42
|
+
"data-testid": "delete-apikey-button",
|
|
43
|
+
label: t("neetoIntegrations.common.delete"),
|
|
44
|
+
onClick: function onClick() {
|
|
45
|
+
return setApiKeyToDelete(apiKey);
|
|
46
|
+
}
|
|
47
|
+
}];
|
|
48
|
+
};
|
|
49
|
+
var getApiKeysTableColumnData = function getApiKeysTableColumnData() {
|
|
50
|
+
return [{
|
|
51
|
+
header: t("neetoIntegrations.zapier.tableColumns.label"),
|
|
52
|
+
accessorKey: "options",
|
|
53
|
+
id: "options",
|
|
54
|
+
size: 272,
|
|
55
|
+
cell: function cell(_ref2) {
|
|
56
|
+
var row = _ref2.row;
|
|
57
|
+
var options = row.original.options;
|
|
58
|
+
var actions = row.original.actions;
|
|
59
|
+
return /*#__PURE__*/jsxs("div", {
|
|
60
|
+
className: "flex items-center justify-between gap-x-3",
|
|
61
|
+
children: [/*#__PURE__*/jsx(Typography, {
|
|
62
|
+
className: "w-4/5",
|
|
63
|
+
variant: "body2",
|
|
64
|
+
children: options === null || options === void 0 ? void 0 : options.label
|
|
65
|
+
}), actions]
|
|
66
|
+
});
|
|
67
|
+
}
|
|
68
|
+
}, {
|
|
69
|
+
header: t("neetoIntegrations.zapier.tableColumns.createdAt"),
|
|
70
|
+
accessorKey: "createdAt",
|
|
71
|
+
id: "createdAt",
|
|
72
|
+
size: 200
|
|
73
|
+
}];
|
|
74
|
+
};
|
|
75
|
+
var getApiKeysTableRowData = function getApiKeysTableRowData(_ref3) {
|
|
76
|
+
var apiKeys = _ref3.apiKeys,
|
|
77
|
+
setApiKeyToDelete = _ref3.setApiKeyToDelete;
|
|
78
|
+
return apiKeys.map(function (apiKey) {
|
|
79
|
+
return _objectSpread$1(_objectSpread$1({}, apiKey), {}, {
|
|
80
|
+
createdAt: timeFormat.fromNow(apiKey.createdAt),
|
|
81
|
+
actions: /*#__PURE__*/jsx(MoreDropdown, {
|
|
82
|
+
dropdownProps: {
|
|
83
|
+
strategy: "fixed"
|
|
84
|
+
},
|
|
85
|
+
menuItems: getMenuItems({
|
|
86
|
+
apiKey: apiKey,
|
|
87
|
+
setApiKeyToDelete: setApiKeyToDelete
|
|
88
|
+
})
|
|
89
|
+
})
|
|
90
|
+
});
|
|
91
|
+
});
|
|
92
|
+
};
|
|
93
|
+
|
|
94
|
+
var ApiKeysList = function ApiKeysList(_ref) {
|
|
95
|
+
var _apiKeyToDelete$optio;
|
|
96
|
+
var _ref$apiKeys = _ref.apiKeys,
|
|
97
|
+
apiKeys = _ref$apiKeys === void 0 ? [] : _ref$apiKeys,
|
|
98
|
+
_ref$deleteApiKey = _ref.deleteApiKey,
|
|
99
|
+
deleteApiKey = _ref$deleteApiKey === void 0 ? noop : _ref$deleteApiKey,
|
|
100
|
+
_ref$isDeleting = _ref.isDeleting,
|
|
101
|
+
isDeleting = _ref$isDeleting === void 0 ? false : _ref$isDeleting,
|
|
102
|
+
_ref$setNewlyCreatedA = _ref.setNewlyCreatedApiKey,
|
|
103
|
+
setNewlyCreatedApiKey = _ref$setNewlyCreatedA === void 0 ? noop : _ref$setNewlyCreatedA;
|
|
104
|
+
var _useState = useState(null),
|
|
105
|
+
_useState2 = _slicedToArray(_useState, 2),
|
|
106
|
+
apiKeyToDelete = _useState2[0],
|
|
107
|
+
setApiKeyToDelete = _useState2[1];
|
|
108
|
+
var _useState3 = useState(DEFAULT_PAGE_INDEX),
|
|
109
|
+
_useState4 = _slicedToArray(_useState3, 2),
|
|
110
|
+
currentPageNumber = _useState4[0],
|
|
111
|
+
setCurrentPageNumber = _useState4[1];
|
|
112
|
+
var _useTranslation = useTranslation(),
|
|
113
|
+
t = _useTranslation.t;
|
|
114
|
+
var closeAlert = function closeAlert() {
|
|
115
|
+
return setApiKeyToDelete(null);
|
|
116
|
+
};
|
|
117
|
+
var handleSubmit = function handleSubmit() {
|
|
118
|
+
deleteApiKey(apiKeyToDelete === null || apiKeyToDelete === void 0 ? void 0 : apiKeyToDelete.id, {
|
|
119
|
+
onSuccess: function onSuccess() {
|
|
120
|
+
closeAlert();
|
|
121
|
+
setNewlyCreatedApiKey("");
|
|
122
|
+
}
|
|
123
|
+
});
|
|
124
|
+
};
|
|
125
|
+
if (isEmpty(apiKeys)) return null;
|
|
126
|
+
return /*#__PURE__*/jsxs(Fragment, {
|
|
127
|
+
children: [/*#__PURE__*/jsx(Typography, {
|
|
128
|
+
className: "mb-3",
|
|
129
|
+
variant: "h3",
|
|
130
|
+
children: t("neetoIntegrations.zapier.tableTitle")
|
|
131
|
+
}), /*#__PURE__*/jsx(TableWrapper, {
|
|
132
|
+
children: /*#__PURE__*/jsx(DataTable, {
|
|
133
|
+
allowRowClick: false,
|
|
134
|
+
columns: getApiKeysTableColumnData(),
|
|
135
|
+
currentPage: currentPageNumber,
|
|
136
|
+
data: getApiKeysTableRowData({
|
|
137
|
+
apiKeys: apiKeys,
|
|
138
|
+
setApiKeyToDelete: setApiKeyToDelete
|
|
139
|
+
}),
|
|
140
|
+
pageSize: DEFAULT_PAGE_SIZE,
|
|
141
|
+
onPageChange: setCurrentPageNumber
|
|
142
|
+
})
|
|
143
|
+
}), /*#__PURE__*/jsx(Alert, {
|
|
144
|
+
backdropClassName: "zapier-delete-alert",
|
|
145
|
+
isOpen: isNotNil(apiKeyToDelete),
|
|
146
|
+
isSubmitting: isDeleting,
|
|
147
|
+
submitButtonLabel: t("neetoIntegrations.common.delete"),
|
|
148
|
+
title: t("neetoIntegrations.zapier.deleteApiKey.title"),
|
|
149
|
+
message: /*#__PURE__*/jsx(Trans, {
|
|
150
|
+
i18nKey: "neetoIntegrations.zapier.deleteApiKey.message",
|
|
151
|
+
values: {
|
|
152
|
+
key: apiKeyToDelete === null || apiKeyToDelete === void 0 || (_apiKeyToDelete$optio = apiKeyToDelete.options) === null || _apiKeyToDelete$optio === void 0 ? void 0 : _apiKeyToDelete$optio.label
|
|
153
|
+
}
|
|
154
|
+
}),
|
|
155
|
+
onClose: closeAlert,
|
|
156
|
+
onSubmit: handleSubmit
|
|
157
|
+
})]
|
|
158
|
+
});
|
|
159
|
+
};
|
|
160
|
+
|
|
161
|
+
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; }
|
|
162
|
+
function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys(Object(t), true).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; }
|
|
163
|
+
var GenerateKey = function GenerateKey(_ref) {
|
|
164
|
+
var handleSubmit = _ref.handleSubmit,
|
|
165
|
+
isLoading = _ref.isLoading,
|
|
166
|
+
helpDocUrl = _ref.helpDocUrl;
|
|
167
|
+
var _useTranslation = useTranslation(),
|
|
168
|
+
t = _useTranslation.t;
|
|
169
|
+
var inputRef = useRef(null);
|
|
170
|
+
var history = useHistory();
|
|
171
|
+
useEffect(function () {
|
|
172
|
+
if (!inputRef.current) return;
|
|
173
|
+
inputRef.current.focus();
|
|
174
|
+
}, []);
|
|
175
|
+
return /*#__PURE__*/jsx(Form, {
|
|
176
|
+
className: "w-full",
|
|
177
|
+
formikProps: _objectSpread(_objectSpread({}, GENERATE_API_KEY_FORMIK_PROPS), {}, {
|
|
178
|
+
onSubmit: handleSubmit
|
|
179
|
+
}),
|
|
180
|
+
children: /*#__PURE__*/jsx(CardLayout, {
|
|
181
|
+
title: t("neetoIntegrations.zapier.apiKeys"),
|
|
182
|
+
actionBlock: /*#__PURE__*/jsx(ActionBlock, {
|
|
183
|
+
cancelButtonProps: {
|
|
184
|
+
onClick: function onClick() {
|
|
185
|
+
return history.goBack();
|
|
186
|
+
}
|
|
187
|
+
},
|
|
188
|
+
isSubmitting: isLoading,
|
|
189
|
+
submitButtonProps: {
|
|
190
|
+
label: t("neetoIntegrations.zapier.generateApiKey")
|
|
191
|
+
}
|
|
192
|
+
}),
|
|
193
|
+
description: /*#__PURE__*/jsxs(Fragment, {
|
|
194
|
+
children: [t("neetoIntegrations.zapier.emptyText"), " ", isNotEmpty(helpDocUrl) && /*#__PURE__*/jsx(Button, {
|
|
195
|
+
href: helpDocUrl,
|
|
196
|
+
label: t("neetoIntegrations.zapier.learnMore"),
|
|
197
|
+
target: "_blank",
|
|
198
|
+
variant: "link"
|
|
199
|
+
})]
|
|
200
|
+
}),
|
|
201
|
+
children: /*#__PURE__*/jsx(Input, {
|
|
202
|
+
name: "label",
|
|
203
|
+
placeholder: t("neetoIntegrations.zapier.labelInputPlaceholder"),
|
|
204
|
+
ref: inputRef
|
|
205
|
+
})
|
|
206
|
+
})
|
|
207
|
+
});
|
|
208
|
+
};
|
|
209
|
+
|
|
210
|
+
var NewApiKeyInfo = withT(function (_ref) {
|
|
211
|
+
var t = _ref.t,
|
|
212
|
+
apiKey = _ref.apiKey;
|
|
213
|
+
return /*#__PURE__*/jsxs("div", {
|
|
214
|
+
className: "space-y-3",
|
|
215
|
+
children: [/*#__PURE__*/jsx(Typography, {
|
|
216
|
+
variant: "body2",
|
|
217
|
+
weight: "normal",
|
|
218
|
+
children: t("neetoIntegrations.zapier.newApiKeyInstruction")
|
|
219
|
+
}), /*#__PURE__*/jsxs("div", {
|
|
220
|
+
className: "flex gap-2",
|
|
221
|
+
children: [/*#__PURE__*/jsx(Typography, {
|
|
222
|
+
className: "min-w-96 rounded border border-border bg-muted px-2 py-1",
|
|
223
|
+
variant: "body2",
|
|
224
|
+
weight: "medium",
|
|
225
|
+
children: apiKey
|
|
226
|
+
}), /*#__PURE__*/jsx(CopyToClipboardButton, {
|
|
227
|
+
value: apiKey
|
|
228
|
+
})]
|
|
229
|
+
})]
|
|
230
|
+
});
|
|
231
|
+
});
|
|
232
|
+
|
|
233
|
+
var ZapierForm = function ZapierForm(_ref) {
|
|
234
|
+
var _ref$newlyCreatedApiK = _ref.newlyCreatedApiKey,
|
|
235
|
+
newlyCreatedApiKey = _ref$newlyCreatedApiK === void 0 ? "" : _ref$newlyCreatedApiK,
|
|
236
|
+
_ref$videoUrl = _ref.videoUrl,
|
|
237
|
+
videoUrl = _ref$videoUrl === void 0 ? "" : _ref$videoUrl,
|
|
238
|
+
_ref$helpDocUrl = _ref.helpDocUrl,
|
|
239
|
+
helpDocUrl = _ref$helpDocUrl === void 0 ? "" : _ref$helpDocUrl,
|
|
240
|
+
_ref$apiKeys = _ref.apiKeys,
|
|
241
|
+
apiKeys = _ref$apiKeys === void 0 ? [] : _ref$apiKeys,
|
|
242
|
+
_ref$isGenerating = _ref.isGenerating,
|
|
243
|
+
isGenerating = _ref$isGenerating === void 0 ? false : _ref$isGenerating,
|
|
244
|
+
_ref$isLoading = _ref.isLoading,
|
|
245
|
+
isLoading = _ref$isLoading === void 0 ? true : _ref$isLoading,
|
|
246
|
+
_ref$isDeleting = _ref.isDeleting,
|
|
247
|
+
isDeleting = _ref$isDeleting === void 0 ? false : _ref$isDeleting,
|
|
248
|
+
_ref$deleteApiKey = _ref.deleteApiKey,
|
|
249
|
+
deleteApiKey = _ref$deleteApiKey === void 0 ? noop : _ref$deleteApiKey,
|
|
250
|
+
_ref$handleGenerateAp = _ref.handleGenerateApiKey,
|
|
251
|
+
handleGenerateApiKey = _ref$handleGenerateAp === void 0 ? noop : _ref$handleGenerateAp,
|
|
252
|
+
_ref$setNewlyCreatedA = _ref.setNewlyCreatedApiKey,
|
|
253
|
+
setNewlyCreatedApiKey = _ref$setNewlyCreatedA === void 0 ? noop : _ref$setNewlyCreatedA,
|
|
254
|
+
_ref$setIsDemoModalOp = _ref.setIsDemoModalOpen,
|
|
255
|
+
setIsDemoModalOpen = _ref$setIsDemoModalOp === void 0 ? noop : _ref$setIsDemoModalOp;
|
|
256
|
+
var _useTranslation = useTranslation(),
|
|
257
|
+
t = _useTranslation.t;
|
|
258
|
+
if (isLoading) {
|
|
259
|
+
return /*#__PURE__*/jsx("div", {
|
|
260
|
+
className: "flex h-full w-full items-center justify-center",
|
|
261
|
+
children: /*#__PURE__*/jsx(Spinner, {})
|
|
262
|
+
});
|
|
263
|
+
}
|
|
264
|
+
return /*#__PURE__*/jsxs("div", {
|
|
265
|
+
className: "mx-auto flex w-full max-w-3xl flex-col items-start space-y-6",
|
|
266
|
+
children: [/*#__PURE__*/jsxs("div", {
|
|
267
|
+
className: "w-full",
|
|
268
|
+
children: [/*#__PURE__*/jsx(GenerateKey, {
|
|
269
|
+
helpDocUrl: helpDocUrl,
|
|
270
|
+
videoUrl: videoUrl,
|
|
271
|
+
handleSubmit: handleGenerateApiKey,
|
|
272
|
+
isLoading: isGenerating
|
|
273
|
+
}), /*#__PURE__*/jsxs("div", {
|
|
274
|
+
className: "space-y-4",
|
|
275
|
+
children: [isNotEmpty(newlyCreatedApiKey) && /*#__PURE__*/jsx(NewApiKeyInfo, {
|
|
276
|
+
apiKey: newlyCreatedApiKey
|
|
277
|
+
}), isNotEmpty(videoUrl) && /*#__PURE__*/jsx(Button, {
|
|
278
|
+
label: t("neetoIntegrations.zapier.walkthroughText"),
|
|
279
|
+
variant: "link",
|
|
280
|
+
onClick: function onClick() {
|
|
281
|
+
return setIsDemoModalOpen(true);
|
|
282
|
+
}
|
|
283
|
+
})]
|
|
284
|
+
})]
|
|
285
|
+
}), /*#__PURE__*/jsx(ApiKeysList, {
|
|
286
|
+
apiKeys: apiKeys,
|
|
287
|
+
deleteApiKey: deleteApiKey,
|
|
288
|
+
isDeleting: isDeleting,
|
|
289
|
+
setNewlyCreatedApiKey: setNewlyCreatedApiKey
|
|
290
|
+
})]
|
|
291
|
+
});
|
|
292
|
+
};
|
|
293
|
+
|
|
294
|
+
export { ZapierForm as default };
|
|
295
|
+
//# sourceMappingURL=ZapierForm.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ZapierForm.js","sources":["../../app/javascript/src/components/v2/Integrations/ZapierForm/constants.js","../../app/javascript/src/components/v2/Integrations/ZapierForm/utils.jsx","../../app/javascript/src/components/v2/Integrations/ZapierForm/ApiKeysList.jsx","../../app/javascript/src/components/v2/Integrations/ZapierForm/GenerateKey.jsx","../../app/javascript/src/components/v2/Integrations/ZapierForm/NewApiKeyInfo.jsx","../../app/javascript/src/components/v2/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 { Typography } from \"@bigbinary/neeto-atoms\";\nimport { t } from \"i18next\";\nimport { timeFormat } from \"neetocommons/utils\";\nimport MoreDropdown from \"neetomolecules/v2/MoreDropdown\";\n\nimport { MENU_ITEMS } from \"./constants\";\n\nconst getMenuItems = ({ apiKey, setApiKeyToDelete }) => [\n {\n key: MENU_ITEMS.DELETE,\n \"data-testid\": \"delete-apikey-button\",\n label: t(\"neetoIntegrations.common.delete\"),\n onClick: () => setApiKeyToDelete(apiKey),\n },\n];\n\nexport const getApiKeysTableColumnData = () => [\n {\n header: t(\"neetoIntegrations.zapier.tableColumns.label\"),\n accessorKey: \"options\",\n id: \"options\",\n size: 272,\n cell: ({ row }) => {\n const options = row.original.options;\n const actions = row.original.actions;\n\n return (\n <div className=\"flex items-center justify-between gap-x-3\">\n <Typography className=\"w-4/5\" variant=\"body2\">\n {options?.label}\n </Typography>\n {actions}\n </div>\n );\n },\n },\n {\n header: t(\"neetoIntegrations.zapier.tableColumns.createdAt\"),\n accessorKey: \"createdAt\",\n id: \"createdAt\",\n size: 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 { Alert, DataTable, Typography } from \"@bigbinary/neeto-atoms\";\nimport { noop } from \"neetocist\";\nimport { DEFAULT_PAGE_SIZE, DEFAULT_PAGE_INDEX } from \"neetocommons/constants\";\nimport TableWrapper from \"neetomolecules/v2/TableWrapper\";\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 <Typography className=\"mb-3\" variant=\"h3\">\n {t(\"neetoIntegrations.zapier.tableTitle\")}\n </Typography>\n <TableWrapper>\n <DataTable\n allowRowClick={false}\n columns={getApiKeysTableColumnData()}\n currentPage={currentPageNumber}\n data={getApiKeysTableRowData({ apiKeys, setApiKeyToDelete })}\n pageSize={DEFAULT_PAGE_SIZE}\n onPageChange={setCurrentPageNumber}\n />\n </TableWrapper>\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 { Button } from \"@bigbinary/neeto-atoms\";\nimport { ActionBlock, Form, Input } from \"@bigbinary/neeto-atoms/formik\";\nimport { isNotEmpty } from \"neetocist\";\nimport CardLayout from \"neetomolecules/v2/CardLayout\";\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 target=\"_blank\"\n variant=\"link\"\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 { Typography } from \"@bigbinary/neeto-atoms\";\nimport { withT } from \"neetocommons/react-utils\";\nimport CopyToClipboardButton from \"neetomolecules/v2/CopyToClipboardButton\";\n\nconst NewApiKeyInfo = withT(({ t, apiKey }) => (\n <div className=\"space-y-3\">\n <Typography variant=\"body2\" weight=\"normal\">\n {t(\"neetoIntegrations.zapier.newApiKeyInstruction\")}\n </Typography>\n <div className=\"flex gap-2\">\n <Typography\n className=\"min-w-96 rounded border border-border bg-muted px-2 py-1\"\n variant=\"body2\"\n weight=\"medium\"\n >\n {apiKey}\n </Typography>\n <CopyToClipboardButton value={apiKey} />\n </div>\n </div>\n));\n\nexport default NewApiKeyInfo;\n","import { Button, Spinner } from \"@bigbinary/neeto-atoms\";\nimport { isNotEmpty, noop } from \"neetocist\";\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 variant=\"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","header","accessorKey","id","size","cell","_ref2","row","options","original","actions","_jsxs","className","children","_jsx","Typography","variant","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","onSuccess","isEmpty","_Fragment","TableWrapper","DataTable","allowRowClick","columns","currentPage","data","pageSize","DEFAULT_PAGE_SIZE","onPageChange","Alert","backdropClassName","isOpen","isNotNil","isSubmitting","submitButtonLabel","title","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","setIsDemoModalOpen","Spinner"],"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;AACX,CAAC,CAAC;AAEK,IAAMC,6BAA6B,GAAG;AAC3CC,EAAAA,aAAa,EAAE;AAAEP,IAAAA,KAAK,EAAE;GAAI;AAC5BQ,EAAAA,gBAAgB,EAAEX,2BAA2B;AAC7CY,EAAAA,cAAc,EAAE;AAClB,CAAC;AAEM,IAAMC,UAAU,GAAG;AAAEC,EAAAA,MAAM,EAAE;AAAS,CAAC;;;;ACT9C,IAAMC,YAAY,G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;AACrD+B,UAAAA,OAAO,EAAC,MAAM;UACdjB,OAAO,EAAE,SAATA,OAAOA,GAAA;YAAA,OAAQ2H,kBAAkB,CAAC,IAAI,CAAC;AAAA,UAAA;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/v2/Zoom.js
ADDED
|
@@ -0,0 +1,123 @@
|
|
|
1
|
+
import _slicedToArray from '@babel/runtime/helpers/slicedToArray';
|
|
2
|
+
import { useState } from 'react';
|
|
3
|
+
import { Spinner } from '@bigbinary/neeto-atoms';
|
|
4
|
+
import { isPresent, noop } from '@bigbinary/neeto-cist';
|
|
5
|
+
import ZoomIcon from '@bigbinary/neeto-icons/misc/Zoom';
|
|
6
|
+
import { useTranslation, Trans } from 'react-i18next';
|
|
7
|
+
import Manage from './Manage.js';
|
|
8
|
+
import { useQuery } from '@tanstack/react-query';
|
|
9
|
+
import { DEFAULT_STALE_TIME } from '@bigbinary/neeto-commons-frontend/constants';
|
|
10
|
+
import { useMutationWithInvalidation } from '@bigbinary/neeto-commons-frontend/react-utils';
|
|
11
|
+
import axios from 'axios';
|
|
12
|
+
import { c as INTEGRATION_DETAILS_URL, d as INTEGRATIONS_ENGINE_ZOOM_URL, Q as QUERY_KEYS } from '../query-BADHOzBP.js';
|
|
13
|
+
import { jsx } from 'react/jsx-runtime';
|
|
14
|
+
import '@babel/runtime/helpers/defineProperty';
|
|
15
|
+
import 'lucide-react';
|
|
16
|
+
import './DisconnectAlert.js';
|
|
17
|
+
import '@babel/runtime/helpers/objectWithoutProperties';
|
|
18
|
+
import '@bigbinary/neeto-commons-frontend/react-utils/withT';
|
|
19
|
+
|
|
20
|
+
// eslint-disable-next-line @bigbinary/neeto/no-axios-import-outside-apis
|
|
21
|
+
var show = function show() {
|
|
22
|
+
return axios.get(INTEGRATION_DETAILS_URL, {
|
|
23
|
+
params: {
|
|
24
|
+
serviceName: "Zoom",
|
|
25
|
+
integrableType: "User"
|
|
26
|
+
}
|
|
27
|
+
});
|
|
28
|
+
};
|
|
29
|
+
var destroy = function destroy() {
|
|
30
|
+
return axios["delete"]("".concat(INTEGRATIONS_ENGINE_ZOOM_URL, "/oauth"));
|
|
31
|
+
};
|
|
32
|
+
var zoomApi = {
|
|
33
|
+
show: show,
|
|
34
|
+
destroy: destroy
|
|
35
|
+
};
|
|
36
|
+
|
|
37
|
+
var useShowZoom = function useShowZoom() {
|
|
38
|
+
return useQuery({
|
|
39
|
+
queryKey: [QUERY_KEYS.ZOOM_DETAILS],
|
|
40
|
+
queryFn: zoomApi.show,
|
|
41
|
+
staleTime: DEFAULT_STALE_TIME
|
|
42
|
+
});
|
|
43
|
+
};
|
|
44
|
+
var useDestroyZoom = function useDestroyZoom(_ref) {
|
|
45
|
+
var _onSuccess = _ref.onSuccess;
|
|
46
|
+
return useMutationWithInvalidation(zoomApi.destroy, {
|
|
47
|
+
keysToInvalidate: [[QUERY_KEYS.ZOOM_DETAILS]],
|
|
48
|
+
onSuccess: function onSuccess() {
|
|
49
|
+
return _onSuccess === null || _onSuccess === void 0 ? void 0 : _onSuccess();
|
|
50
|
+
}
|
|
51
|
+
});
|
|
52
|
+
};
|
|
53
|
+
|
|
54
|
+
var Zoom = function Zoom(_ref) {
|
|
55
|
+
var _ref$connectUrl = _ref.connectUrl,
|
|
56
|
+
connectUrl = _ref$connectUrl === void 0 ? "" : _ref$connectUrl,
|
|
57
|
+
_ref$description = _ref.description,
|
|
58
|
+
description = _ref$description === void 0 ? "" : _ref$description,
|
|
59
|
+
_ref$onDisconnect = _ref.onDisconnect,
|
|
60
|
+
onDisconnect = _ref$onDisconnect === void 0 ? noop : _ref$onDisconnect;
|
|
61
|
+
var _useTranslation = useTranslation(),
|
|
62
|
+
t = _useTranslation.t;
|
|
63
|
+
var _useState = useState(false),
|
|
64
|
+
_useState2 = _slicedToArray(_useState, 2),
|
|
65
|
+
isDisconnectAlertOpen = _useState2[0],
|
|
66
|
+
setIsDisconnectAlertOpen = _useState2[1];
|
|
67
|
+
var _useShowZoom = useShowZoom(),
|
|
68
|
+
_useShowZoom$data = _useShowZoom.data,
|
|
69
|
+
_useShowZoom$data2 = _useShowZoom$data === void 0 ? {} : _useShowZoom$data,
|
|
70
|
+
_useShowZoom$data2$me = _useShowZoom$data2.metadata,
|
|
71
|
+
_useShowZoom$data2$me2 = _useShowZoom$data2$me === void 0 ? {} : _useShowZoom$data2$me,
|
|
72
|
+
_useShowZoom$data2$me3 = _useShowZoom$data2$me2.email,
|
|
73
|
+
email = _useShowZoom$data2$me3 === void 0 ? "" : _useShowZoom$data2$me3,
|
|
74
|
+
isLoading = _useShowZoom.isLoading;
|
|
75
|
+
var _useDestroyZoom = useDestroyZoom({
|
|
76
|
+
onSuccess: function onSuccess() {
|
|
77
|
+
setIsDisconnectAlertOpen(false);
|
|
78
|
+
onDisconnect === null || onDisconnect === void 0 || onDisconnect();
|
|
79
|
+
}
|
|
80
|
+
}),
|
|
81
|
+
destroyIntegration = _useDestroyZoom.mutate,
|
|
82
|
+
isDisconnecting = _useDestroyZoom.isPending;
|
|
83
|
+
var isConnected = isPresent(email);
|
|
84
|
+
var handleDisconnect = function handleDisconnect() {
|
|
85
|
+
return destroyIntegration("zoom");
|
|
86
|
+
};
|
|
87
|
+
if (isLoading) {
|
|
88
|
+
return /*#__PURE__*/jsx("div", {
|
|
89
|
+
className: "flex h-full w-full items-center justify-center",
|
|
90
|
+
children: /*#__PURE__*/jsx(Spinner, {})
|
|
91
|
+
});
|
|
92
|
+
}
|
|
93
|
+
return /*#__PURE__*/jsx(Manage, {
|
|
94
|
+
connectUrl: connectUrl,
|
|
95
|
+
isConnected: isConnected,
|
|
96
|
+
isDisconnectAlertOpen: isDisconnectAlertOpen,
|
|
97
|
+
isDisconnecting: isDisconnecting,
|
|
98
|
+
setIsDisconnectAlertOpen: setIsDisconnectAlertOpen,
|
|
99
|
+
Icon: ZoomIcon,
|
|
100
|
+
integration: "zoom",
|
|
101
|
+
description: isConnected ? /*#__PURE__*/jsx(Trans, {
|
|
102
|
+
components: {
|
|
103
|
+
underline: /*#__PURE__*/jsx("u", {
|
|
104
|
+
className: "font-medium"
|
|
105
|
+
})
|
|
106
|
+
},
|
|
107
|
+
i18nKey: "neetoIntegrations.zoom.account",
|
|
108
|
+
values: {
|
|
109
|
+
email: email
|
|
110
|
+
}
|
|
111
|
+
}) : description,
|
|
112
|
+
title: isConnected ? t("neetoIntegrations.zoom.connected") : t("neetoIntegrations.zoom.connect"),
|
|
113
|
+
onClose: function onClose() {
|
|
114
|
+
return setIsDisconnectAlertOpen(false);
|
|
115
|
+
},
|
|
116
|
+
onDisconnect: function onDisconnect() {
|
|
117
|
+
return handleDisconnect();
|
|
118
|
+
}
|
|
119
|
+
});
|
|
120
|
+
};
|
|
121
|
+
|
|
122
|
+
export { Zoom as default };
|
|
123
|
+
//# sourceMappingURL=Zoom.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"Zoom.js","sources":["../../app/javascript/src/components/v2/apis/zoom.js","../../app/javascript/src/components/v2/hooks/reactQuery/useZoomApi.js","../../app/javascript/src/components/v2/Integrations/Zoom/index.jsx"],"sourcesContent":["// eslint-disable-next-line @bigbinary/neeto/no-axios-import-outside-apis\nimport axios from \"axios\";\n\nimport {\n INTEGRATIONS_ENGINE_ZOOM_URL,\n INTEGRATION_DETAILS_URL,\n} from \"../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 \"../../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 { Spinner } from \"@bigbinary/neeto-atoms\";\nimport { isPresent, noop } from \"neetocist\";\nimport { Zoom as ZoomIcon } from \"neetoicons/misc\";\nimport { Trans, useTranslation } from \"react-i18next\";\n\nimport ManageIntegrations from \"../../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":";;;;;;;;;;;;;;;;;;;AAAA;AAQA,IAAMA,IAAI,GAAG,SAAPA,IAAIA,GAAA;AAAA,EAAA,OACRC,KAAK,CAACC,GAAG,CAACC,uBAAuB,EAAE;AACjCC,IAAAA,MAAM,EAAE;AAAEC,MAAAA,WAAW,EAAE,MAAM;AAAEC,MAAAA,cAAc,EAAE;AAAO;AACxD,GAAC,CAAC;AAAA,CAAA;AAEJ,IAAMC,OAAO,GAAG,SAAVA,OAAOA,GAAA;AAAA,EAAA,OAASN,KAAK,CAAA,QAAA,CAAO,CAAA,EAAA,CAAAO,MAAA,CAAIC,4BAA4B,WAAQ,CAAC;AAAA,CAAA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AAA,EAAA;AAAKC,MAAAA,SAAS,EAAC,gDAAgD;AAAAC,MAAAA,QAAA,eAC7DF,GAAA,CAACG,OAAO,EAAA,EAAE;AAAC,KACR,CAAC;AAEV,EAAA;EAEA,oBACEH,GAAA,CAACI,MAAkB,EAAA;AAEfrC,IAAAA,UAAU,EAAVA,UAAU;AACV8B,IAAAA,WAAW,EAAXA,WAAW;AACXjB,IAAAA,qBAAqB,EAArBA,qBAAqB;AACrBe,IAAAA,eAAe,EAAfA,eAAe;AACfd,IAAAA,wBAAwB,EAAxBA,wBAAwB;AAE1BwB,IAAAA,IAAI,EAAEC,QAAS;AACfC,IAAAA,WAAW,EAAC,MAAM;AAClBtC,IAAAA,WAAW,EACT4B,WAAW,gBACTG,GAAA,CAACQ,KAAK,EAAA;AACJC,MAAAA,UAAU,EAAE;AAAEC,QAAAA,SAAS,eAAEV,GAAA,CAAA,GAAA,EAAA;AAAGC,UAAAA,SAAS,EAAC;SAAe;OAAI;AACzDU,MAAAA,OAAO,EAAC,gCAAgC;AACxCC,MAAAA,MAAM,EAAE;AAAEtB,QAAAA,KAAK,EAALA;AAAM;KACjB,CAAC,GAEFrB,WAEH;IACD4C,KAAK,EACHhB,WAAW,GACPtB,CAAC,CAAC,kCAAkC,CAAC,GACrCA,CAAC,CAAC,gCAAgC,CACvC;IACDuC,OAAO,EAAE,SAATA,OAAOA,GAAA;MAAA,OAAQjC,wBAAwB,CAAC,KAAK,CAAC;IAAA,CAAC;IAC/CV,YAAY,EAAE,SAAdA,YAAYA,GAAA;MAAA,OAAQ4B,gBAAgB,EAAE;AAAA,IAAA;AAAC,GACxC,CAAC;AAEN;;;;"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@bigbinary/neeto-integrations-frontend",
|
|
3
|
-
"version": "4.0.
|
|
3
|
+
"version": "4.0.26",
|
|
4
4
|
"description": "UI for integrations in neeto products",
|
|
5
5
|
"license": "UNLICENSED",
|
|
6
6
|
"homepage": "https://github.com/bigbinary/neeto-integrations-nano",
|
|
@@ -12,6 +12,7 @@
|
|
|
12
12
|
"files": [
|
|
13
13
|
"dist",
|
|
14
14
|
"types.d.ts",
|
|
15
|
+
"typeTemplates-v2",
|
|
15
16
|
"app/javascript/src/translations"
|
|
16
17
|
],
|
|
17
18
|
"module": "./dist/index.js",
|
|
@@ -27,6 +28,11 @@
|
|
|
27
28
|
"import": "./dist/*.js",
|
|
28
29
|
"require": "./dist/cjs/*.js",
|
|
29
30
|
"types": "./types.d.ts"
|
|
31
|
+
},
|
|
32
|
+
"./v2/*": {
|
|
33
|
+
"import": "./dist/v2/*.js",
|
|
34
|
+
"require": "./dist/cjs/v2/*.js",
|
|
35
|
+
"types": "./types.d.ts"
|
|
30
36
|
}
|
|
31
37
|
},
|
|
32
38
|
"scripts": {
|
|
@@ -62,12 +68,13 @@
|
|
|
62
68
|
"@babel/runtime": "7.29.2",
|
|
63
69
|
"@bigbinary/babel-preset-neeto": "^1.0.3",
|
|
64
70
|
"@bigbinary/eslint-plugin-neeto": "1.9.0",
|
|
71
|
+
"@bigbinary/neeto-atoms": "latest",
|
|
65
72
|
"@bigbinary/neeto-cist": "1.0.17",
|
|
66
|
-
"@bigbinary/neeto-commons-frontend": "4.13.
|
|
67
|
-
"@bigbinary/neeto-filters-frontend": "4.3.
|
|
68
|
-
"@bigbinary/neeto-icons": "1.20.
|
|
69
|
-
"@bigbinary/neeto-molecules": "4.1.
|
|
70
|
-
"@bigbinary/neetoui": "8.
|
|
73
|
+
"@bigbinary/neeto-commons-frontend": "4.13.121",
|
|
74
|
+
"@bigbinary/neeto-filters-frontend": "4.3.33",
|
|
75
|
+
"@bigbinary/neeto-icons": "1.20.87",
|
|
76
|
+
"@bigbinary/neeto-molecules": "4.1.60",
|
|
77
|
+
"@bigbinary/neetoui": "8.6.0",
|
|
71
78
|
"@emotion/is-prop-valid": "1.2.0",
|
|
72
79
|
"@faker-js/faker": "8.2.0",
|
|
73
80
|
"@honeybadger-io/js": "6.10.1",
|
|
@@ -85,7 +92,7 @@
|
|
|
85
92
|
"@tanstack/react-query-devtools": "5.59.20",
|
|
86
93
|
"antd": "5.22.1",
|
|
87
94
|
"autoprefixer": "^10.4.5",
|
|
88
|
-
"axios": "1.
|
|
95
|
+
"axios": "1.15.0",
|
|
89
96
|
"babel-loader": "^8.2.5",
|
|
90
97
|
"babel-plugin-istanbul": "^6.1.1",
|
|
91
98
|
"babel-plugin-js-logger": "1.0.17",
|
|
@@ -126,6 +133,7 @@
|
|
|
126
133
|
"i18next-browser-languagedetector": "7.0.1",
|
|
127
134
|
"js-logger": "1.6.1",
|
|
128
135
|
"lint-staged": "12.4.1",
|
|
136
|
+
"lucide-react": "^0.577.0",
|
|
129
137
|
"mini-css-extract-plugin": "2.7.6",
|
|
130
138
|
"mixpanel-browser": "2.47.0",
|
|
131
139
|
"os-browserify": "0.3.0",
|
|
@@ -174,19 +182,20 @@
|
|
|
174
182
|
},
|
|
175
183
|
"peerDependencies": {
|
|
176
184
|
"@babel/runtime": "7.29.2",
|
|
185
|
+
"@bigbinary/neeto-atoms": "latest",
|
|
177
186
|
"@bigbinary/neeto-cist": "1.0.17",
|
|
178
|
-
"@bigbinary/neeto-commons-frontend": "4.13.
|
|
179
|
-
"@bigbinary/neeto-filters-frontend": "4.3.
|
|
180
|
-
"@bigbinary/neeto-icons": "1.20.
|
|
181
|
-
"@bigbinary/neeto-molecules": "4.1.
|
|
182
|
-
"@bigbinary/neetoui": "8.
|
|
187
|
+
"@bigbinary/neeto-commons-frontend": "4.13.121",
|
|
188
|
+
"@bigbinary/neeto-filters-frontend": "4.3.33",
|
|
189
|
+
"@bigbinary/neeto-icons": "1.20.87",
|
|
190
|
+
"@bigbinary/neeto-molecules": "4.1.60",
|
|
191
|
+
"@bigbinary/neetoui": "8.6.0",
|
|
183
192
|
"@honeybadger-io/js": "6.10.1",
|
|
184
193
|
"@honeybadger-io/react": "6.1.25",
|
|
185
194
|
"@tailwindcss/container-queries": "^0.1.1",
|
|
186
195
|
"@tanstack/react-query": "5.59.20",
|
|
187
196
|
"@tanstack/react-query-devtools": "5.59.20",
|
|
188
197
|
"antd": "5.22.1",
|
|
189
|
-
"axios": "1.
|
|
198
|
+
"axios": "1.15.0",
|
|
190
199
|
"buffer": "^6.0.3",
|
|
191
200
|
"classnames": "2.5.1",
|
|
192
201
|
"crypto-browserify": "3.12.1",
|
|
@@ -195,6 +204,7 @@
|
|
|
195
204
|
"https-browserify": "1.0.0",
|
|
196
205
|
"i18next": "22.5.1",
|
|
197
206
|
"js-logger": "1.6.1",
|
|
207
|
+
"lucide-react": "^0.577.0",
|
|
198
208
|
"mixpanel-browser": "^2.45.0",
|
|
199
209
|
"os-browserify": "0.3.0",
|
|
200
210
|
"path-browserify": "^1.0.1",
|