@bigbinary/neeto-api-keys-frontend 1.0.7 → 1.0.9
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/en.json +64 -0
- package/app/javascript/src/translations/index.js +3 -0
- package/dist/index.cjs.js +47 -132
- package/dist/index.cjs.js.map +1 -1
- package/dist/index.js +40 -124
- package/dist/index.js.map +1 -1
- package/package.json +10 -6
package/dist/index.js
CHANGED
|
@@ -1,11 +1,11 @@
|
|
|
1
|
-
import i18n, { t } from 'i18next';
|
|
2
|
-
import { initReactI18next, useTranslation, Trans } from 'react-i18next';
|
|
3
1
|
import React, { useRef, useState, useEffect } from 'react';
|
|
2
|
+
import { t } from 'i18next';
|
|
4
3
|
import { DEFAULT_PAGE_INDEX, PLURAL } from '@bigbinary/neeto-commons-frontend/constants';
|
|
5
|
-
import { isPresent, isNotPresent, isNotEmpty } from '@bigbinary/neeto-
|
|
4
|
+
import { isPresent, isNotPresent, isNotEmpty } from '@bigbinary/neeto-cist';
|
|
6
5
|
import { useMutationWithInvalidation, useDebounce, withTitle } from '@bigbinary/neeto-commons-frontend/react-utils';
|
|
7
6
|
import Header from '@bigbinary/neeto-molecules/Header';
|
|
8
7
|
import { Dropdown, Typography, Button, Tag, DatePicker as DatePicker$1, Pane, NoData, Table as Table$1, Alert } from '@bigbinary/neetoui';
|
|
8
|
+
import { useTranslation, Trans } from 'react-i18next';
|
|
9
9
|
import { useQuery } from 'react-query';
|
|
10
10
|
import axios from 'axios';
|
|
11
11
|
import { Form as Form$1, Input, Checkbox, ActionBlock } from '@bigbinary/neetoui/formik';
|
|
@@ -18,90 +18,6 @@ import PageLoader from '@bigbinary/neeto-molecules/PageLoader';
|
|
|
18
18
|
import TableWrapper from '@bigbinary/neeto-molecules/TableWrapper';
|
|
19
19
|
import { useHistory } from 'react-router-dom';
|
|
20
20
|
|
|
21
|
-
var common = {
|
|
22
|
-
apiKey_one: "API key",
|
|
23
|
-
apiKey_other: "API keys",
|
|
24
|
-
never: "Never"
|
|
25
|
-
};
|
|
26
|
-
var headers = {
|
|
27
|
-
createApiKey: "Create API key",
|
|
28
|
-
updateApiKey: "Update API key"
|
|
29
|
-
};
|
|
30
|
-
var noData = {
|
|
31
|
-
title: "There are no API Keys"
|
|
32
|
-
};
|
|
33
|
-
var alert = {
|
|
34
|
-
titles: {
|
|
35
|
-
deleteApiKey: "Delete API key?"
|
|
36
|
-
},
|
|
37
|
-
descriptions: {
|
|
38
|
-
deleteApiKey: "You are deleting the API key named <strong>{{name}}</strong>. This cannot be undone."
|
|
39
|
-
}
|
|
40
|
-
};
|
|
41
|
-
var buttons = {
|
|
42
|
-
"delete": "Delete",
|
|
43
|
-
addApiKey: "Add API key",
|
|
44
|
-
edit: "Edit",
|
|
45
|
-
submit: "Submit",
|
|
46
|
-
cancel: "Cancel"
|
|
47
|
-
};
|
|
48
|
-
var placeholders = {
|
|
49
|
-
search: "Search API keys",
|
|
50
|
-
selectExpiryDate: "Select an expiry date",
|
|
51
|
-
label: "Add a label for the API key"
|
|
52
|
-
};
|
|
53
|
-
var notifications = {
|
|
54
|
-
copiedToClipboard: "API key has been copied to clipboard"
|
|
55
|
-
};
|
|
56
|
-
var tooltips = {
|
|
57
|
-
copyToClipboard: "Copy to clipboard"
|
|
58
|
-
};
|
|
59
|
-
var table = {
|
|
60
|
-
headers: {
|
|
61
|
-
label: "Label",
|
|
62
|
-
token: "Token",
|
|
63
|
-
expiresAt: "Expires at",
|
|
64
|
-
createdAt: "Created at",
|
|
65
|
-
status: "Status"
|
|
66
|
-
}
|
|
67
|
-
};
|
|
68
|
-
var fields = {
|
|
69
|
-
label: "Label",
|
|
70
|
-
expiryDate: "Expiry date",
|
|
71
|
-
neverExpire: "Never expire"
|
|
72
|
-
};
|
|
73
|
-
var validations = {
|
|
74
|
-
expiry: "$t(fields.expiryDate) should be at least {{date}}",
|
|
75
|
-
required: "{{entity}} is required"
|
|
76
|
-
};
|
|
77
|
-
var tags = {
|
|
78
|
-
expired: "Expired",
|
|
79
|
-
active: "Active"
|
|
80
|
-
};
|
|
81
|
-
var en = {
|
|
82
|
-
common: common,
|
|
83
|
-
headers: headers,
|
|
84
|
-
noData: noData,
|
|
85
|
-
alert: alert,
|
|
86
|
-
buttons: buttons,
|
|
87
|
-
placeholders: placeholders,
|
|
88
|
-
notifications: notifications,
|
|
89
|
-
tooltips: tooltips,
|
|
90
|
-
table: table,
|
|
91
|
-
fields: fields,
|
|
92
|
-
validations: validations,
|
|
93
|
-
tags: tags
|
|
94
|
-
};
|
|
95
|
-
|
|
96
|
-
i18n.use(initReactI18next).init({
|
|
97
|
-
resources: {
|
|
98
|
-
en: {
|
|
99
|
-
translation: en
|
|
100
|
-
}
|
|
101
|
-
},
|
|
102
|
-
fallbackLng: "en"
|
|
103
|
-
});
|
|
104
|
-
|
|
105
21
|
function _extends() {
|
|
106
22
|
_extends = Object.assign ? Object.assign.bind() : function (target) {
|
|
107
23
|
for (var i = 1; i < arguments.length; i++) {
|
|
@@ -249,7 +165,7 @@ var dayjs_min = {exports: {}};
|
|
|
249
165
|
dayjs_min.exports;
|
|
250
166
|
|
|
251
167
|
(function (module, exports) {
|
|
252
|
-
!function(t,e){module.exports=e();}(commonjsGlobal,(function(){var t=1e3,e=6e4,n=36e5,r="millisecond",i="second",s="minute",u="hour",a="day",o="week",c="month",f="quarter",h="year",d="date",l="Invalid Date",$=/^(\d{4})[-/]?(\d{1,2})?[-/]?(\d{0,2})[Tt\s]*(\d{1,2})?:?(\d{1,2})?:?(\d{1,2})?[.:]?(\d+)?$/,y=/\[([^\]]+)]|Y{1,4}|M{1,4}|D{1,2}|d{1,4}|H{1,2}|h{1,2}|a|A|m{1,2}|s{1,2}|Z{1,2}|SSS/g,M={name:"en",weekdays:"Sunday_Monday_Tuesday_Wednesday_Thursday_Friday_Saturday".split("_"),months:"January_February_March_April_May_June_July_August_September_October_November_December".split("_"),ordinal:function(t){var e=["th","st","nd","rd"],n=t%100;return "["+t+(e[(n-20)%10]||e[n]||e[0])+"]"}},m=function(t,e,n){var r=String(t);return !r||r.length>=e?t:""+Array(e+1-r.length).join(n)+t},v={s:m,z:function(t){var e=-t.utcOffset(),n=Math.abs(e),r=Math.floor(n/60),i=n%60;return (e<=0?"+":"-")+m(r,2,"0")+":"+m(i,2,"0")},m:function t(e,n){if(e.date()<n.date())return -t(n,e);var r=12*(n.year()-e.year())+(n.month()-e.month()),i=e.clone().add(r,c),s=n-i<0,u=e.clone().add(r+(s?-1:1),c);return +(-(r+(n-i)/(s?i-u:u-i))||0)},a:function(t){return t<0?Math.ceil(t)||0:Math.floor(t)},p:function(t){return {M:c,y:h,w:o,d:a,D:d,h:u,m:s,s:i,ms:r,Q:f}[t]||String(t||"").toLowerCase().replace(/s$/,"")},u:function(t){return void 0===t}},g="en",D={};D[g]=M;var p=function(t){return t instanceof
|
|
168
|
+
!function(t,e){module.exports=e();}(commonjsGlobal,(function(){var t=1e3,e=6e4,n=36e5,r="millisecond",i="second",s="minute",u="hour",a="day",o="week",c="month",f="quarter",h="year",d="date",l="Invalid Date",$=/^(\d{4})[-/]?(\d{1,2})?[-/]?(\d{0,2})[Tt\s]*(\d{1,2})?:?(\d{1,2})?:?(\d{1,2})?[.:]?(\d+)?$/,y=/\[([^\]]+)]|Y{1,4}|M{1,4}|D{1,2}|d{1,4}|H{1,2}|h{1,2}|a|A|m{1,2}|s{1,2}|Z{1,2}|SSS/g,M={name:"en",weekdays:"Sunday_Monday_Tuesday_Wednesday_Thursday_Friday_Saturday".split("_"),months:"January_February_March_April_May_June_July_August_September_October_November_December".split("_"),ordinal:function(t){var e=["th","st","nd","rd"],n=t%100;return "["+t+(e[(n-20)%10]||e[n]||e[0])+"]"}},m=function(t,e,n){var r=String(t);return !r||r.length>=e?t:""+Array(e+1-r.length).join(n)+t},v={s:m,z:function(t){var e=-t.utcOffset(),n=Math.abs(e),r=Math.floor(n/60),i=n%60;return (e<=0?"+":"-")+m(r,2,"0")+":"+m(i,2,"0")},m:function t(e,n){if(e.date()<n.date())return -t(n,e);var r=12*(n.year()-e.year())+(n.month()-e.month()),i=e.clone().add(r,c),s=n-i<0,u=e.clone().add(r+(s?-1:1),c);return +(-(r+(n-i)/(s?i-u:u-i))||0)},a:function(t){return t<0?Math.ceil(t)||0:Math.floor(t)},p:function(t){return {M:c,y:h,w:o,d:a,D:d,h:u,m:s,s:i,ms:r,Q:f}[t]||String(t||"").toLowerCase().replace(/s$/,"")},u:function(t){return void 0===t}},g="en",D={};D[g]=M;var p="$isDayjsObject",S=function(t){return t instanceof _||!(!t||!t[p])},w=function t(e,n,r){var i;if(!e)return g;if("string"==typeof e){var s=e.toLowerCase();D[s]&&(i=s),n&&(D[s]=n,i=s);var u=e.split("-");if(!i&&u.length>1)return t(u[0])}else {var a=e.name;D[a]=e,i=a;}return !r&&i&&(g=i),i||!r&&g},O=function(t,e){if(S(t))return t.clone();var n="object"==typeof e?e:{};return n.date=t,n.args=arguments,new _(n)},b=v;b.l=w,b.i=S,b.w=function(t,e){return O(t,{locale:e.$L,utc:e.$u,x:e.$x,$offset:e.$offset})};var _=function(){function M(t){this.$L=w(t.locale,null,!0),this.parse(t),this.$x=this.$x||t.x||{},this[p]=!0;}var m=M.prototype;return m.parse=function(t){this.$d=function(t){var e=t.date,n=t.utc;if(null===e)return new Date(NaN);if(b.u(e))return new Date;if(e instanceof Date)return new Date(e);if("string"==typeof e&&!/Z$/i.test(e)){var r=e.match($);if(r){var i=r[2]-1||0,s=(r[7]||"0").substring(0,3);return n?new Date(Date.UTC(r[1],i,r[3]||1,r[4]||0,r[5]||0,r[6]||0,s)):new Date(r[1],i,r[3]||1,r[4]||0,r[5]||0,r[6]||0,s)}}return new Date(e)}(t),this.init();},m.init=function(){var t=this.$d;this.$y=t.getFullYear(),this.$M=t.getMonth(),this.$D=t.getDate(),this.$W=t.getDay(),this.$H=t.getHours(),this.$m=t.getMinutes(),this.$s=t.getSeconds(),this.$ms=t.getMilliseconds();},m.$utils=function(){return b},m.isValid=function(){return !(this.$d.toString()===l)},m.isSame=function(t,e){var n=O(t);return this.startOf(e)<=n&&n<=this.endOf(e)},m.isAfter=function(t,e){return O(t)<this.startOf(e)},m.isBefore=function(t,e){return this.endOf(e)<O(t)},m.$g=function(t,e,n){return b.u(t)?this[e]:this.set(n,t)},m.unix=function(){return Math.floor(this.valueOf()/1e3)},m.valueOf=function(){return this.$d.getTime()},m.startOf=function(t,e){var n=this,r=!!b.u(e)||e,f=b.p(t),l=function(t,e){var i=b.w(n.$u?Date.UTC(n.$y,e,t):new Date(n.$y,e,t),n);return r?i:i.endOf(a)},$=function(t,e){return b.w(n.toDate()[t].apply(n.toDate("s"),(r?[0,0,0,0]:[23,59,59,999]).slice(e)),n)},y=this.$W,M=this.$M,m=this.$D,v="set"+(this.$u?"UTC":"");switch(f){case h:return r?l(1,0):l(31,11);case c:return r?l(1,M):l(0,M+1);case o:var g=this.$locale().weekStart||0,D=(y<g?y+7:y)-g;return l(r?m-D:m+(6-D),M);case a:case d:return $(v+"Hours",0);case u:return $(v+"Minutes",1);case s:return $(v+"Seconds",2);case i:return $(v+"Milliseconds",3);default:return this.clone()}},m.endOf=function(t){return this.startOf(t,!1)},m.$set=function(t,e){var n,o=b.p(t),f="set"+(this.$u?"UTC":""),l=(n={},n[a]=f+"Date",n[d]=f+"Date",n[c]=f+"Month",n[h]=f+"FullYear",n[u]=f+"Hours",n[s]=f+"Minutes",n[i]=f+"Seconds",n[r]=f+"Milliseconds",n)[o],$=o===a?this.$D+(e-this.$W):e;if(o===c||o===h){var y=this.clone().set(d,1);y.$d[l]($),y.init(),this.$d=y.set(d,Math.min(this.$D,y.daysInMonth())).$d;}else l&&this.$d[l]($);return this.init(),this},m.set=function(t,e){return this.clone().$set(t,e)},m.get=function(t){return this[b.p(t)]()},m.add=function(r,f){var d,l=this;r=Number(r);var $=b.p(f),y=function(t){var e=O(l);return b.w(e.date(e.date()+Math.round(t*r)),l)};if($===c)return this.set(c,this.$M+r);if($===h)return this.set(h,this.$y+r);if($===a)return y(1);if($===o)return y(7);var M=(d={},d[s]=e,d[u]=n,d[i]=t,d)[$]||1,m=this.$d.getTime()+r*M;return b.w(m,this)},m.subtract=function(t,e){return this.add(-1*t,e)},m.format=function(t){var e=this,n=this.$locale();if(!this.isValid())return n.invalidDate||l;var r=t||"YYYY-MM-DDTHH:mm:ssZ",i=b.z(this),s=this.$H,u=this.$m,a=this.$M,o=n.weekdays,c=n.months,f=n.meridiem,h=function(t,n,i,s){return t&&(t[n]||t(e,r))||i[n].slice(0,s)},d=function(t){return b.s(s%12||12,t,"0")},$=f||function(t,e,n){var r=t<12?"AM":"PM";return n?r.toLowerCase():r};return r.replace(y,(function(t,r){return r||function(t){switch(t){case"YY":return String(e.$y).slice(-2);case"YYYY":return b.s(e.$y,4,"0");case"M":return a+1;case"MM":return b.s(a+1,2,"0");case"MMM":return h(n.monthsShort,a,c,3);case"MMMM":return h(c,a);case"D":return e.$D;case"DD":return b.s(e.$D,2,"0");case"d":return String(e.$W);case"dd":return h(n.weekdaysMin,e.$W,o,2);case"ddd":return h(n.weekdaysShort,e.$W,o,3);case"dddd":return o[e.$W];case"H":return String(s);case"HH":return b.s(s,2,"0");case"h":return d(1);case"hh":return d(2);case"a":return $(s,u,!0);case"A":return $(s,u,!1);case"m":return String(u);case"mm":return b.s(u,2,"0");case"s":return String(e.$s);case"ss":return b.s(e.$s,2,"0");case"SSS":return b.s(e.$ms,3,"0");case"Z":return i}return null}(t)||i.replace(":","")}))},m.utcOffset=function(){return 15*-Math.round(this.$d.getTimezoneOffset()/15)},m.diff=function(r,d,l){var $,y=this,M=b.p(d),m=O(r),v=(m.utcOffset()-this.utcOffset())*e,g=this-m,D=function(){return b.m(y,m)};switch(M){case h:$=D()/12;break;case c:$=D();break;case f:$=D()/3;break;case o:$=(g-v)/6048e5;break;case a:$=(g-v)/864e5;break;case u:$=g/n;break;case s:$=g/e;break;case i:$=g/t;break;default:$=g;}return l?$:b.a($)},m.daysInMonth=function(){return this.endOf(c).$D},m.$locale=function(){return D[this.$L]},m.locale=function(t,e){if(!t)return this.$L;var n=this.clone(),r=w(t,e,!0);return r&&(n.$L=r),n},m.clone=function(){return b.w(this.$d,this)},m.toDate=function(){return new Date(this.valueOf())},m.toJSON=function(){return this.isValid()?this.toISOString():null},m.toISOString=function(){return this.$d.toISOString()},m.toString=function(){return this.$d.toUTCString()},M}(),k=_.prototype;return O.prototype=k,[["$ms",r],["$s",i],["$m",s],["$H",u],["$W",a],["$M",c],["$y",h],["$D",d]].forEach((function(t){k[t[1]]=function(e){return this.$g(e,t[0],t[1])};})),O.extend=function(t,e){return t.$i||(t(e,_,O),t.$i=!0),O},O.locale=w,O.isDayjs=S,O.unix=function(t){return O(1e3*t)},O.en=D[g],O.Ls=D,O.p={},O}));
|
|
253
169
|
} (dayjs_min, dayjs_min.exports));
|
|
254
170
|
|
|
255
171
|
var dayjs_minExports = dayjs_min.exports;
|
|
@@ -268,10 +184,10 @@ var ActionDropdown = function ActionDropdown(_ref) {
|
|
|
268
184
|
strategy: "fixed"
|
|
269
185
|
}, /*#__PURE__*/React.createElement(Menu, null, /*#__PURE__*/React.createElement(MenuItem.Button, {
|
|
270
186
|
onClick: handleEdit
|
|
271
|
-
}, t("buttons.edit")), /*#__PURE__*/React.createElement(MenuItem.Button, {
|
|
187
|
+
}, t("neetoApiKeys.buttons.edit")), /*#__PURE__*/React.createElement(MenuItem.Button, {
|
|
272
188
|
style: "danger",
|
|
273
189
|
onClick: handleDelete
|
|
274
|
-
}, t("buttons.delete"))));
|
|
190
|
+
}, t("neetoApiKeys.buttons.delete"))));
|
|
275
191
|
};
|
|
276
192
|
|
|
277
193
|
var isInPast = function isInPast(date) {
|
|
@@ -287,12 +203,12 @@ var buildColumnData = function buildColumnData(_ref) {
|
|
|
287
203
|
var _handleDelete = _ref.handleDelete,
|
|
288
204
|
_handleEdit = _ref.handleEdit;
|
|
289
205
|
return [{
|
|
290
|
-
title: t("table.headers.label"),
|
|
206
|
+
title: t("neetoApiKeys.table.headers.label"),
|
|
291
207
|
key: "label",
|
|
292
208
|
dataIndex: "label",
|
|
293
209
|
width: "20%"
|
|
294
210
|
}, {
|
|
295
|
-
title: t("table.headers.token"),
|
|
211
|
+
title: t("neetoApiKeys.table.headers.token"),
|
|
296
212
|
key: "token",
|
|
297
213
|
dataIndex: "token",
|
|
298
214
|
width: "30%",
|
|
@@ -306,49 +222,49 @@ var buildColumnData = function buildColumnData(_ref) {
|
|
|
306
222
|
iconsSize: 28,
|
|
307
223
|
style: "text",
|
|
308
224
|
tooltipProps: {
|
|
309
|
-
content: t("tooltips.copyToClipboard", {
|
|
225
|
+
content: t("neetoApiKeys.tooltips.copyToClipboard", {
|
|
310
226
|
token: token
|
|
311
227
|
}),
|
|
312
228
|
position: "top"
|
|
313
229
|
},
|
|
314
230
|
onClick: function onClick() {
|
|
315
231
|
return copyToClipboard(token, {
|
|
316
|
-
message: t("notifications.copiedToClipboard")
|
|
232
|
+
message: t("neetoApiKeys.notifications.copiedToClipboard")
|
|
317
233
|
});
|
|
318
234
|
}
|
|
319
235
|
}));
|
|
320
236
|
}
|
|
321
237
|
}, {
|
|
322
|
-
title: t("table.headers.status"),
|
|
238
|
+
title: t("neetoApiKeys.table.headers.status"),
|
|
323
239
|
key: "status",
|
|
324
240
|
width: "15%",
|
|
325
241
|
render: function render(_, _ref2) {
|
|
326
242
|
var expiresAt = _ref2.expiresAt;
|
|
327
243
|
return isPresent(expiresAt) && isInPast(expiresAt) ? /*#__PURE__*/React.createElement(Tag, {
|
|
328
244
|
style: "warning"
|
|
329
|
-
}, t("tags.expired")) : /*#__PURE__*/React.createElement(Tag, {
|
|
245
|
+
}, t("neetoApiKeys.tags.expired")) : /*#__PURE__*/React.createElement(Tag, {
|
|
330
246
|
style: "success"
|
|
331
|
-
}, t("tags.active"));
|
|
247
|
+
}, t("neetoApiKeys.tags.active"));
|
|
332
248
|
}
|
|
333
249
|
}, {
|
|
334
|
-
title: t("table.headers.expiresAt"),
|
|
250
|
+
title: t("neetoApiKeys.table.headers.expiresAt"),
|
|
335
251
|
key: "expiresAt",
|
|
336
252
|
dataIndex: "expiresAt",
|
|
337
253
|
width: "15%",
|
|
338
254
|
render: function render(expiresAt) {
|
|
339
255
|
return isPresent(expiresAt) ? formatExpiry(expiresAt) : /*#__PURE__*/React.createElement(Typography, {
|
|
340
256
|
style: "body2"
|
|
341
|
-
}, t("common.never"));
|
|
257
|
+
}, t("neetoApiKeys.common.never"));
|
|
342
258
|
}
|
|
343
259
|
}, {
|
|
344
|
-
title: t("table.headers.createdAt"),
|
|
260
|
+
title: t("neetoApiKeys.table.headers.createdAt"),
|
|
345
261
|
key: "createdAt",
|
|
346
262
|
dataIndex: "createdAt",
|
|
347
263
|
width: "15%",
|
|
348
264
|
render: function render(createdAt) {
|
|
349
265
|
return isPresent(createdAt) ? dateFormat.dateTime(createdAt) : /*#__PURE__*/React.createElement(Typography, {
|
|
350
266
|
style: "body2"
|
|
351
|
-
}, t("common.never"));
|
|
267
|
+
}, t("neetoApiKeys.common.never"));
|
|
352
268
|
}
|
|
353
269
|
}, {
|
|
354
270
|
key: "opitons",
|
|
@@ -412,14 +328,14 @@ var INITIAL_VALUES = {
|
|
|
412
328
|
var NEXT_DAY = dayjs().add(1, "day").startOf("day");
|
|
413
329
|
var VALIDATION_SCHEMA = yup.object({
|
|
414
330
|
expiresAt: yup.date().when("hasNoExpiry", function (hasNoExpiry, field) {
|
|
415
|
-
return hasNoExpiry ? field.nullable() : field.nullable().required(t("validations.required", {
|
|
416
|
-
entity: t("fields.expiryDate")
|
|
417
|
-
})).min(NEXT_DAY, t("validations.expiry", {
|
|
331
|
+
return hasNoExpiry ? field.nullable() : field.nullable().required(t("neetoApiKeys.validations.required", {
|
|
332
|
+
entity: t("neetoApiKeys.fields.expiryDate")
|
|
333
|
+
})).min(NEXT_DAY, t("neetoApiKeys.validations.expiry", {
|
|
418
334
|
date: dateFormat.date(NEXT_DAY)
|
|
419
335
|
}));
|
|
420
336
|
}),
|
|
421
|
-
label: yup.string().required(t("validations.required", {
|
|
422
|
-
entity: t("fields.label")
|
|
337
|
+
label: yup.string().required(t("neetoApiKeys.validations.required", {
|
|
338
|
+
entity: t("neetoApiKeys.fields.label")
|
|
423
339
|
}))
|
|
424
340
|
});
|
|
425
341
|
var DEFAULT_PAGE_SIZE = 15;
|
|
@@ -450,9 +366,9 @@ var Form = function Form(_ref) {
|
|
|
450
366
|
className: "w-full space-y-4"
|
|
451
367
|
}, /*#__PURE__*/React.createElement(Input, {
|
|
452
368
|
autoFocus: true,
|
|
453
|
-
label: t("fields.label"),
|
|
369
|
+
label: t("neetoApiKeys.fields.label"),
|
|
454
370
|
name: "label",
|
|
455
|
-
placeholder: t("placeholders.label"),
|
|
371
|
+
placeholder: t("neetoApiKeys.placeholders.label"),
|
|
456
372
|
ref: initialFocusRef,
|
|
457
373
|
size: "large"
|
|
458
374
|
}), /*#__PURE__*/React.createElement("div", {
|
|
@@ -462,12 +378,12 @@ var Form = function Form(_ref) {
|
|
|
462
378
|
disabledDate: function disabledDate(date) {
|
|
463
379
|
return date < NEXT_DAY;
|
|
464
380
|
},
|
|
465
|
-
label: t("fields.expiryDate"),
|
|
381
|
+
label: t("neetoApiKeys.fields.expiryDate"),
|
|
466
382
|
name: "expiresAt",
|
|
467
|
-
placeholder: t("placeholders.selectExpiryDate")
|
|
383
|
+
placeholder: t("neetoApiKeys.placeholders.selectExpiryDate")
|
|
468
384
|
}), /*#__PURE__*/React.createElement(Checkbox, {
|
|
469
385
|
checked: hasNoExpiry,
|
|
470
|
-
label: t("fields.neverExpire"),
|
|
386
|
+
label: t("neetoApiKeys.fields.neverExpire"),
|
|
471
387
|
name: "hasNoExpiry",
|
|
472
388
|
onChange: function onChange() {
|
|
473
389
|
setFieldValue("expiresAt", null);
|
|
@@ -477,12 +393,12 @@ var Form = function Form(_ref) {
|
|
|
477
393
|
className: "space-x-2",
|
|
478
394
|
cancelButtonProps: {
|
|
479
395
|
onClick: onClose,
|
|
480
|
-
label: t("buttons.cancel")
|
|
396
|
+
label: t("neetoApiKeys.buttons.cancel")
|
|
481
397
|
},
|
|
482
398
|
submitButtonProps: {
|
|
483
399
|
disabled: isSubmitting || !dirty,
|
|
484
400
|
loading: isSubmitting,
|
|
485
|
-
label: t("buttons.submit")
|
|
401
|
+
label: t("neetoApiKeys.buttons.submit")
|
|
486
402
|
}
|
|
487
403
|
})));
|
|
488
404
|
});
|
|
@@ -503,7 +419,7 @@ var Create = function Create(_ref) {
|
|
|
503
419
|
isOpen: isOpen
|
|
504
420
|
}, /*#__PURE__*/React.createElement(Pane.Header, null, /*#__PURE__*/React.createElement(Typography, {
|
|
505
421
|
style: "h2"
|
|
506
|
-
}, t("headers.createApiKey"))), /*#__PURE__*/React.createElement(Form, {
|
|
422
|
+
}, t("neetoApiKeys.headers.createApiKey"))), /*#__PURE__*/React.createElement(Form, {
|
|
507
423
|
initialFocusRef: initialFocusRef,
|
|
508
424
|
onClose: onClose,
|
|
509
425
|
isSubmitting: isCreating,
|
|
@@ -578,7 +494,7 @@ var Update = function Update(_ref) {
|
|
|
578
494
|
isOpen: isNotEmpty(apiKey)
|
|
579
495
|
}, /*#__PURE__*/React.createElement(Pane.Header, null, /*#__PURE__*/React.createElement(Typography, {
|
|
580
496
|
style: "h2"
|
|
581
|
-
}, t("headers.updateApiKey"))), /*#__PURE__*/React.createElement(Form, {
|
|
497
|
+
}, t("neetoApiKeys.headers.updateApiKey"))), /*#__PURE__*/React.createElement(Form, {
|
|
582
498
|
initialValues: initialValues,
|
|
583
499
|
onClose: onClose,
|
|
584
500
|
initialFocusRef: initialFocusRef,
|
|
@@ -657,7 +573,7 @@ var Table = function Table(_ref) {
|
|
|
657
573
|
var queryParams = {
|
|
658
574
|
searchTerm: debouncedSearchTerm,
|
|
659
575
|
page: currentPage,
|
|
660
|
-
|
|
576
|
+
pageSize: DEFAULT_PAGE_SIZE
|
|
661
577
|
};
|
|
662
578
|
var _useFetchApiKeys = useFetchApiKeys({
|
|
663
579
|
params: queryParams,
|
|
@@ -678,7 +594,7 @@ var Table = function Table(_ref) {
|
|
|
678
594
|
className: "flex h-full w-full items-center justify-center"
|
|
679
595
|
}, /*#__PURE__*/React.createElement(NoData, _extends({
|
|
680
596
|
className: "w-full",
|
|
681
|
-
title: t("noData.title")
|
|
597
|
+
title: t("neetoApiKeys.noData.title")
|
|
682
598
|
}, noDataProps)), ";");
|
|
683
599
|
}
|
|
684
600
|
return /*#__PURE__*/React.createElement(TableWrapper, {
|
|
@@ -727,9 +643,9 @@ var ApiKeys = function ApiKeys(_ref) {
|
|
|
727
643
|
return /*#__PURE__*/React.createElement("div", {
|
|
728
644
|
className: "flex h-full w-full flex-col"
|
|
729
645
|
}, /*#__PURE__*/React.createElement(Header, _extends({
|
|
730
|
-
title: t("common.apiKey", PLURAL),
|
|
646
|
+
title: t("neetoApiKeys.common.apiKey", PLURAL),
|
|
731
647
|
actionBlock: /*#__PURE__*/React.createElement(Button, {
|
|
732
|
-
label: t("buttons.addApiKey"),
|
|
648
|
+
label: t("neetoApiKeys.buttons.addApiKey"),
|
|
733
649
|
onClick: function onClick() {
|
|
734
650
|
return setIsCreatePaneOpen(true);
|
|
735
651
|
}
|
|
@@ -740,7 +656,7 @@ var ApiKeys = function ApiKeys(_ref) {
|
|
|
740
656
|
var value = _ref2.target.value;
|
|
741
657
|
return setSearchTerm(value);
|
|
742
658
|
},
|
|
743
|
-
placeholder: t("placeholders.search")
|
|
659
|
+
placeholder: t("neetoApiKeys.placeholders.search")
|
|
744
660
|
}
|
|
745
661
|
}, headerProps)), /*#__PURE__*/React.createElement(Table, {
|
|
746
662
|
handleDelete: setApiKeyToBeDeleted,
|
|
@@ -750,13 +666,13 @@ var ApiKeys = function ApiKeys(_ref) {
|
|
|
750
666
|
}), /*#__PURE__*/React.createElement(Alert, {
|
|
751
667
|
isOpen: isNotEmpty(apiKeyToBeDeleted),
|
|
752
668
|
isSubmitting: isDeleting,
|
|
753
|
-
submitButtonLabel: t("buttons.delete"),
|
|
754
|
-
title: t("alert.titles.deleteApiKey"),
|
|
669
|
+
submitButtonLabel: t("neetoApiKeys.buttons.delete"),
|
|
670
|
+
title: t("neetoApiKeys.alert.titles.deleteApiKey"),
|
|
755
671
|
message: /*#__PURE__*/React.createElement(Trans, {
|
|
756
672
|
components: {
|
|
757
673
|
bold: /*#__PURE__*/React.createElement("strong", null)
|
|
758
674
|
},
|
|
759
|
-
i18nKey: "alert.descriptions.deleteApiKey",
|
|
675
|
+
i18nKey: "neetoApiKeys.alert.descriptions.deleteApiKey",
|
|
760
676
|
values: {
|
|
761
677
|
name: apiKeyToBeDeleted.label
|
|
762
678
|
}
|
|
@@ -779,7 +695,7 @@ var ApiKeys = function ApiKeys(_ref) {
|
|
|
779
695
|
}
|
|
780
696
|
}));
|
|
781
697
|
};
|
|
782
|
-
var index = withTitle(ApiKeys, t("common.apiKey", PLURAL));
|
|
698
|
+
var index = withTitle(ApiKeys, t("neetoApiKeys.common.apiKey", PLURAL));
|
|
783
699
|
|
|
784
700
|
export { index as ApiKeys };
|
|
785
701
|
//# sourceMappingURL=index.js.map
|