@bigbinary/neeto-api-keys-frontend 3.2.0-beta2 → 3.2.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (55) hide show
  1. package/app/javascript/src/translations/ar.json +4 -2
  2. package/app/javascript/src/translations/bg.json +4 -2
  3. package/app/javascript/src/translations/ca.json +4 -2
  4. package/app/javascript/src/translations/cs.json +4 -2
  5. package/app/javascript/src/translations/da.json +4 -2
  6. package/app/javascript/src/translations/de.json +4 -2
  7. package/app/javascript/src/translations/en.json +2 -0
  8. package/app/javascript/src/translations/es-MX.json +4 -2
  9. package/app/javascript/src/translations/es.json +4 -2
  10. package/app/javascript/src/translations/et.json +4 -2
  11. package/app/javascript/src/translations/fi.json +4 -2
  12. package/app/javascript/src/translations/fil.json +4 -2
  13. package/app/javascript/src/translations/fr.json +4 -2
  14. package/app/javascript/src/translations/he.json +4 -2
  15. package/app/javascript/src/translations/hi.json +4 -2
  16. package/app/javascript/src/translations/hr.json +4 -2
  17. package/app/javascript/src/translations/hu.json +4 -2
  18. package/app/javascript/src/translations/id.json +4 -2
  19. package/app/javascript/src/translations/it.json +4 -2
  20. package/app/javascript/src/translations/ja.json +4 -2
  21. package/app/javascript/src/translations/ko.json +4 -2
  22. package/app/javascript/src/translations/lv.json +4 -2
  23. package/app/javascript/src/translations/nl.json +4 -2
  24. package/app/javascript/src/translations/pl.json +4 -2
  25. package/app/javascript/src/translations/pt-BR.json +4 -2
  26. package/app/javascript/src/translations/pt.json +4 -2
  27. package/app/javascript/src/translations/ro.json +4 -2
  28. package/app/javascript/src/translations/ru.json +4 -2
  29. package/app/javascript/src/translations/sk.json +4 -2
  30. package/app/javascript/src/translations/sl.json +4 -2
  31. package/app/javascript/src/translations/sv.json +4 -2
  32. package/app/javascript/src/translations/th.json +4 -2
  33. package/app/javascript/src/translations/tr.json +4 -2
  34. package/app/javascript/src/translations/uk.json +4 -2
  35. package/app/javascript/src/translations/vi.json +4 -2
  36. package/app/javascript/src/translations/zh-CN.json +4 -2
  37. package/app/javascript/src/translations/zh-TW.json +4 -2
  38. package/dist/.ready +1 -1
  39. package/dist/ApiKeys.js +200 -24
  40. package/dist/ApiKeys.js.map +1 -1
  41. package/dist/cjs/ApiKeys.js +199 -23
  42. package/dist/cjs/ApiKeys.js.map +1 -1
  43. package/dist/cjs/index.js +2 -0
  44. package/dist/cjs/index.js.map +1 -1
  45. package/dist/cjs/v2/ApiKeys.js +210 -23
  46. package/dist/cjs/v2/ApiKeys.js.map +1 -1
  47. package/dist/cjs/v2/index.js +1 -0
  48. package/dist/cjs/v2/index.js.map +1 -1
  49. package/dist/index.js +2 -0
  50. package/dist/index.js.map +1 -1
  51. package/dist/v2/ApiKeys.js +212 -25
  52. package/dist/v2/ApiKeys.js.map +1 -1
  53. package/dist/v2/index.js +1 -0
  54. package/dist/v2/index.js.map +1 -1
  55. package/package.json +13 -13
@@ -8,7 +8,8 @@
8
8
  "zapier": "Zapier",
9
9
  "type": "ประเภท",
10
10
  "apiKeyCount_one": "{{count}} คีย์ API",
11
- "apiKeyCount_other": "{{count}} คีย์ API"
11
+ "apiKeyCount_other": "{{count}} คีย์ API",
12
+ "notAvailable": "ไม่สามารถใช้ได้"
12
13
  },
