@bigbinary/neeto-redirect-urls-frontend 2.2.8 → 2.2.10
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 +54 -0
- package/app/javascript/src/translations/en.json +3 -2
- package/app/javascript/src/translations/es.json +54 -0
- package/app/javascript/src/translations/fr.json +54 -0
- package/dist/RedirectUrls.js +160 -134
- package/dist/RedirectUrls.js.map +1 -1
- package/dist/cjs/RedirectUrls.js +161 -135
- 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, {
|
|
@@ -128,12 +133,14 @@ var RedirectUrlPane = function RedirectUrlPane(_ref) {
|
|
|
128
133
|
children: /*#__PURE__*/jsxRuntime.jsxs("div", {
|
|
129
134
|
className: "w-full space-y-4",
|
|
130
135
|
children: [/*#__PURE__*/jsxRuntime.jsx(Input, {
|
|
136
|
+
required: true,
|
|
131
137
|
id: "fromPath",
|
|
132
138
|
label: t("neetoRedirectUrls.redirect.source"),
|
|
133
139
|
name: "fromPath",
|
|
134
140
|
ref: setInitialFocusField,
|
|
135
141
|
placeholder: t("neetoRedirectUrls.common.placeholder.relativeUrl")
|
|
136
142
|
}), /*#__PURE__*/jsxRuntime.jsx(Input, {
|
|
143
|
+
required: true,
|
|
137
144
|
id: "toPath",
|
|
138
145
|
label: t("neetoRedirectUrls.redirect.destination"),
|
|
139
146
|
name: "toPath",
|
|
@@ -152,6 +159,89 @@ var RedirectUrlPane = function RedirectUrlPane(_ref) {
|
|
|
152
159
|
});
|
|
153
160
|
};
|
|
154
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
|
+
|
|
155
245
|
var REDIRECT_URLS_BASE_URL = "/neeto_redirect_urls_engine/api/v1/redirect_urls";
|
|
156
246
|
|
|
157
247
|
var fetch = function fetch() {
|
|
@@ -160,13 +250,16 @@ var fetch = function fetch() {
|
|
|
160
250
|
var fetchAll = function fetchAll(params) {
|
|
161
251
|
return axios.get(REDIRECT_URLS_BASE_URL, params);
|
|
162
252
|
};
|
|
163
|
-
var create = function create(
|
|
164
|
-
|
|
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);
|
|
165
257
|
};
|
|
166
|
-
var update = function update(
|
|
167
|
-
var id =
|
|
168
|
-
payload =
|
|
169
|
-
|
|
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);
|
|
170
263
|
};
|
|
171
264
|
var destroy = function destroy(id) {
|
|
172
265
|
return axios["delete"]("".concat(REDIRECT_URLS_BASE_URL, "/").concat(id));
|
|
@@ -213,18 +306,22 @@ var DOC_BASE_URL = "https://help.".concat(globalProps.appName.toLowerCase(), ".c
|
|
|
213
306
|
var CREATE_REDIRECT_URL_HELP_DOC_URL = "".concat(DOC_BASE_URL, "/creating-a-redirect-url");
|
|
214
307
|
var DOMAIN_LEVEL_REDIRECT_HELP_DOC_URL = "".concat(DOC_BASE_URL, "/domain-level-redirection");
|
|
215
308
|
|
|
216
|
-
var DOMAIN_REDIRECTION_VALIDATION_SCHEMA =
|
|
217
|
-
toPath:
|
|
309
|
+
var DOMAIN_REDIRECTION_VALIDATION_SCHEMA = yup__namespace.object().shape({
|
|
310
|
+
toPath: yup__namespace.string().nullable().when("domainRedirectionActive", {
|
|
218
311
|
is: true,
|
|
219
|
-
then:
|
|
312
|
+
then: yup__namespace.string().required(i18next.t("neetoRedirectUrls.redirect.validations.required", {
|
|
220
313
|
entity: "Destination"
|
|
221
|
-
})).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
|
+
})
|
|
222
318
|
})
|
|
223
319
|
});
|
|
224
320
|
|
|
225
321
|
var DomainRedirection = function DomainRedirection(_ref) {
|
|
226
322
|
var domainRedirectUrl = _ref.domainRedirectUrl,
|
|
227
|
-
entity = _ref.entity
|
|
323
|
+
entity = _ref.entity,
|
|
324
|
+
helpDocUrls = _ref.helpDocUrls;
|
|
228
325
|
var _useState = react.useState(true),
|
|
229
326
|
_useState2 = _slicedToArray(_useState, 2),
|
|
230
327
|
isEditingDomainRedirect = _useState2[0],
|
|
@@ -249,7 +346,9 @@ var DomainRedirection = function DomainRedirection(_ref) {
|
|
|
249
346
|
return domainRedirectUrl ? updateLink({
|
|
250
347
|
id: domainRedirectUrl.id,
|
|
251
348
|
payload: payload
|
|
252
|
-
}) : createLink(
|
|
349
|
+
}) : createLink({
|
|
350
|
+
payload: payload
|
|
351
|
+
});
|
|
253
352
|
};
|
|
254
353
|
var handleRemoveRedirection = function handleRemoveRedirection(domainLinkActive) {
|
|
255
354
|
if (!(domainLinkActive && domainRedirectUrl)) {
|
|
@@ -308,9 +407,9 @@ var DomainRedirection = function DomainRedirection(_ref) {
|
|
|
308
407
|
Link: /*#__PURE__*/jsxRuntime.jsx(Button, {
|
|
309
408
|
className: "text-sm",
|
|
310
409
|
"data-cy": "domain-level-redirections-help-button",
|
|
311
|
-
href: DOMAIN_LEVEL_REDIRECT_HELP_DOC_URL,
|
|
312
410
|
style: "link",
|
|
313
|
-
target: "_blank"
|
|
411
|
+
target: "_blank",
|
|
412
|
+
href: helpDocUrls.domainLevelRedirectUrl || DOMAIN_LEVEL_REDIRECT_HELP_DOC_URL
|
|
314
413
|
})
|
|
315
414
|
}
|
|
316
415
|
})
|
|
@@ -351,102 +450,6 @@ var DomainRedirection = function DomainRedirection(_ref) {
|
|
|
351
450
|
});
|
|
352
451
|
};
|
|
353
452
|
|
|
354
|
-
var SETTINGS_CATEGORIES = {
|
|
355
|
-
GENERAL: "GENERAL"
|
|
356
|
-
};
|
|
357
|
-
var SETTINGS_CATEGORIES_LABELS = _defineProperty({}, SETTINGS_CATEGORIES.GENERAL, i18next.t("neetoRedirectUrls.settings.general.title"));
|
|
358
|
-
|
|
359
|
-
var routes = {
|
|
360
|
-
admin: {
|
|
361
|
-
index: "/admin",
|
|
362
|
-
courses: {
|
|
363
|
-
chapters: {
|
|
364
|
-
show: "/admin/courses/:courseId/chapters/:chapterId",
|
|
365
|
-
chapterVersions: {
|
|
366
|
-
show: "/admin/courses/:courseId/chapters/:chapterId/chapter-versions/:chapterVersionId"
|
|
367
|
-
},
|
|
368
|
-
pages: {
|
|
369
|
-
show: "/admin/courses/:courseId/chapters/:chapterId/pages/:pageId",
|
|
370
|
-
pageVersions: {
|
|
371
|
-
show: "/admin/courses/:courseId/chapters/:chapterId/pages/:pageId/page-versions/:pageVersionId"
|
|
372
|
-
}
|
|
373
|
-
}
|
|
374
|
-
},
|
|
375
|
-
index: "/admin/courses",
|
|
376
|
-
show: "/admin/courses/:courseId",
|
|
377
|
-
deployments: {
|
|
378
|
-
index: "/admin/courses/:courseId/deployments",
|
|
379
|
-
show: "/admin/courses/:courseId/deployments/:deploymentId"
|
|
380
|
-
},
|
|
381
|
-
configure: {
|
|
382
|
-
index: "/admin/courses/:courseId/configure",
|
|
383
|
-
security: "/admin/courses/:courseId/configure/security",
|
|
384
|
-
certificateConfiguration: "/admin/courses/:courseId/configure/certificate_configuration"
|
|
385
|
-
}
|
|
386
|
-
},
|
|
387
|
-
pullRequestApps: {
|
|
388
|
-
index: "/admin/pull_request_apps",
|
|
389
|
-
show: "/admin/pull_request_apps/:pullRequestAppId",
|
|
390
|
-
courseDeployments: {
|
|
391
|
-
show: "/admin/pull_request_apps/:pullRequestAppId/course-deployments/:courseDeploymentId"
|
|
392
|
-
}
|
|
393
|
-
},
|
|
394
|
-
members: "/admin/members",
|
|
395
|
-
settings: {
|
|
396
|
-
index: "/admin/settings",
|
|
397
|
-
general: {
|
|
398
|
-
apiSettings: "/admin/settings/general/api-settings",
|
|
399
|
-
redirectUrls: "/admin/settings/general/redirect-urls",
|
|
400
|
-
basicInfos: "/admin/settings/general/basic-infos",
|
|
401
|
-
customDomains: {
|
|
402
|
-
index: "/admin/settings/general/custom-domains"
|
|
403
|
-
},
|
|
404
|
-
security: {
|
|
405
|
-
index: "/admin/settings/general/security"
|
|
406
|
-
},
|
|
407
|
-
roles: "/admin/settings/general/roles"
|
|
408
|
-
},
|
|
409
|
-
integrations: {
|
|
410
|
-
index: "/admin/settings/integrations",
|
|
411
|
-
stripe: {
|
|
412
|
-
index: "/admin/settings/integrations/stripe",
|
|
413
|
-
manage: "/admin/settings/integrations/stripe/manage"
|
|
414
|
-
},
|
|
415
|
-
googleAnalytics: {
|
|
416
|
-
index: "/admin/settings/integrations/google-analytics",
|
|
417
|
-
manage: "/admin/settings/integrations/google-analytics/manage"
|
|
418
|
-
}
|
|
419
|
-
}
|
|
420
|
-
},
|
|
421
|
-
reports: {
|
|
422
|
-
index: "/admin/reports",
|
|
423
|
-
invalidUrls: "/admin/reports/invalid-urls"
|
|
424
|
-
},
|
|
425
|
-
assets: {
|
|
426
|
-
index: "/admin/assets",
|
|
427
|
-
databases: "/admin/assets/databases",
|
|
428
|
-
videos: "/admin/assets/videos",
|
|
429
|
-
audios: "/admin/assets/audios",
|
|
430
|
-
resources: "/admin/assets/resources"
|
|
431
|
-
}
|
|
432
|
-
},
|
|
433
|
-
home: "/"
|
|
434
|
-
};
|
|
435
|
-
|
|
436
|
-
var buildSettingsBreadcrumbs = function buildSettingsBreadcrumbs(category, pageTitle) {
|
|
437
|
-
return [{
|
|
438
|
-
link: routes.admin.settings.index,
|
|
439
|
-
text: i18next.t("neetoRedirectUrls.settings.title")
|
|
440
|
-
}, {
|
|
441
|
-
link: utils.buildUrl(routes.admin.settings.index, {
|
|
442
|
-
category: category.toLowerCase()
|
|
443
|
-
}),
|
|
444
|
-
text: SETTINGS_CATEGORIES_LABELS[category]
|
|
445
|
-
}].concat(_toConsumableArray(pageTitle ? [{
|
|
446
|
-
text: pageTitle
|
|
447
|
-
}] : []));
|
|
448
|
-
};
|
|
449
|
-
|
|
450
453
|
var buildBreadcrumbs = function buildBreadcrumbs(pageTitle) {
|
|
451
454
|
return buildSettingsBreadcrumbs(SETTINGS_CATEGORIES.GENERAL, pageTitle);
|
|
452
455
|
};
|
|
@@ -550,7 +553,9 @@ var RedirectUrlsTable = function RedirectUrlsTable(_ref) {
|
|
|
550
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; }
|
|
551
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; }
|
|
552
555
|
var RedirectUrls = function RedirectUrls(_ref) {
|
|
553
|
-
var entity = _ref.entity
|
|
556
|
+
var entity = _ref.entity,
|
|
557
|
+
_ref$helpDocUrls = _ref.helpDocUrls,
|
|
558
|
+
helpDocUrls = _ref$helpDocUrls === void 0 ? {} : _ref$helpDocUrls;
|
|
554
559
|
var _useTranslation = reactI18next.useTranslation(),
|
|
555
560
|
t = _useTranslation.t;
|
|
556
561
|
var _useQueryParams = reactUtils.useQueryParams(),
|
|
@@ -595,18 +600,38 @@ var RedirectUrls = function RedirectUrls(_ref) {
|
|
|
595
600
|
updateRedirectUrl = _useUpdateRedirectUrl.mutate;
|
|
596
601
|
var _useDestroyRedirectUr = useDestroyRedirectUrl(),
|
|
597
602
|
deleteRedirectUrl = _useDestroyRedirectUr.mutate;
|
|
598
|
-
var handleCreateRedirectUrl = function handleCreateRedirectUrl(redirectUrl) {
|
|
599
|
-
|
|
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
|
+
},
|
|
600
614
|
onSuccess: function onSuccess() {
|
|
615
|
+
utils.showThumbsUpToastr();
|
|
601
616
|
setIsModalOpen(false);
|
|
602
617
|
}
|
|
603
618
|
});
|
|
604
619
|
};
|
|
605
|
-
var handleRedirectUrlUpdate = function handleRedirectUrlUpdate(redirectUrl) {
|
|
620
|
+
var handleRedirectUrlUpdate = function handleRedirectUrlUpdate(redirectUrl, _ref3) {
|
|
621
|
+
var setSubmitting = _ref3.setSubmitting,
|
|
622
|
+
setStatus = _ref3.setStatus;
|
|
606
623
|
updateRedirectUrl({
|
|
607
624
|
id: redirectUrl.id,
|
|
608
|
-
payload: redirectUrl
|
|
625
|
+
payload: redirectUrl,
|
|
626
|
+
config: SHOW_TOASTR_CONFIG
|
|
609
627
|
}, {
|
|
628
|
+
onError: function onError(error) {
|
|
629
|
+
handleError(setStatus, error);
|
|
630
|
+
setSubmitting(false);
|
|
631
|
+
},
|
|
632
|
+
onSuccess: function onSuccess() {
|
|
633
|
+
utils.showThumbsUpToastr();
|
|
634
|
+
},
|
|
610
635
|
onSettled: function onSettled() {
|
|
611
636
|
setUrlDetailsToEdit(null);
|
|
612
637
|
}
|
|
@@ -648,9 +673,9 @@ var RedirectUrls = function RedirectUrls(_ref) {
|
|
|
648
673
|
i18nKey: "neetoRedirectUrls.emptyState.redirectURLs.description",
|
|
649
674
|
components: {
|
|
650
675
|
helpLink: /*#__PURE__*/jsxRuntime.jsx(Button, {
|
|
651
|
-
href: CREATE_REDIRECT_URL_HELP_DOC_URL,
|
|
652
676
|
style: "link",
|
|
653
|
-
target: "_blank"
|
|
677
|
+
target: "_blank",
|
|
678
|
+
href: helpDocUrls.createRedirectUrl || CREATE_REDIRECT_URL_HELP_DOC_URL
|
|
654
679
|
})
|
|
655
680
|
}
|
|
656
681
|
}),
|
|
@@ -666,7 +691,8 @@ var RedirectUrls = function RedirectUrls(_ref) {
|
|
|
666
691
|
className: "w-full",
|
|
667
692
|
children: /*#__PURE__*/jsxRuntime.jsx(DomainRedirection, {
|
|
668
693
|
domainRedirectUrl: domainRedirectUrl,
|
|
669
|
-
entity: entity
|
|
694
|
+
entity: entity,
|
|
695
|
+
helpDocUrls: helpDocUrls
|
|
670
696
|
})
|
|
671
697
|
}), /*#__PURE__*/jsxRuntime.jsx(RedirectUrlsTable, {
|
|
672
698
|
currentPageNumber: currentPageNumber,
|