@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/v2/ApiKeys.js
CHANGED
|
@@ -2,8 +2,8 @@ import _defineProperty from '@babel/runtime/helpers/defineProperty';
|
|
|
2
2
|
import _slicedToArray from '@babel/runtime/helpers/slicedToArray';
|
|
3
3
|
import { useRef, useMemo, useState, useEffect } from 'react';
|
|
4
4
|
import { t } from 'i18next';
|
|
5
|
-
import {
|
|
6
|
-
import { isPresent, humanize,
|
|
5
|
+
import { Typography, Badge, DatePicker as DatePicker$1, Sheet, Spinner, Empty, DataTable, Button, Alert } from '@bigbinary/neeto-atoms';
|
|
6
|
+
import { isPresent, humanize, isNotPresent, isNotEmpty } from '@bigbinary/neeto-cist';
|
|
7
7
|
import { DEFAULT_PAGE_SIZE, PLURAL } from '@bigbinary/neeto-commons-frontend/v2/constants';
|
|
8
8
|
import { withTitle, useQueryParams, useDebounce } from '@bigbinary/neeto-commons-frontend/v2/react-utils';
|
|
9
9
|
import { dayjs, dateFormat, getQueryParams } from '@bigbinary/neeto-commons-frontend/v2/utils';
|
|
@@ -21,7 +21,6 @@ import { globalProps } from '@bigbinary/neeto-commons-frontend/v2/initializers';
|
|
|
21
21
|
import CopyToClipboardButton from '@bigbinary/neeto-molecules/v2/CopyToClipboardButton';
|
|
22
22
|
import MoreDropdown from '@bigbinary/neeto-molecules/v2/MoreDropdown';
|
|
23
23
|
import { jsxs, jsx, Fragment } from 'react/jsx-runtime';
|
|
24
|
-
import _objectWithoutProperties from '@babel/runtime/helpers/objectWithoutProperties';
|
|
25
24
|
import { KeyRound } from 'lucide-react';
|
|
26
25
|
import '@bigbinary/neeto-commons-frontend/constants';
|
|
27
26
|
import '@bigbinary/neeto-commons-frontend/react-utils';
|
|
@@ -82,9 +81,6 @@ var MASKED_TOKEN_LENGTH = 20;
|
|
|
82
81
|
var isInPast = function isInPast(date) {
|
|
83
82
|
return dayjs(date).isBefore(dayjs());
|
|
84
83
|
};
|
|
85
|
-
var isExpired = function isExpired(expiresAt) {
|
|
86
|
-
return isPresent(expiresAt) && isInPast(expiresAt);
|
|
87
|
-
};
|
|
88
84
|
var partlyHideToken = function partlyHideToken(key) {
|
|
89
85
|
var prefixMatch = key.match(/^([A-Z]+-)/);
|
|
90
86
|
if (prefixMatch) {
|
|
@@ -118,7 +114,6 @@ var getMenuItems = function getMenuItems(_ref) {
|
|
|
118
114
|
var buildColumnData = function buildColumnData(_ref2) {
|
|
119
115
|
var handleDelete = _ref2.handleDelete,
|
|
120
116
|
handleEdit = _ref2.handleEdit,
|
|
121
|
-
handleView = _ref2.handleView,
|
|
122
117
|
isZapierAvailable = _ref2.isZapierAvailable;
|
|
123
118
|
var columns = [{
|
|
124
119
|
id: "label",
|
|
@@ -132,14 +127,11 @@ var buildColumnData = function buildColumnData(_ref2) {
|
|
|
132
127
|
var apiKey = row.original;
|
|
133
128
|
return /*#__PURE__*/jsxs("div", {
|
|
134
129
|
className: "flex items-center justify-between gap-x-3",
|
|
135
|
-
children: [/*#__PURE__*/jsx(
|
|
136
|
-
className: "min-w-0
|
|
130
|
+
children: [/*#__PURE__*/jsx(Typography, {
|
|
131
|
+
className: "min-w-0 flex-1 truncate",
|
|
137
132
|
"data-testid": "api-keys-label-field",
|
|
138
133
|
title: label,
|
|
139
|
-
variant: "
|
|
140
|
-
onClick: function onClick() {
|
|
141
|
-
return handleView(apiKey);
|
|
142
|
-
},
|
|
134
|
+
variant: "body2",
|
|
143
135
|
children: label
|
|
144
136
|
}), /*#__PURE__*/jsx(MoreDropdown, {
|
|
145
137
|
menuItems: getMenuItems({
|
|
@@ -200,7 +192,7 @@ var buildColumnData = function buildColumnData(_ref2) {
|
|
|
200
192
|
cell: function cell(_ref6) {
|
|
201
193
|
var row = _ref6.row;
|
|
202
194
|
var expiresAt = row.original.expiresAt;
|
|
203
|
-
return
|
|
195
|
+
return isPresent(expiresAt) && isInPast(expiresAt) ? /*#__PURE__*/jsx(Badge, {
|
|
204
196
|
variant: "amber",
|
|
205
197
|
children: t("neetoApiKeys.tags.expired")
|
|
206
198
|
}) : /*#__PURE__*/jsx(Badge, {
|
|
@@ -350,9 +342,9 @@ var getExpirationDate = function getExpirationDate(type) {
|
|
|
350
342
|
}
|
|
351
343
|
};
|
|
352
344
|
|
|
353
|
-
function ownKeys$
|
|
354
|
-
function _objectSpread$
|
|
355
|
-
var Item
|
|
345
|
+
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; }
|
|
346
|
+
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; }
|
|
347
|
+
var Item = RadioGroup.Item;
|
|
356
348
|
var Form = function Form(_ref) {
|
|
357
349
|
var _ref$initialValues = _ref.initialValues,
|
|
358
350
|
initialValues = _ref$initialValues === void 0 ? INITIAL_VALUES : _ref$initialValues,
|
|
@@ -366,7 +358,7 @@ var Form = function Form(_ref) {
|
|
|
366
358
|
isZapierAvailable = _ref$isZapierAvailabl === void 0 ? false : _ref$isZapierAvailabl;
|
|
367
359
|
var _useTranslation = useTranslation(),
|
|
368
360
|
t = _useTranslation.t;
|
|
369
|
-
var formInitialValues = _objectSpread$
|
|
361
|
+
var formInitialValues = _objectSpread$3(_objectSpread$3({}, initialValues), {}, {
|
|
370
362
|
expirationType: getInitialExpirationType({
|
|
371
363
|
isEdit: isEdit,
|
|
372
364
|
values: initialValues
|
|
@@ -408,11 +400,11 @@ var Form = function Form(_ref) {
|
|
|
408
400
|
label: t("neetoApiKeys.common.type"),
|
|
409
401
|
name: "type",
|
|
410
402
|
orientation: "vertical",
|
|
411
|
-
children: [/*#__PURE__*/jsx(Item
|
|
403
|
+
children: [/*#__PURE__*/jsx(Item, {
|
|
412
404
|
label: t("neetoApiKeys.common.general"),
|
|
413
405
|
name: "type",
|
|
414
406
|
value: API_KEY_TYPES.GENERAL
|
|
415
|
-
}), /*#__PURE__*/jsx(Item
|
|
407
|
+
}), /*#__PURE__*/jsx(Item, {
|
|
416
408
|
label: t("neetoApiKeys.common.zapier"),
|
|
417
409
|
name: "type",
|
|
418
410
|
value: API_KEY_TYPES.ZAPIER
|
|
@@ -441,27 +433,27 @@ var Form = function Form(_ref) {
|
|
|
441
433
|
type: expirationType
|
|
442
434
|
});
|
|
443
435
|
},
|
|
444
|
-
children: [/*#__PURE__*/jsx(Item
|
|
436
|
+
children: [/*#__PURE__*/jsx(Item, {
|
|
445
437
|
name: "expirationType",
|
|
446
438
|
value: EXPIRATION_OPTIONS.SEVEN_DAYS,
|
|
447
439
|
label: t("neetoApiKeys.fields.expirationOptions.sevenDays")
|
|
448
|
-
}), /*#__PURE__*/jsx(Item
|
|
440
|
+
}), /*#__PURE__*/jsx(Item, {
|
|
449
441
|
name: "expirationType",
|
|
450
442
|
value: EXPIRATION_OPTIONS.THIRTY_DAYS,
|
|
451
443
|
label: t("neetoApiKeys.fields.expirationOptions.thirtyDays")
|
|
452
|
-
}), /*#__PURE__*/jsx(Item
|
|
444
|
+
}), /*#__PURE__*/jsx(Item, {
|
|
453
445
|
name: "expirationType",
|
|
454
446
|
value: EXPIRATION_OPTIONS.NINETY_DAYS,
|
|
455
447
|
label: t("neetoApiKeys.fields.expirationOptions.ninetyDays")
|
|
456
|
-
}), /*#__PURE__*/jsx(Item
|
|
448
|
+
}), /*#__PURE__*/jsx(Item, {
|
|
457
449
|
name: "expirationType",
|
|
458
450
|
value: EXPIRATION_OPTIONS.ONE_YEAR,
|
|
459
451
|
label: t("neetoApiKeys.fields.expirationOptions.oneYear")
|
|
460
|
-
}), /*#__PURE__*/jsx(Item
|
|
452
|
+
}), /*#__PURE__*/jsx(Item, {
|
|
461
453
|
label: t("neetoApiKeys.fields.expirationOptions.never"),
|
|
462
454
|
name: "expirationType",
|
|
463
455
|
value: EXPIRATION_OPTIONS.NEVER
|
|
464
|
-
}), /*#__PURE__*/jsx(Item
|
|
456
|
+
}), /*#__PURE__*/jsx(Item, {
|
|
465
457
|
name: "expirationType",
|
|
466
458
|
value: EXPIRATION_OPTIONS.CUSTOM,
|
|
467
459
|
label: t("neetoApiKeys.fields.expirationOptions.custom")
|
|
@@ -528,147 +520,6 @@ var Create = function Create(_ref) {
|
|
|
528
520
|
});
|
|
529
521
|
};
|
|
530
522
|
|
|
531
|
-
var _excluded = ["label", "children"];
|
|
532
|
-
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; }
|
|
533
|
-
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; }
|
|
534
|
-
var Item = function Item(_ref) {
|
|
535
|
-
var label = _ref.label,
|
|
536
|
-
children = _ref.children,
|
|
537
|
-
otherProps = _objectWithoutProperties(_ref, _excluded);
|
|
538
|
-
return /*#__PURE__*/jsxs("div", _objectSpread$3(_objectSpread$3({
|
|
539
|
-
className: "space-y-1"
|
|
540
|
-
}, otherProps), {}, {
|
|
541
|
-
children: [/*#__PURE__*/jsx(Typography, {
|
|
542
|
-
color: "muted",
|
|
543
|
-
variant: "body3",
|
|
544
|
-
weight: "medium",
|
|
545
|
-
children: label
|
|
546
|
-
}), /*#__PURE__*/jsx("div", {
|
|
547
|
-
className: "min-w-0",
|
|
548
|
-
children: children
|
|
549
|
-
})]
|
|
550
|
-
}));
|
|
551
|
-
};
|
|
552
|
-
|
|
553
|
-
var Details = function Details(_ref) {
|
|
554
|
-
var apiKey = _ref.apiKey,
|
|
555
|
-
_ref$isZapierAvailabl = _ref.isZapierAvailable,
|
|
556
|
-
isZapierAvailable = _ref$isZapierAvailabl === void 0 ? false : _ref$isZapierAvailabl,
|
|
557
|
-
onClose = _ref.onClose,
|
|
558
|
-
_onEdit = _ref.onEdit,
|
|
559
|
-
_onDelete = _ref.onDelete;
|
|
560
|
-
var _useTranslation = useTranslation(),
|
|
561
|
-
t = _useTranslation.t;
|
|
562
|
-
var label = apiKey.label,
|
|
563
|
-
token = apiKey.token,
|
|
564
|
-
notes = apiKey.notes,
|
|
565
|
-
type = apiKey.type,
|
|
566
|
-
expiresAt = apiKey.expiresAt,
|
|
567
|
-
createdAt = apiKey.createdAt,
|
|
568
|
-
creator = apiKey.creator;
|
|
569
|
-
return /*#__PURE__*/jsxs(Sheet, {
|
|
570
|
-
onClose: onClose,
|
|
571
|
-
isOpen: isNotEmpty(apiKey),
|
|
572
|
-
children: [/*#__PURE__*/jsx(Sheet.Header, {
|
|
573
|
-
children: /*#__PURE__*/jsxs("div", {
|
|
574
|
-
className: "flex items-center gap-x-2",
|
|
575
|
-
children: [/*#__PURE__*/jsx(Sheet.Title, {
|
|
576
|
-
className: "min-w-0 break-words",
|
|
577
|
-
"data-testid": "api-key-details-title",
|
|
578
|
-
children: label
|
|
579
|
-
}), /*#__PURE__*/jsx(MoreDropdown, {
|
|
580
|
-
menuItems: getMenuItems({
|
|
581
|
-
onEdit: function onEdit() {
|
|
582
|
-
return _onEdit(apiKey);
|
|
583
|
-
},
|
|
584
|
-
onDelete: function onDelete() {
|
|
585
|
-
return _onDelete(apiKey);
|
|
586
|
-
},
|
|
587
|
-
isEditVisible: type === API_KEY_TYPES.GENERAL
|
|
588
|
-
})
|
|
589
|
-
})]
|
|
590
|
-
})
|
|
591
|
-
}), /*#__PURE__*/jsx(Sheet.Body, {
|
|
592
|
-
children: /*#__PURE__*/jsxs("div", {
|
|
593
|
-
className: "w-full space-y-6",
|
|
594
|
-
children: [/*#__PURE__*/jsx(Item, {
|
|
595
|
-
label: t("neetoApiKeys.table.headers.token"),
|
|
596
|
-
children: /*#__PURE__*/jsxs("div", {
|
|
597
|
-
className: "flex items-center gap-x-3",
|
|
598
|
-
children: [/*#__PURE__*/jsx(Typography, {
|
|
599
|
-
className: "min-w-0 truncate",
|
|
600
|
-
"data-testid": "api-key-details-token",
|
|
601
|
-
variant: "body2",
|
|
602
|
-
children: isPresent(token) && partlyHideToken(token)
|
|
603
|
-
}), /*#__PURE__*/jsx(CopyToClipboardButton, {
|
|
604
|
-
value: token
|
|
605
|
-
})]
|
|
606
|
-
})
|
|
607
|
-
}), isZapierAvailable && /*#__PURE__*/jsx(Item, {
|
|
608
|
-
label: t("neetoApiKeys.table.headers.type"),
|
|
609
|
-
children: /*#__PURE__*/jsx(Typography, {
|
|
610
|
-
variant: "body2",
|
|
611
|
-
children: humanize(type !== null && type !== void 0 ? type : "")
|
|
612
|
-
})
|
|
613
|
-
}), /*#__PURE__*/jsx(Item, {
|
|
614
|
-
label: t("neetoApiKeys.table.headers.status"),
|
|
615
|
-
children: isExpired(expiresAt) ? /*#__PURE__*/jsx(Badge, {
|
|
616
|
-
variant: "amber",
|
|
617
|
-
children: t("neetoApiKeys.tags.expired")
|
|
618
|
-
}) : /*#__PURE__*/jsx(Badge, {
|
|
619
|
-
variant: "green",
|
|
620
|
-
children: t("neetoApiKeys.tags.active")
|
|
621
|
-
})
|
|
622
|
-
}), isPresent(notes) && /*#__PURE__*/jsx(Item, {
|
|
623
|
-
label: t("neetoApiKeys.table.headers.notes"),
|
|
624
|
-
children: /*#__PURE__*/jsx(Typography, {
|
|
625
|
-
className: "whitespace-pre-wrap break-words",
|
|
626
|
-
"data-testid": "api-key-details-notes",
|
|
627
|
-
variant: "body2",
|
|
628
|
-
children: notes
|
|
629
|
-
})
|
|
630
|
-
}), /*#__PURE__*/jsx(Item, {
|
|
631
|
-
label: t("neetoApiKeys.table.headers.expiresAt"),
|
|
632
|
-
children: /*#__PURE__*/jsx(Typography, {
|
|
633
|
-
"data-testid": "api-key-details-expires-at",
|
|
634
|
-
variant: "body2",
|
|
635
|
-
children: isPresent(expiresAt) ? formatExpiry(expiresAt) : t("neetoApiKeys.common.never")
|
|
636
|
-
})
|
|
637
|
-
}), /*#__PURE__*/jsx(Item, {
|
|
638
|
-
label: t("neetoApiKeys.table.headers.createdAt"),
|
|
639
|
-
children: /*#__PURE__*/jsx(Typography, {
|
|
640
|
-
"data-testid": "api-key-details-created-at",
|
|
641
|
-
variant: "body2",
|
|
642
|
-
children: isPresent(createdAt) && dateFormat.dateTime(createdAt)
|
|
643
|
-
})
|
|
644
|
-
}), /*#__PURE__*/jsx(Item, {
|
|
645
|
-
label: t("neetoApiKeys.fields.createdBy"),
|
|
646
|
-
children: isPresent(creator) ? /*#__PURE__*/jsxs("div", {
|
|
647
|
-
className: "flex items-center gap-x-2",
|
|
648
|
-
"data-testid": "api-key-details-created-by",
|
|
649
|
-
children: [/*#__PURE__*/jsx(Avatar, {
|
|
650
|
-
size: "sm",
|
|
651
|
-
user: {
|
|
652
|
-
name: creator.name,
|
|
653
|
-
imageUrl: creator.profileImageUrl
|
|
654
|
-
}
|
|
655
|
-
}), /*#__PURE__*/jsx(Typography, {
|
|
656
|
-
className: "min-w-0 truncate",
|
|
657
|
-
variant: "body2",
|
|
658
|
-
children: creator.name
|
|
659
|
-
})]
|
|
660
|
-
}) : /*#__PURE__*/jsx(Typography, {
|
|
661
|
-
color: "muted",
|
|
662
|
-
"data-testid": "api-key-details-created-by",
|
|
663
|
-
variant: "body2",
|
|
664
|
-
children: t("neetoApiKeys.common.notAvailable")
|
|
665
|
-
})
|
|
666
|
-
})]
|
|
667
|
-
})
|
|
668
|
-
})]
|
|
669
|
-
});
|
|
670
|
-
};
|
|
671
|
-
|
|
672
523
|
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; }
|
|
673
524
|
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; }
|
|
674
525
|
var Update = function Update(_ref) {
|
|
@@ -723,7 +574,6 @@ function _objectSpread$1(e) { for (var r = 1; r < arguments.length; r++) { var t
|
|
|
723
574
|
var Table = function Table(_ref) {
|
|
724
575
|
var handleDelete = _ref.handleDelete,
|
|
725
576
|
handleEdit = _ref.handleEdit,
|
|
726
|
-
handleView = _ref.handleView,
|
|
727
577
|
currentPage = _ref.currentPage,
|
|
728
578
|
setIsCreatePaneOpen = _ref.setIsCreatePaneOpen,
|
|
729
579
|
_ref$noDataProps = _ref.noDataProps,
|
|
@@ -739,10 +589,9 @@ var Table = function Table(_ref) {
|
|
|
739
589
|
return buildColumnData({
|
|
740
590
|
handleDelete: handleDelete,
|
|
741
591
|
handleEdit: handleEdit,
|
|
742
|
-
handleView: handleView,
|
|
743
592
|
isZapierAvailable: isZapierAvailable
|
|
744
593
|
});
|
|
745
|
-
}, [handleDelete, handleEdit,
|
|
594
|
+
}, [handleDelete, handleEdit, isZapierAvailable]);
|
|
746
595
|
if (isLoading) {
|
|
747
596
|
return /*#__PURE__*/jsx("div", {
|
|
748
597
|
className: "flex h-full w-full items-center justify-center",
|
|
@@ -780,8 +629,8 @@ var Table = function Table(_ref) {
|
|
|
780
629
|
children: /*#__PURE__*/jsx(DataTable, {
|
|
781
630
|
columns: columns,
|
|
782
631
|
currentPage: currentPage,
|
|
783
|
-
enableColumnFreeze: true,
|
|
784
632
|
data: (data === null || data === void 0 ? void 0 : data.apiKeys) || [],
|
|
633
|
+
enableColumnFreeze: true,
|
|
785
634
|
loading: isFetching,
|
|
786
635
|
pageSize: DEFAULT_PAGE_SIZE,
|
|
787
636
|
totalCount: data === null || data === void 0 ? void 0 : data.totalCount
|
|
@@ -807,14 +656,10 @@ var ApiKeys = function ApiKeys(_ref) {
|
|
|
807
656
|
_useState4 = _slicedToArray(_useState3, 2),
|
|
808
657
|
apiKeyToBeEdited = _useState4[0],
|
|
809
658
|
setApiKeyToBeEdited = _useState4[1];
|
|
810
|
-
var _useState5 = useState(
|
|
659
|
+
var _useState5 = useState(false),
|
|
811
660
|
_useState6 = _slicedToArray(_useState5, 2),
|
|
812
|
-
|
|
813
|
-
|
|
814
|
-
var _useState7 = useState(false),
|
|
815
|
-
_useState8 = _slicedToArray(_useState7, 2),
|
|
816
|
-
isCreatePaneOpen = _useState8[0],
|
|
817
|
-
setIsCreatePaneOpen = _useState8[1];
|
|
661
|
+
isCreatePaneOpen = _useState6[0],
|
|
662
|
+
setIsCreatePaneOpen = _useState6[1];
|
|
818
663
|
var _useTranslation = useTranslation(),
|
|
819
664
|
t = _useTranslation.t;
|
|
820
665
|
var _useQueryParams = useQueryParams(),
|
|
@@ -855,14 +700,6 @@ var ApiKeys = function ApiKeys(_ref) {
|
|
|
855
700
|
var showFilters = isPresent(debouncedSearchTerm) || (data === null || data === void 0 ? void 0 : data.totalCount) > 0;
|
|
856
701
|
var _data$isZapierAvailab = data.isZapierAvailable,
|
|
857
702
|
isZapierAvailable = _data$isZapierAvailab === void 0 ? false : _data$isZapierAvailab;
|
|
858
|
-
var handleEditFromDetails = function handleEditFromDetails(apiKey) {
|
|
859
|
-
setApiKeyToBeViewed({});
|
|
860
|
-
setApiKeyToBeEdited(apiKey);
|
|
861
|
-
};
|
|
862
|
-
var handleDeleteFromDetails = function handleDeleteFromDetails(apiKey) {
|
|
863
|
-
setApiKeyToBeViewed({});
|
|
864
|
-
setApiKeyToBeDeleted(apiKey);
|
|
865
|
-
};
|
|
866
703
|
return /*#__PURE__*/jsxs("div", {
|
|
867
704
|
className: "flex h-full w-full flex-col",
|
|
868
705
|
children: [/*#__PURE__*/jsx(Header, _objectSpread({
|
|
@@ -911,8 +748,7 @@ var ApiKeys = function ApiKeys(_ref) {
|
|
|
911
748
|
noDataProps: noDataProps,
|
|
912
749
|
setIsCreatePaneOpen: setIsCreatePaneOpen,
|
|
913
750
|
handleDelete: setApiKeyToBeDeleted,
|
|
914
|
-
handleEdit: setApiKeyToBeEdited
|
|
915
|
-
handleView: setApiKeyToBeViewed
|
|
751
|
+
handleEdit: setApiKeyToBeEdited
|
|
916
752
|
}), /*#__PURE__*/jsx(Alert, {
|
|
917
753
|
isOpen: isNotEmpty(apiKeyToBeDeleted),
|
|
918
754
|
isSubmitting: isDeleting,
|
|
@@ -945,14 +781,6 @@ var ApiKeys = function ApiKeys(_ref) {
|
|
|
945
781
|
onClose: function onClose() {
|
|
946
782
|
return setIsCreatePaneOpen(false);
|
|
947
783
|
}
|
|
948
|
-
}), /*#__PURE__*/jsx(Details, {
|
|
949
|
-
isZapierAvailable: isZapierAvailable,
|
|
950
|
-
apiKey: apiKeyToBeViewed,
|
|
951
|
-
onClose: function onClose() {
|
|
952
|
-
return setApiKeyToBeViewed({});
|
|
953
|
-
},
|
|
954
|
-
onDelete: handleDeleteFromDetails,
|
|
955
|
-
onEdit: handleEditFromDetails
|
|
956
784
|
}), /*#__PURE__*/jsx(Update, {
|
|
957
785
|
helpDocUrl: helpDocUrl,
|
|
958
786
|
apiKey: apiKeyToBeEdited,
|