@bigbinary/neeto-molecules 1.0.97 → 1.0.99
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 +1 -0
- package/dist/IntegrationCard.cjs.js +37 -2
- package/dist/IntegrationCard.cjs.js.map +1 -1
- package/dist/IntegrationCard.js +37 -2
- package/dist/IntegrationCard.js.map +1 -1
- package/dist/IpRestriction.cjs.js +7 -4
- package/dist/IpRestriction.cjs.js.map +1 -1
- package/dist/IpRestriction.js +7 -4
- package/dist/IpRestriction.js.map +1 -1
- package/dist/Settings.cjs.js +387 -0
- package/dist/Settings.cjs.js.map +1 -0
- package/dist/Settings.js +381 -0
- package/dist/Settings.js.map +1 -0
- package/dist/ToggleFeatureCard.cjs.js +104 -19
- package/dist/ToggleFeatureCard.cjs.js.map +1 -1
- package/dist/ToggleFeatureCard.js +104 -19
- package/dist/ToggleFeatureCard.js.map +1 -1
- package/package.json +1 -1
- package/src/translations/en.json +3 -0
- package/types/IntegrationCard.d.ts +23 -21
- package/types/Settings.d.ts +95 -0
- package/types/ToggleFeatureCard.d.ts +3 -9
package/dist/Settings.js
ADDED
|
@@ -0,0 +1,381 @@
|
|
|
1
|
+
import React, { memo, useEffect } from 'react';
|
|
2
|
+
import { joinHyphenCase, getQueryParams } from '@bigbinary/neeto-commons-frontend/utils';
|
|
3
|
+
import { Dropdown as Dropdown$1, Tag, Tooltip, Typography, Spinner, Button, NoData } from '@bigbinary/neetoui';
|
|
4
|
+
import { isNotNil, isEmpty } from 'ramda';
|
|
5
|
+
import { useTranslation } from 'react-i18next';
|
|
6
|
+
import { noop, isNotEmpty } from '@bigbinary/neeto-commons-frontend/pure';
|
|
7
|
+
import { MenuVertical, Warning, Check } from '@bigbinary/neeto-icons';
|
|
8
|
+
import { withRouter, Link } from 'react-router-dom';
|
|
9
|
+
|
|
10
|
+
function _extends() {
|
|
11
|
+
_extends = Object.assign ? Object.assign.bind() : function (target) {
|
|
12
|
+
for (var i = 1; i < arguments.length; i++) {
|
|
13
|
+
var source = arguments[i];
|
|
14
|
+
for (var key in source) {
|
|
15
|
+
if (Object.prototype.hasOwnProperty.call(source, key)) {
|
|
16
|
+
target[key] = source[key];
|
|
17
|
+
}
|
|
18
|
+
}
|
|
19
|
+
}
|
|
20
|
+
return target;
|
|
21
|
+
};
|
|
22
|
+
return _extends.apply(this, arguments);
|
|
23
|
+
}
|
|
24
|
+
|
|
25
|
+
function _objectWithoutPropertiesLoose(source, excluded) {
|
|
26
|
+
if (source == null) return {};
|
|
27
|
+
var target = {};
|
|
28
|
+
var sourceKeys = Object.keys(source);
|
|
29
|
+
var key, i;
|
|
30
|
+
for (i = 0; i < sourceKeys.length; i++) {
|
|
31
|
+
key = sourceKeys[i];
|
|
32
|
+
if (excluded.indexOf(key) >= 0) continue;
|
|
33
|
+
target[key] = source[key];
|
|
34
|
+
}
|
|
35
|
+
return target;
|
|
36
|
+
}
|
|
37
|
+
|
|
38
|
+
function _objectWithoutProperties(source, excluded) {
|
|
39
|
+
if (source == null) return {};
|
|
40
|
+
var target = _objectWithoutPropertiesLoose(source, excluded);
|
|
41
|
+
var key, i;
|
|
42
|
+
if (Object.getOwnPropertySymbols) {
|
|
43
|
+
var sourceSymbolKeys = Object.getOwnPropertySymbols(source);
|
|
44
|
+
for (i = 0; i < sourceSymbolKeys.length; i++) {
|
|
45
|
+
key = sourceSymbolKeys[i];
|
|
46
|
+
if (excluded.indexOf(key) >= 0) continue;
|
|
47
|
+
if (!Object.prototype.propertyIsEnumerable.call(source, key)) continue;
|
|
48
|
+
target[key] = source[key];
|
|
49
|
+
}
|
|
50
|
+
}
|
|
51
|
+
return target;
|
|
52
|
+
}
|
|
53
|
+
|
|
54
|
+
var classnames$1 = {exports: {}};
|
|
55
|
+
|
|
56
|
+
/*!
|
|
57
|
+
Copyright (c) 2018 Jed Watson.
|
|
58
|
+
Licensed under the MIT License (MIT), see
|
|
59
|
+
http://jedwatson.github.io/classnames
|
|
60
|
+
*/
|
|
61
|
+
|
|
62
|
+
(function (module) {
|
|
63
|
+
/* global define */
|
|
64
|
+
|
|
65
|
+
(function () {
|
|
66
|
+
|
|
67
|
+
var hasOwn = {}.hasOwnProperty;
|
|
68
|
+
|
|
69
|
+
function classNames() {
|
|
70
|
+
var classes = [];
|
|
71
|
+
|
|
72
|
+
for (var i = 0; i < arguments.length; i++) {
|
|
73
|
+
var arg = arguments[i];
|
|
74
|
+
if (!arg) continue;
|
|
75
|
+
|
|
76
|
+
var argType = typeof arg;
|
|
77
|
+
|
|
78
|
+
if (argType === 'string' || argType === 'number') {
|
|
79
|
+
classes.push(arg);
|
|
80
|
+
} else if (Array.isArray(arg)) {
|
|
81
|
+
if (arg.length) {
|
|
82
|
+
var inner = classNames.apply(null, arg);
|
|
83
|
+
if (inner) {
|
|
84
|
+
classes.push(inner);
|
|
85
|
+
}
|
|
86
|
+
}
|
|
87
|
+
} else if (argType === 'object') {
|
|
88
|
+
if (arg.toString !== Object.prototype.toString && !arg.toString.toString().includes('[native code]')) {
|
|
89
|
+
classes.push(arg.toString());
|
|
90
|
+
continue;
|
|
91
|
+
}
|
|
92
|
+
|
|
93
|
+
for (var key in arg) {
|
|
94
|
+
if (hasOwn.call(arg, key) && arg[key]) {
|
|
95
|
+
classes.push(key);
|
|
96
|
+
}
|
|
97
|
+
}
|
|
98
|
+
}
|
|
99
|
+
}
|
|
100
|
+
|
|
101
|
+
return classes.join(' ');
|
|
102
|
+
}
|
|
103
|
+
|
|
104
|
+
if (module.exports) {
|
|
105
|
+
classNames.default = classNames;
|
|
106
|
+
module.exports = classNames;
|
|
107
|
+
} else {
|
|
108
|
+
window.classNames = classNames;
|
|
109
|
+
}
|
|
110
|
+
}());
|
|
111
|
+
} (classnames$1));
|
|
112
|
+
|
|
113
|
+
var classnames = classnames$1.exports;
|
|
114
|
+
|
|
115
|
+
var Menu = Dropdown$1.Menu,
|
|
116
|
+
MenuItem = Dropdown$1.MenuItem;
|
|
117
|
+
var Dropdown = function Dropdown(_ref) {
|
|
118
|
+
var customDropdown = _ref.customDropdown,
|
|
119
|
+
_ref$handleManage = _ref.handleManage,
|
|
120
|
+
handleManage = _ref$handleManage === void 0 ? noop : _ref$handleManage,
|
|
121
|
+
_ref$hideDisconnect = _ref.hideDisconnect,
|
|
122
|
+
hideDisconnect = _ref$hideDisconnect === void 0 ? false : _ref$hideDisconnect,
|
|
123
|
+
_ref$onDisconnect = _ref.onDisconnect,
|
|
124
|
+
onDisconnect = _ref$onDisconnect === void 0 ? noop : _ref$onDisconnect;
|
|
125
|
+
var _useTranslation = useTranslation(),
|
|
126
|
+
t = _useTranslation.t;
|
|
127
|
+
if (isNotNil(customDropdown)) {
|
|
128
|
+
return /*#__PURE__*/React.createElement("div", {
|
|
129
|
+
onClick: function onClick(e) {
|
|
130
|
+
return e.stopPropagation();
|
|
131
|
+
}
|
|
132
|
+
}, customDropdown);
|
|
133
|
+
}
|
|
134
|
+
var isManageable = isNotNil(handleManage);
|
|
135
|
+
if (!isManageable && hideDisconnect) {
|
|
136
|
+
return null;
|
|
137
|
+
}
|
|
138
|
+
return /*#__PURE__*/React.createElement("div", {
|
|
139
|
+
onClick: function onClick(e) {
|
|
140
|
+
return e.stopPropagation();
|
|
141
|
+
}
|
|
142
|
+
}, /*#__PURE__*/React.createElement(Dropdown$1, {
|
|
143
|
+
buttonStyle: "text",
|
|
144
|
+
icon: MenuVertical
|
|
145
|
+
}, /*#__PURE__*/React.createElement(Menu, null, isManageable && /*#__PURE__*/React.createElement(MenuItem.Button, {
|
|
146
|
+
onClick: handleManage
|
|
147
|
+
}, t("neetoMolecules.integrationCard.manage")), !hideDisconnect && /*#__PURE__*/React.createElement(MenuItem.Button, {
|
|
148
|
+
onClick: onDisconnect
|
|
149
|
+
}, t("neetoMolecules.integrationCard.disconnect")))));
|
|
150
|
+
};
|
|
151
|
+
|
|
152
|
+
var Status = function Status(_ref) {
|
|
153
|
+
var isExpired = _ref.isExpired;
|
|
154
|
+
var _useTranslation = useTranslation(),
|
|
155
|
+
t = _useTranslation.t;
|
|
156
|
+
var tagProps = isExpired ? {
|
|
157
|
+
icon: Warning,
|
|
158
|
+
label: t("neetoMolecules.integrationCard.tags.expired"),
|
|
159
|
+
style: "warning"
|
|
160
|
+
} : {
|
|
161
|
+
icon: Check,
|
|
162
|
+
label: t("neetoMolecules.integrationCard.tags.connected"),
|
|
163
|
+
style: "success"
|
|
164
|
+
};
|
|
165
|
+
return /*#__PURE__*/React.createElement(Tag, _extends({
|
|
166
|
+
className: "flex-row-reverse"
|
|
167
|
+
}, tagProps, {
|
|
168
|
+
"data-testid": "integration-status"
|
|
169
|
+
}));
|
|
170
|
+
};
|
|
171
|
+
|
|
172
|
+
var _excluded$1 = ["icon", "subIcons", "label", "description", "className", "onConnect", "onDisconnect", "onManage", "isLoading", "isConnected", "isFailed", "isExpired", "disabled", "hidden", "hideDisconnect", "onClick", "tooltipProps", "customDropdown", "dataCy", "children"];
|
|
173
|
+
var IntegrationCard = function IntegrationCard(_ref) {
|
|
174
|
+
var Icon = _ref.icon,
|
|
175
|
+
_ref$subIcons = _ref.subIcons,
|
|
176
|
+
subIcons = _ref$subIcons === void 0 ? [] : _ref$subIcons,
|
|
177
|
+
_ref$label = _ref.label,
|
|
178
|
+
label = _ref$label === void 0 ? "" : _ref$label,
|
|
179
|
+
_ref$description = _ref.description,
|
|
180
|
+
description = _ref$description === void 0 ? "" : _ref$description,
|
|
181
|
+
_ref$className = _ref.className,
|
|
182
|
+
className = _ref$className === void 0 ? "" : _ref$className,
|
|
183
|
+
_ref$onConnect = _ref.onConnect,
|
|
184
|
+
onConnect = _ref$onConnect === void 0 ? noop : _ref$onConnect,
|
|
185
|
+
_ref$onDisconnect = _ref.onDisconnect,
|
|
186
|
+
onDisconnect = _ref$onDisconnect === void 0 ? noop : _ref$onDisconnect,
|
|
187
|
+
_ref$onManage = _ref.onManage,
|
|
188
|
+
onManage = _ref$onManage === void 0 ? undefined : _ref$onManage,
|
|
189
|
+
_ref$isLoading = _ref.isLoading,
|
|
190
|
+
isLoading = _ref$isLoading === void 0 ? false : _ref$isLoading,
|
|
191
|
+
_ref$isConnected = _ref.isConnected,
|
|
192
|
+
isConnected = _ref$isConnected === void 0 ? false : _ref$isConnected,
|
|
193
|
+
_ref$isFailed = _ref.isFailed,
|
|
194
|
+
isFailed = _ref$isFailed === void 0 ? false : _ref$isFailed,
|
|
195
|
+
_ref$isExpired = _ref.isExpired,
|
|
196
|
+
isExpired = _ref$isExpired === void 0 ? false : _ref$isExpired,
|
|
197
|
+
_ref$disabled = _ref.disabled,
|
|
198
|
+
disabled = _ref$disabled === void 0 ? false : _ref$disabled,
|
|
199
|
+
_ref$hidden = _ref.hidden,
|
|
200
|
+
hidden = _ref$hidden === void 0 ? false : _ref$hidden,
|
|
201
|
+
_ref$hideDisconnect = _ref.hideDisconnect,
|
|
202
|
+
hideDisconnect = _ref$hideDisconnect === void 0 ? false : _ref$hideDisconnect,
|
|
203
|
+
_ref$onClick = _ref.onClick,
|
|
204
|
+
onCardClick = _ref$onClick === void 0 ? undefined : _ref$onClick,
|
|
205
|
+
_ref$tooltipProps = _ref.tooltipProps,
|
|
206
|
+
tooltipProps = _ref$tooltipProps === void 0 ? {} : _ref$tooltipProps,
|
|
207
|
+
_ref$customDropdown = _ref.customDropdown,
|
|
208
|
+
customDropdown = _ref$customDropdown === void 0 ? null : _ref$customDropdown,
|
|
209
|
+
_ref$dataCy = _ref.dataCy,
|
|
210
|
+
dataCy = _ref$dataCy === void 0 ? "" : _ref$dataCy,
|
|
211
|
+
children = _ref.children,
|
|
212
|
+
otherProps = _objectWithoutProperties(_ref, _excluded$1);
|
|
213
|
+
var _useTranslation = useTranslation(),
|
|
214
|
+
t = _useTranslation.t;
|
|
215
|
+
if (hidden) return null;
|
|
216
|
+
var isCardClickable = isConnected && isNotNil(onCardClick);
|
|
217
|
+
var cardProps = isCardClickable ? {
|
|
218
|
+
onClick: onCardClick
|
|
219
|
+
} : {};
|
|
220
|
+
return /*#__PURE__*/React.createElement(Tooltip, _extends({
|
|
221
|
+
disabled: !disabled,
|
|
222
|
+
position: "top",
|
|
223
|
+
content: disabled && t("neetoMolecules.integrationCard.tooltip.integrationNotAvailable")
|
|
224
|
+
}, tooltipProps), /*#__PURE__*/React.createElement("div", _extends({
|
|
225
|
+
"data-cy": dataCy,
|
|
226
|
+
"data-testid": "integration-card",
|
|
227
|
+
className: classnames("outline-none neeto-ui-border-gray-300 neeto-ui-shadow-xs hover:neeto-ui-border-gray-500 focus:neeto-ui-border-gray-500 neeto-ui-rounded-lg flex flex-col border p-6 no-underline transition-colors", {
|
|
228
|
+
"hover:neeto-ui-bg-100 cursor-not-allowed opacity-50": disabled,
|
|
229
|
+
"cursor-pointer": isCardClickable
|
|
230
|
+
}, className)
|
|
231
|
+
}, cardProps, otherProps), /*#__PURE__*/React.createElement("div", {
|
|
232
|
+
className: "flex flex-grow justify-between",
|
|
233
|
+
"data-cy": "integration-tabs"
|
|
234
|
+
}, /*#__PURE__*/React.createElement("div", {
|
|
235
|
+
className: "flex min-w-0 flex-col justify-end"
|
|
236
|
+
}, /*#__PURE__*/React.createElement("div", {
|
|
237
|
+
className: "relative mb-4 flex h-8"
|
|
238
|
+
}, Icon && /*#__PURE__*/React.createElement(Icon, {
|
|
239
|
+
size: 32
|
|
240
|
+
})), /*#__PURE__*/React.createElement("div", {
|
|
241
|
+
className: "my-auto"
|
|
242
|
+
}, /*#__PURE__*/React.createElement(Typography, {
|
|
243
|
+
className: "mb-2",
|
|
244
|
+
"data-cy": "integration-card-label",
|
|
245
|
+
style: "h4",
|
|
246
|
+
weight: "semibold"
|
|
247
|
+
}, label), /*#__PURE__*/React.createElement(Typography, {
|
|
248
|
+
className: "break-words",
|
|
249
|
+
"data-cy": "".concat(joinHyphenCase(label), "-integration-description"),
|
|
250
|
+
style: "body2"
|
|
251
|
+
}, description), children)), isNotEmpty(subIcons) && /*#__PURE__*/React.createElement("div", {
|
|
252
|
+
className: "flex h-24 flex-col gap-2"
|
|
253
|
+
}, subIcons.map(function (Icon, index) {
|
|
254
|
+
return /*#__PURE__*/React.createElement(Icon, {
|
|
255
|
+
className: "neeto-ui-text-gray-600",
|
|
256
|
+
key: index,
|
|
257
|
+
size: 24
|
|
258
|
+
});
|
|
259
|
+
}))), /*#__PURE__*/React.createElement("div", {
|
|
260
|
+
className: "neeto-ui-border-gray-300 mt-4 w-full border-t pt-2"
|
|
261
|
+
}, isLoading ? /*#__PURE__*/React.createElement("div", {
|
|
262
|
+
className: "mt-3 flex items-center justify-start"
|
|
263
|
+
}, /*#__PURE__*/React.createElement(Spinner, null)) : /*#__PURE__*/React.createElement("div", {
|
|
264
|
+
className: "flex h-8 items-center justify-between"
|
|
265
|
+
}, isConnected && /*#__PURE__*/React.createElement(Status, {
|
|
266
|
+
isExpired: isExpired
|
|
267
|
+
}), isFailed && /*#__PURE__*/React.createElement(Button, {
|
|
268
|
+
className: "neeto-ui-text-warning-500",
|
|
269
|
+
"data-cy": "connect-button",
|
|
270
|
+
disabled: disabled || isLoading,
|
|
271
|
+
label: t("neetoMolecules.integrationCard.tryAgain"),
|
|
272
|
+
style: "link",
|
|
273
|
+
onClick: onConnect
|
|
274
|
+
}), !isConnected && !isFailed && /*#__PURE__*/React.createElement(Button, {
|
|
275
|
+
"data-cy": "connect-button",
|
|
276
|
+
"data-testid": "integraiton-card-connect-button",
|
|
277
|
+
disabled: disabled || isLoading,
|
|
278
|
+
label: t("neetoMolecules.integrationCard.connect"),
|
|
279
|
+
style: "link",
|
|
280
|
+
onClick: onConnect
|
|
281
|
+
}), (isConnected || isFailed) && /*#__PURE__*/React.createElement(Dropdown, {
|
|
282
|
+
customDropdown: customDropdown,
|
|
283
|
+
hideDisconnect: hideDisconnect,
|
|
284
|
+
onDisconnect: onDisconnect,
|
|
285
|
+
handleManage: onManage
|
|
286
|
+
})))));
|
|
287
|
+
};
|
|
288
|
+
|
|
289
|
+
var _excluded = ["label", "description", "icon", "path", "dataCy", "className"];
|
|
290
|
+
var Item = function Item(_ref) {
|
|
291
|
+
var label = _ref.label,
|
|
292
|
+
description = _ref.description,
|
|
293
|
+
_ref$icon = _ref.icon,
|
|
294
|
+
Icon = _ref$icon === void 0 ? null : _ref$icon,
|
|
295
|
+
path = _ref.path,
|
|
296
|
+
dataCy = _ref.dataCy,
|
|
297
|
+
_ref$className = _ref.className,
|
|
298
|
+
className = _ref$className === void 0 ? "" : _ref$className,
|
|
299
|
+
otherProps = _objectWithoutProperties(_ref, _excluded);
|
|
300
|
+
return /*#__PURE__*/React.createElement(Link, _extends({
|
|
301
|
+
"data-cy": dataCy,
|
|
302
|
+
to: path,
|
|
303
|
+
className: classnames("outline-none neeto-ui-border-gray-300 neeto-ui-shadow-xs hover:neeto-ui-border-gray-500 focus:neeto-ui-border-gray-500 neeto-ui-rounded-lg flex cursor-pointer flex-col border p-6 no-underline transition-colors", className)
|
|
304
|
+
}, otherProps), /*#__PURE__*/React.createElement("div", {
|
|
305
|
+
"data-testid": "settings-item-".concat(joinHyphenCase(label))
|
|
306
|
+
}, Icon && /*#__PURE__*/React.createElement(Icon, {
|
|
307
|
+
className: "neeto-ui-text-gray-600 mb-4",
|
|
308
|
+
size: 32
|
|
309
|
+
}), /*#__PURE__*/React.createElement(Typography, {
|
|
310
|
+
className: "mb-2",
|
|
311
|
+
"data-cy": "settings-item-heading",
|
|
312
|
+
style: "h4",
|
|
313
|
+
weight: "semibold"
|
|
314
|
+
}, label), /*#__PURE__*/React.createElement(Typography, {
|
|
315
|
+
"data-cy": "settings-item-description",
|
|
316
|
+
style: "body2"
|
|
317
|
+
}, description)));
|
|
318
|
+
};
|
|
319
|
+
var Item$1 = /*#__PURE__*/memo(withRouter(Item));
|
|
320
|
+
|
|
321
|
+
var Category = function Category(_ref) {
|
|
322
|
+
var items = _ref.items,
|
|
323
|
+
label = _ref.label,
|
|
324
|
+
id = _ref.id,
|
|
325
|
+
isIntegration = _ref.isIntegration;
|
|
326
|
+
var SettingsCard = isIntegration ? IntegrationCard : Item$1;
|
|
327
|
+
return /*#__PURE__*/React.createElement("div", {
|
|
328
|
+
className: "flex flex-col py-6",
|
|
329
|
+
id: id
|
|
330
|
+
}, isNotEmpty(items) && /*#__PURE__*/React.createElement(Typography, {
|
|
331
|
+
className: "mb-6",
|
|
332
|
+
component: "h2",
|
|
333
|
+
"data-cy": "settings-category-heading",
|
|
334
|
+
style: "h2",
|
|
335
|
+
weight: "semibold"
|
|
336
|
+
}, label), /*#__PURE__*/React.createElement("div", {
|
|
337
|
+
className: "grid grid-cols-1 gap-3 lg:grid-cols-2 lg:gap-6 xl:grid-cols-3 2xl:grid-cols-4"
|
|
338
|
+
}, items.map(function (item) {
|
|
339
|
+
return /*#__PURE__*/React.createElement(SettingsCard, _extends({
|
|
340
|
+
key: item.label
|
|
341
|
+
}, item));
|
|
342
|
+
})));
|
|
343
|
+
};
|
|
344
|
+
|
|
345
|
+
var scrollIntoSettingCategory = function scrollIntoSettingCategory(activeCategory) {
|
|
346
|
+
var _document$getElementB;
|
|
347
|
+
(_document$getElementB = document.getElementById(activeCategory)) === null || _document$getElementB === void 0 ? void 0 : _document$getElementB.scrollIntoView();
|
|
348
|
+
};
|
|
349
|
+
|
|
350
|
+
var Settings = function Settings(_ref) {
|
|
351
|
+
var _ref$categories = _ref.categories,
|
|
352
|
+
categories = _ref$categories === void 0 ? [] : _ref$categories;
|
|
353
|
+
var _useTranslation = useTranslation(),
|
|
354
|
+
t = _useTranslation.t;
|
|
355
|
+
var _getQueryParams = getQueryParams(),
|
|
356
|
+
categoryParam = _getQueryParams.category;
|
|
357
|
+
useEffect(function () {
|
|
358
|
+
scrollIntoSettingCategory(categoryParam === null || categoryParam === void 0 ? void 0 : categoryParam.toUpperCase());
|
|
359
|
+
}, [categoryParam]);
|
|
360
|
+
return /*#__PURE__*/React.createElement(React.Fragment, null, isEmpty(categories) ? /*#__PURE__*/React.createElement("div", {
|
|
361
|
+
className: "flex h-full w-full flex-grow items-center justify-center",
|
|
362
|
+
"data-testid": "settings-no-data"
|
|
363
|
+
}, /*#__PURE__*/React.createElement(NoData, {
|
|
364
|
+
title: t("neetoMolecules.settingsPage.noData")
|
|
365
|
+
})) : categories.map(function (_ref2) {
|
|
366
|
+
var id = _ref2.id,
|
|
367
|
+
label = _ref2.label,
|
|
368
|
+
items = _ref2.items,
|
|
369
|
+
isIntegration = _ref2.isIntegration;
|
|
370
|
+
return /*#__PURE__*/React.createElement(Category, {
|
|
371
|
+
id: id,
|
|
372
|
+
isIntegration: isIntegration,
|
|
373
|
+
items: items,
|
|
374
|
+
label: label,
|
|
375
|
+
key: id
|
|
376
|
+
});
|
|
377
|
+
}));
|
|
378
|
+
};
|
|
379
|
+
|
|
380
|
+
export { Settings as default };
|
|
381
|
+
//# sourceMappingURL=Settings.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"Settings.js","sources":["../node_modules/@babel/runtime/helpers/esm/extends.js","../node_modules/@babel/runtime/helpers/esm/objectWithoutPropertiesLoose.js","../node_modules/@babel/runtime/helpers/esm/objectWithoutProperties.js","../node_modules/classnames/index.js","../src/components/IntegrationCard/Dropdown.jsx","../src/components/IntegrationCard/Status.jsx","../src/components/IntegrationCard/index.jsx","../src/components/Settings/Item.jsx","../src/components/Settings/Category.jsx","../src/components/Settings/utils.js","../src/components/Settings/index.jsx"],"sourcesContent":["export default function _extends() {\n _extends = Object.assign ? Object.assign.bind() : function (target) {\n for (var i = 1; i < arguments.length; i++) {\n var source = arguments[i];\n for (var key in source) {\n if (Object.prototype.hasOwnProperty.call(source, key)) {\n target[key] = source[key];\n }\n }\n }\n return target;\n };\n return _extends.apply(this, arguments);\n}","export default function _objectWithoutPropertiesLoose(source, excluded) {\n if (source == null) return {};\n var target = {};\n var sourceKeys = Object.keys(source);\n var key, i;\n for (i = 0; i < sourceKeys.length; i++) {\n key = sourceKeys[i];\n if (excluded.indexOf(key) >= 0) continue;\n target[key] = source[key];\n }\n return target;\n}","import objectWithoutPropertiesLoose from \"./objectWithoutPropertiesLoose.js\";\nexport default function _objectWithoutProperties(source, excluded) {\n if (source == null) return {};\n var target = objectWithoutPropertiesLoose(source, excluded);\n var key, i;\n if (Object.getOwnPropertySymbols) {\n var sourceSymbolKeys = Object.getOwnPropertySymbols(source);\n for (i = 0; i < sourceSymbolKeys.length; i++) {\n key = sourceSymbolKeys[i];\n if (excluded.indexOf(key) >= 0) continue;\n if (!Object.prototype.propertyIsEnumerable.call(source, key)) continue;\n target[key] = source[key];\n }\n }\n return target;\n}","/*!\n\tCopyright (c) 2018 Jed Watson.\n\tLicensed under the MIT License (MIT), see\n\thttp://jedwatson.github.io/classnames\n*/\n/* global define */\n\n(function () {\n\t'use strict';\n\n\tvar hasOwn = {}.hasOwnProperty;\n\tvar nativeCodeString = '[native code]';\n\n\tfunction classNames() {\n\t\tvar classes = [];\n\n\t\tfor (var i = 0; i < arguments.length; i++) {\n\t\t\tvar arg = arguments[i];\n\t\t\tif (!arg) continue;\n\n\t\t\tvar argType = typeof arg;\n\n\t\t\tif (argType === 'string' || argType === 'number') {\n\t\t\t\tclasses.push(arg);\n\t\t\t} else if (Array.isArray(arg)) {\n\t\t\t\tif (arg.length) {\n\t\t\t\t\tvar inner = classNames.apply(null, arg);\n\t\t\t\t\tif (inner) {\n\t\t\t\t\t\tclasses.push(inner);\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t} else if (argType === 'object') {\n\t\t\t\tif (arg.toString !== Object.prototype.toString && !arg.toString.toString().includes('[native code]')) {\n\t\t\t\t\tclasses.push(arg.toString());\n\t\t\t\t\tcontinue;\n\t\t\t\t}\n\n\t\t\t\tfor (var key in arg) {\n\t\t\t\t\tif (hasOwn.call(arg, key) && arg[key]) {\n\t\t\t\t\t\tclasses.push(key);\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\treturn classes.join(' ');\n\t}\n\n\tif (typeof module !== 'undefined' && module.exports) {\n\t\tclassNames.default = classNames;\n\t\tmodule.exports = classNames;\n\t} else if (typeof define === 'function' && typeof define.amd === 'object' && define.amd) {\n\t\t// register as 'classnames', consistent with npm package name\n\t\tdefine('classnames', [], function () {\n\t\t\treturn classNames;\n\t\t});\n\t} else {\n\t\twindow.classNames = classNames;\n\t}\n}());\n","import React from \"react\";\n\nimport { noop } from \"neetocommons/pure\";\nimport { MenuVertical } from \"neetoicons\";\nimport { Dropdown as NeetoUIDropdown } from \"neetoui\";\nimport { isNotNil } from \"ramda\";\nimport { useTranslation } from \"react-i18next\";\n\nconst { Menu, MenuItem } = NeetoUIDropdown;\n\nconst Dropdown = ({\n customDropdown,\n handleManage = noop,\n hideDisconnect = false,\n onDisconnect = noop,\n}) => {\n const { t } = useTranslation();\n\n if (isNotNil(customDropdown)) {\n return <div onClick={e => e.stopPropagation()}>{customDropdown}</div>;\n }\n\n const isManageable = isNotNil(handleManage);\n\n if (!isManageable && hideDisconnect) {\n return null;\n }\n\n return (\n <div onClick={e => e.stopPropagation()}>\n <NeetoUIDropdown buttonStyle=\"text\" icon={MenuVertical}>\n <Menu>\n {isManageable && (\n <MenuItem.Button onClick={handleManage}>\n {t(\"neetoMolecules.integrationCard.manage\")}\n </MenuItem.Button>\n )}\n {!hideDisconnect && (\n <MenuItem.Button onClick={onDisconnect}>\n {t(\"neetoMolecules.integrationCard.disconnect\")}\n </MenuItem.Button>\n )}\n </Menu>\n </NeetoUIDropdown>\n </div>\n );\n};\n\nexport default Dropdown;\n","import React from \"react\";\n\nimport { Check, Warning } from \"neetoicons\";\nimport { Tag } from \"neetoui\";\nimport { useTranslation } from \"react-i18next\";\n\nconst Status = ({ isExpired }) => {\n const { t } = useTranslation();\n\n const tagProps = isExpired\n ? {\n icon: Warning,\n label: t(\"neetoMolecules.integrationCard.tags.expired\"),\n style: \"warning\",\n }\n : {\n icon: Check,\n label: t(\"neetoMolecules.integrationCard.tags.connected\"),\n style: \"success\",\n };\n\n return (\n <Tag\n className=\"flex-row-reverse\"\n {...tagProps}\n data-testid=\"integration-status\"\n />\n );\n};\n\nexport default Status;\n","import React from \"react\";\n\nimport classnames from \"classnames\";\nimport { isNotEmpty, noop } from \"neetocommons/pure\";\nimport { joinHyphenCase } from \"neetocommons/utils\";\nimport { Typography, Button, Spinner, Tooltip } from \"neetoui\";\nimport PropTypes from \"prop-types\";\nimport { isNotNil } from \"ramda\";\nimport { useTranslation } from \"react-i18next\";\n\nimport Dropdown from \"./Dropdown\";\nimport Status from \"./Status\";\n\nconst IntegrationCard = ({\n icon: Icon,\n subIcons = [],\n label = \"\",\n description = \"\",\n className = \"\",\n onConnect = noop,\n onDisconnect = noop,\n onManage = undefined,\n isLoading = false,\n isConnected = false,\n isFailed = false,\n isExpired = false,\n disabled = false,\n hidden = false,\n hideDisconnect = false,\n onClick: onCardClick = undefined,\n tooltipProps = {},\n customDropdown = null,\n dataCy = \"\",\n children,\n ...otherProps\n}) => {\n const { t } = useTranslation();\n\n if (hidden) return null;\n\n const isCardClickable = isConnected && isNotNil(onCardClick);\n\n const cardProps = isCardClickable ? { onClick: onCardClick } : {};\n\n return (\n <Tooltip\n disabled={!disabled}\n position=\"top\"\n content={\n disabled &&\n t(\"neetoMolecules.integrationCard.tooltip.integrationNotAvailable\")\n }\n {...tooltipProps}\n >\n <div\n data-cy={dataCy}\n data-testid=\"integration-card\"\n className={classnames(\n \"outline-none neeto-ui-border-gray-300 neeto-ui-shadow-xs hover:neeto-ui-border-gray-500 focus:neeto-ui-border-gray-500 neeto-ui-rounded-lg flex flex-col border p-6 no-underline transition-colors\",\n {\n \"hover:neeto-ui-bg-100 cursor-not-allowed opacity-50\": disabled,\n \"cursor-pointer\": isCardClickable,\n },\n className\n )}\n {...cardProps}\n {...otherProps}\n >\n <div\n className=\"flex flex-grow justify-between\"\n data-cy=\"integration-tabs\"\n >\n <div className=\"flex min-w-0 flex-col justify-end\">\n <div className=\"relative mb-4 flex h-8\">\n {Icon && <Icon size={32} />}\n </div>\n <div className=\"my-auto\">\n <Typography\n className=\"mb-2\"\n data-cy=\"integration-card-label\"\n style=\"h4\"\n weight=\"semibold\"\n >\n {label}\n </Typography>\n <Typography\n className=\"break-words\"\n data-cy={`${joinHyphenCase(label)}-integration-description`}\n style=\"body2\"\n >\n {description}\n </Typography>\n {children}\n </div>\n </div>\n {isNotEmpty(subIcons) && (\n <div className=\"flex h-24 flex-col gap-2\">\n {subIcons.map((Icon, index) => (\n <Icon\n className=\"neeto-ui-text-gray-600\"\n key={index}\n size={24}\n />\n ))}\n </div>\n )}\n </div>\n <div className=\"neeto-ui-border-gray-300 mt-4 w-full border-t pt-2\">\n {isLoading ? (\n <div className=\"mt-3 flex items-center justify-start\">\n <Spinner />\n </div>\n ) : (\n <div className=\"flex h-8 items-center justify-between\">\n {isConnected && <Status {...{ isExpired }} />}\n {isFailed && (\n <Button\n className=\"neeto-ui-text-warning-500\"\n data-cy=\"connect-button\"\n disabled={disabled || isLoading}\n label={t(\"neetoMolecules.integrationCard.tryAgain\")}\n style=\"link\"\n onClick={onConnect}\n />\n )}\n {!isConnected && !isFailed && (\n <Button\n data-cy=\"connect-button\"\n data-testid=\"integraiton-card-connect-button\"\n disabled={disabled || isLoading}\n label={t(\"neetoMolecules.integrationCard.connect\")}\n style=\"link\"\n onClick={onConnect}\n />\n )}\n {(isConnected || isFailed) && (\n <Dropdown\n {...{ customDropdown, hideDisconnect, onDisconnect }}\n handleManage={onManage}\n />\n )}\n </div>\n )}\n </div>\n </div>\n </Tooltip>\n );\n};\n\nIntegrationCard.propTypes = {\n /**\n * The icon component to be displayed on the card.\n */\n icon: PropTypes.elementType,\n /**\n * Array of sub-icons to be displayed on the card.\n */\n subIcons: PropTypes.arrayOf(PropTypes.elementType),\n /**\n * The label to be displayed on the card.\n */\n label: PropTypes.string,\n /**\n * The description of the card.\n */\n description: PropTypes.string,\n /**\n * Additional class names for styling the card.\n */\n className: PropTypes.string,\n /**\n * Handler function called when the integration is connected.\n */\n onConnect: PropTypes.func,\n /**\n * Handler function called when the manage dropdown is clicked.\n */\n onManage: PropTypes.func,\n /**\n * Handler function called when clicked on integration card.\n */\n onClick: PropTypes.func,\n /**\n * Handler function called when the disconnect dropdown is clicked.\n */\n onDisconnect: PropTypes.func,\n /**\n * Flag indicating if the integration is currently loading.\n */\n isLoading: PropTypes.bool,\n /**\n * Flag indicating if the integration is connected.\n */\n isConnected: PropTypes.bool,\n /**\n * Flag indicating if the integration has failed.\n */\n isFailed: PropTypes.bool,\n /**\n * Flag indicating if the integration has expired.\n */\n isExpired: PropTypes.bool,\n /**\n * Flag indicating if the integration is disabled.\n */\n disabled: PropTypes.bool,\n /**\n * Flag indicating if the card should be hidden.\n */\n hidden: PropTypes.bool,\n /**\n * Flag indicating if the disconnect button should be hidden.\n */\n hideDisconnect: PropTypes.bool,\n /**\n * Additional props for customizing the tooltip wrapper.\n */\n tooltipProps: PropTypes.object,\n /**\n * Custom dropdown component to be rendered.\n */\n customDropdown: PropTypes.element,\n /**\n * Additional children elements to be rendered within the card.\n */\n children: PropTypes.node,\n};\n\nexport default IntegrationCard;\n","import React, { memo } from \"react\";\n\nimport classnames from \"classnames\";\nimport { joinHyphenCase } from \"neetocommons/utils\";\nimport { Typography } from \"neetoui\";\nimport { withRouter, Link } from \"react-router-dom\";\n\nconst Item = ({\n label,\n description,\n icon: Icon = null,\n path,\n dataCy,\n className = \"\",\n ...otherProps\n}) => (\n <Link\n data-cy={dataCy}\n to={path}\n className={classnames(\n \"outline-none neeto-ui-border-gray-300 neeto-ui-shadow-xs hover:neeto-ui-border-gray-500 focus:neeto-ui-border-gray-500 neeto-ui-rounded-lg flex cursor-pointer flex-col border p-6 no-underline transition-colors\",\n className\n )}\n {...otherProps}\n >\n <div data-testid={`settings-item-${joinHyphenCase(label)}`}>\n {Icon && <Icon className=\"neeto-ui-text-gray-600 mb-4\" size={32} />}\n <Typography\n className=\"mb-2\"\n data-cy=\"settings-item-heading\"\n style=\"h4\"\n weight=\"semibold\"\n >\n {label}\n </Typography>\n <Typography data-cy=\"settings-item-description\" style=\"body2\">\n {description}\n </Typography>\n </div>\n </Link>\n);\n\nexport default memo(withRouter(Item));\n","import React from \"react\";\n\nimport { isNotEmpty } from \"neetocommons/pure\";\nimport { Typography } from \"neetoui\";\n\nimport IntegrationCard from \"components/IntegrationCard\";\n\nimport Item from \"./Item\";\n\nconst Category = ({ items, label, id, isIntegration }) => {\n const SettingsCard = isIntegration ? IntegrationCard : Item;\n\n return (\n <div className=\"flex flex-col py-6\" {...{ id }}>\n {isNotEmpty(items) && (\n <Typography\n className=\"mb-6\"\n component=\"h2\"\n data-cy=\"settings-category-heading\"\n style=\"h2\"\n weight=\"semibold\"\n >\n {label}\n </Typography>\n )}\n <div className=\"grid grid-cols-1 gap-3 lg:grid-cols-2 lg:gap-6 xl:grid-cols-3 2xl:grid-cols-4\">\n {items.map(item => (\n <SettingsCard key={item.label} {...item} />\n ))}\n </div>\n </div>\n );\n};\n\nexport default Category;\n","export const scrollIntoSettingCategory = activeCategory => {\n document.getElementById(activeCategory)?.scrollIntoView();\n};\n","import React, { useEffect } from \"react\";\n\nimport { getQueryParams } from \"neetocommons/utils\";\nimport { NoData } from \"neetoui\";\nimport propTypes from \"prop-types\";\nimport { isEmpty } from \"ramda\";\nimport { useTranslation } from \"react-i18next\";\n\nimport Category from \"./Category\";\nimport { scrollIntoSettingCategory } from \"./utils\";\n\nconst Settings = ({ categories = [] }) => {\n const { t } = useTranslation();\n\n const { category: categoryParam } = getQueryParams();\n\n useEffect(() => {\n scrollIntoSettingCategory(categoryParam?.toUpperCase());\n }, [categoryParam]);\n\n return (\n <>\n {isEmpty(categories) ? (\n <div\n className=\"flex h-full w-full flex-grow items-center justify-center\"\n data-testid=\"settings-no-data\"\n >\n <NoData title={t(\"neetoMolecules.settingsPage.noData\")} />\n </div>\n ) : (\n categories.map(({ id, label, items, isIntegration }) => (\n <Category {...{ id, isIntegration, items, label }} key={id} />\n ))\n )}\n </>\n );\n};\n\nSettings.propTypes = {\n /**\n * An array of setting categories to be displayed.\n */\n categories: propTypes.array,\n};\n\nexport default Settings;\n"],"names":["objectWithoutPropertiesLoose","Menu","NeetoUIDropdown","MenuItem","Dropdown","_ref","customDropdown","_ref$handleManage","handleManage","noop","_ref$hideDisconnect","hideDisconnect","_ref$onDisconnect","onDisconnect","_useTranslation","useTranslation","t","isNotNil","React","createElement","onClick","e","stopPropagation","isManageable","buttonStyle","icon","MenuVertical","Button","Status","isExpired","tagProps","Warning","label","style","Check","Tag","_extends","className","IntegrationCard","Icon","_ref$subIcons","subIcons","_ref$label","_ref$description","description","_ref$className","_ref$onConnect","onConnect","_ref$onManage","onManage","undefined","_ref$isLoading","isLoading","_ref$isConnected","isConnected","_ref$isFailed","isFailed","_ref$isExpired","_ref$disabled","disabled","_ref$hidden","hidden","_ref$onClick","onCardClick","_ref$tooltipProps","tooltipProps","_ref$customDropdown","_ref$dataCy","dataCy","children","otherProps","_objectWithoutProperties","_excluded","isCardClickable","cardProps","Tooltip","position","content","classnames","size","Typography","weight","concat","joinHyphenCase","isNotEmpty","map","index","key","Spinner","Item","_ref$icon","path","Link","to","memo","withRouter","Category","items","id","isIntegration","SettingsCard","component","item","scrollIntoSettingCategory","activeCategory","_document$getElementB","document","getElementById","scrollIntoView","Settings","_ref$categories","categories","_getQueryParams","getQueryParams","categoryParam","category","useEffect","toUpperCase","Fragment","isEmpty","NoData","title","_ref2"],"mappings":";;;;;;;;;AAAe,SAAS,QAAQ,GAAG;AACnC,EAAE,QAAQ,GAAG,MAAM,CAAC,MAAM,GAAG,MAAM,CAAC,MAAM,CAAC,IAAI,EAAE,GAAG,UAAU,MAAM,EAAE;AACtE,IAAI,KAAK,IAAI,CAAC,GAAG,CAAC,EAAE,CAAC,GAAG,SAAS,CAAC,MAAM,EAAE,CAAC,EAAE,EAAE;AAC/C,MAAM,IAAI,MAAM,GAAG,SAAS,CAAC,CAAC,CAAC,CAAC;AAChC,MAAM,KAAK,IAAI,GAAG,IAAI,MAAM,EAAE;AAC9B,QAAQ,IAAI,MAAM,CAAC,SAAS,CAAC,cAAc,CAAC,IAAI,CAAC,MAA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,CAAC6E,QAAQ,EAAA;AAAOE,MAAAA,EAAE,EAAFA,EAAE;AAAEC,MAAAA,aAAa,EAAbA,aAAa;AAAEF,MAAAA,KAAK,EAALA,KAAK;AAAEjE,MAAAA,KAAK,EAALA,KAAK;AAAIuD,MAAAA,GAAG,EAAEW,EAAAA;KAAM,CAAA,CAAA;AAAA,GAC/D,CACF,CACA,CAAA;AAEP;;;;"}
|
|
@@ -14,6 +14,62 @@ function _interopDefaultLegacy (e) { return e && typeof e === 'object' && 'defau
|
|
|
14
14
|
|
|
15
15
|
var React__default = /*#__PURE__*/_interopDefaultLegacy(React);
|
|
16
16
|
|
|
17
|
+
function _extends() {
|
|
18
|
+
_extends = Object.assign ? Object.assign.bind() : function (target) {
|
|
19
|
+
for (var i = 1; i < arguments.length; i++) {
|
|
20
|
+
var source = arguments[i];
|
|
21
|
+
for (var key in source) {
|
|
22
|
+
if (Object.prototype.hasOwnProperty.call(source, key)) {
|
|
23
|
+
target[key] = source[key];
|
|
24
|
+
}
|
|
25
|
+
}
|
|
26
|
+
}
|
|
27
|
+
return target;
|
|
28
|
+
};
|
|
29
|
+
return _extends.apply(this, arguments);
|
|
30
|
+
}
|
|
31
|
+
|
|
32
|
+
function _typeof(obj) {
|
|
33
|
+
"@babel/helpers - typeof";
|
|
34
|
+
|
|
35
|
+
return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (obj) {
|
|
36
|
+
return typeof obj;
|
|
37
|
+
} : function (obj) {
|
|
38
|
+
return obj && "function" == typeof Symbol && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj;
|
|
39
|
+
}, _typeof(obj);
|
|
40
|
+
}
|
|
41
|
+
|
|
42
|
+
function _toPrimitive(input, hint) {
|
|
43
|
+
if (_typeof(input) !== "object" || input === null) return input;
|
|
44
|
+
var prim = input[Symbol.toPrimitive];
|
|
45
|
+
if (prim !== undefined) {
|
|
46
|
+
var res = prim.call(input, hint || "default");
|
|
47
|
+
if (_typeof(res) !== "object") return res;
|
|
48
|
+
throw new TypeError("@@toPrimitive must return a primitive value.");
|
|
49
|
+
}
|
|
50
|
+
return (hint === "string" ? String : Number)(input);
|
|
51
|
+
}
|
|
52
|
+
|
|
53
|
+
function _toPropertyKey(arg) {
|
|
54
|
+
var key = _toPrimitive(arg, "string");
|
|
55
|
+
return _typeof(key) === "symbol" ? key : String(key);
|
|
56
|
+
}
|
|
57
|
+
|
|
58
|
+
function _defineProperty(obj, key, value) {
|
|
59
|
+
key = _toPropertyKey(key);
|
|
60
|
+
if (key in obj) {
|
|
61
|
+
Object.defineProperty(obj, key, {
|
|
62
|
+
value: value,
|
|
63
|
+
enumerable: true,
|
|
64
|
+
configurable: true,
|
|
65
|
+
writable: true
|
|
66
|
+
});
|
|
67
|
+
} else {
|
|
68
|
+
obj[key] = value;
|
|
69
|
+
}
|
|
70
|
+
return obj;
|
|
71
|
+
}
|
|
72
|
+
|
|
17
73
|
function _arrayWithHoles(arr) {
|
|
18
74
|
if (Array.isArray(arr)) return arr;
|
|
19
75
|
}
|
|
@@ -145,6 +201,38 @@ var e=[],t=[];function n(n,r){if(n&&"undefined"!=typeof document){var a,s=!0===r
|
|
|
145
201
|
var css = ".toggle-feature-card--highlighted{border-color:rgb(var(--neeto-ui-primary-800))!important;box-shadow:0 0 0 1px rgb(var(--neeto-ui-primary-800))}";
|
|
146
202
|
n(css,{});
|
|
147
203
|
|
|
204
|
+
function _objectWithoutPropertiesLoose(source, excluded) {
|
|
205
|
+
if (source == null) return {};
|
|
206
|
+
var target = {};
|
|
207
|
+
var sourceKeys = Object.keys(source);
|
|
208
|
+
var key, i;
|
|
209
|
+
for (i = 0; i < sourceKeys.length; i++) {
|
|
210
|
+
key = sourceKeys[i];
|
|
211
|
+
if (excluded.indexOf(key) >= 0) continue;
|
|
212
|
+
target[key] = source[key];
|
|
213
|
+
}
|
|
214
|
+
return target;
|
|
215
|
+
}
|
|
216
|
+
|
|
217
|
+
function _objectWithoutProperties(source, excluded) {
|
|
218
|
+
if (source == null) return {};
|
|
219
|
+
var target = _objectWithoutPropertiesLoose(source, excluded);
|
|
220
|
+
var key, i;
|
|
221
|
+
if (Object.getOwnPropertySymbols) {
|
|
222
|
+
var sourceSymbolKeys = Object.getOwnPropertySymbols(source);
|
|
223
|
+
for (i = 0; i < sourceSymbolKeys.length; i++) {
|
|
224
|
+
key = sourceSymbolKeys[i];
|
|
225
|
+
if (excluded.indexOf(key) >= 0) continue;
|
|
226
|
+
if (!Object.prototype.propertyIsEnumerable.call(source, key)) continue;
|
|
227
|
+
target[key] = source[key];
|
|
228
|
+
}
|
|
229
|
+
}
|
|
230
|
+
return target;
|
|
231
|
+
}
|
|
232
|
+
|
|
233
|
+
var _excluded = ["t", "enabledCondition", "name", "isDisabled", "switchDataCy"];
|
|
234
|
+
function ownKeys$1(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); enumerableOnly && (symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; }
|
|
235
|
+
function _objectSpread$1(target) { for (var i = 1; i < arguments.length; i++) { var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? ownKeys$1(Object(source), !0).forEach(function (key) { _defineProperty(target, key, source[key]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys$1(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } return target; }
|
|
148
236
|
var TooltipSwitch = reactUtils.withT(function (_ref) {
|
|
149
237
|
var t = _ref.t,
|
|
150
238
|
enabledCondition = _ref.enabledCondition,
|
|
@@ -152,18 +240,22 @@ var TooltipSwitch = reactUtils.withT(function (_ref) {
|
|
|
152
240
|
name = _ref$name === void 0 ? "" : _ref$name,
|
|
153
241
|
_ref$isDisabled = _ref.isDisabled,
|
|
154
242
|
isDisabled = _ref$isDisabled === void 0 ? false : _ref$isDisabled,
|
|
155
|
-
switchDataCy = _ref.switchDataCy
|
|
243
|
+
switchDataCy = _ref.switchDataCy,
|
|
244
|
+
otherProps = _objectWithoutProperties(_ref, _excluded);
|
|
156
245
|
return /*#__PURE__*/React__default["default"].createElement(neetoui.Tooltip, {
|
|
157
246
|
position: "top",
|
|
158
247
|
content: enabledCondition ? t("neetoMolecules.toggleFeatureCard.switchTooltip.enabled") : t("neetoMolecules.toggleFeatureCard.switchTooltip.disabled")
|
|
159
|
-
}, /*#__PURE__*/React__default["default"].createElement("span", null, /*#__PURE__*/React__default["default"].createElement(formik.Switch, {
|
|
248
|
+
}, /*#__PURE__*/React__default["default"].createElement("span", null, /*#__PURE__*/React__default["default"].createElement(formik.Switch, _extends({
|
|
160
249
|
"data-cy": switchDataCy,
|
|
161
250
|
"data-testid": "toggle-feature-card-switch",
|
|
162
|
-
disabled: isDisabled
|
|
251
|
+
disabled: isDisabled
|
|
252
|
+
}, _objectSpread$1({
|
|
163
253
|
name: name
|
|
164
|
-
})));
|
|
254
|
+
}, otherProps)))));
|
|
165
255
|
});
|
|
166
256
|
|
|
257
|
+
function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); enumerableOnly && (symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; }
|
|
258
|
+
function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? ownKeys(Object(source), !0).forEach(function (key) { _defineProperty(target, key, source[key]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } return target; }
|
|
167
259
|
var ToggleFeatureCard = function ToggleFeatureCard(_ref) {
|
|
168
260
|
var _ref$title = _ref.title,
|
|
169
261
|
title = _ref$title === void 0 ? "" : _ref$title,
|
|
@@ -181,16 +273,8 @@ var ToggleFeatureCard = function ToggleFeatureCard(_ref) {
|
|
|
181
273
|
isDisabled = _ref$isDisabled === void 0 ? false : _ref$isDisabled,
|
|
182
274
|
_ref$children = _ref.children,
|
|
183
275
|
children = _ref$children === void 0 ? null : _ref$children,
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
name: null,
|
|
187
|
-
display: null,
|
|
188
|
-
label: null,
|
|
189
|
-
editButtonTooltip: null,
|
|
190
|
-
editButtonDataCy: "",
|
|
191
|
-
placeholder: null,
|
|
192
|
-
dataCy: ""
|
|
193
|
-
} : _ref$inputProps;
|
|
276
|
+
inputProps = _ref.inputProps,
|
|
277
|
+
switchProps = _ref.switchProps;
|
|
194
278
|
var _useTranslation = reactI18next.useTranslation(),
|
|
195
279
|
t = _useTranslation.t;
|
|
196
280
|
var cardRef = React.useRef();
|
|
@@ -248,12 +332,13 @@ var ToggleFeatureCard = function ToggleFeatureCard(_ref) {
|
|
|
248
332
|
})
|
|
249
333
|
}, /*#__PURE__*/React__default["default"].createElement(neetoui.Label, {
|
|
250
334
|
className: "flex flex-row items-center gap-2"
|
|
251
|
-
}, /*#__PURE__*/React__default["default"].createElement(TooltipSwitch, {
|
|
335
|
+
}, /*#__PURE__*/React__default["default"].createElement(TooltipSwitch, _extends({}, _objectSpread({
|
|
252
336
|
enabledCondition: enabledCondition,
|
|
253
337
|
isDisabled: isDisabled,
|
|
254
|
-
switchDataCy: switchDataCy
|
|
338
|
+
switchDataCy: switchDataCy
|
|
339
|
+
}, switchProps), {
|
|
255
340
|
name: switchName
|
|
256
|
-
}), /*#__PURE__*/React__default["default"].createElement(neetoui.Typography, {
|
|
341
|
+
})), /*#__PURE__*/React__default["default"].createElement(neetoui.Typography, {
|
|
257
342
|
component: "span",
|
|
258
343
|
"data-cy": titleDataCy,
|
|
259
344
|
"data-testid": "toggle-feature-card-title",
|
|
@@ -280,7 +365,7 @@ var ToggleFeatureCard = function ToggleFeatureCard(_ref) {
|
|
|
280
365
|
onClick: function onClick() {
|
|
281
366
|
return setIsEditing(true);
|
|
282
367
|
}
|
|
283
|
-
})), hasInput && isEditing && /*#__PURE__*/React__default["default"].createElement(formik.Input, {
|
|
368
|
+
})), hasInput && isEditing && /*#__PURE__*/React__default["default"].createElement(formik.Input, _extends({
|
|
284
369
|
autoFocus: true,
|
|
285
370
|
"data-cy": inputProps === null || inputProps === void 0 ? void 0 : inputProps.dataCy,
|
|
286
371
|
"data-testid": "toggle-feature-card-input-field",
|
|
@@ -297,7 +382,7 @@ var ToggleFeatureCard = function ToggleFeatureCard(_ref) {
|
|
|
297
382
|
type: "button",
|
|
298
383
|
onClick: handleInputReset
|
|
299
384
|
})
|
|
300
|
-
}), children);
|
|
385
|
+
}, inputProps)), children);
|
|
301
386
|
};
|
|
302
387
|
|
|
303
388
|
module.exports = ToggleFeatureCard;
|