@bigbinary/neeto-custom-domains-frontend 3.0.0 → 3.0.2

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 CHANGED
@@ -107,23 +107,66 @@ const CustomDomain = () => {
107
107
  },
108
108
  ];
109
109
 
110
- const title = (
111
- <div className="flex items-center gap-x-2">
112
- {t("neetoCustomDomains.customDomain", SINGULAR)}
113
- <HelpPopover
114
- description={t("neetoCustomDomains.toolTips.customDomain")}
115
- helpLinkProps={{ href: CUSTOM_DOMAIN_HELP_DOC_URL }}
116
- popoverProps={{ position: "top" }}
117
- title={t("neetoCustomDomains.customDomain", SINGULAR)}
118
- />
119
- </div>
120
- );
110
+ const CUSTOM_DOMAIN_DNS_PROVIDER_HELP_DOCS = {
111
+ cloudflare: {
112
+ subdomain: `${PERMANENT_URL}/permanent-url-1`,
113
+ rootDomain: `${PERMANENT_URL}/permanent-url-2`,
114
+ },
115
+ unknown: {
116
+ subdomain: `${PERMANENT_URL}/permanent-url-3`,
117
+ rootDomain: `${PERMANENT_URL}/permanent-url-4`,
118
+ },
119
+ namecheap: {
120
+ subdomain: `${PERMANENT_URL}/permanent-url-5`,
121
+ rootDomain: `${PERMANENT_URL}/permanent-url-6`,
122
+ },
123
+ hostinger: {
124
+ subdomain: `${PERMANENT_URL}/permanent-url-7`,
125
+ rootDomain: `${PERMANENT_URL}/permanent-url-8`,
126
+ },
127
+ digitalocean: {
128
+ subdomain: `${PERMANENT_URL}/permanent-url-9`,
129
+ rootDomain: `${PERMANENT_URL}/permanent-url-10`,
130
+ },
131
+ godaddy: {
132
+ subdomain: `${PERMANENT_URL}/permanent-url-11`,
133
+ rootDomain: `${PERMANENT_URL}/permanent-url-12`,
134
+ },
135
+ squarespace: {
136
+ subdomain: `${PERMANENT_URL}/permanent-url-13`,
137
+ rootDomain: `${PERMANENT_URL}/permanent-url-14`,
138
+ },
139
+ wix: {
140
+ subdomain: `${PERMANENT_URL}/permanent-url-15`,
141
+ rootDomain: `${PERMANENT_URL}/permanent-url-16`,
142
+ },
143
+ porkbun: {
144
+ subdomain: `${PERMANENT_URL}/permanent-url-17`,
145
+ rootDomain: `${PERMANENT_URL}/permanent-url-18`,
146
+ },
147
+ networksolutions: {
148
+ subdomain: `${PERMANENT_URL}/permanent-url-19`,
149
+ rootDomain: `${PERMANENT_URL}/permanent-url-20`,
150
+ },
151
+ aws: {
152
+ subdomain: `${PERMANENT_URL}/permanent-url-21`,
153
+ rootDomain: `${PERMANENT_URL}/permanent-url-22`,
154
+ },
155
+ strato: {
156
+ subdomain: `${PERMANENT_URL}/permanent-url-23`,
157
+ rootDomain: `${PERMANENT_URL}/permanent-url-24`,
158
+ },
159
+ }
121
160
 
122
161
  return (
123
162
  <div className="w-full">
124
163
  <NeetoCustomDomainDashboard
125
- headerProps={{ breadcrumbs, title }}
126
- url={`${BASE_API_V1_URL}/custom_domain`}
164
+ appName="appname" // Eg: `cal`, `form`
165
+ dnsHelpDocs={CUSTOM_DOMAIN_DNS_PROVIDER_HELP_DOCS}
166
+ helpDocUrl={CUSTOM_DOMAIN_HELP_DOC_URL}
167
+ subdomainPlaceholder="subdomain-placeholder" // Eg: `schedule` for NeetoCal and `form` for NeetoForm
168
+ url={`${BASE_URL}/custom-domains`}
169
+ { ...{ breadcrumbs } }
127
170
  />
128
171
  </div>
129
172
  );
@@ -153,6 +196,7 @@ Consult the
153
196
  guide for details on how to publish.
154
197
 
155
198
  ## Integrations
199
+
156
200
  - NeetoCal
157
201
  - NeetoForm
158
202
  - NeetoKb
@@ -23,7 +23,7 @@
23
23
  "settings": "Custom domain settings",
24
24
  "connectionTitle": "Connected custom domain",
25
25
  "noDomainConnected": "No custom domain connected",