13
14
  "headers": {
14
15
  "createApiKey": "เพิ่มกุญแจ API ใหม่",
@@ -77,7 +78,8 @@
77
78
  "ninetyDays": "90 วัน",
78
79
  "oneYear": "1 ปี",
79
80
  "custom": "กำหนดเอง"
80
- }
81
+ },
82
+ "createdBy": "สร้างโดย"
81
83
  },
82
84
  "validations": {
83
85
  "expiry": "$t(neetoApiKeys.fields.expiryDate) ต้องเป็นอย่างน้อย {{date}}",
@@ -8,7 +8,8 @@
8
8
  "zapier": "Zapier",
9
9
  "type": "Tür",
10
10
  "apiKeyCount_one": "{{count}} API anahtarı",
11
- "apiKeyCount_other": "{{count}} API anahtarları"
11
+ "apiKeyCount_other": "{{count}} API anahtarları",
12
+ "notAvailable": "Mevcut değil"
12
13
  },
13
14
  "headers": {
14
15
  "createApiKey": "Yeni API anahtarı ekle",
@@ -77,7 +78,8 @@
77
78
  "ninetyDays": "90 gün",
78
79
  "oneYear": "1 yıl",
79
80
  "custom": "Özel"
80
- }
81
+ },
82
+ "createdBy": "Tarafından oluşturuldu"
81
83
  },
82
84
  "validations": {
83
85
  "expiry": "$t(neetoApiKeys.fields.expiryDate) en az {{date}} olmalıdır",
@@ -8,7 +8,8 @@
8
8
  "zapier": "Zapier",
9
9
  "type": "Тип",
10
10
  "apiKeyCount_one": "{{count}} API ключ",
11
- "apiKeyCount_other": "{{count}} API ключів"
11
+ "apiKeyCount_other": "{{count}} API ключів",
12
+ "notAvailable": "Недоступно"
12
13
  },
13
14
  "headers": {
14
15
  "createApiKey": "Додати новий API ключ",
@@ -77,7 +78,8 @@
77
78
  "ninetyDays": "90 днів",
78
79
  "oneYear": "1 рік",
79
80
  "custom": "Індивідуальний"
80
- }
81
+ },
82
+ "createdBy": "Створено ким"
81
83
  },
82
84
  "validations": {
83
85
  "expiry": "$t(neetoApiKeys.fields.expiryDate) має бути щонайменше {{date}}",
@@ -8,7 +8,8 @@
8
8
  "zapier": "Zapier",
9
9
  "type": "Loại",
10
10
  "apiKeyCount_one": "{{count}} khóa API",
11
- "apiKeyCount_other": "{{count}} khóa API"
11
+ "apiKeyCount_other": "{{count}} khóa API",
12
+ "notAvailable": "Không có sẵn"
12
13
  },
13
14
  "headers": {
14
15
  "createApiKey": "Thêm khóa API mới",
@@ -77,7 +78,8 @@
77
78
  "ninetyDays": "90 ngày",
78
79
  "oneYear": "1 năm",
79
80
  "custom": "Tùy chỉnh"
80
- }
81
+ },
82
+ "createdBy": "Tạo bởi"
81
83
  },
82
84
  "validations": {
83
85
  "expiry": "$t(neetoApiKeys.fields.expiryDate) nên ít nhất là {{date}}",
@@ -8,7 +8,8 @@
8
8
  "zapier": "Zapier",
9
9
  "type": "类型",
10
10
  "apiKeyCount_one": "{{count}} 个 API 密钥",
11
- "apiKeyCount_other": "{{count}} 个 API 密钥"
11
+ "apiKeyCount_other": "{{count}} 个 API 密钥",
12
+ "notAvailable": "不可用"
12
13
  },
13
14
  "headers": {
14
15
  "createApiKey": "添加新的 API 密钥",
@@ -77,7 +78,8 @@
77
78
  "ninetyDays": "90天",
78
79
  "oneYear": "1年",
79
80
  "custom": "自定义"
80
- }
81
+ },
82
+ "createdBy": "创建者"
81
83
  },
82
84
  "validations": {
83
85
  "expiry": "$t(neetoApiKeys.fields.expiryDate) 应至少为 {{date}}",
@@ -8,7 +8,8 @@
8
8
  "zapier": "Zapier",
9
9
  "type": "類型",
10
10
  "apiKeyCount_one": "{{count}} 個 API 金鑰",
11
- "apiKeyCount_other": "{{count}} 個 API 金鑰"
11
+ "apiKeyCount_other": "{{count}} 個 API 金鑰",
12
+ "notAvailable": "不可用"
12
13
  },
