@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
|
@@ -8,8 +8,7 @@
|
|
|
8
8
|
"zapier": "Zapier",
|
|
9
9
|
"type": "ประเภท",
|
|
10
10
|
"apiKeyCount_one": "{{count}} คีย์ API",
|
|
11
|
-
"apiKeyCount_other": "{{count}} คีย์ API"
|
|
12
|
-
"notAvailable": "ไม่สามารถใช้ได้"
|
|
11
|
+
"apiKeyCount_other": "{{count}} คีย์ API"
|
|
13
12
|
},
|
|
14
13
|
"headers": {
|
|
15
14
|
"createApiKey": "เพิ่มกุญแจ API ใหม่",
|
|
@@ -78,8 +77,7 @@
|
|
|
78
77
|
"ninetyDays": "90 วัน",
|
|
79
78
|
"oneYear": "1 ปี",
|
|
80
79
|
"custom": "กำหนดเอง"
|
|
81
|
-
}
|
|
82
|
-
"createdBy": "สร้างโดย"
|
|
80
|
+
}
|
|
83
81
|
},
|
|
84
82
|
"validations": {
|
|
85
83
|
"expiry": "$t(neetoApiKeys.fields.expiryDate) ต้องเป็นอย่างน้อย {{date}}",
|
|
@@ -8,8 +8,7 @@
|
|
|
8
8
|
"zapier": "Zapier",
|
|
9
9
|
"type": "Tür",
|
|
10
10
|
"apiKeyCount_one": "{{count}} API anahtarı",
|
|
11
|
-
"apiKeyCount_other": "{{count}} API anahtarları"
|
|
12
|
-
"notAvailable": "Mevcut değil"
|
|
11
|
+
"apiKeyCount_other": "{{count}} API anahtarları"
|
|
13
12
|
},
|
|
14
13
|
"headers": {
|
|
15
14
|
"createApiKey": "Yeni API anahtarı ekle",
|
|
@@ -78,8 +77,7 @@
|
|
|
78
77
|
"ninetyDays": "90 gün",
|
|
79
78
|
"oneYear": "1 yıl",
|
|
80
79
|
"custom": "Özel"
|
|
81
|
-
}
|
|
82
|
-
"createdBy": "Tarafından oluşturuldu"
|
|
80
|
+
}
|
|
83
81
|
},
|
|
84
82
|
"validations": {
|
|
85
83
|
"expiry": "$t(neetoApiKeys.fields.expiryDate) en az {{date}} olmalıdır",
|
|
@@ -8,8 +8,7 @@
|
|
|
8
8
|
"zapier": "Zapier",
|
|
9
9
|
"type": "Тип",
|
|
10
10
|
"apiKeyCount_one": "{{count}} API ключ",
|
|
11
|
-
"apiKeyCount_other": "{{count}} API ключів"
|
|
12
|
-
"notAvailable": "Недоступно"
|
|
11
|
+
"apiKeyCount_other": "{{count}} API ключів"
|
|
13
12
|
},
|
|
14
13
|
"headers": {
|
|
15
14
|
"createApiKey": "Додати новий API ключ",
|
|
@@ -78,8 +77,7 @@
|
|
|
78
77
|
"ninetyDays": "90 днів",
|
|
79
78
|
"oneYear": "1 рік",
|
|
80
79
|
"custom": "Індивідуальний"
|
|
81
|
-
}
|
|
82
|
-
"createdBy": "Створено ким"
|
|
80
|
+
}
|
|
83
81
|
},
|
|
84
82
|
"validations": {
|
|
85
83
|
"expiry": "$t(neetoApiKeys.fields.expiryDate) має бути щонайменше {{date}}",
|
|
@@ -8,8 +8,7 @@
|
|
|
8
8
|
"zapier": "Zapier",
|
|
9
9
|
"type": "Loại",
|
|
10
10
|
"apiKeyCount_one": "{{count}} khóa API",
|
|
11
|
-
"apiKeyCount_other": "{{count}} khóa API"
|
|
12
|
-
"notAvailable": "Không có sẵn"
|
|
11
|
+
"apiKeyCount_other": "{{count}} khóa API"
|
|
13
12
|
},
|
|
14
13
|
"headers": {
|
|
15
14
|
"createApiKey": "Thêm khóa API mới",
|
|
@@ -78,8 +77,7 @@
|
|
|
78
77
|
"ninetyDays": "90 ngày",
|
|
79
78
|
"oneYear": "1 năm",
|
|
80
79
|
"custom": "Tùy chỉnh"
|
|
81
|
-
}
|
|
82
|
-
"createdBy": "Tạo bởi"
|
|
80
|
+
}
|
|
83
81
|
},
|
|
84
82
|
"validations": {
|
|
85
83
|
"expiry": "$t(neetoApiKeys.fields.expiryDate) nên ít nhất là {{date}}",
|
|
@@ -8,8 +8,7 @@
|
|
|
8
8
|
"zapier": "Zapier",
|
|
9
9
|
"type": "类型",
|
|
10
10
|
"apiKeyCount_one": "{{count}} 个 API 密钥",
|
|
11
|
-
"apiKeyCount_other": "{{count}} 个 API 密钥"
|
|
12
|
-
"notAvailable": "不可用"
|
|
11
|
+
"apiKeyCount_other": "{{count}} 个 API 密钥"
|
|
13
12
|
},
|
|
14
13
|
"headers": {
|
|
15
14
|
"createApiKey": "添加新的 API 密钥",
|
|
@@ -78,8 +77,7 @@
|
|
|
78
77
|
"ninetyDays": "90天",
|
|
79
78
|
"oneYear": "1年",
|
|
80
79
|
"custom": "自定义"
|
|
81
|
-
}
|
|
82
|
-
"createdBy": "创建者"
|
|
80
|
+
}
|
|
83
81
|
},
|
|
84
82
|
"validations": {
|
|
85
83
|
"expiry": "$t(neetoApiKeys.fields.expiryDate) 应至少为 {{date}}",
|
|
@@ -8,8 +8,7 @@
|
|
|
8
8
|
"zapier": "Zapier",
|
|
9
9
|
"type": "類型",
|
|
10
10
|
"apiKeyCount_one": "{{count}} 個 API 金鑰",
|
|
11
|
-
"apiKeyCount_other": "{{count}} 個 API 金鑰"
|
|
12
|
-
"notAvailable": "不可用"
|
|
11
|
+
"apiKeyCount_other": "{{count}} 個 API 金鑰"
|
|
13
12
|
},
|
|
14
13
|
"headers": {
|
|
15
14
|
"createApiKey": "新增 API 金鑰",
|
|
@@ -78,8 +77,7 @@
|
|
|
78
77
|
"ninetyDays": "90 天",
|
|
79
78
|
"oneYear": "1 年",
|
|
80
79
|
"custom": "自訂"
|
|
81
|
-
}
|
|
82
|
-
"createdBy": "建立者"
|
|
80
|
+
}
|
|
83
81
|
},
|
|
84
82
|
"validations": {
|
|
85
83
|
"expiry": "$t(neetoApiKeys.fields.expiryDate) 應至少為 {{date}}",
|
package/dist/.ready
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
Built at 2026-10-
|
|
1
|
+
Built at 2026-10-31T11:57:33.312Z
|
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,
|
|
5
|
+
import { truncate, isPresent, humanize, isNotPresent, isNotEmpty } 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,8 +29,6 @@ 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';
|
|
34
32
|
import TableWrapper from '@bigbinary/neeto-molecules/TableWrapper';
|
|
35
33
|
import NeetoUITable from '@bigbinary/neetoui/Table';
|
|
36
34
|
import NoData from '@bigbinary/neetoui/NoData';
|
|
@@ -91,9 +89,6 @@ var MENU_ITEMS = {
|
|
|
91
89
|
var isInPast = function isInPast(date) {
|
|
92
90
|
return dayjs(date).isBefore(dayjs());
|
|
93
91
|
};
|
|
94
|
-
var isExpired = function isExpired(expiresAt) {
|
|
95
|
-
return isPresent(expiresAt) && isInPast(expiresAt);
|
|
96
|
-
};
|
|
97
92
|
var partlyHideToken = function partlyHideToken(key) {
|
|
98
93
|
var prefixMatch = key.match(/^([A-Z]+-)/);
|
|
99
94
|
if (prefixMatch) {
|
|
@@ -127,7 +122,6 @@ var getMenuItems = function getMenuItems(_ref) {
|
|
|
127
122
|
var buildColumnData = function buildColumnData(_ref2) {
|
|
128
123
|
var handleDelete = _ref2.handleDelete,
|
|
129
124
|
handleEdit = _ref2.handleEdit,
|
|
130
|
-
handleView = _ref2.handleView,
|
|
131
125
|
isZapierAvailable = _ref2.isZapierAvailable;
|
|
132
126
|
var columns = [{
|
|
133
127
|
title: t("neetoApiKeys.table.headers.label"),
|
|
@@ -137,15 +131,11 @@ var buildColumnData = function buildColumnData(_ref2) {
|
|
|
137
131
|
render: function render(label, apiKey) {
|
|
138
132
|
return /*#__PURE__*/jsxs("div", {
|
|
139
133
|
className: "flex items-center justify-between gap-x-3",
|
|
140
|
-
children: [/*#__PURE__*/jsx(
|
|
141
|
-
className: "min-w-0",
|
|
134
|
+
children: [/*#__PURE__*/jsx(Typography, {
|
|
142
135
|
"data-testid": "api-keys-label-field",
|
|
143
|
-
|
|
144
|
-
style: "link",
|
|
136
|
+
style: "body2",
|
|
145
137
|
title: label,
|
|
146
|
-
|
|
147
|
-
return handleView(apiKey);
|
|
148
|
-
}
|
|
138
|
+
children: truncate(label, 100)
|
|
149
139
|
}), /*#__PURE__*/jsx(MoreDropdown, {
|
|
150
140
|
dropdownButtonProps: {
|
|
151
141
|
className: "me-1 my-1"
|
|
@@ -207,7 +197,7 @@ var buildColumnData = function buildColumnData(_ref2) {
|
|
|
207
197
|
width: 144,
|
|
208
198
|
render: function render(_, _ref3) {
|
|
209
199
|
var expiresAt = _ref3.expiresAt;
|
|
210
|
-
return
|
|
200
|
+
return isPresent(expiresAt) && isInPast(expiresAt) ? /*#__PURE__*/jsx(Tag, {
|
|
211
201
|
style: "warning",
|
|
212
202
|
children: t("neetoApiKeys.tags.expired")
|
|
213
203
|
}) : /*#__PURE__*/jsx(Tag, {
|
|
@@ -264,8 +254,8 @@ var getStartOfTime = function getStartOfTime(time, unit) {
|
|
|
264
254
|
return dayjs(time).startOf(unit);
|
|
265
255
|
};
|
|
266
256
|
|
|
267
|
-
function ownKeys$
|
|
268
|
-
function _objectSpread$
|
|
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; }
|
|
269
259
|
var DatePicker = function DatePicker(_ref) {
|
|
270
260
|
var defaultValue = _ref.defaultValue,
|
|
271
261
|
disabledDate = _ref.disabledDate,
|
|
@@ -281,7 +271,7 @@ var DatePicker = function DatePicker(_ref) {
|
|
|
281
271
|
var field = _ref2.field,
|
|
282
272
|
meta = _ref2.meta,
|
|
283
273
|
setFieldValue = _ref2.form.setFieldValue;
|
|
284
|
-
return /*#__PURE__*/jsx(NeetoUIDatePicker, _objectSpread$
|
|
274
|
+
return /*#__PURE__*/jsx(NeetoUIDatePicker, _objectSpread$4(_objectSpread$4({
|
|
285
275
|
defaultValue: defaultValue,
|
|
286
276
|
disabled: disabled,
|
|
287
277
|
disabledDate: disabledDate,
|
|
@@ -350,9 +340,9 @@ var getExpirationDate = function getExpirationDate(type) {
|
|
|
350
340
|
}
|
|
351
341
|
};
|
|
352
342
|
|
|
353
|
-
function ownKeys$
|
|
354
|
-
function _objectSpread$
|
|
355
|
-
var Item
|
|
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;
|
|
356
346
|
var Form = function Form(_ref) {
|
|
357
347
|
var _ref$initialValues = _ref.initialValues,
|
|
358
348
|
initialValues = _ref$initialValues === void 0 ? INITIAL_VALUES : _ref$initialValues,
|
|
@@ -366,7 +356,7 @@ var Form = function Form(_ref) {
|
|
|
366
356
|
isZapierAvailable = _ref$isZapierAvailabl === void 0 ? false : _ref$isZapierAvailabl;
|
|
367
357
|
var _useTranslation = useTranslation(),
|
|
368
358
|
t = _useTranslation.t;
|
|
369
|
-
var formInitialValues = _objectSpread$
|
|
359
|
+
var formInitialValues = _objectSpread$3(_objectSpread$3({}, initialValues), {}, {
|
|
370
360
|
expirationType: getInitialExpirationType({
|
|
371
361
|
isEdit: isEdit,
|
|
372
362
|
values: initialValues
|
|
@@ -406,11 +396,11 @@ var Form = function Form(_ref) {
|
|
|
406
396
|
children: [!isEdit && isZapierAvailable && /*#__PURE__*/jsxs(Radio, {
|
|
407
397
|
label: t("neetoApiKeys.common.type"),
|
|
408
398
|
name: "type",
|
|
409
|
-
children: [/*#__PURE__*/jsx(Item
|
|
399
|
+
children: [/*#__PURE__*/jsx(Item, {
|
|
410
400
|
label: t("neetoApiKeys.common.general"),
|
|
411
401
|
name: "type",
|
|
412
402
|
value: API_KEY_TYPES.GENERAL
|
|
413
|
-
}), /*#__PURE__*/jsx(Item
|
|
403
|
+
}), /*#__PURE__*/jsx(Item, {
|
|
414
404
|
label: t("neetoApiKeys.common.zapier"),
|
|
415
405
|
name: "type",
|
|
416
406
|
value: API_KEY_TYPES.ZAPIER
|
|
@@ -439,27 +429,27 @@ var Form = function Form(_ref) {
|
|
|
439
429
|
type: event.target.value
|
|
440
430
|
});
|
|
441
431
|
},
|
|
442
|
-
children: [/*#__PURE__*/jsx(Item
|
|
432
|
+
children: [/*#__PURE__*/jsx(Item, {
|
|
443
433
|
name: "expirationType",
|
|
444
434
|
value: EXPIRATION_OPTIONS.SEVEN_DAYS,
|
|
445
435
|
label: t("neetoApiKeys.fields.expirationOptions.sevenDays")
|
|
446
|
-
}), /*#__PURE__*/jsx(Item
|
|
436
|
+
}), /*#__PURE__*/jsx(Item, {
|
|
447
437
|
name: "expirationType",
|
|
448
438
|
value: EXPIRATION_OPTIONS.THIRTY_DAYS,
|
|
449
439
|
label: t("neetoApiKeys.fields.expirationOptions.thirtyDays")
|
|
450
|
-
}), /*#__PURE__*/jsx(Item
|
|
440
|
+
}), /*#__PURE__*/jsx(Item, {
|
|
451
441
|
name: "expirationType",
|
|
452
442
|
value: EXPIRATION_OPTIONS.NINETY_DAYS,
|
|
453
443
|
label: t("neetoApiKeys.fields.expirationOptions.ninetyDays")
|
|
454
|
-
}), /*#__PURE__*/jsx(Item
|
|
444
|
+
}), /*#__PURE__*/jsx(Item, {
|
|
455
445
|
name: "expirationType",
|
|
456
446
|
value: EXPIRATION_OPTIONS.ONE_YEAR,
|
|
457
447
|
label: t("neetoApiKeys.fields.expirationOptions.oneYear")
|
|
458
|
-
}), /*#__PURE__*/jsx(Item
|
|
448
|
+
}), /*#__PURE__*/jsx(Item, {
|
|
459
449
|
label: t("neetoApiKeys.fields.expirationOptions.never"),
|
|
460
450
|
name: "expirationType",
|
|
461
451
|
value: EXPIRATION_OPTIONS.NEVER
|
|
462
|
-
}), /*#__PURE__*/jsx(Item
|
|
452
|
+
}), /*#__PURE__*/jsx(Item, {
|
|
463
453
|
name: "expirationType",
|
|
464
454
|
value: EXPIRATION_OPTIONS.CUSTOM,
|
|
465
455
|
label: t("neetoApiKeys.fields.expirationOptions.custom")
|
|
@@ -527,149 +517,6 @@ var Create = function Create(_ref) {
|
|
|
527
517
|
});
|
|
528
518
|
};
|
|
529
519
|
|
|
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
|
-
|
|
673
520
|
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; }
|
|
674
521
|
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; }
|
|
675
522
|
var Update = function Update(_ref) {
|
|
@@ -723,7 +570,6 @@ function _objectSpread$1(e) { for (var r = 1; r < arguments.length; r++) { var t
|
|
|
723
570
|
var Table = function Table(_ref) {
|
|
724
571
|
var handleDelete = _ref.handleDelete,
|
|
725
572
|
handleEdit = _ref.handleEdit,
|
|
726
|
-
handleView = _ref.handleView,
|
|
727
573
|
currentPage = _ref.currentPage,
|
|
728
574
|
setIsCreatePaneOpen = _ref.setIsCreatePaneOpen,
|
|
729
575
|
_ref$noDataProps = _ref.noDataProps,
|
|
@@ -778,7 +624,6 @@ var Table = function Table(_ref) {
|
|
|
778
624
|
columnData: buildColumnData({
|
|
779
625
|
handleDelete: handleDelete,
|
|
780
626
|
handleEdit: handleEdit,
|
|
781
|
-
handleView: handleView,
|
|
782
627
|
isZapierAvailable: isZapierAvailable
|
|
783
628
|
})
|
|
784
629
|
})
|
|
@@ -803,14 +648,10 @@ var ApiKeys = function ApiKeys(_ref) {
|
|
|
803
648
|
_useState4 = _slicedToArray(_useState3, 2),
|
|
804
649
|
apiKeyToBeEdited = _useState4[0],
|
|
805
650
|
setApiKeyToBeEdited = _useState4[1];
|
|
806
|
-
var _useState5 = useState(
|
|
651
|
+
var _useState5 = useState(false),
|
|
807
652
|
_useState6 = _slicedToArray(_useState5, 2),
|
|
808
|
-
|
|
809
|
-
|
|
810
|
-
var _useState7 = useState(false),
|
|
811
|
-
_useState8 = _slicedToArray(_useState7, 2),
|
|
812
|
-
isCreatePaneOpen = _useState8[0],
|
|
813
|
-
setIsCreatePaneOpen = _useState8[1];
|
|
653
|
+
isCreatePaneOpen = _useState6[0],
|
|
654
|
+
setIsCreatePaneOpen = _useState6[1];
|
|
814
655
|
var _useTranslation = useTranslation(),
|
|
815
656
|
t = _useTranslation.t;
|
|
816
657
|
var _useQueryParams = useQueryParams(),
|
|
@@ -851,14 +692,6 @@ var ApiKeys = function ApiKeys(_ref) {
|
|
|
851
692
|
var showFilters = isPresent(debouncedSearchTerm) || (data === null || data === void 0 ? void 0 : data.totalCount) > 0;
|
|
852
693
|
var _data$isZapierAvailab = data.isZapierAvailable,
|
|
853
694
|
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
|
-
};
|
|
862
695
|
return /*#__PURE__*/jsxs("div", {
|
|
863
696
|
className: "flex h-full w-full flex-col",
|
|
864
697
|
children: [/*#__PURE__*/jsx(Header, _objectSpread({
|
|
@@ -906,8 +739,7 @@ var ApiKeys = function ApiKeys(_ref) {
|
|
|
906
739
|
noDataProps: noDataProps,
|
|
907
740
|
setIsCreatePaneOpen: setIsCreatePaneOpen,
|
|
908
741
|
handleDelete: setApiKeyToBeDeleted,
|
|
909
|
-
handleEdit: setApiKeyToBeEdited
|
|
910
|
-
handleView: setApiKeyToBeViewed
|
|
742
|
+
handleEdit: setApiKeyToBeEdited
|
|
911
743
|
}), /*#__PURE__*/jsx(Alert, {
|
|
912
744
|
isOpen: isNotEmpty(apiKeyToBeDeleted),
|
|
913
745
|
isSubmitting: isDeleting,
|
|
@@ -940,14 +772,6 @@ var ApiKeys = function ApiKeys(_ref) {
|
|
|
940
772
|
onClose: function onClose() {
|
|
941
773
|
return setIsCreatePaneOpen(false);
|
|
942
774
|
}
|
|
943
|
-
}), /*#__PURE__*/jsx(Details, {
|
|
944
|
-
isZapierAvailable: isZapierAvailable,
|
|
945
|
-
apiKey: apiKeyToBeViewed,
|
|
946
|
-
onClose: function onClose() {
|
|
947
|
-
return setApiKeyToBeViewed({});
|
|
948
|
-
},
|
|
949
|
-
onDelete: handleDeleteFromDetails,
|
|
950
|
-
onEdit: handleEditFromDetails
|
|
951
775
|
}), /*#__PURE__*/jsx(Update, {
|
|
952
776
|
helpDocUrl: helpDocUrl,
|
|
953
777
|
apiKey: apiKeyToBeEdited,
|