26
- "readHelpArticle": "<Link>Read more</Link> to learn more about setting up custom domain",
26
+ "readHelpArticle": "<Link>Read more</Link> to learn how to set up custom domains.",
27
27
  "yourDomain": "Your domain",
28
28
  "addNew": "Add custom domain",
29
29
  "delete": "Delete custom domain?",
@@ -40,14 +40,13 @@
40
40
  "proxyMessage": " Do not enable proxy for the record. ",
41
41
  "nameServerMessage": "View <Link>help article</Link> for adding DNS record in {{dnsProvider,anyCase}}.",
42
42
  "domainRedirectionInfo": "It can take up to 2-24 hours for your custom domain to start working. Please visit your site in 24 hours from now and if after 24 hours <strong>{{hostname}}</strong> is not working then please view <Link>help article</Link> for more information and contact us.",
43
- "domainValidationInfo": "CNAME record not found, if you added CNAME record in last 24 hours then please wait sometime and try it again. Verifying your domain usually only takes a few hours, but in some cases can take up to 24-48 hours.",
44
- "certificateProvisionFailed": "CNAME record found but we are facing some issues with provisioning certificate for your domain. Please try again",
43
+ "domainValidationInfo": "DNS record not found, if you added the DNS record in last 24 hours then please wait sometime and try it again. Verifying your domain usually only takes a few hours, but in some cases can take up to 24-48 hours.",
44
+ "certificateProvisionFailed": "The DNS record was found but we are facing some issues with provisioning certificate for your domain. Please try again later.",
45
45
  "learnMoreMessage": "Learn about <button>how to setup custom domains</button>",
46
- "cnameAdded": "I have added redirection CNAME record",
47
46
  "domainCreation": {
48
47
  "existInStaging": "Custom domain <strong>{{hostname}}</strong> is already configured for another workspace. If you are the legitimate owner, please contact support to retrieve the custom domain.",
49
48
  "existInProduction": "Custom domain <strong>{{hostname}}</strong> is already configured for the workspace <strong>{{workspace}}</strong>. Please <Link>login</Link> to that workspace and remove custom domain before trying to add the same domain here. please contact support if you are not part of this workspace.",
50
- "rootDomainUnsupported": "{{dnsProvider,anyCase}} doesn't allow you to set a CNAME record for the root domain. However, you can set up your custom domain for a subdomain. <br/><br/>This means that, if you try to set up <strong>https://{{hostname}}</strong>, {{dnsProvider,anyCase}} will not allow it. However, you can have a subdomain like <strong>https://{{subdomainPlaceholder, anyCase}}.{{hostname}}</strong>, and {{dnsProvider,anyCase}} will allow you to setup a custom domain."
49
+ "rootDomainUnsupported": "{{dnsProvider,anyCase}} doesn't allow you to add a DNS record for the root domain. However, you can set up your custom domain for a subdomain. <br/><br/>This means that, if you try to set up <strong>https://{{hostname}}</strong>, {{dnsProvider,anyCase}} will not allow it. However, you can have a subdomain like <strong>https://{{subdomainPlaceholder, anyCase}}.{{hostname}}</strong>, and {{dnsProvider,anyCase}} will allow you to setup a custom domain."
51
50
  },
52
51
  "validation": {
53
52
  "successMessage": "Custom domain successfully validated.",
@@ -77,4 +76,4 @@
77
76
  "customDomain": "Add domain of your choice in case you do not prefer to use the default neeto domain."
78
77
  }
79
78
  }
80
- }
79
+ }
@@ -12,6 +12,7 @@ import Alert from '@bigbinary/neetoui/Alert';
12
12
  import { Trans, useTranslation } from 'react-i18next';
13
13
  import { jsx, jsxs } from 'react/jsx-runtime';
14
14
  import { SINGULAR } from '@bigbinary/neeto-commons-frontend/constants';
15
+ import CardLayout from '@bigbinary/neeto-molecules/CardLayout';
15
16
  import { hyphenize } from '@bigbinary/neeto-commons-frontend/utils/general';
16
17
  import MoreDropdown from '@bigbinary/neeto-molecules/MoreDropdown';
17
18
  import Button from '@bigbinary/neetoui/Button';
@@ -31,7 +32,6 @@ import { isNil } from 'ramda';
31
32
  import CopyToClipboardButton from '@bigbinary/neeto-molecules/CopyToClipboardButton';
32
33
  import psl from 'psl';
33
34
  import NeetoHeader from '@bigbinary/neeto-molecules/Header';
34
- import HelpPopover from '@bigbinary/neeto-molecules/HelpPopover';
35
35
 
