@bigbinary/neeto-api-keys-frontend 3.1.8 → 3.2.0-beta2
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/app/javascript/src/translations/ar.json +2 -4
- package/app/javascript/src/translations/bg.json +2 -4
- package/app/javascript/src/translations/ca.json +2 -4
- package/app/javascript/src/translations/cs.json +2 -4
- package/app/javascript/src/translations/da.json +2 -4
- package/app/javascript/src/translations/de.json +2 -4
- package/app/javascript/src/translations/en.json +0 -2
- package/app/javascript/src/translations/es-MX.json +2 -4
- package/app/javascript/src/translations/es.json +2 -4
- package/app/javascript/src/translations/et.json +2 -4
- package/app/javascript/src/translations/fi.json +2 -4
- package/app/javascript/src/translations/fil.json +2 -4
- package/app/javascript/src/translations/fr.json +2 -4
- package/app/javascript/src/translations/he.json +2 -4
- package/app/javascript/src/translations/hi.json +2 -4
- package/app/javascript/src/translations/hr.json +2 -4
- package/app/javascript/src/translations/hu.json +2 -4
- package/app/javascript/src/translations/id.json +2 -4
- package/app/javascript/src/translations/it.json +2 -4
- package/app/javascript/src/translations/ja.json +2 -4
- package/app/javascript/src/translations/ko.json +2 -4
- package/app/javascript/src/translations/lv.json +2 -4
- package/app/javascript/src/translations/nl.json +2 -4
- package/app/javascript/src/translations/pl.json +2 -4
- package/app/javascript/src/translations/pt-BR.json +2 -4
- package/app/javascript/src/translations/pt.json +2 -4
- package/app/javascript/src/translations/ro.json +2 -4
- package/app/javascript/src/translations/ru.json +2 -4
- package/app/javascript/src/translations/sk.json +2 -4
- package/app/javascript/src/translations/sl.json +2 -4
- package/app/javascript/src/translations/sv.json +2 -4
- package/app/javascript/src/translations/th.json +2 -4
- package/app/javascript/src/translations/tr.json +2 -4
- package/app/javascript/src/translations/uk.json +2 -4
- package/app/javascript/src/translations/vi.json +2 -4
- package/app/javascript/src/translations/zh-CN.json +2 -4
- package/app/javascript/src/translations/zh-TW.json +2 -4
- package/dist/.ready +1 -1
- package/dist/ApiKeys.js +24 -200
- package/dist/ApiKeys.js.map +1 -1
- package/dist/cjs/ApiKeys.js +23 -199
- package/dist/cjs/ApiKeys.js.map +1 -1
- package/dist/cjs/index.js +0 -2
- package/dist/cjs/index.js.map +1 -1
- package/dist/cjs/v2/ApiKeys.js +22 -194
- package/dist/cjs/v2/ApiKeys.js.map +1 -1
- package/dist/cjs/v2/index.js +0 -1
- package/dist/cjs/v2/index.js.map +1 -1
- package/dist/index.js +0 -2
- package/dist/index.js.map +1 -1
- package/dist/v2/ApiKeys.js +24 -196
- package/dist/v2/ApiKeys.js.map +1 -1
- package/dist/v2/index.js +0 -1
- package/dist/v2/index.js.map +1 -1
- package/package.json +11 -11
package/dist/cjs/v2/ApiKeys.js
CHANGED
|
@@ -23,7 +23,6 @@ var initializers = require('@bigbinary/neeto-commons-frontend/v2/initializers');
|
|
|
23
23
|
var CopyToClipboardButton = require('@bigbinary/neeto-molecules/v2/CopyToClipboardButton');
|
|
24
24
|
var MoreDropdown = require('@bigbinary/neeto-molecules/v2/MoreDropdown');
|
|
25
25
|
var jsxRuntime = require('react/jsx-runtime');
|
|
26
|
-
var _objectWithoutProperties = require('@babel/runtime/helpers/objectWithoutProperties');
|
|
27
26
|
var lucideReact = require('lucide-react');
|
|
28
27
|
require('@bigbinary/neeto-commons-frontend/constants');
|
|
29
28
|
require('@bigbinary/neeto-commons-frontend/react-utils');
|
|
@@ -103,9 +102,6 @@ var MASKED_TOKEN_LENGTH = 20;
|
|
|
103
102
|
var isInPast = function isInPast(date) {
|
|
104
103
|
return utils.dayjs(date).isBefore(utils.dayjs());
|
|
105
104
|
};
|
|
106
|
-
var isExpired = function isExpired(expiresAt) {
|
|
107
|
-
return neetoCist.isPresent(expiresAt) && isInPast(expiresAt);
|
|
108
|
-
};
|
|
109
105
|
var partlyHideToken = function partlyHideToken(key) {
|
|
110
106
|
var prefixMatch = key.match(/^([A-Z]+-)/);
|
|
111
107
|
if (prefixMatch) {
|
|
@@ -139,7 +135,6 @@ var getMenuItems = function getMenuItems(_ref) {
|
|
|
139
135
|
var buildColumnData = function buildColumnData(_ref2) {
|
|
140
136
|
var handleDelete = _ref2.handleDelete,
|
|
141
137
|
handleEdit = _ref2.handleEdit,
|
|
142
|
-
handleView = _ref2.handleView,
|
|
143
138
|
isZapierAvailable = _ref2.isZapierAvailable;
|
|
144
139
|
var columns = [{
|
|
145
140
|
id: "label",
|
|
@@ -153,14 +148,11 @@ var buildColumnData = function buildColumnData(_ref2) {
|
|
|
153
148
|
var apiKey = row.original;
|
|
154
149
|
return /*#__PURE__*/jsxRuntime.jsxs("div", {
|
|
155
150
|
className: "flex items-center justify-between gap-x-3",
|
|
156
|
-
children: [/*#__PURE__*/jsxRuntime.jsx(neetoAtoms.
|
|
157
|
-
className: "min-w-0
|
|
151
|
+
children: [/*#__PURE__*/jsxRuntime.jsx(neetoAtoms.Typography, {
|
|
152
|
+
className: "min-w-0 flex-1 truncate",
|
|
158
153
|
"data-testid": "api-keys-label-field",
|
|
159
154
|
title: label,
|
|
160
|
-
variant: "
|
|
161
|
-
onClick: function onClick() {
|
|
162
|
-
return handleView(apiKey);
|
|
163
|
-
},
|
|
155
|
+
variant: "body2",
|
|
164
156
|
children: label
|
|
165
157
|
}), /*#__PURE__*/jsxRuntime.jsx(MoreDropdown, {
|
|
166
158
|
menuItems: getMenuItems({
|
|
@@ -221,7 +213,7 @@ var buildColumnData = function buildColumnData(_ref2) {
|
|
|
221
213
|
cell: function cell(_ref6) {
|
|
222
214
|
var row = _ref6.row;
|
|
223
215
|
var expiresAt = row.original.expiresAt;
|
|
224
|
-
return
|
|
216
|
+
return neetoCist.isPresent(expiresAt) && isInPast(expiresAt) ? /*#__PURE__*/jsxRuntime.jsx(neetoAtoms.Badge, {
|
|
225
217
|
variant: "amber",
|
|
226
218
|
children: i18next.t("neetoApiKeys.tags.expired")
|
|
227
219
|
}) : /*#__PURE__*/jsxRuntime.jsx(neetoAtoms.Badge, {
|
|
@@ -371,9 +363,9 @@ var getExpirationDate = function getExpirationDate(type) {
|
|
|
371
363
|
}
|
|
372
364
|
};
|
|
373
365
|
|
|
374
|
-
function ownKeys$
|
|
375
|
-
function _objectSpread$
|
|
376
|
-
var Item
|
|
366
|
+
function ownKeys$3(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; }
|
|
367
|
+
function _objectSpread$3(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys$3(Object(t), true).forEach(function (r) { _defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys$3(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }
|
|
368
|
+
var Item = formik$1.RadioGroup.Item;
|
|
377
369
|
var Form = function Form(_ref) {
|
|
378
370
|
var _ref$initialValues = _ref.initialValues,
|
|
379
371
|
initialValues = _ref$initialValues === void 0 ? INITIAL_VALUES : _ref$initialValues,
|
|
@@ -387,7 +379,7 @@ var Form = function Form(_ref) {
|
|
|
387
379
|
isZapierAvailable = _ref$isZapierAvailabl === void 0 ? false : _ref$isZapierAvailabl;
|
|
388
380
|
var _useTranslation = reactI18next.useTranslation(),
|
|
389
381
|
t = _useTranslation.t;
|
|
390
|
-
var formInitialValues = _objectSpread$
|
|
382
|
+
var formInitialValues = _objectSpread$3(_objectSpread$3({}, initialValues), {}, {
|
|
391
383
|
expirationType: getInitialExpirationType({
|
|
392
384
|
isEdit: isEdit,
|
|
393
385
|
values: initialValues
|
|
@@ -429,11 +421,11 @@ var Form = function Form(_ref) {
|
|
|
429
421
|
label: t("neetoApiKeys.common.type"),
|
|
430
422
|
name: "type",
|
|
431
423
|
orientation: "vertical",
|
|
432
|
-
children: [/*#__PURE__*/jsxRuntime.jsx(Item
|
|
424
|
+
children: [/*#__PURE__*/jsxRuntime.jsx(Item, {
|
|
433
425
|
label: t("neetoApiKeys.common.general"),
|
|
434
426
|
name: "type",
|
|
435
427
|
value: API_KEY_TYPES.GENERAL
|
|
436
|
-
}), /*#__PURE__*/jsxRuntime.jsx(Item
|
|
428
|
+
}), /*#__PURE__*/jsxRuntime.jsx(Item, {
|
|
437
429
|
label: t("neetoApiKeys.common.zapier"),
|
|
438
430
|
name: "type",
|
|
439
431
|
value: API_KEY_TYPES.ZAPIER
|
|
@@ -462,27 +454,27 @@ var Form = function Form(_ref) {
|
|
|
462
454
|
type: expirationType
|
|
463
455
|
});
|
|
464
456
|
},
|
|
465
|
-
children: [/*#__PURE__*/jsxRuntime.jsx(Item
|
|
457
|
+
children: [/*#__PURE__*/jsxRuntime.jsx(Item, {
|
|
466
458
|
name: "expirationType",
|
|
467
459
|
value: EXPIRATION_OPTIONS.SEVEN_DAYS,
|
|
468
460
|
label: t("neetoApiKeys.fields.expirationOptions.sevenDays")
|
|
469
|
-
}), /*#__PURE__*/jsxRuntime.jsx(Item
|
|
461
|
+
}), /*#__PURE__*/jsxRuntime.jsx(Item, {
|
|
470
462
|
name: "expirationType",
|
|
471
463
|
value: EXPIRATION_OPTIONS.THIRTY_DAYS,
|
|
472
464
|
label: t("neetoApiKeys.fields.expirationOptions.thirtyDays")
|
|
473
|
-
}), /*#__PURE__*/jsxRuntime.jsx(Item
|
|
465
|
+
}), /*#__PURE__*/jsxRuntime.jsx(Item, {
|
|
474
466
|
name: "expirationType",
|
|
475
467
|
value: EXPIRATION_OPTIONS.NINETY_DAYS,
|
|
476
468
|
label: t("neetoApiKeys.fields.expirationOptions.ninetyDays")
|
|
477
|
-
}), /*#__PURE__*/jsxRuntime.jsx(Item
|
|
469
|
+
}), /*#__PURE__*/jsxRuntime.jsx(Item, {
|
|
478
470
|
name: "expirationType",
|
|
479
471
|
value: EXPIRATION_OPTIONS.ONE_YEAR,
|
|
480
472
|
label: t("neetoApiKeys.fields.expirationOptions.oneYear")
|
|
481
|
-
}), /*#__PURE__*/jsxRuntime.jsx(Item
|
|
473
|
+
}), /*#__PURE__*/jsxRuntime.jsx(Item, {
|
|
482
474
|
label: t("neetoApiKeys.fields.expirationOptions.never"),
|
|
483
475
|
name: "expirationType",
|
|
484
476
|
value: EXPIRATION_OPTIONS.NEVER
|
|
485
|
-
}), /*#__PURE__*/jsxRuntime.jsx(Item
|
|
477
|
+
}), /*#__PURE__*/jsxRuntime.jsx(Item, {
|
|
486
478
|
name: "expirationType",
|
|
487
479
|
value: EXPIRATION_OPTIONS.CUSTOM,
|
|
488
480
|
label: t("neetoApiKeys.fields.expirationOptions.custom")
|
|
@@ -549,147 +541,6 @@ var Create = function Create(_ref) {
|
|
|
549
541
|
});
|
|
550
542
|
};
|
|
551
543
|
|
|
552
|
-
var _excluded = ["label", "children"];
|
|
553
|
-
function ownKeys$3(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; }
|
|
554
|
-
function _objectSpread$3(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys$3(Object(t), true).forEach(function (r) { _defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys$3(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }
|
|
555
|
-
var Item = function Item(_ref) {
|
|
556
|
-
var label = _ref.label,
|
|
557
|
-
children = _ref.children,
|
|
558
|
-
otherProps = _objectWithoutProperties(_ref, _excluded);
|
|
559
|
-
return /*#__PURE__*/jsxRuntime.jsxs("div", _objectSpread$3(_objectSpread$3({
|
|
560
|
-
className: "space-y-1"
|
|
561
|
-
}, otherProps), {}, {
|
|
562
|
-
children: [/*#__PURE__*/jsxRuntime.jsx(neetoAtoms.Typography, {
|
|
563
|
-
color: "muted",
|
|
564
|
-
variant: "body3",
|
|
565
|
-
weight: "medium",
|
|
566
|
-
children: label
|
|
567
|
-
}), /*#__PURE__*/jsxRuntime.jsx("div", {
|
|
568
|
-
className: "min-w-0",
|
|
569
|
-
children: children
|
|
570
|
-
})]
|
|
571
|
-
}));
|
|
572
|
-
};
|
|
573
|
-
|
|
574
|
-
var Details = function Details(_ref) {
|
|
575
|
-
var apiKey = _ref.apiKey,
|
|
576
|
-
_ref$isZapierAvailabl = _ref.isZapierAvailable,
|
|
577
|
-
isZapierAvailable = _ref$isZapierAvailabl === void 0 ? false : _ref$isZapierAvailabl,
|
|
578
|
-
onClose = _ref.onClose,
|
|
579
|
-
_onEdit = _ref.onEdit,
|
|
580
|
-
_onDelete = _ref.onDelete;
|
|
581
|
-
var _useTranslation = reactI18next.useTranslation(),
|
|
582
|
-
t = _useTranslation.t;
|
|
583
|
-
var label = apiKey.label,
|
|
584
|
-
token = apiKey.token,
|
|
585
|
-
notes = apiKey.notes,
|
|
586
|
-
type = apiKey.type,
|
|
587
|
-
expiresAt = apiKey.expiresAt,
|
|
588
|
-
createdAt = apiKey.createdAt,
|
|
589
|
-
creator = apiKey.creator;
|
|
590
|
-
return /*#__PURE__*/jsxRuntime.jsxs(neetoAtoms.Sheet, {
|
|
591
|
-
onClose: onClose,
|
|
592
|
-
isOpen: neetoCist.isNotEmpty(apiKey),
|
|
593
|
-
children: [/*#__PURE__*/jsxRuntime.jsx(neetoAtoms.Sheet.Header, {
|
|
594
|
-
children: /*#__PURE__*/jsxRuntime.jsxs("div", {
|
|
595
|
-
className: "flex items-center gap-x-2",
|
|
596
|
-
children: [/*#__PURE__*/jsxRuntime.jsx(neetoAtoms.Sheet.Title, {
|
|
597
|
-
className: "min-w-0 break-words",
|
|
598
|
-
"data-testid": "api-key-details-title",
|
|
599
|
-
children: label
|
|
600
|
-
}), /*#__PURE__*/jsxRuntime.jsx(MoreDropdown, {
|
|
601
|
-
menuItems: getMenuItems({
|
|
602
|
-
onEdit: function onEdit() {
|
|
603
|
-
return _onEdit(apiKey);
|
|
604
|
-
},
|
|
605
|
-
onDelete: function onDelete() {
|
|
606
|
-
return _onDelete(apiKey);
|
|
607
|
-
},
|
|
608
|
-
isEditVisible: type === API_KEY_TYPES.GENERAL
|
|
609
|
-
})
|
|
610
|
-
})]
|
|
611
|
-
})
|
|
612
|
-
}), /*#__PURE__*/jsxRuntime.jsx(neetoAtoms.Sheet.Body, {
|
|
613
|
-
children: /*#__PURE__*/jsxRuntime.jsxs("div", {
|
|
614
|
-
className: "w-full space-y-6",
|
|
615
|
-
children: [/*#__PURE__*/jsxRuntime.jsx(Item, {
|
|
616
|
-
label: t("neetoApiKeys.table.headers.token"),
|
|
617
|
-
children: /*#__PURE__*/jsxRuntime.jsxs("div", {
|
|
618
|
-
className: "flex items-center gap-x-3",
|
|
619
|
-
children: [/*#__PURE__*/jsxRuntime.jsx(neetoAtoms.Typography, {
|
|
620
|
-
className: "min-w-0 truncate",
|
|
621
|
-
"data-testid": "api-key-details-token",
|
|
622
|
-
variant: "body2",
|
|
623
|
-
children: neetoCist.isPresent(token) && partlyHideToken(token)
|
|
624
|
-
}), /*#__PURE__*/jsxRuntime.jsx(CopyToClipboardButton, {
|
|
625
|
-
value: token
|
|
626
|
-
})]
|
|
627
|
-
})
|
|
628
|
-
}), isZapierAvailable && /*#__PURE__*/jsxRuntime.jsx(Item, {
|
|
629
|
-
label: t("neetoApiKeys.table.headers.type"),
|
|
630
|
-
children: /*#__PURE__*/jsxRuntime.jsx(neetoAtoms.Typography, {
|
|
631
|
-
variant: "body2",
|
|
632
|
-
children: neetoCist.humanize(type !== null && type !== void 0 ? type : "")
|
|
633
|
-
})
|
|
634
|
-
}), /*#__PURE__*/jsxRuntime.jsx(Item, {
|
|
635
|
-
label: t("neetoApiKeys.table.headers.status"),
|
|
636
|
-
children: isExpired(expiresAt) ? /*#__PURE__*/jsxRuntime.jsx(neetoAtoms.Badge, {
|
|
637
|
-
variant: "amber",
|
|
638
|
-
children: t("neetoApiKeys.tags.expired")
|
|
639
|
-
}) : /*#__PURE__*/jsxRuntime.jsx(neetoAtoms.Badge, {
|
|
640
|
-
variant: "green",
|
|
641
|
-
children: t("neetoApiKeys.tags.active")
|
|
642
|
-
})
|
|
643
|
-
}), neetoCist.isPresent(notes) && /*#__PURE__*/jsxRuntime.jsx(Item, {
|
|
644
|
-
label: t("neetoApiKeys.table.headers.notes"),
|
|
645
|
-
children: /*#__PURE__*/jsxRuntime.jsx(neetoAtoms.Typography, {
|
|
646
|
-
className: "whitespace-pre-wrap break-words",
|
|
647
|
-
"data-testid": "api-key-details-notes",
|
|
648
|
-
variant: "body2",
|
|
649
|
-
children: notes
|
|
650
|
-
})
|
|
651
|
-
}), /*#__PURE__*/jsxRuntime.jsx(Item, {
|
|
652
|
-
label: t("neetoApiKeys.table.headers.expiresAt"),
|
|
653
|
-
children: /*#__PURE__*/jsxRuntime.jsx(neetoAtoms.Typography, {
|
|
654
|
-
"data-testid": "api-key-details-expires-at",
|
|
655
|
-
variant: "body2",
|
|
656
|
-
children: neetoCist.isPresent(expiresAt) ? formatExpiry(expiresAt) : t("neetoApiKeys.common.never")
|
|
657
|
-
})
|
|
658
|
-
}), /*#__PURE__*/jsxRuntime.jsx(Item, {
|
|
659
|
-
label: t("neetoApiKeys.table.headers.createdAt"),
|
|
660
|
-
children: /*#__PURE__*/jsxRuntime.jsx(neetoAtoms.Typography, {
|
|
661
|
-
"data-testid": "api-key-details-created-at",
|
|
662
|
-
variant: "body2",
|
|
663
|
-
children: neetoCist.isPresent(createdAt) && utils.dateFormat.dateTime(createdAt)
|
|
664
|
-
})
|
|
665
|
-
}), /*#__PURE__*/jsxRuntime.jsx(Item, {
|
|
666
|
-
label: t("neetoApiKeys.fields.createdBy"),
|
|
667
|
-
children: neetoCist.isPresent(creator) ? /*#__PURE__*/jsxRuntime.jsxs("div", {
|
|
668
|
-
className: "flex items-center gap-x-2",
|
|
669
|
-
"data-testid": "api-key-details-created-by",
|
|
670
|
-
children: [/*#__PURE__*/jsxRuntime.jsx(neetoAtoms.Avatar, {
|
|
671
|
-
size: "sm",
|
|
672
|
-
user: {
|
|
673
|
-
name: creator.name,
|
|
674
|
-
imageUrl: creator.profileImageUrl
|
|
675
|
-
}
|
|
676
|
-
}), /*#__PURE__*/jsxRuntime.jsx(neetoAtoms.Typography, {
|
|
677
|
-
className: "min-w-0 truncate",
|
|
678
|
-
variant: "body2",
|
|
679
|
-
children: creator.name
|
|
680
|
-
})]
|
|
681
|
-
}) : /*#__PURE__*/jsxRuntime.jsx(neetoAtoms.Typography, {
|
|
682
|
-
color: "muted",
|
|
683
|
-
"data-testid": "api-key-details-created-by",
|
|
684
|
-
variant: "body2",
|
|
685
|
-
children: t("neetoApiKeys.common.notAvailable")
|
|
686
|
-
})
|
|
687
|
-
})]
|
|
688
|
-
})
|
|
689
|
-
})]
|
|
690
|
-
});
|
|
691
|
-
};
|
|
692
|
-
|
|
693
544
|
function ownKeys$2(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; }
|
|
694
545
|
function _objectSpread$2(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys$2(Object(t), true).forEach(function (r) { _defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys$2(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }
|
|
695
546
|
var Update = function Update(_ref) {
|
|
@@ -744,7 +595,6 @@ function _objectSpread$1(e) { for (var r = 1; r < arguments.length; r++) { var t
|
|
|
744
595
|
var Table = function Table(_ref) {
|
|
745
596
|
var handleDelete = _ref.handleDelete,
|
|
746
597
|
handleEdit = _ref.handleEdit,
|
|
747
|
-
handleView = _ref.handleView,
|
|
748
598
|
currentPage = _ref.currentPage,
|
|
749
599
|
setIsCreatePaneOpen = _ref.setIsCreatePaneOpen,
|
|
750
600
|
_ref$noDataProps = _ref.noDataProps,
|
|
@@ -760,10 +610,9 @@ var Table = function Table(_ref) {
|
|
|
760
610
|
return buildColumnData({
|
|
761
611
|
handleDelete: handleDelete,
|
|
762
612
|
handleEdit: handleEdit,
|
|
763
|
-
handleView: handleView,
|
|
764
613
|
isZapierAvailable: isZapierAvailable
|
|
765
614
|
});
|
|
766
|
-
}, [handleDelete, handleEdit,
|
|
615
|
+
}, [handleDelete, handleEdit, isZapierAvailable]);
|
|
767
616
|
if (isLoading) {
|
|
768
617
|
return /*#__PURE__*/jsxRuntime.jsx("div", {
|
|
769
618
|
className: "flex h-full w-full items-center justify-center",
|
|
@@ -801,8 +650,8 @@ var Table = function Table(_ref) {
|
|
|
801
650
|
children: /*#__PURE__*/jsxRuntime.jsx(neetoAtoms.DataTable, {
|
|
802
651
|
columns: columns,
|
|
803
652
|
currentPage: currentPage,
|
|
804
|
-
enableColumnFreeze: true,
|
|
805
653
|
data: (data === null || data === void 0 ? void 0 : data.apiKeys) || [],
|
|
654
|
+
enableColumnFreeze: true,
|
|
806
655
|
loading: isFetching,
|
|
807
656
|
pageSize: constants.DEFAULT_PAGE_SIZE,
|
|
808
657
|
totalCount: data === null || data === void 0 ? void 0 : data.totalCount
|
|
@@ -828,14 +677,10 @@ var ApiKeys = function ApiKeys(_ref) {
|
|
|
828
677
|
_useState4 = _slicedToArray(_useState3, 2),
|
|
829
678
|
apiKeyToBeEdited = _useState4[0],
|
|
830
679
|
setApiKeyToBeEdited = _useState4[1];
|
|
831
|
-
var _useState5 = react.useState(
|
|
680
|
+
var _useState5 = react.useState(false),
|
|
832
681
|
_useState6 = _slicedToArray(_useState5, 2),
|
|
833
|
-
|
|
834
|
-
|
|
835
|
-
var _useState7 = react.useState(false),
|
|
836
|
-
_useState8 = _slicedToArray(_useState7, 2),
|
|
837
|
-
isCreatePaneOpen = _useState8[0],
|
|
838
|
-
setIsCreatePaneOpen = _useState8[1];
|
|
682
|
+
isCreatePaneOpen = _useState6[0],
|
|
683
|
+
setIsCreatePaneOpen = _useState6[1];
|
|
839
684
|
var _useTranslation = reactI18next.useTranslation(),
|
|
840
685
|
t = _useTranslation.t;
|
|
841
686
|
var _useQueryParams = reactUtils.useQueryParams(),
|
|
@@ -876,14 +721,6 @@ var ApiKeys = function ApiKeys(_ref) {
|
|
|
876
721
|
var showFilters = neetoCist.isPresent(debouncedSearchTerm) || (data === null || data === void 0 ? void 0 : data.totalCount) > 0;
|
|
877
722
|
var _data$isZapierAvailab = data.isZapierAvailable,
|
|
878
723
|
isZapierAvailable = _data$isZapierAvailab === void 0 ? false : _data$isZapierAvailab;
|
|
879
|
-
var handleEditFromDetails = function handleEditFromDetails(apiKey) {
|
|
880
|
-
setApiKeyToBeViewed({});
|
|
881
|
-
setApiKeyToBeEdited(apiKey);
|
|
882
|
-
};
|
|
883
|
-
var handleDeleteFromDetails = function handleDeleteFromDetails(apiKey) {
|
|
884
|
-
setApiKeyToBeViewed({});
|
|
885
|
-
setApiKeyToBeDeleted(apiKey);
|
|
886
|
-
};
|
|
887
724
|
return /*#__PURE__*/jsxRuntime.jsxs("div", {
|
|
888
725
|
className: "flex h-full w-full flex-col",
|
|
889
726
|
children: [/*#__PURE__*/jsxRuntime.jsx(Header, _objectSpread({
|
|
@@ -932,8 +769,7 @@ var ApiKeys = function ApiKeys(_ref) {
|
|
|
932
769
|
noDataProps: noDataProps,
|
|
933
770
|
setIsCreatePaneOpen: setIsCreatePaneOpen,
|
|
934
771
|
handleDelete: setApiKeyToBeDeleted,
|
|
935
|
-
handleEdit: setApiKeyToBeEdited
|
|
936
|
-
handleView: setApiKeyToBeViewed
|
|
772
|
+
handleEdit: setApiKeyToBeEdited
|
|
937
773
|
}), /*#__PURE__*/jsxRuntime.jsx(neetoAtoms.Alert, {
|
|
938
774
|
isOpen: neetoCist.isNotEmpty(apiKeyToBeDeleted),
|
|
939
775
|
isSubmitting: isDeleting,
|
|
@@ -966,14 +802,6 @@ var ApiKeys = function ApiKeys(_ref) {
|
|
|
966
802
|
onClose: function onClose() {
|
|
967
803
|
return setIsCreatePaneOpen(false);
|
|
968
804
|
}
|
|
969
|
-
}), /*#__PURE__*/jsxRuntime.jsx(Details, {
|
|
970
|
-
isZapierAvailable: isZapierAvailable,
|
|
971
|
-
apiKey: apiKeyToBeViewed,
|
|
972
|
-
onClose: function onClose() {
|
|
973
|
-
return setApiKeyToBeViewed({});
|
|
974
|
-
},
|
|
975
|
-
onDelete: handleDeleteFromDetails,
|
|
976
|
-
onEdit: handleEditFromDetails
|
|
977
805
|
}), /*#__PURE__*/jsxRuntime.jsx(Update, {
|
|
978
806
|
helpDocUrl: helpDocUrl,
|
|
979
807
|
apiKey: apiKeyToBeEdited,
|