13
14
  "headers": {
14
15
  "createApiKey": "新增 API 金鑰",
@@ -77,7 +78,8 @@
77
78
  "ninetyDays": "90 天",
78
79
  "oneYear": "1 年",
79
80
  "custom": "自訂"
80
- }
81
+ },
82
+ "createdBy": "建立者"
81
83
  },
82
84
  "validations": {
83
85
  "expiry": "$t(neetoApiKeys.fields.expiryDate) 應至少為 {{date}}",
package/dist/.ready CHANGED
@@ -1 +1 @@
1
- Built at 2026-10-31T11:57:33.312Z
1
+ Built at 2026-11-13T11:50:16.705Z
package/dist/ApiKeys.js CHANGED
@@ -2,7 +2,7 @@ import _defineProperty from '@babel/runtime/helpers/defineProperty';
2
2
  import _slicedToArray from '@babel/runtime/helpers/slicedToArray';
3
3
  import { useRef, useState, useEffect } from 'react';
4
4
  import { t } from 'i18next';
5
- import { truncate, isPresent, humanize, isNotPresent, isNotEmpty } from '@bigbinary/neeto-cist';
5
+ import { truncate, isPresent, humanize, isNotEmpty, isNotPresent } from '@bigbinary/neeto-cist';
6
6
  import { DEFAULT_PAGE_SIZE, PLURAL } from '@bigbinary/neeto-commons-frontend/constants';
7
7
  import { withTitle, useQueryParams, useDebounce } from '@bigbinary/neeto-commons-frontend/react-utils';
8
8
  import { dayjs, dateFormat, getQueryParams } from '@bigbinary/neeto-commons-frontend/utils';
@@ -29,6 +29,8 @@ import CopyToClipboardButton from '@bigbinary/neeto-molecules/CopyToClipboardBut
29
29
  import MoreDropdown from '@bigbinary/neeto-molecules/MoreDropdown';
30
30
  import Tag from '@bigbinary/neetoui/Tag';
31
31
  import { jsxs, jsx, Fragment } from 'react/jsx-runtime';
32
+ import Avatar from '@bigbinary/neetoui/Avatar';
33
+ import _objectWithoutProperties from '@babel/runtime/helpers/objectWithoutProperties';
32
34
  import TableWrapper from '@bigbinary/neeto-molecules/TableWrapper';
33
35
  import NeetoUITable from '@bigbinary/neetoui/Table';
34
36
  import NoData from '@bigbinary/neetoui/NoData';
@@ -89,6 +91,9 @@ var MENU_ITEMS = {
89
91
  var isInPast = function isInPast(date) {
90
92
  return dayjs(date).isBefore(dayjs());
91
93
  };
94
+ var isExpired = function isExpired(expiresAt) {
95
+ return isPresent(expiresAt) && isInPast(expiresAt);
96
+ };
92
97
  var partlyHideToken = function partlyHideToken(key) {
93
98
  var prefixMatch = key.match(/^([A-Z]+-)/);
94
99
  if (prefixMatch) {
@@ -122,6 +127,7 @@ var getMenuItems = function getMenuItems(_ref) {
122
127
  var buildColumnData = function buildColumnData(_ref2) {
123
128
  var handleDelete = _ref2.handleDelete,
124
129
  handleEdit = _ref2.handleEdit,
130
+ handleView = _ref2.handleView,
125
131
  isZapierAvailable = _ref2.isZapierAvailable;
126
132
  var columns = [{
127
133
  title: t("neetoApiKeys.table.headers.label"),
@@ -131,11 +137,15 @@ var buildColumnData = function buildColumnData(_ref2) {
131
137
  render: function render(label, apiKey) {
132
138
  return /*#__PURE__*/jsxs("div", {
133
139
  className: "flex items-center justify-between gap-x-3",
134
- children: [/*#__PURE__*/jsx(Typography, {
140
+ children: [/*#__PURE__*/jsx(Button, {
141
+ className: "min-w-0",
135
142
  "data-testid": "api-keys-label-field",
136
- style: "body2",
143
+ label: truncate(label, 100),
144
+ style: "link",
137
145
  title: label,
138
- children: truncate(label, 100)
146
+ onClick: function onClick() {
147
+ return handleView(apiKey);
148
+ }
139
149
  }), /*#__PURE__*/jsx(MoreDropdown, {
140
150
  dropdownButtonProps: {
141
151
  className: "me-1 my-1"
@@ -197,7 +207,7 @@ var buildColumnData = function buildColumnData(_ref2) {
197
207
  width: 144,
198
208
  render: function render(_, _ref3) {
199
209
  var expiresAt = _ref3.expiresAt;
200
- return isPresent(expiresAt) && isInPast(expiresAt) ? /*#__PURE__*/jsx(Tag, {
210
+ return isExpired(expiresAt) ? /*#__PURE__*/jsx(Tag, {
201
211
  style: "warning",
202
212
  children: t("neetoApiKeys.tags.expired")
203
213
  }) : /*#__PURE__*/jsx(Tag, {
@@ -254,8 +264,8 @@ var getStartOfTime = function getStartOfTime(time, unit) {
254
264
  return dayjs(time).startOf(unit);
255
265
  };
256
266
 
257
- function ownKeys$4(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; }
258
- function _objectSpread$4(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys$4(Object(t), true).forEach(function (r) { _defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys$4(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }
267
+ function ownKeys$5(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; }
268
+ function _objectSpread$5(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys$5(Object(t), true).forEach(function (r) { _defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys$5(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }
259
269
  var DatePicker = function DatePicker(_ref) {
260
270
  var defaultValue = _ref.defaultValue,
261
271
  disabledDate = _ref.disabledDate,
@@ -271,7 +281,7 @@ var DatePicker = function DatePicker(_ref) {
271
281
  var field = _ref2.field,
272
282
  meta = _ref2.meta,
273
283
  setFieldValue = _ref2.form.setFieldValue;
274
- return /*#__PURE__*/jsx(NeetoUIDatePicker, _objectSpread$4(_objectSpread$4({
284
+ return /*#__PURE__*/jsx(NeetoUIDatePicker, _objectSpread$5(_objectSpread$5({
275
285
  defaultValue: defaultValue,
276
286
  disabled: disabled,
277
287
  disabledDate: disabledDate,
@@ -340,9 +350,9 @@ var getExpirationDate = function getExpirationDate(type) {
340
350
  }
341
351
  };
342
352
 
343
- 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; }
344
- 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; }
345
- var Item = Radio.Item;
353
+ function ownKeys$4(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; }
354
+ function _objectSpread$4(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys$4(Object(t), true).forEach(function (r) { _defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys$4(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }
355
+ var Item$1 = Radio.Item;
346
356
  var Form = function Form(_ref) {
347
357
  var _ref$initialValues = _ref.initialValues,
348
358
  initialValues = _ref$initialValues === void 0 ? INITIAL_VALUES : _ref$initialValues,
@@ -356,7 +366,7 @@ var Form = function Form(_ref) {
356
366
  isZapierAvailable = _ref$isZapierAvailabl === void 0 ? false : _ref$isZapierAvailabl;
357
367
  var _useTranslation = useTranslation(),
358
368
  t = _useTranslation.t;
359
- var formInitialValues = _objectSpread$3(_objectSpread$3({}, initialValues), {}, {
369
+ var formInitialValues = _objectSpread$4(_objectSpread$4({}, initialValues), {}, {
360
370
  expirationType: getInitialExpirationType({
361
371
  isEdit: isEdit,
362
372
  values: initialValues
@@ -396,11 +406,11 @@ var Form = function Form(_ref) {
396
406
  children: [!isEdit && isZapierAvailable && /*#__PURE__*/jsxs(Radio, {
397
407
  label: t("neetoApiKeys.common.type"),
398
408
  name: "type",
399
- children: [/*#__PURE__*/jsx(Item, {
409
+ children: [/*#__PURE__*/jsx(Item$1, {
400
410
  label: t("neetoApiKeys.common.general"),
401
411
  name: "type",
402
412
  value: API_KEY_TYPES.GENERAL
403
- }), /*#__PURE__*/jsx(Item, {
413
+ }), /*#__PURE__*/jsx(Item$1, {
404
414
  label: t("neetoApiKeys.common.zapier"),
405
415
  name: "type",
406
416
  value: API_KEY_TYPES.ZAPIER
@@ -429,27 +439,27 @@ var Form = function Form(_ref) {
429
439
  type: event.target.value
430
440
  });
431
441
  },
432
- children: [/*#__PURE__*/jsx(Item, {
442
+ children: [/*#__PURE__*/jsx(Item$1, {
433
443
  name: "expirationType",
434
444
  value: EXPIRATION_OPTIONS.SEVEN_DAYS,
435
445
  label: t("neetoApiKeys.fields.expirationOptions.sevenDays")
436
- }), /*#__PURE__*/jsx(Item, {
446
+ }), /*#__PURE__*/jsx(Item$1, {
437
447
  name: "expirationType",
438
448
  value: EXPIRATION_OPTIONS.THIRTY_DAYS,
439
449
  label: t("neetoApiKeys.fields.expirationOptions.thirtyDays")
440
- }), /*#__PURE__*/jsx(Item, {
450
+ }), /*#__PURE__*/jsx(Item$1, {
441
451
  name: "expirationType",
442
452
  value: EXPIRATION_OPTIONS.NINETY_DAYS,
443
453
  label: t("neetoApiKeys.fields.expirationOptions.ninetyDays")
444
- }), /*#__PURE__*/jsx(Item, {
454
+ }), /*#__PURE__*/jsx(Item$1, {
445
455
  name: "expirationType",
446
456
  value: EXPIRATION_OPTIONS.ONE_YEAR,
447
457
  label: t("neetoApiKeys.fields.expirationOptions.oneYear")
448
- }), /*#__PURE__*/jsx(Item, {
458
+ }), /*#__PURE__*/jsx(Item$1, {
449
459
  label: t("neetoApiKeys.fields.expirationOptions.never"),
450
460
  name: "expirationType",
451
461
  value: EXPIRATION_OPTIONS.NEVER
452
- }), /*#__PURE__*/jsx(Item, {
462
+ }), /*#__PURE__*/jsx(Item$1, {
453
463
  name: "expirationType",
454
464
  value: EXPIRATION_OPTIONS.CUSTOM,
455
465
  label: t("neetoApiKeys.fields.expirationOptions.custom")
@@ -517,6 +527,149 @@ var Create = function Create(_ref) {
517
527
  });
518
528
  };
519
529
 
530
+ var _excluded = ["label", "children"];
531
+ 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; }
532
+ 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; }
533
+ var Item = function Item(_ref) {
534
+ var label = _ref.label,
535
+ children = _ref.children,
536
+ otherProps = _objectWithoutProperties(_ref, _excluded);
537
+ return /*#__PURE__*/jsxs("div", _objectSpread$3(_objectSpread$3({
538
+ className: "space-y-1"
539
+ }, otherProps), {}, {
540
+ children: [/*#__PURE__*/jsx(Typography, {
541
+ className: "neeto-ui-text-gray-600",
542
+ style: "body3",
543
+ weight: "medium",
544
+ children: label
545
+ }), /*#__PURE__*/jsx("div", {
546
+ className: "min-w-0",
547
+ children: children
548
+ })]
549
+ }));
550
+ };
551
+
552
+ var Details = function Details(_ref) {
553
+ var apiKey = _ref.apiKey,
554
+ _ref$isZapierAvailabl = _ref.isZapierAvailable,
555
+ isZapierAvailable = _ref$isZapierAvailabl === void 0 ? false : _ref$isZapierAvailabl,
556
+ onClose = _ref.onClose,
557
+ _onEdit = _ref.onEdit,
558
+ _onDelete = _ref.onDelete;
559
+ var _useTranslation = useTranslation(),
560
+ t = _useTranslation.t;
561
+ var label = apiKey.label,
562
+ token = apiKey.token,
563
+ notes = apiKey.notes,
564
+ type = apiKey.type,
565
+ expiresAt = apiKey.expiresAt,
566
+ createdAt = apiKey.createdAt,
567
+ creator = apiKey.creator;
568
+ return /*#__PURE__*/jsxs(Pane, {
569
+ onClose: onClose,
570
+ isOpen: isNotEmpty(apiKey),
571
+ children: [/*#__PURE__*/jsx(Pane.Header, {
572
+ children: /*#__PURE__*/jsxs("div", {
573
+ className: "flex items-center gap-x-2",
574
+ children: [/*#__PURE__*/jsx(Typography, {
575
+ className: "min-w-0 break-words",
576
+ "data-testid": "api-key-details-title",
577
+ style: "h2",
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(Pane.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
+ style: "body2",
602
+ children: isPresent(token) && partlyHideToken(token)
603
+ }), /*#__PURE__*/jsx(CopyToClipboardButton, {
604
+ style: "text",
605
+ value: token
606
+ })]
607
+ })
608
+ }), isZapierAvailable && /*#__PURE__*/jsx(Item, {
609
+ label: t("neetoApiKeys.table.headers.type"),
610
+ children: /*#__PURE__*/jsx(Typography, {
611
+ style: "body2",
612
+ children: humanize(type !== null && type !== void 0 ? type : "")
613
+ })
614
+ }), /*#__PURE__*/jsx(Item, {
615
+ label: t("neetoApiKeys.table.headers.status"),
616
+ children: isExpired(expiresAt) ? /*#__PURE__*/jsx(Tag, {
617
+ style: "warning",
618
+ children: t("neetoApiKeys.tags.expired")
619
+ }) : /*#__PURE__*/jsx(Tag, {
620
+ style: "success",
621
+ children: t("neetoApiKeys.tags.active")
622
+ })
623
+ }), isPresent(notes) && /*#__PURE__*/jsx(Item, {
624
+ label: t("neetoApiKeys.table.headers.notes"),
625
+ children: /*#__PURE__*/jsx(Typography, {
626
+ className: "whitespace-pre-wrap break-words",
627
+ "data-testid": "api-key-details-notes",
628
+ style: "body2",
629
+ children: notes
630
+ })
631
+ }), /*#__PURE__*/jsx(Item, {
632
+ label: t("neetoApiKeys.table.headers.expiresAt"),
633
+ children: /*#__PURE__*/jsx(Typography, {
634
+ "data-testid": "api-key-details-expires-at",
635
+ style: "body2",
636
+ children: isPresent(expiresAt) ? formatExpiry(expiresAt) : t("neetoApiKeys.common.never")
637
+ })
638
+ }), /*#__PURE__*/jsx(Item, {
639
+ label: t("neetoApiKeys.table.headers.createdAt"),
640
+ children: /*#__PURE__*/jsx(Typography, {
641
+ "data-testid": "api-key-details-created-at",
642
+ style: "body2",
643
+ children: isPresent(createdAt) && dateFormat.dateTime(createdAt)
644
+ })
645
+ }), /*#__PURE__*/jsx(Item, {
646
+ label: t("neetoApiKeys.fields.createdBy"),
647
+ children: isPresent(creator) ? /*#__PURE__*/jsxs("div", {
648
+ className: "flex items-center gap-x-2",
649
+ "data-testid": "api-key-details-created-by",
650
+ children: [/*#__PURE__*/jsx(Avatar, {
651
+ size: "small",
652
+ user: {
653
+ name: creator.name,
654
+ imageUrl: creator.profileImageUrl
655
+ }
656
+ }), /*#__PURE__*/jsx(Typography, {
657
+ className: "min-w-0 truncate",
658
+ style: "body2",
659
+ children: creator.name
660
+ })]
661
+ }) : /*#__PURE__*/jsx(Typography, {
662
+ className: "neeto-ui-text-gray-600",
663
+ "data-testid": "api-key-details-created-by",
664
+ style: "body2",
665
+ children: t("neetoApiKeys.common.notAvailable")
666
+ })
667
+ })]
668
+ })
669
+ })]
670
+ });
671
+ };
672
+
520
673
  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; }
521
674
  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; }
522
675
  var Update = function Update(_ref) {
@@ -570,6 +723,7 @@ function _objectSpread$1(e) { for (var r = 1; r < arguments.length; r++) { var t
570
723
  var Table = function Table(_ref) {
571
724
  var handleDelete = _ref.handleDelete,
572
725
  handleEdit = _ref.handleEdit,
726
+ handleView = _ref.handleView,
573
727
  currentPage = _ref.currentPage,
574
728
  setIsCreatePaneOpen = _ref.setIsCreatePaneOpen,
575
729
  _ref$noDataProps = _ref.noDataProps,
@@ -624,6 +778,7 @@ var Table = function Table(_ref) {
624
778
  columnData: buildColumnData({
625
779
  handleDelete: handleDelete,
626
780
  handleEdit: handleEdit,
781
+ handleView: handleView,
627
782
  isZapierAvailable: isZapierAvailable
628
783
  })
629
784
  })
@@ -648,10 +803,14 @@ var ApiKeys = function ApiKeys(_ref) {
648
803
  _useState4 = _slicedToArray(_useState3, 2),
649
804
  apiKeyToBeEdited = _useState4[0],
650
805
  setApiKeyToBeEdited = _useState4[1];
651
- var _useState5 = useState(false),
806
+ var _useState5 = useState({}),
652
807
  _useState6 = _slicedToArray(_useState5, 2),
653
- isCreatePaneOpen = _useState6[0],
654
- setIsCreatePaneOpen = _useState6[1];
808
+ apiKeyToBeViewed = _useState6[0],
809
+ setApiKeyToBeViewed = _useState6[1];
810
+ var _useState7 = useState(false),
811
+ _useState8 = _slicedToArray(_useState7, 2),
812
+ isCreatePaneOpen = _useState8[0],
813
+ setIsCreatePaneOpen = _useState8[1];
655
814
  var _useTranslation = useTranslation(),
656
815
  t = _useTranslation.t;
657
816
  var _useQueryParams = useQueryParams(),
@@ -692,6 +851,14 @@ var ApiKeys = function ApiKeys(_ref) {
692
851
  var showFilters = isPresent(debouncedSearchTerm) || (data === null || data === void 0 ? void 0 : data.totalCount) > 0;
693
852
  var _data$isZapierAvailab = data.isZapierAvailable,
694
853
  isZapierAvailable = _data$isZapierAvailab === void 0 ? false : _data$isZapierAvailab;
854
+ var handleEditFromDetails = function handleEditFromDetails(apiKey) {
855
+ setApiKeyToBeViewed({});
856
+ setApiKeyToBeEdited(apiKey);
857
+ };
858
+ var handleDeleteFromDetails = function handleDeleteFromDetails(apiKey) {
859
+ setApiKeyToBeViewed({});
860
+ setApiKeyToBeDeleted(apiKey);
861
+ };
695
862
  return /*#__PURE__*/jsxs("div", {
696
863
  className: "flex h-full w-full flex-col",
697
864
  children: [/*#__PURE__*/jsx(Header, _objectSpread({
@@ -739,7 +906,8 @@ var ApiKeys = function ApiKeys(_ref) {
739
906
  noDataProps: noDataProps,
740
907
  setIsCreatePaneOpen: setIsCreatePaneOpen,
741
908
  handleDelete: setApiKeyToBeDeleted,
742
- handleEdit: setApiKeyToBeEdited
909
+ handleEdit: setApiKeyToBeEdited,
910
+ handleView: setApiKeyToBeViewed
743
911
  }), /*#__PURE__*/jsx(Alert, {
744
912
  isOpen: isNotEmpty(apiKeyToBeDeleted),
745
913
  isSubmitting: isDeleting,
@@ -772,6 +940,14 @@ var ApiKeys = function ApiKeys(_ref) {
772
940
  onClose: function onClose() {
773
941
  return setIsCreatePaneOpen(false);
774
942
  }
943
+ }), /*#__PURE__*/jsx(Details, {
944
+ isZapierAvailable: isZapierAvailable,
945
+ apiKey: apiKeyToBeViewed,
946
+ onClose: function onClose() {
947
+ return setApiKeyToBeViewed({});
948
+ },
949
+ onDelete: handleDeleteFromDetails,
950
+ onEdit: handleEditFromDetails
775
951
  }), /*#__PURE__*/jsx(Update, {
776
952
  helpDocUrl: helpDocUrl,
777
953
  apiKey: apiKeyToBeEdited,