@bigbinary/neeto-custom-domains-frontend 3.3.4 → 3.3.6

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.
@@ -4,12 +4,12 @@ import { isPresent, truncate, isNotEmpty } from '@bigbinary/neeto-cist';
4
4
  import { withT, useQueryParams } from '@bigbinary/neeto-commons-frontend/v2/react-utils';
5
5
  import { Alert, Typography, Button, Tooltip, Badge, Sheet, Callout, DataTable, Toastr, Stepper, Spinner } from '@bigbinary/neeto-atoms';
6
6
  import { Trans, useTranslation } from 'react-i18next';
7
- import { p as parse, u as useCreateCustomDomain, i as img, a as useValidateDomain, D as DOMAIN_QUERY_KEY, b as useFetchCustomDomain, c as useDeleteCustomDomain } from '../application-kZuSmUKo.js';
7
+ import { p as parse, u as useCreateCustomDomain, i as img, a as useValidateDomain, D as DOMAIN_QUERY_KEY, b as useFetchCustomDomain, c as useDeleteCustomDomain } from '../application-CK-Outm_.js';
8
8
  import Container from '@bigbinary/neeto-molecules/v2/Container';
9
9
  import CheckCircle from '@bigbinary/neeto-icons/CheckCircle';
10
10
  import Warning2 from '@bigbinary/neeto-icons/Warning2';
11
11
  import CloseCircle from '@bigbinary/neeto-icons/CloseCircle';
12
- import { jsx, jsxs } from 'react/jsx-runtime';
12
+ import { jsx, jsxs, Fragment } from 'react/jsx-runtime';
13
13
  import classNames from 'classnames';
14
14
  import { SINGULAR } from '@bigbinary/neeto-commons-frontend/v2/constants';
15
15
  import CustomDomain$1 from '@bigbinary/neeto-icons/CustomDomain';
@@ -36,20 +36,6 @@ var STATUS_ICON = {
36
36
  pending: Warning2,
37
37
  failed: CloseCircle
38
38
  };
39
- var DNS_TARGETS = {
40
- staging: {
41
- cname: "staging.neetodeployapp.com",
42
- ip: "98.89.128.226"
43
- },
44
- production: {
45
- cname: "dns.neetodeployapp.com",
46
- ip: "34.233.85.113"
47
- },
48
- development: {
49
- cname: "dns.neetodeployapp.com",
50
- ip: "34.233.85.113"
51
- }
52
- };
53
39
  var NEETO_CUSTOM_DOMAINS_NANO_README_URL = "https://github.com/neetozone/neeto-custom-domains-nano#env-variables";
54
40
 
55
41
  var DeleteAlert = withT(function (_ref) {
@@ -112,14 +98,14 @@ var Domain = function Domain(_ref) {
112
98
  })
113
99
  }),
