@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
|
@@ -0,0 +1,64 @@
|
|
|
1
|
+
{
|
|
2
|
+
"neetoApiKeys": {
|
|
3
|
+
"common": {
|
|
4
|
+
"apiKey_one": "API key",
|
|
5
|
+
"apiKey_other": "API keys",
|
|
6
|
+
"never": "Never"
|
|
7
|
+
},
|
|
8
|
+
"headers": {
|
|
9
|
+
"createApiKey": "Create API key",
|
|
10
|
+
"updateApiKey": "Update API key"
|
|
11
|
+
},
|
|
12
|
+
"noData": {
|
|
13
|
+
"title": "There are no API Keys"
|
|
14
|
+
},
|
|
15
|
+
"alert": {
|
|
16
|
+
"titles": {
|
|
17
|
+
"deleteApiKey": "Delete API key?"
|
|
18
|
+
},
|
|
19
|
+
"descriptions": {
|
|
20
|
+
"deleteApiKey": "You are deleting the API key named <strong>{{name}}</strong>. This cannot be undone."
|
|
21
|
+
}
|
|
22
|
+
},
|
|
23
|
+
"buttons": {
|
|
24
|
+
"delete": "Delete",
|
|
25
|
+
"addApiKey": "Add API key",
|
|
26
|
+
"edit": "Edit",
|
|
27
|
+
"submit": "Submit",
|
|
28
|
+
"cancel": "Cancel"
|
|
29
|
+
},
|
|
30
|
+
"placeholders": {
|
|
31
|
+
"search": "Search API keys",
|
|
32
|
+
"selectExpiryDate": "Select an expiry date",
|
|
33
|
+
"label": "Add a label for the API key"
|
|
34
|
+
},
|
|
35
|
+
"notifications": {
|
|
36
|
+
"copiedToClipboard": "API key has been copied to clipboard"
|
|
37
|
+
},
|
|
38
|
+
"tooltips": {
|
|
39
|
+
"copyToClipboard": "Copy to clipboard"
|
|
40
|
+
},
|
|
41
|
+
"table": {
|
|
42
|
+
"headers": {
|
|
43
|
+
"label": "Label",
|
|
44
|
+
"token": "Token",
|
|
45
|
+
"expiresAt": "Expires at",
|
|
46
|
+
"createdAt": "Created at",
|
|
47
|
+
"status": "Status"
|
|
48
|
+
}
|
|
49
|
+
},
|
|
50
|
+
"fields": {
|
|
51
|
+
"label": "Label",
|
|
52
|
+
"expiryDate": "Expiry date",
|
|
53
|
+
"neverExpire": "Never expire"
|
|
54
|
+
},
|
|
55
|
+
"validations": {
|
|
56
|
+
"expiry": "$t(neetoApiKeys.fields.expiryDate) should be at least {{date}}",
|
|
57
|
+
"required": "{{entity}} is required"
|
|
58
|
+
},
|
|
59
|
+
"tags": {
|
|
60
|
+
"expired": "Expired",
|
|
61
|
+
"active": "Active"
|
|
62
|
+
}
|
|
63
|
+
}
|
|
64
|
+
}
|
package/dist/index.cjs.js
CHANGED
|
@@ -2,14 +2,14 @@
|
|
|
2
2
|
|
|
3
3
|
Object.defineProperty(exports, '__esModule', { value: true });
|
|
4
4
|
|
|
5
|
-
var i18n = require('i18next');
|
|
6
|
-
var reactI18next = require('react-i18next');
|
|
7
5
|
var React = require('react');
|
|
6
|
+
var i18next = require('i18next');
|
|
8
7
|
var constants = require('@bigbinary/neeto-commons-frontend/constants');
|
|
9
|
-
var
|
|
8
|
+
var neetoCist = require('@bigbinary/neeto-cist');
|
|
10
9
|
var reactUtils = require('@bigbinary/neeto-commons-frontend/react-utils');
|
|
11
10
|
var Header = require('@bigbinary/neeto-molecules/Header');
|
|
12
11
|
var neetoui = require('@bigbinary/neetoui');
|
|
12
|
+
var reactI18next = require('react-i18next');
|
|
13
13
|
var reactQuery = require('react-query');
|
|
14
14
|
var axios = require('axios');
|
|
15
15
|
var formik$1 = require('@bigbinary/neetoui/formik');
|
|
@@ -42,7 +42,6 @@ function _interopNamespace(e) {
|
|
|
42
42
|
return Object.freeze(n);
|
|
43
43
|
}
|
|
44
44
|
|
|
45
|
-
var i18n__default = /*#__PURE__*/_interopDefaultLegacy(i18n);
|
|
46
45
|
var React__default = /*#__PURE__*/_interopDefaultLegacy(React);
|
|
47
46
|
var Header__default = /*#__PURE__*/_interopDefaultLegacy(Header);
|
|
48
47
|
var axios__default = /*#__PURE__*/_interopDefaultLegacy(axios);
|
|
@@ -50,90 +49,6 @@ var yup__namespace = /*#__PURE__*/_interopNamespace(yup);
|
|
|
50
49
|
var PageLoader__default = /*#__PURE__*/_interopDefaultLegacy(PageLoader);
|
|
51
50
|
var TableWrapper__default = /*#__PURE__*/_interopDefaultLegacy(TableWrapper);
|
|
52
51
|
|
|
53
|
-
var common = {
|
|
54
|
-
apiKey_one: "API key",
|
|
55
|
-
apiKey_other: "API keys",
|
|
56
|
-
never: "Never"
|
|
57
|
-
};
|
|
58
|
-
var headers = {
|
|
59
|
-
createApiKey: "Create API key",
|
|
60
|
-
updateApiKey: "Update API key"
|
|
61
|
-
};
|
|
62
|
-
var noData = {
|
|
63
|
-
title: "There are no API Keys"
|
|
64
|
-
};
|
|
65
|
-
var alert = {
|
|
66
|
-
titles: {
|
|
67
|
-
deleteApiKey: "Delete API key?"
|
|
68
|
-
},
|
|
69
|
-
descriptions: {
|
|
70
|
-
deleteApiKey: "You are deleting the API key named <strong>{{name}}</strong>. This cannot be undone."
|
|
71
|
-
}
|
|
72
|
-
};
|
|
73
|
-
var buttons = {
|
|
74
|
-
"delete": "Delete",
|
|
75
|
-
addApiKey: "Add API key",
|
|
76
|
-
edit: "Edit",
|
|
77
|
-
submit: "Submit",
|
|
78
|
-
cancel: "Cancel"
|
|
79
|
-
};
|
|
80
|
-
var placeholders = {
|
|
81
|
-
search: "Search API keys",
|
|
82
|
-
selectExpiryDate: "Select an expiry date",
|
|
83
|
-
label: "Add a label for the API key"
|
|
84
|
-
};
|
|
85
|
-
var notifications = {
|
|
86
|
-
copiedToClipboard: "API key has been copied to clipboard"
|
|
87
|
-
};
|
|
88
|
-
var tooltips = {
|
|
89
|
-
copyToClipboard: "Copy to clipboard"
|
|
90
|
-
};
|
|
91
|
-
var table = {
|
|
92
|
-
headers: {
|
|
93
|
-
label: "Label",
|
|
94
|
-
token: "Token",
|
|
95
|
-
expiresAt: "Expires at",
|
|
96
|
-
createdAt: "Created at",
|
|
97
|
-
status: "Status"
|
|
98
|
-
}
|
|
99
|
-
};
|
|
100
|
-
var fields = {
|
|
101
|
-
label: "Label",
|
|
102
|
-
expiryDate: "Expiry date",
|
|
103
|
-
neverExpire: "Never expire"
|
|
104
|
-
};
|
|
105
|
-
var validations = {
|
|
106
|
-
expiry: "$t(fields.expiryDate) should be at least {{date}}",
|
|
107
|
-
required: "{{entity}} is required"
|
|
108
|
-
};
|
|
109
|
-
var tags = {
|
|
110
|
-
expired: "Expired",
|
|
111
|
-
active: "Active"
|
|
112
|
-
};
|
|
113
|
-
var en = {
|
|
114
|
-
common: common,
|
|
115
|
-
headers: headers,
|
|
116
|
-
noData: noData,
|
|
117
|
-
alert: alert,
|
|
118
|
-
buttons: buttons,
|
|
119
|
-
placeholders: placeholders,
|
|
120
|
-
notifications: notifications,
|
|
121
|
-
tooltips: tooltips,
|
|
122
|
-
table: table,
|
|
123
|
-
fields: fields,
|
|
124
|
-
validations: validations,
|
|
125
|
-
tags: tags
|
|
126
|
-
};
|
|
127
|
-
|
|
128
|
-
i18n__default["default"].use(reactI18next.initReactI18next).init({
|
|
129
|
-
resources: {
|
|
130
|
-
en: {
|
|
131
|
-
translation: en
|
|
132
|
-
}
|
|
133
|
-
},
|
|
134
|
-
fallbackLng: "en"
|
|
135
|
-
});
|
|
136
|
-
|
|
137
52
|
function _extends() {
|
|
138
53
|
_extends = Object.assign ? Object.assign.bind() : function (target) {
|
|
139
54
|
for (var i = 1; i < arguments.length; i++) {
|
|
@@ -281,7 +196,7 @@ var dayjs_min = {exports: {}};
|
|
|
281
196
|
dayjs_min.exports;
|
|
282
197
|
|
|
283
198
|
(function (module, exports) {
|
|
284
|
-
!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
|
|
199
|
+
!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}));
|
|
285
200
|
} (dayjs_min, dayjs_min.exports));
|
|
286
201
|
|
|
287
202
|
var dayjs_minExports = dayjs_min.exports;
|
|
@@ -300,10 +215,10 @@ var ActionDropdown = function ActionDropdown(_ref) {
|
|
|
300
215
|
strategy: "fixed"
|
|
301
216
|
}, /*#__PURE__*/React__default["default"].createElement(Menu, null, /*#__PURE__*/React__default["default"].createElement(MenuItem.Button, {
|
|
302
217
|
onClick: handleEdit
|
|
303
|
-
}, t("buttons.edit")), /*#__PURE__*/React__default["default"].createElement(MenuItem.Button, {
|
|
218
|
+
}, t("neetoApiKeys.buttons.edit")), /*#__PURE__*/React__default["default"].createElement(MenuItem.Button, {
|
|
304
219
|
style: "danger",
|
|
305
220
|
onClick: handleDelete
|
|
306
|
-
}, t("buttons.delete"))));
|
|
221
|
+
}, t("neetoApiKeys.buttons.delete"))));
|
|
307
222
|
};
|
|
308
223
|
|
|
309
224
|
var isInPast = function isInPast(date) {
|
|
@@ -319,12 +234,12 @@ var buildColumnData = function buildColumnData(_ref) {
|
|
|
319
234
|
var _handleDelete = _ref.handleDelete,
|
|
320
235
|
_handleEdit = _ref.handleEdit;
|
|
321
236
|
return [{
|
|
322
|
-
title:
|
|
237
|
+
title: i18next.t("neetoApiKeys.table.headers.label"),
|
|
323
238
|
key: "label",
|
|
324
239
|
dataIndex: "label",
|
|
325
240
|
width: "20%"
|
|
326
241
|
}, {
|
|
327
|
-
title:
|
|
242
|
+
title: i18next.t("neetoApiKeys.table.headers.token"),
|
|
328
243
|
key: "token",
|
|
329
244
|
dataIndex: "token",
|
|
330
245
|
width: "30%",
|
|
@@ -338,49 +253,49 @@ var buildColumnData = function buildColumnData(_ref) {
|
|
|
338
253
|
iconsSize: 28,
|
|
339
254
|
style: "text",
|
|
340
255
|
tooltipProps: {
|
|
341
|
-
content:
|
|
256
|
+
content: i18next.t("neetoApiKeys.tooltips.copyToClipboard", {
|
|
342
257
|
token: token
|
|
343
258
|
}),
|
|
344
259
|
position: "top"
|
|
345
260
|
},
|
|
346
261
|
onClick: function onClick() {
|
|
347
262
|
return utils.copyToClipboard(token, {
|
|
348
|
-
message:
|
|
263
|
+
message: i18next.t("neetoApiKeys.notifications.copiedToClipboard")
|
|
349
264
|
});
|
|
350
265
|
}
|
|
351
266
|
}));
|
|
352
267
|
}
|
|
353
268
|
}, {
|
|
354
|
-
title:
|
|
269
|
+
title: i18next.t("neetoApiKeys.table.headers.status"),
|
|
355
270
|
key: "status",
|
|
356
271
|
width: "15%",
|
|
357
272
|
render: function render(_, _ref2) {
|
|
358
273
|
var expiresAt = _ref2.expiresAt;
|
|
359
|
-
return
|
|
274
|
+
return neetoCist.isPresent(expiresAt) && isInPast(expiresAt) ? /*#__PURE__*/React__default["default"].createElement(neetoui.Tag, {
|
|
360
275
|
style: "warning"
|
|
361
|
-
},
|
|
276
|
+
}, i18next.t("neetoApiKeys.tags.expired")) : /*#__PURE__*/React__default["default"].createElement(neetoui.Tag, {
|
|
362
277
|
style: "success"
|
|
363
|
-
},
|
|
278
|
+
}, i18next.t("neetoApiKeys.tags.active"));
|
|
364
279
|
}
|
|
365
280
|
}, {
|
|
366
|
-
title:
|
|
281
|
+
title: i18next.t("neetoApiKeys.table.headers.expiresAt"),
|
|
367
282
|
key: "expiresAt",
|
|
368
283
|
dataIndex: "expiresAt",
|
|
369
284
|
width: "15%",
|
|
370
285
|
render: function render(expiresAt) {
|
|
371
|
-
return
|
|
286
|
+
return neetoCist.isPresent(expiresAt) ? formatExpiry(expiresAt) : /*#__PURE__*/React__default["default"].createElement(neetoui.Typography, {
|
|
372
287
|
style: "body2"
|
|
373
|
-
},
|
|
288
|
+
}, i18next.t("neetoApiKeys.common.never"));
|
|
374
289
|
}
|
|
375
290
|
}, {
|
|
376
|
-
title:
|
|
291
|
+
title: i18next.t("neetoApiKeys.table.headers.createdAt"),
|
|
377
292
|
key: "createdAt",
|
|
378
293
|
dataIndex: "createdAt",
|
|
379
294
|
width: "15%",
|
|
380
295
|
render: function render(createdAt) {
|
|
381
|
-
return
|
|
296
|
+
return neetoCist.isPresent(createdAt) ? utils.dateFormat.dateTime(createdAt) : /*#__PURE__*/React__default["default"].createElement(neetoui.Typography, {
|
|
382
297
|
style: "body2"
|
|
383
|
-
},
|
|
298
|
+
}, i18next.t("neetoApiKeys.common.never"));
|
|
384
299
|
}
|
|
385
300
|
}, {
|
|
386
301
|
key: "opitons",
|
|
@@ -444,14 +359,14 @@ var INITIAL_VALUES = {
|
|
|
444
359
|
var NEXT_DAY = dayjs().add(1, "day").startOf("day");
|
|
445
360
|
var VALIDATION_SCHEMA = yup__namespace.object({
|
|
446
361
|
expiresAt: yup__namespace.date().when("hasNoExpiry", function (hasNoExpiry, field) {
|
|
447
|
-
return hasNoExpiry ? field.nullable() : field.nullable().required(
|
|
448
|
-
entity:
|
|
449
|
-
})).min(NEXT_DAY,
|
|
362
|
+
return hasNoExpiry ? field.nullable() : field.nullable().required(i18next.t("neetoApiKeys.validations.required", {
|
|
363
|
+
entity: i18next.t("neetoApiKeys.fields.expiryDate")
|
|
364
|
+
})).min(NEXT_DAY, i18next.t("neetoApiKeys.validations.expiry", {
|
|
450
365
|
date: utils.dateFormat.date(NEXT_DAY)
|
|
451
366
|
}));
|
|
452
367
|
}),
|
|
453
|
-
label: yup__namespace.string().required(
|
|
454
|
-
entity:
|
|
368
|
+
label: yup__namespace.string().required(i18next.t("neetoApiKeys.validations.required", {
|
|
369
|
+
entity: i18next.t("neetoApiKeys.fields.label")
|
|
455
370
|
}))
|
|
456
371
|
});
|
|
457
372
|
var DEFAULT_PAGE_SIZE = 15;
|
|
@@ -482,9 +397,9 @@ var Form = function Form(_ref) {
|
|
|
482
397
|
className: "w-full space-y-4"
|
|
483
398
|
}, /*#__PURE__*/React__default["default"].createElement(formik$1.Input, {
|
|
484
399
|
autoFocus: true,
|
|
485
|
-
label: t("fields.label"),
|
|
400
|
+
label: t("neetoApiKeys.fields.label"),
|
|
486
401
|
name: "label",
|
|
487
|
-
placeholder: t("placeholders.label"),
|
|
402
|
+
placeholder: t("neetoApiKeys.placeholders.label"),
|
|
488
403
|
ref: initialFocusRef,
|
|
489
404
|
size: "large"
|
|
490
405
|
}), /*#__PURE__*/React__default["default"].createElement("div", {
|
|
@@ -494,12 +409,12 @@ var Form = function Form(_ref) {
|
|
|
494
409
|
disabledDate: function disabledDate(date) {
|
|
495
410
|
return date < NEXT_DAY;
|
|
496
411
|
},
|
|
497
|
-
label: t("fields.expiryDate"),
|
|
412
|
+
label: t("neetoApiKeys.fields.expiryDate"),
|
|
498
413
|
name: "expiresAt",
|
|
499
|
-
placeholder: t("placeholders.selectExpiryDate")
|
|
414
|
+
placeholder: t("neetoApiKeys.placeholders.selectExpiryDate")
|
|
500
415
|
}), /*#__PURE__*/React__default["default"].createElement(formik$1.Checkbox, {
|
|
501
416
|
checked: hasNoExpiry,
|
|
502
|
-
label: t("fields.neverExpire"),
|
|
417
|
+
label: t("neetoApiKeys.fields.neverExpire"),
|
|
503
418
|
name: "hasNoExpiry",
|
|
504
419
|
onChange: function onChange() {
|
|
505
420
|
setFieldValue("expiresAt", null);
|
|
@@ -509,12 +424,12 @@ var Form = function Form(_ref) {
|
|
|
509
424
|
className: "space-x-2",
|
|
510
425
|
cancelButtonProps: {
|
|
511
426
|
onClick: onClose,
|
|
512
|
-
label: t("buttons.cancel")
|
|
427
|
+
label: t("neetoApiKeys.buttons.cancel")
|
|
513
428
|
},
|
|
514
429
|
submitButtonProps: {
|
|
515
430
|
disabled: isSubmitting || !dirty,
|
|
516
431
|
loading: isSubmitting,
|
|
517
|
-
label: t("buttons.submit")
|
|
432
|
+
label: t("neetoApiKeys.buttons.submit")
|
|
518
433
|
}
|
|
519
434
|
})));
|
|
520
435
|
});
|
|
@@ -535,7 +450,7 @@ var Create = function Create(_ref) {
|
|
|
535
450
|
isOpen: isOpen
|
|
536
451
|
}, /*#__PURE__*/React__default["default"].createElement(neetoui.Pane.Header, null, /*#__PURE__*/React__default["default"].createElement(neetoui.Typography, {
|
|
537
452
|
style: "h2"
|
|
538
|
-
}, t("headers.createApiKey"))), /*#__PURE__*/React__default["default"].createElement(Form, {
|
|
453
|
+
}, t("neetoApiKeys.headers.createApiKey"))), /*#__PURE__*/React__default["default"].createElement(Form, {
|
|
539
454
|
initialFocusRef: initialFocusRef,
|
|
540
455
|
onClose: onClose,
|
|
541
456
|
isSubmitting: isCreating,
|
|
@@ -602,15 +517,15 @@ var Update = function Update(_ref) {
|
|
|
602
517
|
});
|
|
603
518
|
};
|
|
604
519
|
var initialValues = _objectSpread(_objectSpread({}, apiKey), {}, {
|
|
605
|
-
hasNoExpiry:
|
|
520
|
+
hasNoExpiry: neetoCist.isNotPresent(apiKey.expiresAt)
|
|
606
521
|
});
|
|
607
522
|
return /*#__PURE__*/React__default["default"].createElement(neetoui.Pane, {
|
|
608
523
|
initialFocusRef: initialFocusRef,
|
|
609
524
|
onClose: onClose,
|
|
610
|
-
isOpen:
|
|
525
|
+
isOpen: neetoCist.isNotEmpty(apiKey)
|
|
611
526
|
}, /*#__PURE__*/React__default["default"].createElement(neetoui.Pane.Header, null, /*#__PURE__*/React__default["default"].createElement(neetoui.Typography, {
|
|
612
527
|
style: "h2"
|
|
613
|
-
}, t("headers.updateApiKey"))), /*#__PURE__*/React__default["default"].createElement(Form, {
|
|
528
|
+
}, t("neetoApiKeys.headers.updateApiKey"))), /*#__PURE__*/React__default["default"].createElement(Form, {
|
|
614
529
|
initialValues: initialValues,
|
|
615
530
|
onClose: onClose,
|
|
616
531
|
initialFocusRef: initialFocusRef,
|
|
@@ -646,7 +561,7 @@ var usePagination = function usePagination(_ref) {
|
|
|
646
561
|
handlePageChange(getPageFromSearchParams());
|
|
647
562
|
}, []);
|
|
648
563
|
React.useEffect(function () {
|
|
649
|
-
if (
|
|
564
|
+
if (neetoCist.isNotEmpty(searchTerm) && currentPage !== constants.DEFAULT_PAGE_INDEX) {
|
|
650
565
|
handlePageChange(constants.DEFAULT_PAGE_INDEX);
|
|
651
566
|
}
|
|
652
567
|
}, [searchTerm]);
|
|
@@ -689,7 +604,7 @@ var Table = function Table(_ref) {
|
|
|
689
604
|
var queryParams = {
|
|
690
605
|
searchTerm: debouncedSearchTerm,
|
|
691
606
|
page: currentPage,
|
|
692
|
-
|
|
607
|
+
pageSize: DEFAULT_PAGE_SIZE
|
|
693
608
|
};
|
|
694
609
|
var _useFetchApiKeys = useFetchApiKeys({
|
|
695
610
|
params: queryParams,
|
|
@@ -710,7 +625,7 @@ var Table = function Table(_ref) {
|
|
|
710
625
|
className: "flex h-full w-full items-center justify-center"
|
|
711
626
|
}, /*#__PURE__*/React__default["default"].createElement(neetoui.NoData, _extends({
|
|
712
627
|
className: "w-full",
|
|
713
|
-
title: t("noData.title")
|
|
628
|
+
title: t("neetoApiKeys.noData.title")
|
|
714
629
|
}, noDataProps)), ";");
|
|
715
630
|
}
|
|
716
631
|
return /*#__PURE__*/React__default["default"].createElement(TableWrapper__default["default"], {
|
|
@@ -759,9 +674,9 @@ var ApiKeys = function ApiKeys(_ref) {
|
|
|
759
674
|
return /*#__PURE__*/React__default["default"].createElement("div", {
|
|
760
675
|
className: "flex h-full w-full flex-col"
|
|
761
676
|
}, /*#__PURE__*/React__default["default"].createElement(Header__default["default"], _extends({
|
|
762
|
-
title: t("common.apiKey", constants.PLURAL),
|
|
677
|
+
title: t("neetoApiKeys.common.apiKey", constants.PLURAL),
|
|
763
678
|
actionBlock: /*#__PURE__*/React__default["default"].createElement(neetoui.Button, {
|
|
764
|
-
label: t("buttons.addApiKey"),
|
|
679
|
+
label: t("neetoApiKeys.buttons.addApiKey"),
|
|
765
680
|
onClick: function onClick() {
|
|
766
681
|
return setIsCreatePaneOpen(true);
|
|
767
682
|
}
|
|
@@ -772,7 +687,7 @@ var ApiKeys = function ApiKeys(_ref) {
|
|
|
772
687
|
var value = _ref2.target.value;
|
|
773
688
|
return setSearchTerm(value);
|
|
774
689
|
},
|
|
775
|
-
placeholder: t("placeholders.search")
|
|
690
|
+
placeholder: t("neetoApiKeys.placeholders.search")
|
|
776
691
|
}
|
|
777
692
|
}, headerProps)), /*#__PURE__*/React__default["default"].createElement(Table, {
|
|
778
693
|
handleDelete: setApiKeyToBeDeleted,
|
|
@@ -780,15 +695,15 @@ var ApiKeys = function ApiKeys(_ref) {
|
|
|
780
695
|
searchTerm: searchTerm,
|
|
781
696
|
noDataProps: noDataProps
|
|
782
697
|
}), /*#__PURE__*/React__default["default"].createElement(neetoui.Alert, {
|
|
783
|
-
isOpen:
|
|
698
|
+
isOpen: neetoCist.isNotEmpty(apiKeyToBeDeleted),
|
|
784
699
|
isSubmitting: isDeleting,
|
|
785
|
-
submitButtonLabel: t("buttons.delete"),
|
|
786
|
-
title: t("alert.titles.deleteApiKey"),
|
|
700
|
+
submitButtonLabel: t("neetoApiKeys.buttons.delete"),
|
|
701
|
+
title: t("neetoApiKeys.alert.titles.deleteApiKey"),
|
|
787
702
|
message: /*#__PURE__*/React__default["default"].createElement(reactI18next.Trans, {
|
|
788
703
|
components: {
|
|
789
704
|
bold: /*#__PURE__*/React__default["default"].createElement("strong", null)
|
|
790
705
|
},
|
|
791
|
-
i18nKey: "alert.descriptions.deleteApiKey",
|
|
706
|
+
i18nKey: "neetoApiKeys.alert.descriptions.deleteApiKey",
|
|
792
707
|
values: {
|
|
793
708
|
name: apiKeyToBeDeleted.label
|
|
794
709
|
}
|
|
@@ -811,7 +726,7 @@ var ApiKeys = function ApiKeys(_ref) {
|
|
|
811
726
|
}
|
|
812
727
|
}));
|
|
813
728
|
};
|
|
814
|
-
var index = reactUtils.withTitle(ApiKeys,
|
|
729
|
+
var index = reactUtils.withTitle(ApiKeys, i18next.t("neetoApiKeys.common.apiKey", constants.PLURAL));
|
|
815
730
|
|
|
816
731
|
exports.ApiKeys = index;
|
|
817
732
|
//# sourceMappingURL=index.cjs.js.map
|