@bigbinary/neeto-redirect-urls-frontend 2.2.0 → 2.2.2
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/dist/RedirectUrls.js +7 -118
- package/dist/RedirectUrls.js.map +1 -1
- package/dist/cjs/RedirectUrls.js +42 -174
- package/dist/cjs/RedirectUrls.js.map +1 -1
- package/dist/cjs/index.js +3 -2
- package/dist/cjs/index.js.map +1 -1
- package/dist/index.js +3 -0
- package/dist/index.js.map +1 -1
- package/package.json +114 -95
package/dist/cjs/RedirectUrls.js
CHANGED
|
@@ -1,5 +1,7 @@
|
|
|
1
1
|
'use strict';
|
|
2
2
|
|
|
3
|
+
var _defineProperty = require('@babel/runtime/helpers/defineProperty');
|
|
4
|
+
var _slicedToArray = require('@babel/runtime/helpers/slicedToArray');
|
|
3
5
|
var react = require('react');
|
|
4
6
|
var neetoCist = require('@bigbinary/neeto-cist');
|
|
5
7
|
var reactUtils = require('@bigbinary/neeto-commons-frontend/react-utils');
|
|
@@ -29,12 +31,10 @@ var constants = require('@bigbinary/neeto-commons-frontend/constants');
|
|
|
29
31
|
var MoreDropdown = require('@bigbinary/neeto-molecules/MoreDropdown');
|
|
30
32
|
var TableWrapper = require('@bigbinary/neeto-molecules/TableWrapper');
|
|
31
33
|
var Table = require('@bigbinary/neetoui/Table');
|
|
34
|
+
var _toConsumableArray = require('@babel/runtime/helpers/toConsumableArray');
|
|
32
35
|
var utils = require('@bigbinary/neeto-commons-frontend/utils');
|
|
33
36
|
|
|
34
|
-
function
|
|
35
|
-
|
|
36
|
-
function _interopNamespace(e) {
|
|
37
|
-
if (e && e.__esModule) return e;
|
|
37
|
+
function _interopNamespaceDefault(e) {
|
|
38
38
|
var n = Object.create(null);
|
|
39
39
|
if (e) {
|
|
40
40
|
Object.keys(e).forEach(function (k) {
|
|
@@ -47,125 +47,11 @@ function _interopNamespace(e) {
|
|
|
47
47
|
}
|
|
48
48
|
});
|
|
49
49
|
}
|
|
50
|
-
n
|
|
50
|
+
n.default = e;
|
|
51
51
|
return Object.freeze(n);
|
|
52
52
|
}
|
|
53
53
|
|
|
54
|
-
var
|
|
55
|
-
var Header__default = /*#__PURE__*/_interopDefaultLegacy(Header);
|
|
56
|
-
var PageLoader__default = /*#__PURE__*/_interopDefaultLegacy(PageLoader);
|
|
57
|
-
var Pane__default = /*#__PURE__*/_interopDefaultLegacy(Pane);
|
|
58
|
-
var NoData__default = /*#__PURE__*/_interopDefaultLegacy(NoData);
|
|
59
|
-
var Button__default = /*#__PURE__*/_interopDefaultLegacy(Button);
|
|
60
|
-
var Alert__default = /*#__PURE__*/_interopDefaultLegacy(Alert);
|
|
61
|
-
var Typography__default = /*#__PURE__*/_interopDefaultLegacy(Typography);
|
|
62
|
-
var Input__default = /*#__PURE__*/_interopDefaultLegacy(Input);
|
|
63
|
-
var Form__default = /*#__PURE__*/_interopDefaultLegacy(Form);
|
|
64
|
-
var ActionBlock__default = /*#__PURE__*/_interopDefaultLegacy(ActionBlock);
|
|
65
|
-
var Yup__namespace = /*#__PURE__*/_interopNamespace(Yup);
|
|
66
|
-
var axios__default = /*#__PURE__*/_interopDefaultLegacy(axios);
|
|
67
|
-
var Edit__default = /*#__PURE__*/_interopDefaultLegacy(Edit);
|
|
68
|
-
var Label__default = /*#__PURE__*/_interopDefaultLegacy(Label);
|
|
69
|
-
var Switch__default = /*#__PURE__*/_interopDefaultLegacy(Switch);
|
|
70
|
-
var MoreDropdown__default = /*#__PURE__*/_interopDefaultLegacy(MoreDropdown);
|
|
71
|
-
var TableWrapper__default = /*#__PURE__*/_interopDefaultLegacy(TableWrapper);
|
|
72
|
-
var Table__default = /*#__PURE__*/_interopDefaultLegacy(Table);
|
|
73
|
-
|
|
74
|
-
function _typeof(o) {
|
|
75
|
-
"@babel/helpers - typeof";
|
|
76
|
-
|
|
77
|
-
return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (o) {
|
|
78
|
-
return typeof o;
|
|
79
|
-
} : function (o) {
|
|
80
|
-
return o && "function" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? "symbol" : typeof o;
|
|
81
|
-
}, _typeof(o);
|
|
82
|
-
}
|
|
83
|
-
|
|
84
|
-
function _toPrimitive(input, hint) {
|
|
85
|
-
if (_typeof(input) !== "object" || input === null) return input;
|
|
86
|
-
var prim = input[Symbol.toPrimitive];
|
|
87
|
-
if (prim !== undefined) {
|
|
88
|
-
var res = prim.call(input, hint || "default");
|
|
89
|
-
if (_typeof(res) !== "object") return res;
|
|
90
|
-
throw new TypeError("@@toPrimitive must return a primitive value.");
|
|
91
|
-
}
|
|
92
|
-
return (hint === "string" ? String : Number)(input);
|
|
93
|
-
}
|
|
94
|
-
|
|
95
|
-
function _toPropertyKey(arg) {
|
|
96
|
-
var key = _toPrimitive(arg, "string");
|
|
97
|
-
return _typeof(key) === "symbol" ? key : String(key);
|
|
98
|
-
}
|
|
99
|
-
|
|
100
|
-
function _defineProperty(obj, key, value) {
|
|
101
|
-
key = _toPropertyKey(key);
|
|
102
|
-
if (key in obj) {
|
|
103
|
-
Object.defineProperty(obj, key, {
|
|
104
|
-
value: value,
|
|
105
|
-
enumerable: true,
|
|
106
|
-
configurable: true,
|
|
107
|
-
writable: true
|
|
108
|
-
});
|
|
109
|
-
} else {
|
|
110
|
-
obj[key] = value;
|
|
111
|
-
}
|
|
112
|
-
return obj;
|
|
113
|
-
}
|
|
114
|
-
|
|
115
|
-
function _arrayWithHoles(arr) {
|
|
116
|
-
if (Array.isArray(arr)) return arr;
|
|
117
|
-
}
|
|
118
|
-
|
|
119
|
-
function _iterableToArrayLimit(r, l) {
|
|
120
|
-
var t = null == r ? null : "undefined" != typeof Symbol && r[Symbol.iterator] || r["@@iterator"];
|
|
121
|
-
if (null != t) {
|
|
122
|
-
var e,
|
|
123
|
-
n,
|
|
124
|
-
i,
|
|
125
|
-
u,
|
|
126
|
-
a = [],
|
|
127
|
-
f = !0,
|
|
128
|
-
o = !1;
|
|
129
|
-
try {
|
|
130
|
-
if (i = (t = t.call(r)).next, 0 === l) {
|
|
131
|
-
if (Object(t) !== t) return;
|
|
132
|
-
f = !1;
|
|
133
|
-
} else for (; !(f = (e = i.call(t)).done) && (a.push(e.value), a.length !== l); f = !0);
|
|
134
|
-
} catch (r) {
|
|
135
|
-
o = !0, n = r;
|
|
136
|
-
} finally {
|
|
137
|
-
try {
|
|
138
|
-
if (!f && null != t["return"] && (u = t["return"](), Object(u) !== u)) return;
|
|
139
|
-
} finally {
|
|
140
|
-
if (o) throw n;
|
|
141
|
-
}
|
|
142
|
-
}
|
|
143
|
-
return a;
|
|
144
|
-
}
|
|
145
|
-
}
|
|
146
|
-
|
|
147
|
-
function _arrayLikeToArray(arr, len) {
|
|
148
|
-
if (len == null || len > arr.length) len = arr.length;
|
|
149
|
-
for (var i = 0, arr2 = new Array(len); i < len; i++) arr2[i] = arr[i];
|
|
150
|
-
return arr2;
|
|
151
|
-
}
|
|
152
|
-
|
|
153
|
-
function _unsupportedIterableToArray(o, minLen) {
|
|
154
|
-
if (!o) return;
|
|
155
|
-
if (typeof o === "string") return _arrayLikeToArray(o, minLen);
|
|
156
|
-
var n = Object.prototype.toString.call(o).slice(8, -1);
|
|
157
|
-
if (n === "Object" && o.constructor) n = o.constructor.name;
|
|
158
|
-
if (n === "Map" || n === "Set") return Array.from(o);
|
|
159
|
-
if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen);
|
|
160
|
-
}
|
|
161
|
-
|
|
162
|
-
function _nonIterableRest() {
|
|
163
|
-
throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.");
|
|
164
|
-
}
|
|
165
|
-
|
|
166
|
-
function _slicedToArray(arr, i) {
|
|
167
|
-
return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _unsupportedIterableToArray(arr, i) || _nonIterableRest();
|
|
168
|
-
}
|
|
54
|
+
var Yup__namespace = /*#__PURE__*/_interopNamespaceDefault(Yup);
|
|
169
55
|
|
|
170
56
|
var DeleteRedirectUrlModal = function DeleteRedirectUrlModal(_ref) {
|
|
171
57
|
var handleClose = _ref.handleClose,
|
|
@@ -179,7 +65,7 @@ var DeleteRedirectUrlModal = function DeleteRedirectUrlModal(_ref) {
|
|
|
179
65
|
toPath = detailsToDelete.toPath,
|
|
180
66
|
fromPath = detailsToDelete.fromPath;
|
|
181
67
|
var title = t("neetoRedirectUrls.alerts.delete.title");
|
|
182
|
-
return /*#__PURE__*/jsxRuntime.jsx(
|
|
68
|
+
return /*#__PURE__*/jsxRuntime.jsx(Alert, {
|
|
183
69
|
isOpen: isOpen,
|
|
184
70
|
title: title,
|
|
185
71
|
submitButtonLabel: t("neetoRedirectUrls.common.delete"),
|
|
@@ -213,12 +99,12 @@ var RedirectUrlPane = function RedirectUrlPane(_ref) {
|
|
|
213
99
|
t = _useTranslation.t;
|
|
214
100
|
var redirectUrlId = initialValues === null || initialValues === void 0 ? void 0 : initialValues.id;
|
|
215
101
|
return /*#__PURE__*/jsxRuntime.jsxs(jsxRuntime.Fragment, {
|
|
216
|
-
children: [/*#__PURE__*/jsxRuntime.jsx(
|
|
217
|
-
children: /*#__PURE__*/jsxRuntime.jsx(
|
|
102
|
+
children: [/*#__PURE__*/jsxRuntime.jsx(Pane.Header, {
|
|
103
|
+
children: /*#__PURE__*/jsxRuntime.jsx(Typography, {
|
|
218
104
|
style: "h2",
|
|
219
105
|
children: redirectUrlId ? t("neetoRedirectUrls.redirect.edit") : t("neetoRedirectUrls.redirect.add")
|
|
220
106
|
})
|
|
221
|
-
}), /*#__PURE__*/jsxRuntime.jsx(
|
|
107
|
+
}), /*#__PURE__*/jsxRuntime.jsx(Form, {
|
|
222
108
|
formikProps: {
|
|
223
109
|
initialValues: initialValues || {
|
|
224
110
|
fromPath: "",
|
|
@@ -237,24 +123,24 @@ var RedirectUrlPane = function RedirectUrlPane(_ref) {
|
|
|
237
123
|
}
|
|
238
124
|
},
|
|
239
125
|
children: /*#__PURE__*/jsxRuntime.jsxs(jsxRuntime.Fragment, {
|
|
240
|
-
children: [/*#__PURE__*/jsxRuntime.jsx(
|
|
126
|
+
children: [/*#__PURE__*/jsxRuntime.jsx(Pane.Body, {
|
|
241
127
|
children: /*#__PURE__*/jsxRuntime.jsxs("div", {
|
|
242
128
|
className: "w-full space-y-4",
|
|
243
|
-
children: [/*#__PURE__*/jsxRuntime.jsx(
|
|
129
|
+
children: [/*#__PURE__*/jsxRuntime.jsx(Input, {
|
|
244
130
|
id: "fromPath",
|
|
245
131
|
label: t("neetoRedirectUrls.redirect.source"),
|
|
246
132
|
name: "fromPath",
|
|
247
133
|
ref: setInitialFocusField,
|
|
248
134
|
placeholder: t("neetoRedirectUrls.common.placeholder.relativeUrl")
|
|
249
|
-
}), /*#__PURE__*/jsxRuntime.jsx(
|
|
135
|
+
}), /*#__PURE__*/jsxRuntime.jsx(Input, {
|
|
250
136
|
id: "toPath",
|
|
251
137
|
label: t("neetoRedirectUrls.redirect.destination"),
|
|
252
138
|
name: "toPath",
|
|
253
139
|
placeholder: window.location.origin
|
|
254
140
|
})]
|
|
255
141
|
})
|
|
256
|
-
}), /*#__PURE__*/jsxRuntime.jsx(
|
|
257
|
-
children: /*#__PURE__*/jsxRuntime.jsx(
|
|
142
|
+
}), /*#__PURE__*/jsxRuntime.jsx(Pane.Footer, {
|
|
143
|
+
children: /*#__PURE__*/jsxRuntime.jsx(ActionBlock, {
|
|
258
144
|
cancelButtonProps: {
|
|
259
145
|
onClick: handleClose
|
|
260
146
|
}
|
|
@@ -268,21 +154,21 @@ var RedirectUrlPane = function RedirectUrlPane(_ref) {
|
|
|
268
154
|
var REDIRECT_URLS_BASE_URL = "/neeto_redirect_urls_engine/api/v1/redirect_urls";
|
|
269
155
|
|
|
270
156
|
var fetch = function fetch() {
|
|
271
|
-
return
|
|
157
|
+
return axios.get(REDIRECT_URLS_BASE_URL);
|
|
272
158
|
};
|
|
273
159
|
var fetchAll = function fetchAll(params) {
|
|
274
|
-
return
|
|
160
|
+
return axios.get(REDIRECT_URLS_BASE_URL, params);
|
|
275
161
|
};
|
|
276
162
|
var create = function create(payload) {
|
|
277
|
-
return
|
|
163
|
+
return axios.post(REDIRECT_URLS_BASE_URL, payload);
|
|
278
164
|
};
|
|
279
165
|
var update = function update(_ref) {
|
|
280
166
|
var id = _ref.id,
|
|
281
167
|
payload = _ref.payload;
|
|
282
|
-
return
|
|
168
|
+
return axios.put("".concat(REDIRECT_URLS_BASE_URL, "/").concat(id), payload);
|
|
283
169
|
};
|
|
284
170
|
var destroy = function destroy(id) {
|
|
285
|
-
return
|
|
171
|
+
return axios["delete"]("".concat(REDIRECT_URLS_BASE_URL, "/").concat(id));
|
|
286
172
|
};
|
|
287
173
|
var redirectUrlApi = {
|
|
288
174
|
fetch: fetch,
|
|
@@ -377,7 +263,7 @@ var DomainRedirection = function DomainRedirection(_ref) {
|
|
|
377
263
|
}, [domainRedirectUrl]);
|
|
378
264
|
return /*#__PURE__*/jsxRuntime.jsx("div", {
|
|
379
265
|
className: "neeto-ui-border-gray-200 mb-8 border-b ",
|
|
380
|
-
children: /*#__PURE__*/jsxRuntime.jsx(
|
|
266
|
+
children: /*#__PURE__*/jsxRuntime.jsx(Form, {
|
|
381
267
|
className: "mb-2 w-full",
|
|
382
268
|
formikProps: {
|
|
383
269
|
initialValues: initialValues,
|
|
@@ -393,28 +279,28 @@ var DomainRedirection = function DomainRedirection(_ref) {
|
|
|
393
279
|
className: "flex items-center justify-between py-3",
|
|
394
280
|
children: /*#__PURE__*/jsxRuntime.jsxs("div", {
|
|
395
281
|
className: "flex flex-col space-y-2",
|
|
396
|
-
children: [/*#__PURE__*/jsxRuntime.jsxs(
|
|
282
|
+
children: [/*#__PURE__*/jsxRuntime.jsxs(Label, {
|
|
397
283
|
className: "flex items-center gap-2",
|
|
398
|
-
children: [/*#__PURE__*/jsxRuntime.jsx(
|
|
284
|
+
children: [/*#__PURE__*/jsxRuntime.jsx(Switch, {
|
|
399
285
|
"data-cy": "domain-level-redirection-switch",
|
|
400
286
|
name: "domainRedirectionActive",
|
|
401
287
|
onClick: function onClick() {
|
|
402
288
|
return handleRemoveRedirection(domainRedirectionActive);
|
|
403
289
|
}
|
|
404
|
-
}), /*#__PURE__*/jsxRuntime.jsx(
|
|
290
|
+
}), /*#__PURE__*/jsxRuntime.jsx(Typography, {
|
|
405
291
|
component: "span",
|
|
406
292
|
"data-cy": "domain-level-redirection-heading",
|
|
407
293
|
style: "h5",
|
|
408
294
|
weight: "medium",
|
|
409
295
|
children: t("neetoRedirectUrls.redirect.domainLevelRedirect.label")
|
|
410
296
|
})]
|
|
411
|
-
}), /*#__PURE__*/jsxRuntime.jsx(
|
|
297
|
+
}), /*#__PURE__*/jsxRuntime.jsx(Typography, {
|
|
412
298
|
component: "p",
|
|
413
299
|
style: "body2",
|
|
414
300
|
children: /*#__PURE__*/jsxRuntime.jsx(reactI18next.Trans, {
|
|
415
301
|
i18nKey: "neetoRedirectUrls.redirect.domainLevelRedirect.description",
|
|
416
302
|
components: {
|
|
417
|
-
Link: /*#__PURE__*/jsxRuntime.jsx(
|
|
303
|
+
Link: /*#__PURE__*/jsxRuntime.jsx(Button, {
|
|
418
304
|
className: "text-sm",
|
|
419
305
|
"data-cy": "domain-level-redirections-help-button",
|
|
420
306
|
href: DOMAIN_LEVEL_REDIRECT_HELP_DOC_URL,
|
|
@@ -442,11 +328,11 @@ var DomainRedirection = function DomainRedirection(_ref) {
|
|
|
442
328
|
"data-cy": "domain-level-redirection-link-submit-button"
|
|
443
329
|
}
|
|
444
330
|
}) : /*#__PURE__*/jsxRuntime.jsxs(jsxRuntime.Fragment, {
|
|
445
|
-
children: [/*#__PURE__*/jsxRuntime.jsx(
|
|
331
|
+
children: [/*#__PURE__*/jsxRuntime.jsx(Input, {
|
|
446
332
|
disabled: true,
|
|
447
333
|
name: "toPath"
|
|
448
|
-
}), /*#__PURE__*/jsxRuntime.jsx(
|
|
449
|
-
icon:
|
|
334
|
+
}), /*#__PURE__*/jsxRuntime.jsx(Button, {
|
|
335
|
+
icon: Edit,
|
|
450
336
|
style: "link",
|
|
451
337
|
onClick: function onClick() {
|
|
452
338
|
return setIsEditingDomainRedirect(true);
|
|
@@ -465,22 +351,6 @@ var SETTINGS_CATEGORIES = {
|
|
|
465
351
|
};
|
|
466
352
|
var SETTINGS_CATEGORIES_LABELS = _defineProperty({}, SETTINGS_CATEGORIES.GENERAL, i18next.t("neetoRedirectUrls.settings.general.title"));
|
|
467
353
|
|
|
468
|
-
function _arrayWithoutHoles(arr) {
|
|
469
|
-
if (Array.isArray(arr)) return _arrayLikeToArray(arr);
|
|
470
|
-
}
|
|
471
|
-
|
|
472
|
-
function _iterableToArray(iter) {
|
|
473
|
-
if (typeof Symbol !== "undefined" && iter[Symbol.iterator] != null || iter["@@iterator"] != null) return Array.from(iter);
|
|
474
|
-
}
|
|
475
|
-
|
|
476
|
-
function _nonIterableSpread() {
|
|
477
|
-
throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.");
|
|
478
|
-
}
|
|
479
|
-
|
|
480
|
-
function _toConsumableArray(arr) {
|
|
481
|
-
return _arrayWithoutHoles(arr) || _iterableToArray(arr) || _unsupportedIterableToArray(arr) || _nonIterableSpread();
|
|
482
|
-
}
|
|
483
|
-
|
|
484
354
|
var routes = {
|
|
485
355
|
admin: {
|
|
486
356
|
index: "/admin",
|
|
@@ -630,7 +500,7 @@ var RedirectUrlsTable = function RedirectUrlsTable(_ref) {
|
|
|
630
500
|
className: "flex items-center justify-between gap-x-3",
|
|
631
501
|
children: [/*#__PURE__*/jsxRuntime.jsx("span", {
|
|
632
502
|
children: fromPath && truncateUrl(fromPath)
|
|
633
|
-
}), /*#__PURE__*/jsxRuntime.jsx(
|
|
503
|
+
}), /*#__PURE__*/jsxRuntime.jsx(MoreDropdown, {
|
|
634
504
|
dropdownProps: {
|
|
635
505
|
strategy: "fixed"
|
|
636
506
|
},
|
|
@@ -650,9 +520,9 @@ var RedirectUrlsTable = function RedirectUrlsTable(_ref) {
|
|
|
650
520
|
return toPath && truncateUrl(toPath);
|
|
651
521
|
}
|
|
652
522
|
}];
|
|
653
|
-
return /*#__PURE__*/jsxRuntime.jsx(
|
|
523
|
+
return /*#__PURE__*/jsxRuntime.jsx(TableWrapper, {
|
|
654
524
|
hasPagination: recordsCount > constants.DEFAULT_PAGE_SIZE,
|
|
655
|
-
children: /*#__PURE__*/jsxRuntime.jsx(
|
|
525
|
+
children: /*#__PURE__*/jsxRuntime.jsx(Table, {
|
|
656
526
|
columnData: columnData,
|
|
657
527
|
currentPageNumber: currentPageNumber,
|
|
658
528
|
fixedHeight: true,
|
|
@@ -707,14 +577,12 @@ var RedirectUrls = function RedirectUrls() {
|
|
|
707
577
|
}),
|
|
708
578
|
_useFetchAllRedirectU2 = _useFetchAllRedirectU.data,
|
|
709
579
|
_useFetchAllRedirectU3 = _useFetchAllRedirectU2 === void 0 ? {} : _useFetchAllRedirectU2,
|
|
710
|
-
_useFetchAllRedirectU4 = _useFetchAllRedirectU3.
|
|
711
|
-
|
|
712
|
-
_useFetchAllRedirectU5 = _useFetchAllRedirectU3.redirectUrls,
|
|
713
|
-
redirectUrls = _useFetchAllRedirectU5 === void 0 ? [] : _useFetchAllRedirectU5,
|
|
580
|
+
_useFetchAllRedirectU4 = _useFetchAllRedirectU3.redirectUrls,
|
|
581
|
+
redirectUrls = _useFetchAllRedirectU4 === void 0 ? [] : _useFetchAllRedirectU4,
|
|
714
582
|
domainRedirectUrl = _useFetchAllRedirectU3.domainRedirectUrl,
|
|
715
583
|
isLoading = _useFetchAllRedirectU.isLoading,
|
|
716
584
|
isFetching = _useFetchAllRedirectU.isFetching;
|
|
717
|
-
var isFiltersVisible =
|
|
585
|
+
var isFiltersVisible = (redirectUrls === null || redirectUrls === void 0 ? void 0 : redirectUrls.length) > 0 || neetoCist.isPresent(searchTerm);
|
|
718
586
|
var _useUpdateRedirectUrl = useUpdateRedirectUrl(),
|
|
719
587
|
updateRedirectUrl = _useUpdateRedirectUrl.mutate;
|
|
720
588
|
var _useDestroyRedirectUr = useDestroyRedirectUrl(),
|
|
@@ -747,13 +615,13 @@ var RedirectUrls = function RedirectUrls() {
|
|
|
747
615
|
var setInitialFocusField = function setInitialFocusField(fieldRef) {
|
|
748
616
|
return initialFocusField.current = fieldRef;
|
|
749
617
|
};
|
|
750
|
-
return /*#__PURE__*/jsxRuntime.jsx(
|
|
618
|
+
return /*#__PURE__*/jsxRuntime.jsx(Container, {
|
|
751
619
|
className: "w-full",
|
|
752
|
-
children: isLoading ? /*#__PURE__*/jsxRuntime.jsx(
|
|
753
|
-
children: [" ", /*#__PURE__*/jsxRuntime.jsx(
|
|
620
|
+
children: isLoading ? /*#__PURE__*/jsxRuntime.jsx(PageLoader, {}) : /*#__PURE__*/jsxRuntime.jsxs(jsxRuntime.Fragment, {
|
|
621
|
+
children: [" ", /*#__PURE__*/jsxRuntime.jsx(Header, {
|
|
754
622
|
breadcrumbs: buildBreadcrumbs(pageTitle),
|
|
755
623
|
title: pageTitle,
|
|
756
|
-
actionBlock: /*#__PURE__*/jsxRuntime.jsx(
|
|
624
|
+
actionBlock: /*#__PURE__*/jsxRuntime.jsx(Button, {
|
|
757
625
|
label: t("neetoRedirectUrls.redirect.add"),
|
|
758
626
|
onClick: function onClick() {
|
|
759
627
|
return setIsModalOpen(true);
|
|
@@ -765,7 +633,7 @@ var RedirectUrls = function RedirectUrls() {
|
|
|
765
633
|
}), /*#__PURE__*/jsxRuntime.jsxs(jsxRuntime.Fragment, {
|
|
766
634
|
children: [ramda.isEmpty(redirectUrls) ? /*#__PURE__*/jsxRuntime.jsx("div", {
|
|
767
635
|
className: "flex h-full w-full items-center justify-center",
|
|
768
|
-
children: /*#__PURE__*/jsxRuntime.jsx(
|
|
636
|
+
children: /*#__PURE__*/jsxRuntime.jsx(NoData, {
|
|
769
637
|
title: t("neetoRedirectUrls.emptyState.redirectURLs.title"),
|
|
770
638
|
helpText: /*#__PURE__*/jsxRuntime.jsx(reactI18next.Trans, {
|
|
771
639
|
i18nKey: "neetoRedirectUrls.emptyState.redirectURLs.description",
|
|
@@ -798,7 +666,7 @@ var RedirectUrls = function RedirectUrls() {
|
|
|
798
666
|
setCurrentPageNumber: setCurrentPageNumber,
|
|
799
667
|
setUrlDetailsToDelete: setUrlDetailsToDelete,
|
|
800
668
|
setUrlDetailsToEdit: setUrlDetailsToEdit,
|
|
801
|
-
recordsCount:
|
|
669
|
+
recordsCount: redirectUrls.length
|
|
802
670
|
})]
|
|
803
671
|
}), /*#__PURE__*/jsxRuntime.jsx(DeleteRedirectUrlModal, {
|
|
804
672
|
detailsToDelete: urlDetailsToDelete,
|
|
@@ -807,7 +675,7 @@ var RedirectUrls = function RedirectUrls() {
|
|
|
807
675
|
},
|
|
808
676
|
handleSubmit: handleRedirectUrlDelete,
|
|
809
677
|
isOpen: urlDetailsToDelete !== null
|
|
810
|
-
}), /*#__PURE__*/jsxRuntime.jsx(
|
|
678
|
+
}), /*#__PURE__*/jsxRuntime.jsx(Pane, {
|
|
811
679
|
initialFocusRef: initialFocusField,
|
|
812
680
|
isOpen: isModalOpen || ramda.isNotNil(urlDetailsToEdit),
|
|
813
681
|
onClose: function onClose() {
|