@bigbinary/neeto-redirect-urls-frontend 2.2.9 → 2.2.11
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/de.json +55 -0
- package/app/javascript/src/translations/en.json +3 -2
- package/app/javascript/src/translations/es.json +55 -0
- package/app/javascript/src/translations/fr.json +55 -0
- package/dist/RedirectUrls.js +165 -109
- package/dist/RedirectUrls.js.map +1 -1
- package/dist/cjs/RedirectUrls.js +166 -110
- package/dist/cjs/RedirectUrls.js.map +1 -1
- package/dist/cjs/index.js +4 -4
- package/dist/index.js +4 -4
- package/package.json +12 -12
package/dist/cjs/RedirectUrls.js
CHANGED
|
@@ -5,6 +5,7 @@ var _slicedToArray = require('@babel/runtime/helpers/slicedToArray');
|
|
|
5
5
|
var react = require('react');
|
|
6
6
|
var neetoCist = require('@bigbinary/neeto-cist');
|
|
7
7
|
var reactUtils = require('@bigbinary/neeto-commons-frontend/react-utils');
|
|
8
|
+
var utils = require('@bigbinary/neeto-commons-frontend/utils');
|
|
8
9
|
var Container = require('@bigbinary/neeto-molecules/Container');
|
|
9
10
|
var Header = require('@bigbinary/neeto-molecules/Header');
|
|
10
11
|
var PageLoader = require('@bigbinary/neeto-molecules/PageLoader');
|
|
@@ -19,7 +20,10 @@ var Typography = require('@bigbinary/neetoui/Typography');
|
|
|
19
20
|
var Input = require('@bigbinary/neetoui/formik/Input');
|
|
20
21
|
var Form = require('@bigbinary/neetoui/formik/Form');
|
|
21
22
|
var ActionBlock = require('@bigbinary/neetoui/formik/ActionBlock');
|
|
22
|
-
var
|
|
23
|
+
var i18next = require('i18next');
|
|
24
|
+
var constants = require('@bigbinary/neeto-commons-frontend/constants');
|
|
25
|
+
var yup = require('yup');
|
|
26
|
+
var _toConsumableArray = require('@babel/runtime/helpers/toConsumableArray');
|
|
23
27
|
var reactQuery = require('@tanstack/react-query');
|
|
24
28
|
var axios = require('axios');
|
|
25
29
|
var Edit = require('@bigbinary/neeto-icons/Edit');
|
|
@@ -27,13 +31,9 @@ var CardLayout = require('@bigbinary/neeto-molecules/CardLayout');
|
|
|
27
31
|
var InlineInput = require('@bigbinary/neeto-molecules/InlineInput');
|
|
28
32
|
var Label = require('@bigbinary/neetoui/Label');
|
|
29
33
|
var Switch = require('@bigbinary/neetoui/formik/Switch');
|
|
30
|
-
var i18next = require('i18next');
|
|
31
|
-
var constants = require('@bigbinary/neeto-commons-frontend/constants');
|
|
32
34
|
var MoreDropdown = require('@bigbinary/neeto-molecules/MoreDropdown');
|
|
33
35
|
var TableWrapper = require('@bigbinary/neeto-molecules/TableWrapper');
|
|
34
36
|
var Table = require('@bigbinary/neetoui/Table');
|
|
35
|
-
var _toConsumableArray = require('@babel/runtime/helpers/toConsumableArray');
|
|
36
|
-
var utils = require('@bigbinary/neeto-commons-frontend/utils');
|
|
37
37
|
|
|
38
38
|
function _interopNamespaceDefault(e) {
|
|
39
39
|
var n = Object.create(null);
|
|
@@ -52,7 +52,7 @@ function _interopNamespaceDefault(e) {
|
|
|
52
52
|
return Object.freeze(n);
|
|
53
53
|
}
|
|
54
54
|
|
|
55
|
-
var
|
|
55
|
+
var yup__namespace = /*#__PURE__*/_interopNamespaceDefault(yup);
|
|
56
56
|
|
|
57
57
|
var DeleteRedirectUrlModal = function DeleteRedirectUrlModal(_ref) {
|
|
58
58
|
var handleClose = _ref.handleClose,
|
|
@@ -84,9 +84,21 @@ var DeleteRedirectUrlModal = function DeleteRedirectUrlModal(_ref) {
|
|
|
84
84
|
});
|
|
85
85
|
};
|
|
86
86
|
|
|
87
|
-
var URL_WITH_PROTOCOL_REGEX = /^(http(s)?):\/\/[(www.)?a-zA-Z0-9@:%._+~#=-]{2,256}\.[a-z]{2,6}\b([-a-zA-Z0-9@:%_+.~#?&//=]*)$/g;
|
|
88
87
|
var URL_PATHNAME_REGEX = /^\/[-a-zA-Z0-9@:%_+.~#?&//=]*$/g;
|
|
89
88
|
|
|
89
|
+
var REDIRECT_URL_VALIDATION_SCHEMA = yup__namespace.object().shape({
|
|
90
|
+
fromPath: yup__namespace.string().required(i18next.t("neetoRedirectUrls.redirect.validations.required", {
|
|
91
|
+
entity: "Source"
|
|
92
|
+
})).matches(URL_PATHNAME_REGEX, i18next.t("neetoRedirectUrls.redirect.validations.source")),
|
|
93
|
+
toPath: yup__namespace.string().required(i18next.t("neetoRedirectUrls.redirect.validations.required", {
|
|
94
|
+
entity: "Destination"
|
|
95
|
+
})).matches(new RegExp("".concat(constants.VALID_URL_REGEX.source, "|").concat(URL_PATHNAME_REGEX.source)), i18next.t("neetoRedirectUrls.redirect.validations.destination")).test("paths-not-same", i18next.t("neetoRedirectUrls.redirect.validations.samePaths"), function (value, context) {
|
|
96
|
+
var fromPath = context.parent.fromPath;
|
|
97
|
+
if (!value || !fromPath) return true;
|
|
98
|
+
return value !== fromPath;
|
|
99
|
+
})
|
|
100
|
+
});
|
|
101
|
+
|
|
90
102
|
function ownKeys$2(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }
|
|
91
103
|
function _objectSpread$2(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys$2(Object(t), !0).forEach(function (r) { _defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys$2(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }
|
|
92
104
|
var RedirectUrlPane = function RedirectUrlPane(_ref) {
|
|
@@ -111,16 +123,9 @@ var RedirectUrlPane = function RedirectUrlPane(_ref) {
|
|
|
111
123
|
fromPath: "",
|
|
112
124
|
toPath: ""
|
|
113
125
|
},
|
|
114
|
-
validationSchema:
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
})).matches(URL_PATHNAME_REGEX, t("neetoRedirectUrls.redirect.validations.source")),
|
|
118
|
-
toPath: Yup__namespace.string().required(t("neetoRedirectUrls.redirect.validations.required", {
|
|
119
|
-
entity: "Destination"
|
|
120
|
-
})).matches(new RegExp("".concat(URL_WITH_PROTOCOL_REGEX.source, "|").concat(URL_PATHNAME_REGEX.source)), t("neetoRedirectUrls.redirect.validations.destination"))
|
|
121
|
-
}),
|
|
122
|
-
onSubmit: function onSubmit(values) {
|
|
123
|
-
handleSubmit(_objectSpread$2({}, values));
|
|
126
|
+
validationSchema: REDIRECT_URL_VALIDATION_SCHEMA,
|
|
127
|
+
onSubmit: function onSubmit(values, formikBag) {
|
|
128
|
+
handleSubmit(_objectSpread$2({}, values), formikBag);
|
|
124
129
|
}
|
|
125
130
|
},
|
|
126
131
|
children: /*#__PURE__*/jsxRuntime.jsxs(jsxRuntime.Fragment, {
|
|
@@ -154,6 +159,89 @@ var RedirectUrlPane = function RedirectUrlPane(_ref) {
|
|
|
154
159
|
});
|
|
155
160
|
};
|
|
156
161
|
|
|
162
|
+
var SETTINGS_CATEGORIES = {
|
|
163
|
+
GENERAL: "GENERAL"
|
|
164
|
+
};
|
|
165
|
+
var SETTINGS_CATEGORIES_LABELS = _defineProperty({}, SETTINGS_CATEGORIES.GENERAL, i18next.t("neetoRedirectUrls.settings.general.title"));
|
|
166
|
+
var SHOW_TOASTR_CONFIG = {
|
|
167
|
+
showToastr: false
|
|
168
|
+
};
|
|
169
|
+
|
|
170
|
+
var routes = {
|
|
171
|
+
admin: {
|
|
172
|
+
index: "/admin",
|
|
173
|
+
courses: {
|
|
174
|
+
chapters: {
|
|
175
|
+
show: "/admin/courses/:courseId/chapters/:chapterId",
|
|
176
|
+
chapterVersions: {
|
|
177
|
+
show: "/admin/courses/:courseId/chapters/:chapterId/chapter-versions/:chapterVersionId"
|
|
178
|
+
},
|
|
179
|
+
pages: {
|
|
180
|
+
show: "/admin/courses/:courseId/chapters/:chapterId/pages/:pageId",
|
|
181
|
+
pageVersions: {
|
|
182
|
+
show: "/admin/courses/:courseId/chapters/:chapterId/pages/:pageId/page-versions/:pageVersionId"
|
|
183
|
+
}
|
|
184
|
+
}
|
|
185
|
+
},
|
|
186
|
+
index: "/admin/courses",
|
|
187
|
+
show: "/admin/courses/:courseId",
|
|
188
|
+
deployments: {
|
|
189
|
+
index: "/admin/courses/:courseId/deployments",
|
|
190
|
+
show: "/admin/courses/:courseId/deployments/:deploymentId"
|
|
191
|
+
},
|
|
192
|
+
configure: {
|
|
193
|
+
index: "/admin/courses/:courseId/configure",
|
|
194
|
+
security: "/admin/courses/:courseId/configure/security",
|
|
195
|
+
certificateConfiguration: "/admin/courses/:courseId/configure/certificate_configuration"
|
|
196
|
+
}
|
|
197
|
+
},
|
|
198
|
+
pullRequestApps: {
|
|
199
|
+
index: "/admin/pull_request_apps",
|
|
200
|
+
show: "/admin/pull_request_apps/:pullRequestAppId",
|
|
201
|
+
courseDeployments: {
|
|
202
|
+
show: "/admin/pull_request_apps/:pullRequestAppId/course-deployments/:courseDeploymentId"
|
|
203
|
+
}
|
|
204
|
+
},
|
|
205
|
+
members: "/admin/members",
|
|
206
|
+
adminPanel: "/admin/admin-panel",
|
|
207
|
+
reports: {
|
|
208
|
+
index: "/admin/reports",
|
|
209
|
+
invalidUrls: "/admin/reports/invalid-urls"
|
|
210
|
+
},
|
|
211
|
+
assets: {
|
|
212
|
+
index: "/admin/assets",
|
|
213
|
+
databases: "/admin/assets/databases",
|
|
214
|
+
videos: "/admin/assets/videos",
|
|
215
|
+
audios: "/admin/assets/audios",
|
|
216
|
+
resources: "/admin/assets/resources"
|
|
217
|
+
}
|
|
218
|
+
},
|
|
219
|
+
home: "/"
|
|
220
|
+
};
|
|
221
|
+
|
|
222
|
+
var buildSettingsBreadcrumbs = function buildSettingsBreadcrumbs(category, pageTitle) {
|
|
223
|
+
return [{
|
|
224
|
+
link: routes.admin.adminPanel,
|
|
225
|
+
text: i18next.t("neetoRedirectUrls.settings.title")
|
|
226
|
+
}, {
|
|
227
|
+
link: utils.buildUrl(routes.admin.adminPanel, {
|
|
228
|
+
category: category.toLowerCase()
|
|
229
|
+
}),
|
|
230
|
+
text: SETTINGS_CATEGORIES_LABELS[category]
|
|
231
|
+
}].concat(_toConsumableArray(pageTitle ? [{
|
|
232
|
+
text: pageTitle
|
|
233
|
+
}] : []));
|
|
234
|
+
};
|
|
235
|
+
var normalizeURL = function normalizeURL(url) {
|
|
236
|
+
return url ? url.replace(/\/+$/, "") : "";
|
|
237
|
+
};
|
|
238
|
+
var handleError = function handleError(setStatus, error) {
|
|
239
|
+
var response = error.response;
|
|
240
|
+
if (response && response.data && response.data.errors) {
|
|
241
|
+
setStatus(response.data.errors);
|
|
242
|
+
}
|
|
243
|
+
};
|
|
244
|
+
|
|
157
245
|
var REDIRECT_URLS_BASE_URL = "/neeto_redirect_urls_engine/api/v1/redirect_urls";
|
|
158
246
|
|
|
159
247
|
var fetch = function fetch() {
|
|
@@ -162,13 +250,16 @@ var fetch = function fetch() {
|
|
|
162
250
|
var fetchAll = function fetchAll(params) {
|
|
163
251
|
return axios.get(REDIRECT_URLS_BASE_URL, params);
|
|
164
252
|
};
|
|
165
|
-
var create = function create(
|
|
166
|
-
|
|
253
|
+
var create = function create(_ref) {
|
|
254
|
+
var payload = _ref.payload,
|
|
255
|
+
config = _ref.config;
|
|
256
|
+
return axios.post(REDIRECT_URLS_BASE_URL, payload, config);
|
|
167
257
|
};
|
|
168
|
-
var update = function update(
|
|
169
|
-
var id =
|
|
170
|
-
payload =
|
|
171
|
-
|
|
258
|
+
var update = function update(_ref2) {
|
|
259
|
+
var id = _ref2.id,
|
|
260
|
+
payload = _ref2.payload,
|
|
261
|
+
config = _ref2.config;
|
|
262
|
+
return axios.put("".concat(REDIRECT_URLS_BASE_URL, "/").concat(id), payload, config);
|
|
172
263
|
};
|
|
173
264
|
var destroy = function destroy(id) {
|
|
174
265
|
return axios["delete"]("".concat(REDIRECT_URLS_BASE_URL, "/").concat(id));
|
|
@@ -215,18 +306,22 @@ var DOC_BASE_URL = "https://help.".concat(globalProps.appName.toLowerCase(), ".c
|
|
|
215
306
|
var CREATE_REDIRECT_URL_HELP_DOC_URL = "".concat(DOC_BASE_URL, "/creating-a-redirect-url");
|
|
216
307
|
var DOMAIN_LEVEL_REDIRECT_HELP_DOC_URL = "".concat(DOC_BASE_URL, "/domain-level-redirection");
|
|
217
308
|
|
|
218
|
-
var DOMAIN_REDIRECTION_VALIDATION_SCHEMA =
|
|
219
|
-
toPath:
|
|
309
|
+
var DOMAIN_REDIRECTION_VALIDATION_SCHEMA = yup__namespace.object().shape({
|
|
310
|
+
toPath: yup__namespace.string().nullable().when("domainRedirectionActive", {
|
|
220
311
|
is: true,
|
|
221
|
-
then:
|
|
312
|
+
then: yup__namespace.string().required(i18next.t("neetoRedirectUrls.redirect.validations.required", {
|
|
222
313
|
entity: "Destination"
|
|
223
|
-
})).matches(
|
|
314
|
+
})).matches(constants.VALID_URL_REGEX, i18next.t("neetoRedirectUrls.redirect.validations.destination")).test("not-duplicate-domain", i18next.t("neetoRedirectUrls.redirect.validations.duplicateDomain"), function (value) {
|
|
315
|
+
if (!value) return true;
|
|
316
|
+
return normalizeURL(value) !== normalizeURL(location.origin);
|
|
317
|
+
})
|
|
224
318
|
})
|
|
225
319
|
});
|
|
226
320
|
|
|
227
321
|
var DomainRedirection = function DomainRedirection(_ref) {
|
|
228
322
|
var domainRedirectUrl = _ref.domainRedirectUrl,
|
|
229
|
-
entity = _ref.entity
|
|
323
|
+
entity = _ref.entity,
|
|
324
|
+
helpDocUrls = _ref.helpDocUrls;
|
|
230
325
|
var _useState = react.useState(true),
|
|
231
326
|
_useState2 = _slicedToArray(_useState, 2),
|
|
232
327
|
isEditingDomainRedirect = _useState2[0],
|
|
@@ -251,7 +346,9 @@ var DomainRedirection = function DomainRedirection(_ref) {
|
|
|
251
346
|
return domainRedirectUrl ? updateLink({
|
|
252
347
|
id: domainRedirectUrl.id,
|
|
253
348
|
payload: payload
|
|
254
|
-
}) : createLink(
|
|
349
|
+
}) : createLink({
|
|
350
|
+
payload: payload
|
|
351
|
+
});
|
|
255
352
|
};
|
|
256
353
|
var handleRemoveRedirection = function handleRemoveRedirection(domainLinkActive) {
|
|
257
354
|
if (!(domainLinkActive && domainRedirectUrl)) {
|
|
@@ -310,9 +407,9 @@ var DomainRedirection = function DomainRedirection(_ref) {
|
|
|
310
407
|
Link: /*#__PURE__*/jsxRuntime.jsx(Button, {
|
|
311
408
|
className: "text-sm",
|
|
312
409
|
"data-cy": "domain-level-redirections-help-button",
|
|
313
|
-
href: DOMAIN_LEVEL_REDIRECT_HELP_DOC_URL,
|
|
314
410
|
style: "link",
|
|
315
|
-
target: "_blank"
|
|
411
|
+
target: "_blank",
|
|
412
|
+
href: helpDocUrls.domainLevelRedirectUrl || DOMAIN_LEVEL_REDIRECT_HELP_DOC_URL
|
|
316
413
|
})
|
|
317
414
|
}
|
|
318
415
|
})
|
|
@@ -353,77 +450,6 @@ var DomainRedirection = function DomainRedirection(_ref) {
|
|
|
353
450
|
});
|
|
354
451
|
};
|
|
355
452
|
|
|
356
|
-
var SETTINGS_CATEGORIES = {
|
|
357
|
-
GENERAL: "GENERAL"
|
|
358
|
-
};
|
|
359
|
-
var SETTINGS_CATEGORIES_LABELS = _defineProperty({}, SETTINGS_CATEGORIES.GENERAL, i18next.t("neetoRedirectUrls.settings.general.title"));
|
|
360
|
-
|
|
361
|
-
var routes = {
|
|
362
|
-
admin: {
|
|
363
|
-
index: "/admin",
|
|
364
|
-
courses: {
|
|
365
|
-
chapters: {
|
|
366
|
-
show: "/admin/courses/:courseId/chapters/:chapterId",
|
|
367
|
-
chapterVersions: {
|
|
368
|
-
show: "/admin/courses/:courseId/chapters/:chapterId/chapter-versions/:chapterVersionId"
|
|
369
|
-
},
|
|
370
|
-
pages: {
|
|
371
|
-
show: "/admin/courses/:courseId/chapters/:chapterId/pages/:pageId",
|
|
372
|
-
pageVersions: {
|
|
373
|
-
show: "/admin/courses/:courseId/chapters/:chapterId/pages/:pageId/page-versions/:pageVersionId"
|
|
374
|
-
}
|
|
375
|
-
}
|
|
376
|
-
},
|
|
377
|
-
index: "/admin/courses",
|
|
378
|
-
show: "/admin/courses/:courseId",
|
|
379
|
-
deployments: {
|
|
380
|
-
index: "/admin/courses/:courseId/deployments",
|
|
381
|
-
show: "/admin/courses/:courseId/deployments/:deploymentId"
|
|
382
|
-
},
|
|
383
|
-
configure: {
|
|
384
|
-
index: "/admin/courses/:courseId/configure",
|
|
385
|
-
security: "/admin/courses/:courseId/configure/security",
|
|
386
|
-
certificateConfiguration: "/admin/courses/:courseId/configure/certificate_configuration"
|
|
387
|
-
}
|
|
388
|
-
},
|
|
389
|
-
pullRequestApps: {
|
|
390
|
-
index: "/admin/pull_request_apps",
|
|
391
|
-
show: "/admin/pull_request_apps/:pullRequestAppId",
|
|
392
|
-
courseDeployments: {
|
|
393
|
-
show: "/admin/pull_request_apps/:pullRequestAppId/course-deployments/:courseDeploymentId"
|
|
394
|
-
}
|
|
395
|
-
},
|
|
396
|
-
members: "/admin/members",
|
|
397
|
-
adminPanel: "/admin/admin-panel",
|
|
398
|
-
reports: {
|
|
399
|
-
index: "/admin/reports",
|
|
400
|
-
invalidUrls: "/admin/reports/invalid-urls"
|
|
401
|
-
},
|
|
402
|
-
assets: {
|
|
403
|
-
index: "/admin/assets",
|
|
404
|
-
databases: "/admin/assets/databases",
|
|
405
|
-
videos: "/admin/assets/videos",
|
|
406
|
-
audios: "/admin/assets/audios",
|
|
407
|
-
resources: "/admin/assets/resources"
|
|
408
|
-
}
|
|
409
|
-
},
|
|
410
|
-
home: "/"
|
|
411
|
-
};
|
|
412
|
-
|
|
413
|
-
var buildSettingsBreadcrumbs = function buildSettingsBreadcrumbs(category, pageTitle) {
|
|
414
|
-
return [{
|
|
415
|
-
link: routes.admin.adminPanel,
|
|
416
|
-
text: i18next.t("neetoRedirectUrls.settings.title")
|
|
417
|
-
}, {
|
|
418
|
-
link: utils.buildUrl(routes.admin.adminPanel, {
|
|
419
|
-
category: category.toLowerCase()
|
|
420
|
-
}),
|
|
421
|
-
text: SETTINGS_CATEGORIES_LABELS[category]
|
|
422
|
-
}].concat(_toConsumableArray(pageTitle ? [{
|
|
423
|
-
text: pageTitle
|
|
424
|
-
}] : []));
|
|
425
|
-
};
|
|
426
|
-
|
|
427
453
|
var buildBreadcrumbs = function buildBreadcrumbs(pageTitle) {
|
|
428
454
|
return buildSettingsBreadcrumbs(SETTINGS_CATEGORIES.GENERAL, pageTitle);
|
|
429
455
|
};
|
|
@@ -527,7 +553,9 @@ var RedirectUrlsTable = function RedirectUrlsTable(_ref) {
|
|
|
527
553
|
function ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }
|
|
528
554
|
function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys(Object(t), !0).forEach(function (r) { _defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }
|
|
529
555
|
var RedirectUrls = function RedirectUrls(_ref) {
|
|
530
|
-
var entity = _ref.entity
|
|
556
|
+
var entity = _ref.entity,
|
|
557
|
+
_ref$helpDocUrls = _ref.helpDocUrls,
|
|
558
|
+
helpDocUrls = _ref$helpDocUrls === void 0 ? {} : _ref$helpDocUrls;
|
|
531
559
|
var _useTranslation = reactI18next.useTranslation(),
|
|
532
560
|
t = _useTranslation.t;
|
|
533
561
|
var _useQueryParams = reactUtils.useQueryParams(),
|
|
@@ -572,18 +600,38 @@ var RedirectUrls = function RedirectUrls(_ref) {
|
|
|
572
600
|
updateRedirectUrl = _useUpdateRedirectUrl.mutate;
|
|
573
601
|
var _useDestroyRedirectUr = useDestroyRedirectUrl(),
|
|
574
602
|
deleteRedirectUrl = _useDestroyRedirectUr.mutate;
|
|
575
|
-
var handleCreateRedirectUrl = function handleCreateRedirectUrl(redirectUrl) {
|
|
576
|
-
|
|
603
|
+
var handleCreateRedirectUrl = function handleCreateRedirectUrl(redirectUrl, _ref2) {
|
|
604
|
+
var setSubmitting = _ref2.setSubmitting,
|
|
605
|
+
setStatus = _ref2.setStatus;
|
|
606
|
+
createRedirectUrl({
|
|
607
|
+
payload: redirectUrl,
|
|
608
|
+
config: SHOW_TOASTR_CONFIG
|
|
609
|
+
}, {
|
|
610
|
+
onError: function onError(error) {
|
|
611
|
+
handleError(setStatus, error);
|
|
612
|
+
setSubmitting(false);
|
|
613
|
+
},
|
|
577
614
|
onSuccess: function onSuccess() {
|
|
615
|
+
utils.showThumbsUpToastr();
|
|
578
616
|
setIsModalOpen(false);
|
|
579
617
|
}
|
|
580
618
|
});
|
|
581
619
|
};
|
|
582
|
-
var handleRedirectUrlUpdate = function handleRedirectUrlUpdate(redirectUrl) {
|
|
620
|
+
var handleRedirectUrlUpdate = function handleRedirectUrlUpdate(redirectUrl, _ref3) {
|
|
621
|
+
var setSubmitting = _ref3.setSubmitting,
|
|
622
|
+
setStatus = _ref3.setStatus;
|
|
583
623
|
updateRedirectUrl({
|
|
584
624
|
id: redirectUrl.id,
|
|
585
|
-
payload: redirectUrl
|
|
625
|
+
payload: redirectUrl,
|
|
626
|
+
config: SHOW_TOASTR_CONFIG
|
|
586
627
|
}, {
|
|
628
|
+
onError: function onError(error) {
|
|
629
|
+
handleError(setStatus, error);
|
|
630
|
+
setSubmitting(false);
|
|
631
|
+
},
|
|
632
|
+
onSuccess: function onSuccess() {
|
|
633
|
+
utils.showThumbsUpToastr();
|
|
634
|
+
},
|
|
587
635
|
onSettled: function onSettled() {
|
|
588
636
|
setUrlDetailsToEdit(null);
|
|
589
637
|
}
|
|
@@ -615,6 +663,13 @@ var RedirectUrls = function RedirectUrls(_ref) {
|
|
|
615
663
|
}),
|
|
616
664
|
searchProps: isFiltersVisible && {
|
|
617
665
|
placeholder: t("neetoRedirectUrls.redirect.search")
|
|
666
|
+
},
|
|
667
|
+
titleHelpPopoverProps: {
|
|
668
|
+
title: t("neetoRedirectUrls.settings.redirecturl.title"),
|
|
669
|
+
description: t("neetoRedirectUrls.settings.redirecturl.description"),
|
|
670
|
+
helpLinkProps: {
|
|
671
|
+
href: helpDocUrls.createRedirectUrl || CREATE_REDIRECT_URL_HELP_DOC_URL
|
|
672
|
+
}
|
|
618
673
|
}
|
|
619
674
|
}), /*#__PURE__*/jsxRuntime.jsxs(jsxRuntime.Fragment, {
|
|
620
675
|
children: [ramda.isEmpty(redirectUrls) ? /*#__PURE__*/jsxRuntime.jsx("div", {
|
|
@@ -625,9 +680,9 @@ var RedirectUrls = function RedirectUrls(_ref) {
|
|
|
625
680
|
i18nKey: "neetoRedirectUrls.emptyState.redirectURLs.description",
|
|
626
681
|
components: {
|
|
627
682
|
helpLink: /*#__PURE__*/jsxRuntime.jsx(Button, {
|
|
628
|
-
href: CREATE_REDIRECT_URL_HELP_DOC_URL,
|
|
629
683
|
style: "link",
|
|
630
|
-
target: "_blank"
|
|
684
|
+
target: "_blank",
|
|
685
|
+
href: helpDocUrls.createRedirectUrl || CREATE_REDIRECT_URL_HELP_DOC_URL
|
|
631
686
|
})
|
|
632
687
|
}
|
|
633
688
|
}),
|
|
@@ -643,7 +698,8 @@ var RedirectUrls = function RedirectUrls(_ref) {
|
|
|
643
698
|
className: "w-full",
|
|
644
699
|
children: /*#__PURE__*/jsxRuntime.jsx(DomainRedirection, {
|
|
645
700
|
domainRedirectUrl: domainRedirectUrl,
|
|
646
|
-
entity: entity
|
|
701
|
+
entity: entity,
|
|
702
|
+
helpDocUrls: helpDocUrls
|
|
647
703
|
})
|
|
648
704
|
}), /*#__PURE__*/jsxRuntime.jsx(RedirectUrlsTable, {
|
|
649
705
|
currentPageNumber: currentPageNumber,
|