@bigbinary/neeto-api-keys-frontend 1.0.1 → 1.0.3
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/README.md +2 -0
- package/dist/index.cjs.js +234 -50
- package/dist/index.cjs.js.map +1 -1
- package/dist/index.js +236 -51
- package/dist/index.js.map +1 -1
- package/package.json +34 -31
- package/types.d.ts +17 -2
package/README.md
CHANGED
|
@@ -1,5 +1,7 @@
|
|
|
1
1
|
# neeto-api-keys-nano
|
|
2
2
|
|
|
3
|
+
[](https://neeto-engineering.neetoci.com/projects/neeto-api-keys-nano)
|
|
4
|
+
|
|
3
5
|
This repo acts as the source of truth for the new nano's structure, configs,
|
|
4
6
|
data etc.
|
|
5
7
|
|
package/dist/index.cjs.js
CHANGED
|
@@ -6,7 +6,6 @@ var React = require('react');
|
|
|
6
6
|
var constants = require('@bigbinary/neeto-commons-frontend/constants');
|
|
7
7
|
var pure = require('@bigbinary/neeto-commons-frontend/pure');
|
|
8
8
|
var reactUtils = require('@bigbinary/neeto-commons-frontend/react-utils');
|
|
9
|
-
var Container = require('@bigbinary/neeto-molecules/Container');
|
|
10
9
|
var Header = require('@bigbinary/neeto-molecules/Header');
|
|
11
10
|
var neetoui = require('@bigbinary/neetoui');
|
|
12
11
|
var reactQuery = require('react-query');
|
|
@@ -42,7 +41,6 @@ function _interopNamespace(e) {
|
|
|
42
41
|
}
|
|
43
42
|
|
|
44
43
|
var React__default = /*#__PURE__*/_interopDefaultLegacy(React);
|
|
45
|
-
var Container__default = /*#__PURE__*/_interopDefaultLegacy(Container);
|
|
46
44
|
var Header__default = /*#__PURE__*/_interopDefaultLegacy(Header);
|
|
47
45
|
var axios__default = /*#__PURE__*/_interopDefaultLegacy(axios);
|
|
48
46
|
var yup__namespace = /*#__PURE__*/_interopNamespace(yup);
|
|
@@ -2369,6 +2367,62 @@ function warnOnce() {
|
|
|
2369
2367
|
if (typeof args[0] === 'string') alreadyWarned[args[0]] = new Date();
|
|
2370
2368
|
warn(...args);
|
|
2371
2369
|
}
|
|
2370
|
+
const loadedClb = (i18n, cb) => () => {
|
|
2371
|
+
if (i18n.isInitialized) {
|
|
2372
|
+
cb();
|
|
2373
|
+
} else {
|
|
2374
|
+
const initialized = () => {
|
|
2375
|
+
setTimeout(() => {
|
|
2376
|
+
i18n.off('initialized', initialized);
|
|
2377
|
+
}, 0);
|
|
2378
|
+
cb();
|
|
2379
|
+
};
|
|
2380
|
+
i18n.on('initialized', initialized);
|
|
2381
|
+
}
|
|
2382
|
+
};
|
|
2383
|
+
function loadNamespaces(i18n, ns, cb) {
|
|
2384
|
+
i18n.loadNamespaces(ns, loadedClb(i18n, cb));
|
|
2385
|
+
}
|
|
2386
|
+
function loadLanguages(i18n, lng, ns, cb) {
|
|
2387
|
+
if (typeof ns === 'string') ns = [ns];
|
|
2388
|
+
ns.forEach(n => {
|
|
2389
|
+
if (i18n.options.ns.indexOf(n) < 0) i18n.options.ns.push(n);
|
|
2390
|
+
});
|
|
2391
|
+
i18n.loadLanguages(lng, loadedClb(i18n, cb));
|
|
2392
|
+
}
|
|
2393
|
+
function oldI18nextHasLoadedNamespace(ns, i18n) {
|
|
2394
|
+
let options = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : {};
|
|
2395
|
+
const lng = i18n.languages[0];
|
|
2396
|
+
const fallbackLng = i18n.options ? i18n.options.fallbackLng : false;
|
|
2397
|
+
const lastLng = i18n.languages[i18n.languages.length - 1];
|
|
2398
|
+
if (lng.toLowerCase() === 'cimode') return true;
|
|
2399
|
+
const loadNotPending = (l, n) => {
|
|
2400
|
+
const loadState = i18n.services.backendConnector.state[`${l}|${n}`];
|
|
2401
|
+
return loadState === -1 || loadState === 2;
|
|
2402
|
+
};
|
|
2403
|
+
if (options.bindI18n && options.bindI18n.indexOf('languageChanging') > -1 && i18n.services.backendConnector.backend && i18n.isLanguageChangingTo && !loadNotPending(i18n.isLanguageChangingTo, ns)) return false;
|
|
2404
|
+
if (i18n.hasResourceBundle(lng, ns)) return true;
|
|
2405
|
+
if (!i18n.services.backendConnector.backend || i18n.options.resources && !i18n.options.partialBundledLanguages) return true;
|
|
2406
|
+
if (loadNotPending(lng, ns) && (!fallbackLng || loadNotPending(lastLng, ns))) return true;
|
|
2407
|
+
return false;
|
|
2408
|
+
}
|
|
2409
|
+
function hasLoadedNamespace(ns, i18n) {
|
|
2410
|
+
let options = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : {};
|
|
2411
|
+
if (!i18n.languages || !i18n.languages.length) {
|
|
2412
|
+
warnOnce('i18n.languages were undefined or empty', i18n.languages);
|
|
2413
|
+
return true;
|
|
2414
|
+
}
|
|
2415
|
+
const isNewerI18next = i18n.options.ignoreJSONStructure !== undefined;
|
|
2416
|
+
if (!isNewerI18next) {
|
|
2417
|
+
return oldI18nextHasLoadedNamespace(ns, i18n, options);
|
|
2418
|
+
}
|
|
2419
|
+
return i18n.hasLoadedNamespace(ns, {
|
|
2420
|
+
lng: options.lng,
|
|
2421
|
+
precheck: (i18nInstance, loadNotPending) => {
|
|
2422
|
+
if (options.bindI18n && options.bindI18n.indexOf('languageChanging') > -1 && i18nInstance.services.backendConnector.backend && i18nInstance.isLanguageChangingTo && !loadNotPending(i18nInstance.isLanguageChangingTo, ns)) return false;
|
|
2423
|
+
}
|
|
2424
|
+
});
|
|
2425
|
+
}
|
|
2372
2426
|
|
|
2373
2427
|
const matchHtmlEntity = /&(?:amp|#38|lt|#60|gt|#62|apos|#39|quot|#34|nbsp|#160|copy|#169|reg|#174|hellip|#8230|#x2F|#47);/g;
|
|
2374
2428
|
const htmlEntities = {
|
|
@@ -2672,6 +2726,19 @@ const initReactI18next = {
|
|
|
2672
2726
|
};
|
|
2673
2727
|
|
|
2674
2728
|
const I18nContext = React.createContext();
|
|
2729
|
+
class ReportNamespaces {
|
|
2730
|
+
constructor() {
|
|
2731
|
+
this.usedNamespaces = {};
|
|
2732
|
+
}
|
|
2733
|
+
addUsedNamespaces(namespaces) {
|
|
2734
|
+
namespaces.forEach(ns => {
|
|
2735
|
+
if (!this.usedNamespaces[ns]) this.usedNamespaces[ns] = true;
|
|
2736
|
+
});
|
|
2737
|
+
}
|
|
2738
|
+
getUsedNamespaces() {
|
|
2739
|
+
return Object.keys(this.usedNamespaces);
|
|
2740
|
+
}
|
|
2741
|
+
}
|
|
2675
2742
|
|
|
2676
2743
|
function Trans(_ref) {
|
|
2677
2744
|
let {
|
|
@@ -2714,6 +2781,112 @@ function Trans(_ref) {
|
|
|
2714
2781
|
});
|
|
2715
2782
|
}
|
|
2716
2783
|
|
|
2784
|
+
const usePrevious = (value, ignore) => {
|
|
2785
|
+
const ref = React.useRef();
|
|
2786
|
+
React.useEffect(() => {
|
|
2787
|
+
ref.current = ignore ? ref.current : value;
|
|
2788
|
+
}, [value, ignore]);
|
|
2789
|
+
return ref.current;
|
|
2790
|
+
};
|
|
2791
|
+
function useTranslation(ns) {
|
|
2792
|
+
let props = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};
|
|
2793
|
+
const {
|
|
2794
|
+
i18n: i18nFromProps
|
|
2795
|
+
} = props;
|
|
2796
|
+
const {
|
|
2797
|
+
i18n: i18nFromContext,
|
|
2798
|
+
defaultNS: defaultNSFromContext
|
|
2799
|
+
} = React.useContext(I18nContext) || {};
|
|
2800
|
+
const i18n = i18nFromProps || i18nFromContext || getI18n();
|
|
2801
|
+
if (i18n && !i18n.reportNamespaces) i18n.reportNamespaces = new ReportNamespaces();
|
|
2802
|
+
if (!i18n) {
|
|
2803
|
+
warnOnce('You will need to pass in an i18next instance by using initReactI18next');
|
|
2804
|
+
const notReadyT = (k, optsOrDefaultValue) => {
|
|
2805
|
+
if (typeof optsOrDefaultValue === 'string') return optsOrDefaultValue;
|
|
2806
|
+
if (optsOrDefaultValue && typeof optsOrDefaultValue === 'object' && typeof optsOrDefaultValue.defaultValue === 'string') return optsOrDefaultValue.defaultValue;
|
|
2807
|
+
return Array.isArray(k) ? k[k.length - 1] : k;
|
|
2808
|
+
};
|
|
2809
|
+
const retNotReady = [notReadyT, {}, false];
|
|
2810
|
+
retNotReady.t = notReadyT;
|
|
2811
|
+
retNotReady.i18n = {};
|
|
2812
|
+
retNotReady.ready = false;
|
|
2813
|
+
return retNotReady;
|
|
2814
|
+
}
|
|
2815
|
+
if (i18n.options.react && i18n.options.react.wait !== undefined) warnOnce('It seems you are still using the old wait option, you may migrate to the new useSuspense behaviour.');
|
|
2816
|
+
const i18nOptions = {
|
|
2817
|
+
...getDefaults(),
|
|
2818
|
+
...i18n.options.react,
|
|
2819
|
+
...props
|
|
2820
|
+
};
|
|
2821
|
+
const {
|
|
2822
|
+
useSuspense,
|
|
2823
|
+
keyPrefix
|
|
2824
|
+
} = i18nOptions;
|
|
2825
|
+
let namespaces = ns || defaultNSFromContext || i18n.options && i18n.options.defaultNS;
|
|
2826
|
+
namespaces = typeof namespaces === 'string' ? [namespaces] : namespaces || ['translation'];
|
|
2827
|
+
if (i18n.reportNamespaces.addUsedNamespaces) i18n.reportNamespaces.addUsedNamespaces(namespaces);
|
|
2828
|
+
const ready = (i18n.isInitialized || i18n.initializedStoreOnce) && namespaces.every(n => hasLoadedNamespace(n, i18n, i18nOptions));
|
|
2829
|
+
function getT() {
|
|
2830
|
+
return i18n.getFixedT(props.lng || null, i18nOptions.nsMode === 'fallback' ? namespaces : namespaces[0], keyPrefix);
|
|
2831
|
+
}
|
|
2832
|
+
const [t, setT] = React.useState(getT);
|
|
2833
|
+
let joinedNS = namespaces.join();
|
|
2834
|
+
if (props.lng) joinedNS = `${props.lng}${joinedNS}`;
|
|
2835
|
+
const previousJoinedNS = usePrevious(joinedNS);
|
|
2836
|
+
const isMounted = React.useRef(true);
|
|
2837
|
+
React.useEffect(() => {
|
|
2838
|
+
const {
|
|
2839
|
+
bindI18n,
|
|
2840
|
+
bindI18nStore
|
|
2841
|
+
} = i18nOptions;
|
|
2842
|
+
isMounted.current = true;
|
|
2843
|
+
if (!ready && !useSuspense) {
|
|
2844
|
+
if (props.lng) {
|
|
2845
|
+
loadLanguages(i18n, props.lng, namespaces, () => {
|
|
2846
|
+
if (isMounted.current) setT(getT);
|
|
2847
|
+
});
|
|
2848
|
+
} else {
|
|
2849
|
+
loadNamespaces(i18n, namespaces, () => {
|
|
2850
|
+
if (isMounted.current) setT(getT);
|
|
2851
|
+
});
|
|
2852
|
+
}
|
|
2853
|
+
}
|
|
2854
|
+
if (ready && previousJoinedNS && previousJoinedNS !== joinedNS && isMounted.current) {
|
|
2855
|
+
setT(getT);
|
|
2856
|
+
}
|
|
2857
|
+
function boundReset() {
|
|
2858
|
+
if (isMounted.current) setT(getT);
|
|
2859
|
+
}
|
|
2860
|
+
if (bindI18n && i18n) i18n.on(bindI18n, boundReset);
|
|
2861
|
+
if (bindI18nStore && i18n) i18n.store.on(bindI18nStore, boundReset);
|
|
2862
|
+
return () => {
|
|
2863
|
+
isMounted.current = false;
|
|
2864
|
+
if (bindI18n && i18n) bindI18n.split(' ').forEach(e => i18n.off(e, boundReset));
|
|
2865
|
+
if (bindI18nStore && i18n) bindI18nStore.split(' ').forEach(e => i18n.store.off(e, boundReset));
|
|
2866
|
+
};
|
|
2867
|
+
}, [i18n, joinedNS]);
|
|
2868
|
+
const isInitial = React.useRef(true);
|
|
2869
|
+
React.useEffect(() => {
|
|
2870
|
+
if (isMounted.current && !isInitial.current) {
|
|
2871
|
+
setT(getT);
|
|
2872
|
+
}
|
|
2873
|
+
isInitial.current = false;
|
|
2874
|
+
}, [i18n, keyPrefix]);
|
|
2875
|
+
const ret = [t, i18n, ready];
|
|
2876
|
+
ret.t = t;
|
|
2877
|
+
ret.i18n = i18n;
|
|
2878
|
+
ret.ready = ready;
|
|
2879
|
+
if (ready) return ret;
|
|
2880
|
+
if (!ready && !useSuspense) return ret;
|
|
2881
|
+
throw new Promise(resolve => {
|
|
2882
|
+
if (props.lng) {
|
|
2883
|
+
loadLanguages(i18n, props.lng, namespaces, () => resolve());
|
|
2884
|
+
} else {
|
|
2885
|
+
loadNamespaces(i18n, namespaces, () => resolve());
|
|
2886
|
+
}
|
|
2887
|
+
});
|
|
2888
|
+
}
|
|
2889
|
+
|
|
2717
2890
|
var common = {
|
|
2718
2891
|
apiKey_one: "API key",
|
|
2719
2892
|
apiKey_other: "API keys",
|
|
@@ -2798,6 +2971,21 @@ instance.use(initReactI18next).init({
|
|
|
2798
2971
|
fallbackLng: "en"
|
|
2799
2972
|
});
|
|
2800
2973
|
|
|
2974
|
+
function _extends() {
|
|
2975
|
+
_extends = Object.assign ? Object.assign.bind() : function (target) {
|
|
2976
|
+
for (var i = 1; i < arguments.length; i++) {
|
|
2977
|
+
var source = arguments[i];
|
|
2978
|
+
for (var key in source) {
|
|
2979
|
+
if (Object.prototype.hasOwnProperty.call(source, key)) {
|
|
2980
|
+
target[key] = source[key];
|
|
2981
|
+
}
|
|
2982
|
+
}
|
|
2983
|
+
}
|
|
2984
|
+
return target;
|
|
2985
|
+
};
|
|
2986
|
+
return _extends.apply(this, arguments);
|
|
2987
|
+
}
|
|
2988
|
+
|
|
2801
2989
|
function _arrayWithHoles(arr) {
|
|
2802
2990
|
if (Array.isArray(arr)) return arr;
|
|
2803
2991
|
}
|
|
@@ -2919,21 +3107,6 @@ var useDeleteApiKey = function useDeleteApiKey(onSuccess) {
|
|
|
2919
3107
|
});
|
|
2920
3108
|
};
|
|
2921
3109
|
|
|
2922
|
-
function _extends() {
|
|
2923
|
-
_extends = Object.assign ? Object.assign.bind() : function (target) {
|
|
2924
|
-
for (var i = 1; i < arguments.length; i++) {
|
|
2925
|
-
var source = arguments[i];
|
|
2926
|
-
for (var key in source) {
|
|
2927
|
-
if (Object.prototype.hasOwnProperty.call(source, key)) {
|
|
2928
|
-
target[key] = source[key];
|
|
2929
|
-
}
|
|
2930
|
-
}
|
|
2931
|
-
}
|
|
2932
|
-
return target;
|
|
2933
|
-
};
|
|
2934
|
-
return _extends.apply(this, arguments);
|
|
2935
|
-
}
|
|
2936
|
-
|
|
2937
3110
|
var dayjs_min = {exports: {}};
|
|
2938
3111
|
|
|
2939
3112
|
dayjs_min.exports;
|
|
@@ -2947,10 +3120,11 @@ var dayjs = /*@__PURE__*/getDefaultExportFromCjs(dayjs_minExports);
|
|
|
2947
3120
|
|
|
2948
3121
|
var Menu = neetoui.Dropdown.Menu,
|
|
2949
3122
|
MenuItem = neetoui.Dropdown.MenuItem;
|
|
2950
|
-
var ActionDropdown =
|
|
2951
|
-
var
|
|
2952
|
-
handleEdit = _ref.handleEdit,
|
|
3123
|
+
var ActionDropdown = function ActionDropdown(_ref) {
|
|
3124
|
+
var handleEdit = _ref.handleEdit,
|
|
2953
3125
|
handleDelete = _ref.handleDelete;
|
|
3126
|
+
var _useTranslation = useTranslation(),
|
|
3127
|
+
t = _useTranslation.t;
|
|
2954
3128
|
return /*#__PURE__*/React__default["default"].createElement(neetoui.Dropdown, {
|
|
2955
3129
|
buttonStyle: "text",
|
|
2956
3130
|
icon: neetoIcons.MenuHorizontal,
|
|
@@ -2961,7 +3135,7 @@ var ActionDropdown = reactUtils.withT(function (_ref) {
|
|
|
2961
3135
|
style: "danger",
|
|
2962
3136
|
onClick: handleDelete
|
|
2963
3137
|
}, t("buttons.delete"))));
|
|
2964
|
-
}
|
|
3138
|
+
};
|
|
2965
3139
|
|
|
2966
3140
|
var isInPast = function isInPast(date) {
|
|
2967
3141
|
return dayjs(date).isBefore(dayjs());
|
|
@@ -3113,14 +3287,15 @@ var VALIDATION_SCHEMA = yup__namespace.object({
|
|
|
3113
3287
|
});
|
|
3114
3288
|
var DEFAULT_PAGE_SIZE = 15;
|
|
3115
3289
|
|
|
3116
|
-
var Form =
|
|
3117
|
-
var
|
|
3118
|
-
_ref$initialValues = _ref.initialValues,
|
|
3290
|
+
var Form = function Form(_ref) {
|
|
3291
|
+
var _ref$initialValues = _ref.initialValues,
|
|
3119
3292
|
initialValues = _ref$initialValues === void 0 ? INITIAL_VALUES : _ref$initialValues,
|
|
3120
3293
|
isSubmitting = _ref.isSubmitting,
|
|
3121
3294
|
onClose = _ref.onClose,
|
|
3122
3295
|
onSubmit = _ref.onSubmit,
|
|
3123
3296
|
initialFocusRef = _ref.initialFocusRef;
|
|
3297
|
+
var _useTranslation = useTranslation(),
|
|
3298
|
+
t = _useTranslation.t;
|
|
3124
3299
|
return /*#__PURE__*/React__default["default"].createElement(formik$1.Form, {
|
|
3125
3300
|
formikProps: {
|
|
3126
3301
|
validationSchema: VALIDATION_SCHEMA,
|
|
@@ -3174,16 +3349,17 @@ var Form = reactUtils.withT(function (_ref) {
|
|
|
3174
3349
|
}
|
|
3175
3350
|
})));
|
|
3176
3351
|
});
|
|
3177
|
-
}
|
|
3352
|
+
};
|
|
3178
3353
|
|
|
3179
|
-
var Create =
|
|
3180
|
-
var
|
|
3181
|
-
onClose = _ref.onClose,
|
|
3354
|
+
var Create = function Create(_ref) {
|
|
3355
|
+
var onClose = _ref.onClose,
|
|
3182
3356
|
isOpen = _ref.isOpen;
|
|
3183
3357
|
var initialFocusRef = React.useRef(null);
|
|
3184
3358
|
var _useCreateApiKey = useCreateApiKey(onClose),
|
|
3185
3359
|
createApiKey = _useCreateApiKey.mutate,
|
|
3186
3360
|
isCreating = _useCreateApiKey.isLoading;
|
|
3361
|
+
var _useTranslation = useTranslation(),
|
|
3362
|
+
t = _useTranslation.t;
|
|
3187
3363
|
return /*#__PURE__*/React__default["default"].createElement(neetoui.Pane, {
|
|
3188
3364
|
initialFocusRef: initialFocusRef,
|
|
3189
3365
|
onClose: onClose,
|
|
@@ -3196,7 +3372,7 @@ var Create = reactUtils.withT(function (_ref) {
|
|
|
3196
3372
|
isSubmitting: isCreating,
|
|
3197
3373
|
onSubmit: createApiKey
|
|
3198
3374
|
}));
|
|
3199
|
-
}
|
|
3375
|
+
};
|
|
3200
3376
|
|
|
3201
3377
|
function _typeof(obj) {
|
|
3202
3378
|
"@babel/helpers - typeof";
|
|
@@ -3241,14 +3417,15 @@ function _defineProperty(obj, key, value) {
|
|
|
3241
3417
|
|
|
3242
3418
|
function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); enumerableOnly && (symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; }
|
|
3243
3419
|
function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? ownKeys(Object(source), !0).forEach(function (key) { _defineProperty(target, key, source[key]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } return target; }
|
|
3244
|
-
var Update =
|
|
3245
|
-
var
|
|
3246
|
-
onClose = _ref.onClose,
|
|
3420
|
+
var Update = function Update(_ref) {
|
|
3421
|
+
var onClose = _ref.onClose,
|
|
3247
3422
|
apiKey = _ref.apiKey;
|
|
3248
3423
|
var initialFocusRef = React.useRef(null);
|
|
3249
3424
|
var _useUpdateApiKey = useUpdateApiKey(onClose),
|
|
3250
3425
|
updateApiKey = _useUpdateApiKey.mutate,
|
|
3251
3426
|
isUpdating = _useUpdateApiKey.isLoading;
|
|
3427
|
+
var _useTranslation = useTranslation(),
|
|
3428
|
+
t = _useTranslation.t;
|
|
3252
3429
|
var handleUpdate = function handleUpdate(values) {
|
|
3253
3430
|
updateApiKey({
|
|
3254
3431
|
id: apiKey.id,
|
|
@@ -3271,7 +3448,7 @@ var Update = reactUtils.withT(function (_ref) {
|
|
|
3271
3448
|
isSubmitting: isUpdating,
|
|
3272
3449
|
onSubmit: handleUpdate
|
|
3273
3450
|
}));
|
|
3274
|
-
}
|
|
3451
|
+
};
|
|
3275
3452
|
|
|
3276
3453
|
var getPageFromSearchParams = function getPageFromSearchParams() {
|
|
3277
3454
|
var _getQueryParams = utils.getQueryParams(),
|
|
@@ -3325,12 +3502,15 @@ var usePagination = function usePagination(_ref) {
|
|
|
3325
3502
|
};
|
|
3326
3503
|
};
|
|
3327
3504
|
|
|
3328
|
-
var Table =
|
|
3329
|
-
var
|
|
3330
|
-
handleDelete = _ref.handleDelete,
|
|
3505
|
+
var Table = function Table(_ref) {
|
|
3506
|
+
var handleDelete = _ref.handleDelete,
|
|
3331
3507
|
handleEdit = _ref.handleEdit,
|
|
3332
|
-
searchTerm = _ref.searchTerm
|
|
3508
|
+
searchTerm = _ref.searchTerm,
|
|
3509
|
+
_ref$noDataProps = _ref.noDataProps,
|
|
3510
|
+
noDataProps = _ref$noDataProps === void 0 ? {} : _ref$noDataProps;
|
|
3333
3511
|
var debouncedSearchTerm = reactUtils.useDebounce(searchTerm);
|
|
3512
|
+
var _useTranslation = useTranslation(),
|
|
3513
|
+
t = _useTranslation.t;
|
|
3334
3514
|
var _usePagination = usePagination({
|
|
3335
3515
|
searchTerm: debouncedSearchTerm
|
|
3336
3516
|
}),
|
|
@@ -3359,10 +3539,10 @@ var Table = reactUtils.withT(function (_ref) {
|
|
|
3359
3539
|
if (ramda.isEmpty(apiKeys)) {
|
|
3360
3540
|
return /*#__PURE__*/React__default["default"].createElement("div", {
|
|
3361
3541
|
className: "flex h-full w-full items-center justify-center"
|
|
3362
|
-
}, /*#__PURE__*/React__default["default"].createElement(neetoui.NoData, {
|
|
3542
|
+
}, /*#__PURE__*/React__default["default"].createElement(neetoui.NoData, _extends({
|
|
3363
3543
|
className: "w-full",
|
|
3364
3544
|
title: t("noData.title")
|
|
3365
|
-
}), ";");
|
|
3545
|
+
}, noDataProps)), ";");
|
|
3366
3546
|
}
|
|
3367
3547
|
return /*#__PURE__*/React__default["default"].createElement(TableWrapper__default["default"], {
|
|
3368
3548
|
hasPagination: totalCount > DEFAULT_PAGE_SIZE
|
|
@@ -3379,12 +3559,11 @@ var Table = reactUtils.withT(function (_ref) {
|
|
|
3379
3559
|
rowData: apiKeys,
|
|
3380
3560
|
totalCount: totalCount
|
|
3381
3561
|
}));
|
|
3382
|
-
}
|
|
3562
|
+
};
|
|
3383
3563
|
|
|
3384
|
-
var ApiKeys =
|
|
3385
|
-
var
|
|
3386
|
-
|
|
3387
|
-
breadcrumbs = _ref$breadcrumbs === void 0 ? [] : _ref$breadcrumbs;
|
|
3564
|
+
var ApiKeys = function ApiKeys(_ref) {
|
|
3565
|
+
var noDataProps = _ref.noDataProps,
|
|
3566
|
+
headerProps = _ref.headerProps;
|
|
3388
3567
|
var _useState = React.useState(""),
|
|
3389
3568
|
_useState2 = _slicedToArray(_useState, 2),
|
|
3390
3569
|
searchTerm = _useState2[0],
|
|
@@ -3401,13 +3580,16 @@ var ApiKeys = reactUtils.withT(function (_ref) {
|
|
|
3401
3580
|
_useState8 = _slicedToArray(_useState7, 2),
|
|
3402
3581
|
isCreatePaneOpen = _useState8[0],
|
|
3403
3582
|
setIsCreatePaneOpen = _useState8[1];
|
|
3583
|
+
var _useTranslation = useTranslation(),
|
|
3584
|
+
t = _useTranslation.t;
|
|
3404
3585
|
var _useDeleteApiKey = useDeleteApiKey(function () {
|
|
3405
3586
|
return setApiKeyToBeDeleted({});
|
|
3406
3587
|
}),
|
|
3407
3588
|
deleteApiKey = _useDeleteApiKey.mutate,
|
|
3408
3589
|
isDeleting = _useDeleteApiKey.isLoading;
|
|
3409
|
-
return /*#__PURE__*/React__default["default"].createElement(
|
|
3410
|
-
|
|
3590
|
+
return /*#__PURE__*/React__default["default"].createElement("div", {
|
|
3591
|
+
className: "flex h-full w-full flex-col"
|
|
3592
|
+
}, /*#__PURE__*/React__default["default"].createElement(Header__default["default"], _extends({
|
|
3411
3593
|
title: t("common.apiKey", constants.PLURAL),
|
|
3412
3594
|
actionBlock: /*#__PURE__*/React__default["default"].createElement(neetoui.Button, {
|
|
3413
3595
|
label: t("buttons.addApiKey"),
|
|
@@ -3423,10 +3605,11 @@ var ApiKeys = reactUtils.withT(function (_ref) {
|
|
|
3423
3605
|
},
|
|
3424
3606
|
placeholder: t("placeholders.search")
|
|
3425
3607
|
}
|
|
3426
|
-
}), /*#__PURE__*/React__default["default"].createElement(Table, {
|
|
3608
|
+
}, headerProps)), /*#__PURE__*/React__default["default"].createElement(Table, {
|
|
3427
3609
|
handleDelete: setApiKeyToBeDeleted,
|
|
3428
3610
|
handleEdit: setApiKeyToBeEdited,
|
|
3429
|
-
searchTerm: searchTerm
|
|
3611
|
+
searchTerm: searchTerm,
|
|
3612
|
+
noDataProps: noDataProps
|
|
3430
3613
|
}), /*#__PURE__*/React__default["default"].createElement(neetoui.Alert, {
|
|
3431
3614
|
isOpen: pure.isNotEmpty(apiKeyToBeDeleted),
|
|
3432
3615
|
isSubmitting: isDeleting,
|
|
@@ -3458,7 +3641,8 @@ var ApiKeys = reactUtils.withT(function (_ref) {
|
|
|
3458
3641
|
return setApiKeyToBeEdited({});
|
|
3459
3642
|
}
|
|
3460
3643
|
}));
|
|
3461
|
-
}
|
|
3644
|
+
};
|
|
3645
|
+
var index = reactUtils.withTitle(ApiKeys, t$1("common.apiKey", constants.PLURAL));
|
|
3462
3646
|
|
|
3463
|
-
exports.ApiKeys =
|
|
3647
|
+
exports.ApiKeys = index;
|
|
3464
3648
|
//# sourceMappingURL=index.cjs.js.map
|