@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.
@@ -6,7 +6,7 @@ var neetoCist = require('@bigbinary/neeto-cist');
6
6
  var reactUtils = require('@bigbinary/neeto-commons-frontend/v2/react-utils');
7
7
  var neetoAtoms = require('@bigbinary/neeto-atoms');
8
8
  var reactI18next = require('react-i18next');
9
- var application = require('../../application-Dwn9zjMI.js');
9
+ var application = require('../../application-DVE1-xzg.js');
10
10
  var Container = require('@bigbinary/neeto-molecules/v2/Container');
11
11
  var CheckCircle = require('@bigbinary/neeto-icons/CheckCircle');
12
12
  var Warning2 = require('@bigbinary/neeto-icons/Warning2');
@@ -57,20 +57,6 @@ var STATUS_ICON = {
57
57
  pending: Warning2,
58
58
  failed: CloseCircle
59
59
  };
60
- var DNS_TARGETS = {
61
- staging: {
62
- cname: "staging.neetodeployapp.com",
63
- ip: "98.89.128.226"
64
- },
65
- production: {
66
- cname: "dns.neetodeployapp.com",
67
- ip: "34.233.85.113"
68
- },
69
- development: {
70
- cname: "dns.neetodeployapp.com",
71
- ip: "34.233.85.113"
72
- }
73
- };
74
60
  var NEETO_CUSTOM_DOMAINS_NANO_README_URL = "https://github.com/neetozone/neeto-custom-domains-nano#env-variables";
75
61
 
76
62
  var DeleteAlert = reactUtils.withT(function (_ref) {
@@ -133,14 +119,14 @@ var Domain = function Domain(_ref) {
133
119
  })
134
120
  }),