36
36
  var getUrlwithId = function getUrlwithId(url, id) {
37
37
  return id ? "".concat(url, "/").concat(id) : url;
@@ -140,12 +140,15 @@ var Domain = withT(function (_ref) {
140
140
  customDomain = _ref.customDomain,
141
141
  openDeleteAlert = _ref.openDeleteAlert,
142
142
  helpDocUrl = _ref.helpDocUrl;
143
- return /*#__PURE__*/jsxs("div", {
144
- className: "neeto-ui-border-gray-300 neeto-ui-rounded w-1/2 space-y-4 border p-6",
145
- children: [/*#__PURE__*/jsx(Typography, {
146
- style: "h2",
147
- children: t("neetoCustomDomains.connectionTitle")
148
- }), /*#__PURE__*/jsxs("div", {
143
+ return /*#__PURE__*/jsx(CardLayout, {
144
+ actionBlock: !isCustomDomainAdded && /*#__PURE__*/jsx(Button, {
145
+ label: t("neetoCustomDomains.actions.add", {
146
+ what: t("neetoCustomDomains.customDomain", SINGULAR)
147
+ }),
148
+ onClick: openPane
149
+ }),
150
+ title: t("neetoCustomDomains.connectionTitle"),
151
+ children: /*#__PURE__*/jsxs("div", {
149
152
  className: "space-y-1",
150
153
  children: [/*#__PURE__*/jsxs("div", {
151
154
  className: "neeto-ui-border-gray-200 neeto-ui-rounded neeto-ui-bg-gray-50 flex items-center justify-between border p-2",
@@ -179,7 +182,7 @@ var Domain = withT(function (_ref) {
179
182
  }]
180
183
  })]
181
184
  }), /*#__PURE__*/jsx(Typography, {
182
- style: "body3",
185
+ style: "body2",
183
186
  children: /*#__PURE__*/jsx(Trans, {
184
187
  i18nKey: "neetoCustomDomains.readHelpArticle",
185
188
  components: {
@@ -192,12 +195,7 @@ var Domain = withT(function (_ref) {
192
195
  }
193
196
  })
194
197
  })]
195
- }), !isCustomDomainAdded && /*#__PURE__*/jsx(Button, {
196
- label: t("neetoCustomDomains.actions.add", {
197
- what: t("neetoCustomDomains.customDomain", SINGULAR)
198
- }),
199
- onClick: openPane
200
- })]
198
+ })
201
199
  });
202
200
  });
203
201
 
@@ -911,27 +909,18 @@ var Header = function Header(_ref) {
911
909
  size = _ref$size === void 0 ? "large" : _ref$size;
912
910
  var _useTranslation = useTranslation(),
913
911
  t = _useTranslation.t;
914
- var title = /*#__PURE__*/jsxs("div", {
915
- className: "flex items-center gap-x-2",
916
- children: [/*#__PURE__*/jsx(Typography, {
917
- style: "h2",
918
- children: t("neetoCustomDomains.customDomain", SINGULAR)
919
- }), /*#__PURE__*/jsx(HelpPopover, {
920
- description: t("neetoCustomDomains.toolTips.customDomain"),
921
- helpLinkProps: {
922
- href: helpDocUrl
923
- },
924
- popoverProps: {
925
- position: "top"
926
- },
927
- title: t("neetoCustomDomains.customDomain", SINGULAR)
928
- })]
929
- });
930
912
  return /*#__PURE__*/jsx(NeetoHeader, {
931
913
  breadcrumbs: breadcrumbs,
932
914
  size: size,
933
- title: title,
934
915
  "data-testid": "custom-domain-header",
916
+ title: t("neetoCustomDomains.customDomain", SINGULAR),
917
+ titleHelpPopoverProps: {
918
+ title: t("neetoCustomDomains.customDomain", SINGULAR),
919
+ description: t("neetoCustomDomains.toolTips.customDomain"),
920
+ helpLinkProps: {
921
+ href: helpDocUrl
922
+ }
923
+ },
935
924
  actionBlock: /*#__PURE__*/jsx(Button, {
936
925
  "data-cy": "add-new-custom-domain-button",
937
926
  disabled: isCustomDomainAdded,
@@ -999,7 +988,7 @@ var CustomDomain = function CustomDomain(_ref) {
999
988
  openPane: openPane,
1000
989
  size: headerSize
1001
990
  }), /*#__PURE__*/jsx("div", {
1002
- className: "mt-10 flex w-full justify-center",
991
+ className: "flex w-full justify-center",
1003
992
  children: /*#__PURE__*/jsx(Domain, {
1004
993
  customDomain: customDomain,
1005
994
  helpDocUrl: helpDocUrl,