114
100
  children: /*#__PURE__*/jsx("div", {
115
- className: "flex flex-col gap-y-6 divide-y divide-gray-200",
101
+ className: "divide-border flex flex-col gap-y-6 divide-y",
116
102
  children: customDomains === null || customDomains === void 0 ? void 0 : customDomains.map(function (customDomain, index) {
117
103
  var _customDomain$redirec;
118
104
  return /*#__PURE__*/jsxs("div", {
119
- className: "flex items-center gap-x-3 pb-6 last:pb-0",
105
+ className: "flex items-start gap-x-3 pb-6 last:pb-0",
120
106
  "data-testid": "custom-domain-item",
121
107
  children: [/*#__PURE__*/jsx("div", {
122
- className: classNames("rounded-lg flex items-center justify-center p-2", {
108
+ className: classNames("flex items-center justify-center rounded-lg p-2", {
123
109
  "bg-success": (customDomain === null || customDomain === void 0 ? void 0 : customDomain.status) === "active",
124
110
  "bg-warning": (customDomain === null || customDomain === void 0 ? void 0 : customDomain.status) === "pending",
125
111
  "bg-error": (customDomain === null || customDomain === void 0 ? void 0 : customDomain.status) === "failed"
@@ -206,8 +192,8 @@ var Domain = function Domain(_ref) {
206
192
  Link: /*#__PURE__*/jsx(Button, {
207
193
  href: helpDocUrl,
208
194
  rel: "noreferrer",
209
- variant: "link",
210
- target: "_blank"
195
+ target: "_blank",
196
+ variant: "link"
211
197
  })
212
198
  }
213
199
  })
@@ -226,39 +212,38 @@ var Domain = function Domain(_ref) {
226
212
  onClick: openPane
227
213
  }),
228
214
  children: /*#__PURE__*/jsxs("div", {
229
- className: "flex h-full w-full items-center gap-x-3",
215
+ className: "flex h-full w-full items-start gap-x-3",
230
216
  children: [/*#__PURE__*/jsx("div", {
231
- className: "bg-muted rounded-lg flex items-center justify-center p-2",
217
+ className: "bg-muted flex items-start justify-center rounded-lg p-2",
232
218
  children: /*#__PURE__*/jsx(CustomDomain$1, {
233
219
  className: "text-muted-foreground",
234
220
  size: 32
235
221
  })
236
222
  }), /*#__PURE__*/jsxs("div", {
237
- className: "flex flex-col gap-y-1",
223
+ className: "flex flex-col",
238
224
  children: [/*#__PURE__*/jsx(Typography, {
225
+ className: "mb-3",
239
226
  variant: "h4",
240
227
  weight: "medium",
241
228
  children: t("neetoCustomDomains.noData.title")
242
- }), /*#__PURE__*/jsxs("div", {
243
- children: [/*#__PURE__*/jsx(Typography, {
244
- className: "text-muted-foreground",
245
- variant: "body2",
246
- children: disconnectedIntegrationCardDescription || t("neetoCustomDomains.noData.helpTextDefault")
247
- }), /*#__PURE__*/jsx(Typography, {
248
- className: "text-muted-foreground mt-2",
249
- variant: "body2",
250
- children: /*#__PURE__*/jsx(Trans, {
251
- i18nKey: "neetoCustomDomains.noData.helpTextDisconnected",
252
- components: {
253
- Link: /*#__PURE__*/jsx(Button, {
254
- href: helpDocUrl,
255
- rel: "noreferrer",
256
- variant: "link",
257
- target: "_blank"
258
- })
259
- }
260
- })
261
- })]
229
+ }), /*#__PURE__*/jsx(Typography, {
230
+ className: "text-muted-foreground",
231
+ variant: "body2",
232
+ children: disconnectedIntegrationCardDescription || t("neetoCustomDomains.noData.helpTextDefault")
233
+ }), /*#__PURE__*/jsx(Typography, {
234
+ className: "text-muted-foreground mt-2",
235
+ variant: "body2",
236
+ children: /*#__PURE__*/jsx(Trans, {
237
+ i18nKey: "neetoCustomDomains.noData.helpTextDisconnected",
238
+ components: {
239
+ Link: /*#__PURE__*/jsx(Button, {
240
+ href: helpDocUrl,
241
+ rel: "noreferrer",
242
+ target: "_blank",
243
+ variant: "link"
244
+ })
245
+ }
246
+ })
262
247
  })]
263
248
  })]
264
249
  })
@@ -331,6 +316,7 @@ var Strategy = withT(function (_ref) {
331
316
  setPrimaryDomain = _ref.setPrimaryDomain,
332
317
  onClose = _ref.onClose;
333
318
  return /*#__PURE__*/jsxs(Form, {
319
+ className: "flex min-h-0 grow flex-col",
334
320
  formikProps: {
335
321
  initialValues: STRATEGY_INITIAL_VALUES,
336
322
  validationSchema: strategyValidationSchema,
@@ -345,8 +331,8 @@ var Strategy = withT(function (_ref) {
345
331
  children: /*#__PURE__*/jsxs("div", {
346
332
  className: "space-y-4",
347
333
  children: [/*#__PURE__*/jsx(RadioGroup, {
348
- stacked: true,
349
334
  name: "strategy",
335
+ orientation: "vertical",
350
336
  children: strategyOptions.map(function (_ref2, index) {
351
337
  var value = _ref2.value,
352
338
  label = _ref2.label,
@@ -381,8 +367,8 @@ var Strategy = withT(function (_ref) {
381
367
  Link: /*#__PURE__*/jsx(Button, {
382
368
  href: errorData === null || errorData === void 0 ? void 0 : errorData.pageUrl,
383
369
  rel: "noreferrer",
384
- variant: "link",
385
- target: "_blank"
370
+ target: "_blank",
371
+ variant: "link"
386
372
  })
387
373
  }
388
374
  })
@@ -496,7 +482,7 @@ var DomainField = function DomainField(_ref) {
496
482
  });
497
483
  }
498
484
  return /*#__PURE__*/jsx(Form, {
499
- className: "flex-col space-y-6",
485
+ className: "flex min-h-0 grow flex-col",
500
486
  formikProps: {
501
487
  initialValues: INITIAL_VALUES,
502
488
  validationSchema: getCustomDomainValidationSchema(),
@@ -504,14 +490,13 @@ var DomainField = function DomainField(_ref) {
504
490
  },
505
491
  children: function children(_ref5) {
506
492
  var dirty = _ref5.dirty;
507
- return /*#__PURE__*/jsxs("div", {
508
- className: "w-full",
493
+ return /*#__PURE__*/jsxs(Fragment, {
509
494
  children: [/*#__PURE__*/jsx(Sheet.Body, {
510
495
  children: /*#__PURE__*/jsxs("div", {
511
496
  className: "w-full space-y-4",
512
497
  children: [/*#__PURE__*/jsx(Input, {
513
498
  required: true,
514
- className: "w-full",
499
+ className: "w-[480px] max-w-full",
515
500
  "data-testid": "custom-domain-input-field",
516
501
  label: t("neetoCustomDomains.label"),
517
502
  name: "hostname",
@@ -558,8 +543,9 @@ var DomainField = function DomainField(_ref) {
558
543
 
559
544
  var getDnsProviderData = function getDnsProviderData(dnsProvider) {
560
545
  var hostname = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : "unknown";
561
- var environment = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : "production";
562
- return dnsProviderData(hostname, environment)[dnsProvider];
546
+ var dnsTarget = arguments.length > 2 ? arguments[2] : undefined;
547
+ var dnsTargetIp = arguments.length > 3 ? arguments[3] : undefined;
548
+ return dnsProviderData(hostname, dnsTarget, dnsTargetIp)[dnsProvider];
563
549
  };
564
550
  var commonColumnData = function commonColumnData(dnsProvider) {
565
551
  var dnsProviderInfo = getDnsProviderData(dnsProvider);
@@ -625,6 +611,7 @@ var columnData = function columnData(dnsProvider) {
625
611
  return /*#__PURE__*/jsx("div", {
626
612
  className: "flex items-center justify-between gap-1",
627
613
  children: /*#__PURE__*/jsx("img", {
614
+ className: "max-h-[30px] w-auto",
628
615
  src: img
629
616
  })
630
617
  });
@@ -644,11 +631,11 @@ var columnData = function columnData(dnsProvider) {
644
631
  dnsProvider === "networksolutions" && commonColumns.splice(1, 0, networkSolutionsRefersToColumn);
645
632
  return commonColumns;
646
633
  };
647
- var rowData = function rowData(dnsProvider, hostname, dnsTarget, environment) {
634
+ var rowData = function rowData(dnsProvider, hostname, dnsTarget, dnsTargetIp) {
648
635
  var _dnsProviderInfo$valu, _dnsProviderInfo$valu2;
649
636
  var subdomain = parse(hostname).subdomain;
650
637
  var hostnameType = isPresent(subdomain) ? "subdomain" : "rootDomain";
651
- var dnsProviderInfo = getDnsProviderData(dnsProvider, hostname, environment);
638
+ var dnsProviderInfo = getDnsProviderData(dnsProvider, hostname, dnsTarget, dnsTargetIp);
652
639
  return [{
653
640
  type: dnsProviderInfo.values.type[hostnameType],
654
641
  name: dnsProviderInfo.values.name[hostnameType],
@@ -656,8 +643,7 @@ var rowData = function rowData(dnsProvider, hostname, dnsTarget, environment) {
656
643
  ttl: dnsProviderInfo.values.ttl[hostnameType]
657
644
  }];
658
645
  };
659
- var dnsProviderData = function dnsProviderData(hostname) {
660
- var environment = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : "production";
646
+ var dnsProviderData = function dnsProviderData(hostname, dnsTarget, dnsTargetIp) {
661
647
  var _parse = parse(hostname),
662
648
  subdomain = _parse.subdomain,
663
649
  domain = _parse.domain;
@@ -760,8 +746,8 @@ var dnsProviderData = function dnsProviderData(hostname) {
760
746
  subdomain: subdomain
761
747
  },
762
748
  target: {
763
- rootDomain: DNS_TARGETS[environment].ip,
764
- subdomain: DNS_TARGETS[environment].cname
749
+ rootDomain: dnsTargetIp,
750
+ subdomain: dnsTarget
765
751
  }
766
752
  },
767
753
  hasRootLevelDomainSupport: true
@@ -789,8 +775,8 @@ var dnsProviderData = function dnsProviderData(hostname) {
789
775
  subdomain: subdomain
790
776
  },
791
777
  target: {
792
- rootDomain: DNS_TARGETS[environment].ip,
793
- subdomain: DNS_TARGETS[environment].cname
778
+ rootDomain: dnsTargetIp,
779
+ subdomain: dnsTarget
794
780
  }
795
781
  },
796
782
  hasRootLevelDomainSupport: true
@@ -844,8 +830,8 @@ var dnsProviderData = function dnsProviderData(hostname) {
844
830
  subdomain: subdomain
845
831
  },
846
832
  target: {
847
- rootDomain: DNS_TARGETS[environment].ip,
848
- subdomain: DNS_TARGETS[environment].cname
833
+ rootDomain: dnsTargetIp,
834
+ subdomain: dnsTarget
849
835
  }
850
836
  },
851
837
  hasRootLevelDomainSupport: true
@@ -923,8 +909,8 @@ var dnsProviderData = function dnsProviderData(hostname) {
923
909
  subdomain: subdomain
924
910
  },
925
911
  target: {
926
- rootDomain: DNS_TARGETS[environment].ip,
927
- subdomain: DNS_TARGETS[environment].cname
912
+ rootDomain: dnsTargetIp,
913
+ subdomain: dnsTarget
928
914
  }
929
915
  },
930
916
  hasRootLevelDomainSupport: true
@@ -951,8 +937,8 @@ var dnsProviderData = function dnsProviderData(hostname) {
951
937
  subdomain: subdomain
952
938
  },
953
939
  target: {
954
- rootDomain: DNS_TARGETS[environment].ip,
955
- subdomain: DNS_TARGETS[environment].cname
940
+ rootDomain: dnsTargetIp,
941
+ subdomain: dnsTarget
956
942
  }
957
943
  },
958
944
  hasRootLevelDomainSupport: true
@@ -980,8 +966,8 @@ var dnsProviderData = function dnsProviderData(hostname) {
980
966
  subdomain: subdomain
981
967
  },
982
968
  target: {
983
- rootDomain: DNS_TARGETS[environment].ip,
984
- subdomain: DNS_TARGETS[environment].cname
969
+ rootDomain: dnsTargetIp,
970
+ subdomain: dnsTarget
985
971
  }
986
972
  },
987
973
  hasRootLevelDomainSupport: true
@@ -1009,8 +995,8 @@ var dnsProviderData = function dnsProviderData(hostname) {
1009
995
  subdomain: subdomain
1010
996
  },
1011
997
  target: {
1012
- rootDomain: DNS_TARGETS[environment].ip,
1013
- subdomain: DNS_TARGETS[environment].cname
998
+ rootDomain: dnsTargetIp,
999
+ subdomain: dnsTarget
1014
1000
  }
1015
1001
  },
1016
1002
  hasRootLevelDomainSupport: true
@@ -1023,8 +1009,7 @@ var Validation = function Validation(_ref) {
1023
1009
  onClose = _ref.onClose,
1024
1010
  url = _ref.url,
1025
1011
  dnsHelpDocs = _ref.dnsHelpDocs,
1026
- primaryDomain = _ref.primaryDomain,
1027
- environment = _ref.environment;
1012
+ primaryDomain = _ref.primaryDomain;
1028
1013
  var _useTranslation = useTranslation(),
1029
1014
  t = _useTranslation.t;
1030
1015
  var hostname = primaryDomain.hostname,
@@ -1036,7 +1021,7 @@ var Validation = function Validation(_ref) {
1036
1021
  errorKey = _useState2[0],
1037
1022
  setErrorKey = _useState2[1];
1038
1023
  var isDomainValidated = status === "active";
1039
- var dnsProviderInfo = getDnsProviderData(dnsProvider, hostname, environment);
1024
+ var dnsProviderInfo = getDnsProviderData(dnsProvider, hostname);
1040
1025
  var domainType = isRootLevelDomain(hostname) ? "rootDomain" : "subdomain";
1041
1026
  var _useValidateDomain = useValidateDomain(url, {
1042
1027
  onError: function onError(_ref2) {
@@ -1082,7 +1067,7 @@ var Validation = function Validation(_ref) {
1082
1067
  Link: /*#__PURE__*/jsx(HelpUrlLink, {}),
1083
1068
  br: /*#__PURE__*/jsx("br", {})
1084
1069
  };
1085
- return /*#__PURE__*/jsxs("div", {
1070
+ return /*#__PURE__*/jsxs(Fragment, {
1086
1071
  children: [/*#__PURE__*/jsxs(Sheet.Body, {
1087
1072
  className: "space-y-4",
1088
1073
  children: [/*#__PURE__*/jsxs("div", {
@@ -1105,18 +1090,20 @@ var Validation = function Validation(_ref) {
1105
1090
  })
1106
1091
  })]
1107
1092
  }), /*#__PURE__*/jsx("div", {
1108
- className: "space-y-1",
1093
+ className: "w-full space-y-1",
1109
1094
  children: /*#__PURE__*/jsx(DataTable, {
1110
1095
  allowRowClick: false,
1111
1096
  columns: columnData(dnsProvider),
1112
1097
  data: customDomains.map(function (_ref5) {
1113
1098
  var hostname = _ref5.hostname,
1114
1099
  dnsTarget = _ref5.dnsTarget,
1100
+ dnsTargetIp = _ref5.dnsTargetIp,
1115
1101
  dnsProvider = _ref5.dnsProvider;
1116
- return rowData(dnsProvider, hostname, dnsTarget, environment);
1102
+ return rowData(dnsProvider, hostname, dnsTarget, dnsTargetIp);
1117
1103
  }).flat()
1118
1104
  })
1119
1105
  }), status === "failed" && /*#__PURE__*/jsx(Callout, {
1106
+ className: "w-full",
1120
1107
  variant: STATUS_TAG_STYLES[status],
1121
1108
  children: /*#__PURE__*/jsx(Typography, {
1122
1109
  variant: "body2",
@@ -1135,6 +1122,7 @@ var Validation = function Validation(_ref) {
1135
1122
  })
1136
1123
  })
1137
1124
  }), isNotEmpty(errorKey) && status === "pending" && /*#__PURE__*/jsx(Callout, {
1125
+ className: "w-full",
1138
1126
  variant: STATUS_TAG_STYLES[status],
1139
1127
  children: /*#__PURE__*/jsx(Typography, {
1140
1128
  variant: "body2",
@@ -1172,8 +1160,7 @@ var DomainPane = function DomainPane(_ref) {
1172
1160
  url = _ref.url,
1173
1161
  helpDocUrl = _ref.helpDocUrl,
1174
1162
  dnsHelpDocs = _ref.dnsHelpDocs,
1175
- subdomainPlaceholder = _ref.subdomainPlaceholder,
1176
- environment = _ref.environment;
1163
+ subdomainPlaceholder = _ref.subdomainPlaceholder;
1177
1164
  var _useTranslation = useTranslation(),
1178
1165
  t = _useTranslation.t;
1179
1166
  var _useState = useState(customDomains[0]),
@@ -1201,17 +1188,13 @@ var DomainPane = function DomainPane(_ref) {
1201
1188
  return /*#__PURE__*/jsxs(Sheet, {
1202
1189
  isOpen: isOpen,
1203
1190
  onClose: onClose,
1204
- className: "flex flex-col",
1205
- size: "large",
1191
+ className: "neeto_custom_domain_pane flex flex-col data-[side=right]:sm:max-w-[1200px]",
1206
1192
  children: [/*#__PURE__*/jsxs(Sheet.Header, {
1207
1193
  className: "space-y-2",
1208
1194
  children: [/*#__PURE__*/jsx(Sheet.Title, {
1209
- children: /*#__PURE__*/jsx(Typography, {
1210
- variant: "h2",
1211
- children: t("neetoCustomDomains.addNew")
1212
- })
1195
+ children: t("neetoCustomDomains.addNew")
1213
1196
  }), /*#__PURE__*/jsx("div", {
1214
- className: "neeto_custom_domain_stepper -ml-2",
1197
+ className: "neeto_custom_domain_stepper mt-2 px-1",
1215
1198
  children: /*#__PURE__*/jsx(Stepper, {
1216
1199
  activeIndex: CURRENT_STEP[getCurrentStep(primaryDomain)],
1217
1200
  steps: STEPS
@@ -1232,7 +1215,6 @@ var DomainPane = function DomainPane(_ref) {
1232
1215
  return /*#__PURE__*/jsx(Validation, {
1233
1216
  customDomains: customDomains,
1234
1217
  dnsHelpDocs: dnsHelpDocs,
1235
- environment: environment,
1236
1218
  helpDocUrl: helpDocUrl,
1237
1219
  onClose: onClose,
1238
1220
  onCreate: onCreate,
@@ -1383,7 +1365,6 @@ var CustomDomain = function CustomDomain(_ref) {
1383
1365
  }), /*#__PURE__*/jsx(DomainPane, {
1384
1366
  customDomains: customDomains,
1385
1367
  dnsHelpDocs: dnsHelpDocs,
1386
- environment: environment,
1387
1368
  helpDocUrl: helpDocUrl,
1388
1369
  onCreate: onCreate,
1389
1370
  url: url,