@bigbinary/neeto-custom-domains-frontend 3.2.2 → 3.3.0
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 +65 -8
- package/app/javascript/src/translations/en.json +7 -5
- package/dist/.ready +1 -0
- package/dist/CustomDomain.js +77 -46
- package/dist/CustomDomain.js.map +1 -1
- package/dist/cjs/CustomDomain.js +74 -43
- package/dist/cjs/CustomDomain.js.map +1 -1
- package/dist/cjs/index.js +3 -3
- package/dist/index.js +3 -3
- package/package.json +27 -27
package/dist/cjs/CustomDomain.js
CHANGED
|
@@ -4,12 +4,12 @@ var _slicedToArray = require('@babel/runtime/helpers/slicedToArray');
|
|
|
4
4
|
var React = require('react');
|
|
5
5
|
var neetoCist = require('@bigbinary/neeto-cist');
|
|
6
6
|
var reactUtils = require('@bigbinary/neeto-commons-frontend/react-utils');
|
|
7
|
-
var Container = require('@bigbinary/neeto-molecules/Container');
|
|
8
7
|
var Spinner = require('@bigbinary/neetoui/Spinner');
|
|
9
8
|
var _defineProperty = require('@babel/runtime/helpers/defineProperty');
|
|
10
9
|
var reactQuery = require('@tanstack/react-query');
|
|
11
10
|
var useMutationWithInvalidation = require('@bigbinary/neeto-commons-frontend/react-utils/useMutationWithInvalidation');
|
|
12
11
|
var axios = require('axios');
|
|
12
|
+
var Container = require('@bigbinary/neeto-molecules/Container');
|
|
13
13
|
var Alert = require('@bigbinary/neetoui/Alert');
|
|
14
14
|
var reactI18next = require('react-i18next');
|
|
15
15
|
var jsxRuntime = require('react/jsx-runtime');
|
|
@@ -17,11 +17,11 @@ var classNames = require('classnames');
|
|
|
17
17
|
var constants = require('@bigbinary/neeto-commons-frontend/constants');
|
|
18
18
|
var CustomDomain$1 = require('@bigbinary/neeto-icons/CustomDomain');
|
|
19
19
|
var ExternalLink = require('@bigbinary/neeto-icons/ExternalLink');
|
|
20
|
-
var CardLayout = require('@bigbinary/neeto-molecules/CardLayout');
|
|
21
|
-
var MoreDropdown = require('@bigbinary/neeto-molecules/MoreDropdown');
|
|
22
20
|
var Button = require('@bigbinary/neetoui/Button');
|
|
23
21
|
var Typography = require('@bigbinary/neetoui/Typography');
|
|
24
22
|
var Tooltip = require('@bigbinary/neetoui/Tooltip');
|
|
23
|
+
var CardLayout = require('@bigbinary/neeto-molecules/CardLayout');
|
|
24
|
+
var MoreDropdown = require('@bigbinary/neeto-molecules/MoreDropdown');
|
|
25
25
|
var CheckCircle = require('@bigbinary/neeto-icons/CheckCircle');
|
|
26
26
|
var Warning2 = require('@bigbinary/neeto-icons/Warning2');
|
|
27
27
|
var CloseCircle = require('@bigbinary/neeto-icons/CloseCircle');
|
|
@@ -94,7 +94,7 @@ var domainsApi = {
|
|
|
94
94
|
var DOMAIN_QUERY_KEY = "custom-domain";
|
|
95
95
|
|
|
96
96
|
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; }
|
|
97
|
-
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),
|
|
97
|
+
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), true).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; }
|
|
98
98
|
var useCreateCustomDomain = function useCreateCustomDomain(url) {
|
|
99
99
|
var options = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};
|
|
100
100
|
return useMutationWithInvalidation(function (payload) {
|
|
@@ -182,9 +182,12 @@ var DNS_TARGETS = {
|
|
|
182
182
|
|
|
183
183
|
var Domain = function Domain(_ref) {
|
|
184
184
|
var isCustomDomainAdded = _ref.isCustomDomainAdded,
|
|
185
|
+
disconnectedIntegrationCardDescription = _ref.disconnectedIntegrationCardDescription,
|
|
186
|
+
connectedIntegrationCardDescription = _ref.connectedIntegrationCardDescription,
|
|
185
187
|
openPane = _ref.openPane,
|
|
186
188
|
customDomains = _ref.customDomains,
|
|
187
189
|
openDeleteAlert = _ref.openDeleteAlert,
|
|
190
|
+
helpDocUrl = _ref.helpDocUrl,
|
|
188
191
|
setSelectedCustomDomain = _ref.setSelectedCustomDomain;
|
|
189
192
|
var _useTranslation = reactI18next.useTranslation(),
|
|
190
193
|
t = _useTranslation.t;
|
|
@@ -280,19 +283,39 @@ var Domain = function Domain(_ref) {
|
|
|
280
283
|
"data-testid": "delete-custom-domain-button"
|
|
281
284
|
}]
|
|
282
285
|
})]
|
|
283
|
-
}), /*#__PURE__*/jsxRuntime.jsxs(
|
|
284
|
-
|
|
285
|
-
|
|
286
|
-
|
|
287
|
-
|
|
288
|
-
|
|
289
|
-
|
|
290
|
-
|
|
291
|
-
|
|
292
|
-
|
|
293
|
-
|
|
294
|
-
|
|
295
|
-
|
|
286
|
+
}), /*#__PURE__*/jsxRuntime.jsxs("div", {
|
|
287
|
+
children: [/*#__PURE__*/jsxRuntime.jsxs(Typography, {
|
|
288
|
+
className: "neeto-ui-text-gray-600",
|
|
289
|
+
style: "body2",
|
|
290
|
+
children: [(customDomain === null || customDomain === void 0 ? void 0 : customDomain.status) === "active" && (customDomain === null || customDomain === void 0 ? void 0 : customDomain.redirection) && /*#__PURE__*/jsxRuntime.jsxs("span", {
|
|
291
|
+
children: [/*#__PURE__*/jsxRuntime.jsx(reactI18next.Trans, {
|
|
292
|
+
components: {
|
|
293
|
+
b: /*#__PURE__*/jsxRuntime.jsx("b", {})
|
|
294
|
+
},
|
|
295
|
+
i18nKey: "neetoCustomDomains.redirectionTooltipDescription",
|
|
296
|
+
values: {
|
|
297
|
+
fromDomain: customDomain === null || customDomain === void 0 ? void 0 : customDomain.hostname,
|
|
298
|
+
toDomain: customDomain === null || customDomain === void 0 || (_customDomain$redirec = customDomain.redirection) === null || _customDomain$redirec === void 0 ? void 0 : _customDomain$redirec.toHostname
|
|
299
|
+
}
|
|
300
|
+
}), " ", connectedIntegrationCardDescription || ""]
|
|
301
|
+
}), (customDomain === null || customDomain === void 0 ? void 0 : customDomain.status) === "active" && !(customDomain !== null && customDomain !== void 0 && customDomain.redirection) && /*#__PURE__*/jsxRuntime.jsxs("span", {
|
|
302
|
+
children: [t("neetoCustomDomains.activeTooltipDescription"), " ", connectedIntegrationCardDescription || ""]
|
|
303
|
+
}), (customDomain === null || customDomain === void 0 ? void 0 : customDomain.status) === "pending" && t("neetoCustomDomains.pendingTooltipDescription"), (customDomain === null || customDomain === void 0 ? void 0 : customDomain.status) === "failed" && t("neetoCustomDomains.failedTooltipDescription")]
|
|
304
|
+
}), /*#__PURE__*/jsxRuntime.jsx(Typography, {
|
|
305
|
+
className: "neeto-ui-text-gray-600 mt-2",
|
|
306
|
+
style: "body2",
|
|
307
|
+
children: /*#__PURE__*/jsxRuntime.jsx(reactI18next.Trans, {
|
|
308
|
+
i18nKey: "neetoCustomDomains.noData.helpTextConnected",
|
|
309
|
+
components: {
|
|
310
|
+
Link: /*#__PURE__*/jsxRuntime.jsx(Button, {
|
|
311
|
+
href: helpDocUrl,
|
|
312
|
+
rel: "noreferrer",
|
|
313
|
+
style: "link",
|
|
314
|
+
target: "_blank"
|
|
315
|
+
})
|
|
316
|
+
}
|
|
317
|
+
})
|
|
318
|
+
})]
|
|
296
319
|
})]
|
|
297
320
|
})]
|
|
298
321
|
}, index);
|
|
@@ -319,10 +342,26 @@ var Domain = function Domain(_ref) {
|
|
|
319
342
|
style: "h4",
|
|
320
343
|
weight: "medium",
|
|
321
344
|
children: t("neetoCustomDomains.noData.title")
|
|
322
|
-
}), /*#__PURE__*/jsxRuntime.
|
|
323
|
-
|
|
324
|
-
|
|
325
|
-
|
|
345
|
+
}), /*#__PURE__*/jsxRuntime.jsxs("div", {
|
|
346
|
+
children: [/*#__PURE__*/jsxRuntime.jsx(Typography, {
|
|
347
|
+
className: "neeto-ui-text-gray-600",
|
|
348
|
+
style: "body2",
|
|
349
|
+
children: disconnectedIntegrationCardDescription || t("neetoCustomDomains.noData.helpTextDefault")
|
|
350
|
+
}), /*#__PURE__*/jsxRuntime.jsx(Typography, {
|
|
351
|
+
className: "neeto-ui-text-gray-600 mt-2",
|
|
352
|
+
style: "body2",
|
|
353
|
+
children: /*#__PURE__*/jsxRuntime.jsx(reactI18next.Trans, {
|
|
354
|
+
i18nKey: "neetoCustomDomains.noData.helpTextDisconnected",
|
|
355
|
+
components: {
|
|
356
|
+
Link: /*#__PURE__*/jsxRuntime.jsx(Button, {
|
|
357
|
+
href: helpDocUrl,
|
|
358
|
+
rel: "noreferrer",
|
|
359
|
+
style: "link",
|
|
360
|
+
target: "_blank"
|
|
361
|
+
})
|
|
362
|
+
}
|
|
363
|
+
})
|
|
364
|
+
})]
|
|
326
365
|
})]
|
|
327
366
|
})]
|
|
328
367
|
})
|
|
@@ -1004,7 +1043,7 @@ var strategyOptions = [{
|
|
|
1004
1043
|
}];
|
|
1005
1044
|
|
|
1006
1045
|
function ownKeys$1(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; }
|
|
1007
|
-
function _objectSpread$1(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys$1(Object(t),
|
|
1046
|
+
function _objectSpread$1(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys$1(Object(t), true).forEach(function (r) { _defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys$1(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }
|
|
1008
1047
|
var Strategy = reactUtils.withT(function (_ref) {
|
|
1009
1048
|
var t = _ref.t,
|
|
1010
1049
|
hostname = _ref.hostname,
|
|
@@ -1090,7 +1129,7 @@ var Strategy = reactUtils.withT(function (_ref) {
|
|
|
1090
1129
|
});
|
|
1091
1130
|
|
|
1092
1131
|
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; }
|
|
1093
|
-
function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys(Object(t),
|
|
1132
|
+
function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys(Object(t), true).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; }
|
|
1094
1133
|
var DomainField = function DomainField(_ref) {
|
|
1095
1134
|
var onCreate = _ref.onCreate,
|
|
1096
1135
|
url = _ref.url,
|
|
@@ -1857,7 +1896,7 @@ var Validation = function Validation(_ref) {
|
|
|
1857
1896
|
});
|
|
1858
1897
|
};
|
|
1859
1898
|
|
|
1860
|
-
var e=[],t=[];function n(n,r){if(n&&"undefined"!=typeof document){var a,s
|
|
1899
|
+
var e=[],t=[];function n(n,r){if(n&&"undefined"!=typeof document){var a,s=true===r.prepend?"prepend":"append",d=true===r.singleTag,i="string"==typeof r.container?document.querySelector(r.container):document.getElementsByTagName("head")[0];if(d){var u=e.indexOf(i);-1===u&&(u=e.push(i)-1,t[u]={}),a=t[u]&&t[u][s]?t[u][s]:t[u][s]=c();}else a=c();65279===n.charCodeAt(0)&&(n=n.substring(1)),a.styleSheet?a.styleSheet.cssText+=n:a.appendChild(document.createTextNode(n));}function c(){var e=document.createElement("style");if(e.setAttribute("type","text/css"),r.attributes)for(var t=Object.keys(r.attributes),n=0;n<t.length;n++)e.setAttribute(t[n],r.attributes[t[n]]);var a="prepend"===s?"afterbegin":"beforeend";return i.insertAdjacentElement(a,e),e}}
|
|
1861
1900
|
|
|
1862
1901
|
var css = ".neeto_custom_domain_stepper button{cursor:default!important}\n/*# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbImFwcC9qYXZhc2NyaXB0L3N0eWxlc2hlZXRzL2RvbWFpbnMvX292ZXJyaWRlcy5zY3NzIiwiYXBwL2phdmFzY3JpcHQvc3R5bGVzaGVldHMvYXBwbGljYXRpb24uc2NzcyJdLCJuYW1lcyI6W10sIm1hcHBpbmdzIjoiQUFDRSxvQ0FDRSx3QkNBSiIsInNvdXJjZXNDb250ZW50IjpbIi5uZWV0b19jdXN0b21fZG9tYWluX3N0ZXBwZXIge1xuICBidXR0b24ge1xuICAgIGN1cnNvcjogZGVmYXVsdCAhaW1wb3J0YW50O1xuICB9XG59XG4iLCIubmVldG9fY3VzdG9tX2RvbWFpbl9zdGVwcGVyIGJ1dHRvbiB7XG4gIGN1cnNvcjogZGVmYXVsdCAhaW1wb3J0YW50O1xufSJdfQ== */";
|
|
1863
1902
|
n(css,{});
|
|
@@ -1952,32 +1991,20 @@ var DomainPane = function DomainPane(_ref) {
|
|
|
1952
1991
|
};
|
|
1953
1992
|
|
|
1954
1993
|
var Header = function Header(_ref) {
|
|
1955
|
-
|
|
1956
|
-
breadcrumbs = _ref.breadcrumbs
|
|
1957
|
-
|
|
1958
|
-
|
|
1959
|
-
helpDocUrl = _ref.helpDocUrl,
|
|
1994
|
+
_ref.openPane;
|
|
1995
|
+
var breadcrumbs = _ref.breadcrumbs;
|
|
1996
|
+
_ref.isCustomDomainAdded;
|
|
1997
|
+
_ref.setSelectedCustomDomain;
|
|
1998
|
+
var helpDocUrl = _ref.helpDocUrl,
|
|
1960
1999
|
_ref$size = _ref.size,
|
|
1961
2000
|
size = _ref$size === void 0 ? "large" : _ref$size;
|
|
1962
2001
|
var _useTranslation = reactI18next.useTranslation(),
|
|
1963
2002
|
t = _useTranslation.t;
|
|
1964
|
-
var handleClick = function handleClick() {
|
|
1965
|
-
setSelectedCustomDomain({});
|
|
1966
|
-
openPane();
|
|
1967
|
-
};
|
|
1968
2003
|
return /*#__PURE__*/jsxRuntime.jsx(NeetoHeader, {
|
|
1969
2004
|
breadcrumbs: breadcrumbs,
|
|
1970
2005
|
size: size,
|
|
1971
2006
|
"data-testid": "custom-domain-header",
|
|
1972
2007
|
title: t("neetoCustomDomains.customDomain", constants.SINGULAR),
|
|
1973
|
-
actionBlock: /*#__PURE__*/jsxRuntime.jsx(Button, {
|
|
1974
|
-
"data-testid": "add-new-custom-domain-button",
|
|
1975
|
-
disabled: isCustomDomainAdded,
|
|
1976
|
-
label: t("neetoCustomDomains.actions.add", {
|
|
1977
|
-
what: t("neetoCustomDomains.customDomain", constants.SINGULAR)
|
|
1978
|
-
}),
|
|
1979
|
-
onClick: handleClick
|
|
1980
|
-
}),
|
|
1981
2008
|
titleHelpPopoverProps: {
|
|
1982
2009
|
title: t("neetoCustomDomains.customDomain", constants.SINGULAR),
|
|
1983
2010
|
description: t("neetoCustomDomains.toolTips.customDomain"),
|
|
@@ -1997,6 +2024,8 @@ var CustomDomain = function CustomDomain(_ref) {
|
|
|
1997
2024
|
headerSize = _ref.headerSize,
|
|
1998
2025
|
dnsHelpDocs = _ref.dnsHelpDocs,
|
|
1999
2026
|
subdomainPlaceholder = _ref.subdomainPlaceholder,
|
|
2027
|
+
disconnectedIntegrationCardDescription = _ref.disconnectedIntegrationCardDescription,
|
|
2028
|
+
connectedIntegrationCardDescription = _ref.connectedIntegrationCardDescription,
|
|
2000
2029
|
appName = _ref.appName,
|
|
2001
2030
|
_ref$environment = _ref.environment,
|
|
2002
2031
|
environment = _ref$environment === void 0 ? "production" : _ref$environment;
|
|
@@ -2039,7 +2068,7 @@ var CustomDomain = function CustomDomain(_ref) {
|
|
|
2039
2068
|
var isCustomDomainAdded = neetoCist.isNotEmpty(customDomains);
|
|
2040
2069
|
if (isLoading) {
|
|
2041
2070
|
return /*#__PURE__*/jsxRuntime.jsx("div", {
|
|
2042
|
-
className: "flex
|
|
2071
|
+
className: "flex h-screen w-full items-center justify-center",
|
|
2043
2072
|
children: /*#__PURE__*/jsxRuntime.jsx(Spinner, {})
|
|
2044
2073
|
});
|
|
2045
2074
|
}
|
|
@@ -2053,9 +2082,11 @@ var CustomDomain = function CustomDomain(_ref) {
|
|
|
2053
2082
|
setSelectedCustomDomain: setSelectedCustomDomain,
|
|
2054
2083
|
size: headerSize
|
|
2055
2084
|
}), /*#__PURE__*/jsxRuntime.jsx("div", {
|
|
2056
|
-
className: "flex w-full justify-center
|
|
2085
|
+
className: "flex h-full w-full justify-center",
|
|
2057
2086
|
children: /*#__PURE__*/jsxRuntime.jsx(Domain, {
|
|
2087
|
+
connectedIntegrationCardDescription: connectedIntegrationCardDescription,
|
|
2058
2088
|
customDomains: customDomains,
|
|
2089
|
+
disconnectedIntegrationCardDescription: disconnectedIntegrationCardDescription,
|
|
2059
2090
|
helpDocUrl: helpDocUrl,
|
|
2060
2091
|
isCustomDomainAdded: isCustomDomainAdded,
|
|
2061
2092
|
openDeleteAlert: openDeleteAlert,
|