135
121
  children: /*#__PURE__*/jsxRuntime.jsx("div", {
136
- className: "flex flex-col gap-y-6 divide-y divide-gray-200",
122
+ className: "divide-border flex flex-col gap-y-6 divide-y",
137
123
  children: customDomains === null || customDomains === void 0 ? void 0 : customDomains.map(function (customDomain, index) {
138
124
  var _customDomain$redirec;
139
125
  return /*#__PURE__*/jsxRuntime.jsxs("div", {
140
- className: "flex items-center gap-x-3 pb-6 last:pb-0",
126
+ className: "flex items-start gap-x-3 pb-6 last:pb-0",
141
127
  "data-testid": "custom-domain-item",
142
128
  children: [/*#__PURE__*/jsxRuntime.jsx("div", {
143
- className: classNames("rounded-lg flex items-center justify-center p-2", {
129
+ className: classNames("flex items-center justify-center rounded-lg p-2", {
144
130
  "bg-success": (customDomain === null || customDomain === void 0 ? void 0 : customDomain.status) === "active",
145
131
  "bg-warning": (customDomain === null || customDomain === void 0 ? void 0 : customDomain.status) === "pending",
146
132
  "bg-error": (customDomain === null || customDomain === void 0 ? void 0 : customDomain.status) === "failed"
@@ -227,8 +213,8 @@ var Domain = function Domain(_ref) {
227
213
  Link: /*#__PURE__*/jsxRuntime.jsx(neetoAtoms.Button, {
228
214
  href: helpDocUrl,
229
215
  rel: "noreferrer",
230
- variant: "link",
231
- target: "_blank"
216
+ target: "_blank",
217
+ variant: "link"
232
218
  })
233
219
  }
234
220
  })
@@ -247,39 +233,38 @@ var Domain = function Domain(_ref) {
247
233
  onClick: openPane
248
234
  }),
249
235
  children: /*#__PURE__*/jsxRuntime.jsxs("div", {
250
- className: "flex h-full w-full items-center gap-x-3",
236
+ className: "flex h-full w-full items-start gap-x-3",
251
237
  children: [/*#__PURE__*/jsxRuntime.jsx("div", {
252
- className: "bg-muted rounded-lg flex items-center justify-center p-2",
238
+ className: "bg-muted flex items-start justify-center rounded-lg p-2",
253
239
  children: /*#__PURE__*/jsxRuntime.jsx(CustomDomain$1, {
254
240
  className: "text-muted-foreground",
255
241
  size: 32
256
242
  })
257
243
  }), /*#__PURE__*/jsxRuntime.jsxs("div", {
258
- className: "flex flex-col gap-y-1",
244
+ className: "flex flex-col",
259
245
  children: [/*#__PURE__*/jsxRuntime.jsx(neetoAtoms.Typography, {
246
+ className: "mb-3",
260
247
  variant: "h4",
261
248
  weight: "medium",
262
249
  children: t("neetoCustomDomains.noData.title")
263
- }), /*#__PURE__*/jsxRuntime.jsxs("div", {
264
- children: [/*#__PURE__*/jsxRuntime.jsx(neetoAtoms.Typography, {
265
- className: "text-muted-foreground",
266
- variant: "body2",
267
- children: disconnectedIntegrationCardDescription || t("neetoCustomDomains.noData.helpTextDefault")
268
- }), /*#__PURE__*/jsxRuntime.jsx(neetoAtoms.Typography, {
269
- className: "text-muted-foreground mt-2",
270
- variant: "body2",
271
- children: /*#__PURE__*/jsxRuntime.jsx(reactI18next.Trans, {
272
- i18nKey: "neetoCustomDomains.noData.helpTextDisconnected",
273
- components: {
274
- Link: /*#__PURE__*/jsxRuntime.jsx(neetoAtoms.Button, {
275
- href: helpDocUrl,
276
- rel: "noreferrer",
277
- variant: "link",
278
- target: "_blank"
279
- })
280
- }
281
- })
282
- })]
250
+ }), /*#__PURE__*/jsxRuntime.jsx(neetoAtoms.Typography, {
251
+ className: "text-muted-foreground",
252
+ variant: "body2",
253
+ children: disconnectedIntegrationCardDescription || t("neetoCustomDomains.noData.helpTextDefault")
254
+ }), /*#__PURE__*/jsxRuntime.jsx(neetoAtoms.Typography, {
255
+ className: "text-muted-foreground mt-2",
256
+ variant: "body2",
257
+ children: /*#__PURE__*/jsxRuntime.jsx(reactI18next.Trans, {
258
+ i18nKey: "neetoCustomDomains.noData.helpTextDisconnected",
259
+ components: {
260
+ Link: /*#__PURE__*/jsxRuntime.jsx(neetoAtoms.Button, {
261
+ href: helpDocUrl,
262
+ rel: "noreferrer",
263
+ target: "_blank",
264
+ variant: "link"
265
+ })
266
+ }
267
+ })
283
268
  })]
284
269
  })]
285
270
  })
@@ -352,6 +337,7 @@ var Strategy = reactUtils.withT(function (_ref) {
352
337
  setPrimaryDomain = _ref.setPrimaryDomain,
353
338
  onClose = _ref.onClose;
354
339
  return /*#__PURE__*/jsxRuntime.jsxs(formik.Form, {
340
+ className: "flex min-h-0 grow flex-col",
355
341
  formikProps: {
356
342
  initialValues: STRATEGY_INITIAL_VALUES,
357
343
  validationSchema: strategyValidationSchema,
@@ -366,8 +352,8 @@ var Strategy = reactUtils.withT(function (_ref) {
366
352
  children: /*#__PURE__*/jsxRuntime.jsxs("div", {
367
353
  className: "space-y-4",
368
354
  children: [/*#__PURE__*/jsxRuntime.jsx(formik.RadioGroup, {
369
- stacked: true,
370
355
  name: "strategy",
356
+ orientation: "vertical",
371
357
  children: strategyOptions.map(function (_ref2, index) {
372
358
  var value = _ref2.value,
373
359
  label = _ref2.label,
@@ -402,8 +388,8 @@ var Strategy = reactUtils.withT(function (_ref) {
402
388
  Link: /*#__PURE__*/jsxRuntime.jsx(neetoAtoms.Button, {
403
389
  href: errorData === null || errorData === void 0 ? void 0 : errorData.pageUrl,
404
390
  rel: "noreferrer",
405
- variant: "link",
406
- target: "_blank"
391
+ target: "_blank",
392
+ variant: "link"
407
393
  })
408
394
  }
409
395
  })
@@ -517,7 +503,7 @@ var DomainField = function DomainField(_ref) {
517
503
  });
518
504
  }
519
505
  return /*#__PURE__*/jsxRuntime.jsx(formik.Form, {
520
- className: "flex-col space-y-6",
506
+ className: "flex min-h-0 grow flex-col",
521
507
  formikProps: {
522
508
  initialValues: INITIAL_VALUES,
523
509
  validationSchema: getCustomDomainValidationSchema(),
@@ -525,14 +511,13 @@ var DomainField = function DomainField(_ref) {
525
511
  },
526
512
  children: function children(_ref5) {
527
513
  var dirty = _ref5.dirty;
528
- return /*#__PURE__*/jsxRuntime.jsxs("div", {
529
- className: "w-full",
514
+ return /*#__PURE__*/jsxRuntime.jsxs(jsxRuntime.Fragment, {
530
515
  children: [/*#__PURE__*/jsxRuntime.jsx(neetoAtoms.Sheet.Body, {
531
516
  children: /*#__PURE__*/jsxRuntime.jsxs("div", {
532
517
  className: "w-full space-y-4",
533
518
  children: [/*#__PURE__*/jsxRuntime.jsx(formik.Input, {
534
519
  required: true,
535
- className: "w-full",
520
+ className: "w-[480px] max-w-full",
536
521
  "data-testid": "custom-domain-input-field",
537
522
  label: t("neetoCustomDomains.label"),
538
523
  name: "hostname",
@@ -579,8 +564,9 @@ var DomainField = function DomainField(_ref) {
579
564
 
580
565
  var getDnsProviderData = function getDnsProviderData(dnsProvider) {
581
566
  var hostname = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : "unknown";
582
- var environment = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : "production";
583
- return dnsProviderData(hostname, environment)[dnsProvider];
567
+ var dnsTarget = arguments.length > 2 ? arguments[2] : undefined;
568
+ var dnsTargetIp = arguments.length > 3 ? arguments[3] : undefined;
569
+ return dnsProviderData(hostname, dnsTarget, dnsTargetIp)[dnsProvider];
584
570
  };
585
571
  var commonColumnData = function commonColumnData(dnsProvider) {
586
572
  var dnsProviderInfo = getDnsProviderData(dnsProvider);
@@ -646,6 +632,7 @@ var columnData = function columnData(dnsProvider) {
646
632
  return /*#__PURE__*/jsxRuntime.jsx("div", {
647
633
  className: "flex items-center justify-between gap-1",
648
634
  children: /*#__PURE__*/jsxRuntime.jsx("img", {
635
+ className: "max-h-[30px] w-auto",
649
636
  src: application.img
650
637
  })
651
638
  });
@@ -665,11 +652,11 @@ var columnData = function columnData(dnsProvider) {
665
652
  dnsProvider === "networksolutions" && commonColumns.splice(1, 0, networkSolutionsRefersToColumn);
666
653
  return commonColumns;
667
654
  };
668
- var rowData = function rowData(dnsProvider, hostname, dnsTarget, environment) {
655
+ var rowData = function rowData(dnsProvider, hostname, dnsTarget, dnsTargetIp) {
669
656
  var _dnsProviderInfo$valu, _dnsProviderInfo$valu2;
670
657
  var subdomain = application.parse(hostname).subdomain;
671
658
  var hostnameType = neetoCist.isPresent(subdomain) ? "subdomain" : "rootDomain";
672
- var dnsProviderInfo = getDnsProviderData(dnsProvider, hostname, environment);
659
+ var dnsProviderInfo = getDnsProviderData(dnsProvider, hostname, dnsTarget, dnsTargetIp);
673
660
  return [{
674
661
  type: dnsProviderInfo.values.type[hostnameType],
675
662
  name: dnsProviderInfo.values.name[hostnameType],
@@ -677,8 +664,7 @@ var rowData = function rowData(dnsProvider, hostname, dnsTarget, environment) {
677
664
  ttl: dnsProviderInfo.values.ttl[hostnameType]
678
665
  }];
679
666
  };
680
- var dnsProviderData = function dnsProviderData(hostname) {
681
- var environment = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : "production";
667
+ var dnsProviderData = function dnsProviderData(hostname, dnsTarget, dnsTargetIp) {
682
668
  var _parse = application.parse(hostname),
683
669
  subdomain = _parse.subdomain,
684
670
  domain = _parse.domain;
@@ -781,8 +767,8 @@ var dnsProviderData = function dnsProviderData(hostname) {
781
767
  subdomain: subdomain
782
768
  },
783
769
  target: {
784
- rootDomain: DNS_TARGETS[environment].ip,
785
- subdomain: DNS_TARGETS[environment].cname
770
+ rootDomain: dnsTargetIp,
771
+ subdomain: dnsTarget
786
772
  }
787
773
  },
788
774
  hasRootLevelDomainSupport: true
@@ -810,8 +796,8 @@ var dnsProviderData = function dnsProviderData(hostname) {
810
796
  subdomain: subdomain
811
797
  },
812
798
  target: {
813
- rootDomain: DNS_TARGETS[environment].ip,
814
- subdomain: DNS_TARGETS[environment].cname
799
+ rootDomain: dnsTargetIp,
800
+ subdomain: dnsTarget
815
801
  }
816
802
  },
817
803
  hasRootLevelDomainSupport: true
@@ -865,8 +851,8 @@ var dnsProviderData = function dnsProviderData(hostname) {
865
851
  subdomain: subdomain
866
852
  },
867
853
  target: {
868
- rootDomain: DNS_TARGETS[environment].ip,
869
- subdomain: DNS_TARGETS[environment].cname
854
+ rootDomain: dnsTargetIp,
855
+ subdomain: dnsTarget
870
856
  }
871
857
  },
872
858
  hasRootLevelDomainSupport: true
@@ -944,8 +930,8 @@ var dnsProviderData = function dnsProviderData(hostname) {
944
930
  subdomain: subdomain
945
931
  },
946
932
  target: {
947
- rootDomain: DNS_TARGETS[environment].ip,
948
- subdomain: DNS_TARGETS[environment].cname
933
+ rootDomain: dnsTargetIp,
934
+ subdomain: dnsTarget
949
935
  }
950
936
  },
951
937
  hasRootLevelDomainSupport: true
@@ -972,8 +958,8 @@ var dnsProviderData = function dnsProviderData(hostname) {
972
958
  subdomain: subdomain
973
959
  },
974
960
  target: {
975
- rootDomain: DNS_TARGETS[environment].ip,
976
- subdomain: DNS_TARGETS[environment].cname
961
+ rootDomain: dnsTargetIp,
962
+ subdomain: dnsTarget
977
963
  }
978
964
  },
979
965
  hasRootLevelDomainSupport: true
@@ -1001,8 +987,8 @@ var dnsProviderData = function dnsProviderData(hostname) {
1001
987
  subdomain: subdomain
1002
988
  },
1003
989
  target: {
1004
- rootDomain: DNS_TARGETS[environment].ip,
1005
- subdomain: DNS_TARGETS[environment].cname
990
+ rootDomain: dnsTargetIp,
991
+ subdomain: dnsTarget
1006
992
  }
1007
993
  },
1008
994
  hasRootLevelDomainSupport: true
@@ -1030,8 +1016,8 @@ var dnsProviderData = function dnsProviderData(hostname) {
1030
1016
  subdomain: subdomain
1031
1017
  },
1032
1018
  target: {
1033
- rootDomain: DNS_TARGETS[environment].ip,
1034
- subdomain: DNS_TARGETS[environment].cname
1019
+ rootDomain: dnsTargetIp,
1020
+ subdomain: dnsTarget
1035
1021
  }
1036
1022
  },
1037
1023
  hasRootLevelDomainSupport: true
@@ -1044,8 +1030,7 @@ var Validation = function Validation(_ref) {
1044
1030
  onClose = _ref.onClose,
1045
1031
  url = _ref.url,
1046
1032
  dnsHelpDocs = _ref.dnsHelpDocs,
1047
- primaryDomain = _ref.primaryDomain,
1048
- environment = _ref.environment;
1033
+ primaryDomain = _ref.primaryDomain;
1049
1034
  var _useTranslation = reactI18next.useTranslation(),
1050
1035
  t = _useTranslation.t;
1051
1036
  var hostname = primaryDomain.hostname,
@@ -1057,7 +1042,7 @@ var Validation = function Validation(_ref) {
1057
1042
  errorKey = _useState2[0],
1058
1043
  setErrorKey = _useState2[1];
1059
1044
  var isDomainValidated = status === "active";
1060
- var dnsProviderInfo = getDnsProviderData(dnsProvider, hostname, environment);
1045
+ var dnsProviderInfo = getDnsProviderData(dnsProvider, hostname);
1061
1046
  var domainType = isRootLevelDomain(hostname) ? "rootDomain" : "subdomain";
1062
1047
  var _useValidateDomain = application.useValidateDomain(url, {
1063
1048
  onError: function onError(_ref2) {
@@ -1103,7 +1088,7 @@ var Validation = function Validation(_ref) {
1103
1088
  Link: /*#__PURE__*/jsxRuntime.jsx(HelpUrlLink, {}),
1104
1089
  br: /*#__PURE__*/jsxRuntime.jsx("br", {})
1105
1090
  };
1106
- return /*#__PURE__*/jsxRuntime.jsxs("div", {
1091
+ return /*#__PURE__*/jsxRuntime.jsxs(jsxRuntime.Fragment, {
1107
1092
  children: [/*#__PURE__*/jsxRuntime.jsxs(neetoAtoms.Sheet.Body, {
1108
1093
  className: "space-y-4",
1109
1094
  children: [/*#__PURE__*/jsxRuntime.jsxs("div", {
@@ -1126,18 +1111,20 @@ var Validation = function Validation(_ref) {
1126
1111
  })
1127
1112
  })]
1128
1113
  }), /*#__PURE__*/jsxRuntime.jsx("div", {
1129
- className: "space-y-1",
1114
+ className: "w-full space-y-1",
1130
1115
  children: /*#__PURE__*/jsxRuntime.jsx(neetoAtoms.DataTable, {
1131
1116
  allowRowClick: false,
1132
1117
  columns: columnData(dnsProvider),
1133
1118
  data: customDomains.map(function (_ref5) {
1134
1119
  var hostname = _ref5.hostname,
1135
1120
  dnsTarget = _ref5.dnsTarget,
1121
+ dnsTargetIp = _ref5.dnsTargetIp,
1136
1122
  dnsProvider = _ref5.dnsProvider;
1137
- return rowData(dnsProvider, hostname, dnsTarget, environment);
1123
+ return rowData(dnsProvider, hostname, dnsTarget, dnsTargetIp);
1138
1124
  }).flat()
1139
1125
  })
1140
1126
  }), status === "failed" && /*#__PURE__*/jsxRuntime.jsx(neetoAtoms.Callout, {
1127
+ className: "w-full",
1141
1128
  variant: STATUS_TAG_STYLES[status],
1142
1129
  children: /*#__PURE__*/jsxRuntime.jsx(neetoAtoms.Typography, {
1143
1130
  variant: "body2",
@@ -1156,6 +1143,7 @@ var Validation = function Validation(_ref) {
1156
1143
  })
1157
1144
  })
1158
1145
  }), neetoCist.isNotEmpty(errorKey) && status === "pending" && /*#__PURE__*/jsxRuntime.jsx(neetoAtoms.Callout, {
1146
+ className: "w-full",
1159
1147
  variant: STATUS_TAG_STYLES[status],
1160
1148
  children: /*#__PURE__*/jsxRuntime.jsx(neetoAtoms.Typography, {
1161
1149
  variant: "body2",
@@ -1193,8 +1181,7 @@ var DomainPane = function DomainPane(_ref) {
1193
1181
  url = _ref.url,
1194
1182
  helpDocUrl = _ref.helpDocUrl,
1195
1183
  dnsHelpDocs = _ref.dnsHelpDocs,
1196
- subdomainPlaceholder = _ref.subdomainPlaceholder,
1197
- environment = _ref.environment;
1184
+ subdomainPlaceholder = _ref.subdomainPlaceholder;
1198
1185
  var _useTranslation = reactI18next.useTranslation(),
1199
1186
  t = _useTranslation.t;
1200
1187
  var _useState = React.useState(customDomains[0]),
@@ -1222,17 +1209,13 @@ var DomainPane = function DomainPane(_ref) {
1222
1209
  return /*#__PURE__*/jsxRuntime.jsxs(neetoAtoms.Sheet, {
1223
1210
  isOpen: isOpen,
1224
1211
  onClose: onClose,
1225
- className: "flex flex-col",
1226
- size: "large",
1212
+ className: "neeto_custom_domain_pane flex flex-col data-[side=right]:sm:max-w-[1200px]",
1227
1213
  children: [/*#__PURE__*/jsxRuntime.jsxs(neetoAtoms.Sheet.Header, {
1228
1214
  className: "space-y-2",
1229
1215
  children: [/*#__PURE__*/jsxRuntime.jsx(neetoAtoms.Sheet.Title, {
1230
- children: /*#__PURE__*/jsxRuntime.jsx(neetoAtoms.Typography, {
1231
- variant: "h2",
1232
- children: t("neetoCustomDomains.addNew")
1233
- })
1216
+ children: t("neetoCustomDomains.addNew")
1234
1217
  }), /*#__PURE__*/jsxRuntime.jsx("div", {
1235
- className: "neeto_custom_domain_stepper -ml-2",
1218
+ className: "neeto_custom_domain_stepper mt-2 px-1",
1236
1219
  children: /*#__PURE__*/jsxRuntime.jsx(neetoAtoms.Stepper, {
1237
1220
  activeIndex: CURRENT_STEP[getCurrentStep(primaryDomain)],
1238
1221
  steps: STEPS
@@ -1253,7 +1236,6 @@ var DomainPane = function DomainPane(_ref) {
1253
1236
  return /*#__PURE__*/jsxRuntime.jsx(Validation, {
1254
1237
  customDomains: customDomains,
1255
1238
  dnsHelpDocs: dnsHelpDocs,
1256
- environment: environment,
1257
1239
  helpDocUrl: helpDocUrl,
1258
1240
  onClose: onClose,
1259
1241
  onCreate: onCreate,
@@ -1404,7 +1386,6 @@ var CustomDomain = function CustomDomain(_ref) {
1404
1386
  }), /*#__PURE__*/jsxRuntime.jsx(DomainPane, {
1405
1387
  customDomains: customDomains,
1406
1388
  dnsHelpDocs: dnsHelpDocs,
1407
- environment: environment,
1408
1389
  helpDocUrl: helpDocUrl,
1409
1390
  onCreate: onCreate,
1410
1391
  url: url,