Skip to content

Commit 54747c7

Browse files
committed
Fix playground, update content
1 parent 087d858 commit 54747c7

File tree

9 files changed

+55
-99
lines changed

9 files changed

+55
-99
lines changed

packages/twenty-docs/src/components/token-form.tsx

+12-8
Original file line numberDiff line numberDiff line change
@@ -29,8 +29,7 @@ const TokenForm = ({
2929
const location = useLocation();
3030
const [isLoading, setIsLoading] = useState(false);
3131
const [locationSetting, setLocationSetting] = useState(
32-
parseJson(localStorage.getItem('baseUrl'))?.locationSetting ??
33-
'production',
32+
parseJson(localStorage.getItem('baseUrl'))?.locationSetting ?? 'production',
3433
);
3534
const [baseUrl, setBaseUrl] = useState(
3635
parseJson(localStorage.getItem('baseUrl'))?.baseUrl ??
@@ -63,14 +62,17 @@ const TokenForm = ({
6362
url = 'http://localhost:3000';
6463
} else {
6564
url = baseUrl?.endsWith('/')
66-
? baseUrl.substring(0, baseUrl.length - 1)
67-
: baseUrl
65+
? baseUrl.substring(0, baseUrl.length - 1)
66+
: baseUrl;
6867
}
69-
68+
7069
setBaseUrl(url);
7170
setLocationSetting(locationSetting);
7271
submitBaseUrl?.(url);
73-
localStorage.setItem('baseUrl', JSON.stringify({ baseUrl: url, locationSetting }));
72+
localStorage.setItem(
73+
'baseUrl',
74+
JSON.stringify({ baseUrl: url, locationSetting }),
75+
);
7476
};
7577

7678
const validateToken = (openApiJson) => {
@@ -133,7 +135,7 @@ const TokenForm = ({
133135
<select
134136
className="select"
135137
onChange={(event) => {
136-
updateBaseUrl(baseUrl, event.target.value)
138+
updateBaseUrl(baseUrl, event.target.value);
137139
}}
138140
value={locationSetting}
139141
>
@@ -154,7 +156,9 @@ const TokenForm = ({
154156
disabled={locationSetting !== 'other'}
155157
placeholder="Base URL"
156158
value={baseUrl}
157-
onChange={(event) => updateBaseUrl(event.target.value, locationSetting)}
159+
onChange={(event) =>
160+
updateBaseUrl(event.target.value, locationSetting)
161+
}
158162
onBlur={() => submitToken(token)}
159163
/>
160164
</div>

packages/twenty-website/src/app/_components/playground/graphql-playground.tsx

-1
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,6 @@ const SubDocToPath = {
1414
metadata: 'metadata',
1515
};
1616

17-
// Docusaurus does SSR for custom pages, but we need to load GraphiQL in the browser
1817
const GraphQlComponent = ({ token, baseUrl, path }: any) => {
1918
const explorer = explorerPlugin({
2019
showAttribution: true,

packages/twenty-website/src/app/_components/playground/token-form.tsx

+9-7
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,6 @@
33
import React, { useEffect, useState } from 'react';
44
import { TbApi, TbChevronLeft, TbLink } from 'react-icons/tb';
55
import { usePathname, useRouter } from 'next/navigation';
6-
import { parseJson } from 'nx/src/utils/json';
76

87
// @ts-expect-error Migration loader as text not passing warnings
98
import tokenForm from '!css-loader!./token-form.css';
@@ -34,27 +33,30 @@ const TokenForm = ({
3433

3534
const [isLoading, setIsLoading] = useState(false);
3635
const [locationSetting, setLocationSetting] = useState(
37-
parseJson?.(localStorage.getItem('baseUrl') || '')?.locationSetting ??
36+
(window.localStorage.getItem('baseUrl') &&
37+
JSON.parse(window.localStorage.getItem('baseUrl') ?? '')
38+
?.locationSetting) ??
3839
'production',
3940
);
4041
const [baseUrl, setBaseUrl] = useState(
41-
parseJson?.(localStorage.getItem('baseUrl') || '')?.baseUrl ??
42+
(window.localStorage.getItem('baseUrl') &&
43+
JSON.parse(window.localStorage.getItem('baseUrl') ?? '')?.baseUrl) ??
4244
'https://api.twenty.com',
4345
);
4446

45-
const tokenLocal = localStorage?.getItem?.(
47+
const tokenLocal = window.localStorage?.getItem?.(
4648
'TryIt_securitySchemeValues',
4749
) as string;
4850

49-
const token = parseJson?.(tokenLocal)?.bearerAuth ?? '';
51+
const token = JSON.parse(tokenLocal)?.bearerAuth ?? '';
5052

5153
const updateLoading = (loading = false) => {
5254
setIsLoading(loading);
5355
setLoadingState?.(!!loading);
5456
};
5557

5658
const updateToken = async (event: React.ChangeEvent<HTMLInputElement>) => {
57-
localStorage.setItem(
59+
window.localStorage.setItem(
5860
'TryIt_securitySchemeValues',
5961
JSON.stringify({ bearerAuth: event.target.value }),
6062
);
@@ -78,7 +80,7 @@ const TokenForm = ({
7880
setBaseUrl(url);
7981
setLocationSetting(locationSetting);
8082
submitBaseUrl?.(url);
81-
localStorage.setItem(
83+
window.localStorage.setItem(
8284
'baseUrl',
8385
JSON.stringify({ baseUrl: url, locationSetting }),
8486
);

packages/twenty-website/src/content/developers/cloud.mdx

-23
This file was deleted.

packages/twenty-website/src/content/developers/constants/DocsIndex.ts

+21-20
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
11
export const DOCS_INDEX = {
22
'Getting Started': {
33
'Getting Started': [{ fileName: 'index' }],
4-
'Managed Cloud': [{ fileName: 'cloud' }],
54
'Local Setup': [{ fileName: 'local-setup' }],
65
'Self-Hosting': [
76
{ fileName: 'self-hosting' },
@@ -10,6 +9,20 @@ export const DOCS_INDEX = {
109
{ fileName: 'cloud-providers' },
1110
],
1211
},
12+
Extending: {
13+
'Rest APIs': [
14+
{ fileName: 'rest-apis' },
15+
{ fileName: 'core-api-rest' },
16+
{ fileName: 'metadata-api-rest' },
17+
],
18+
'GraphQL APIs': [
19+
{ fileName: 'graphql-apis' },
20+
{ fileName: 'core-api-graphql' },
21+
{ fileName: 'metadata-api-graphql' },
22+
],
23+
// Storybook: [{ fileName: 'storybook' }],
24+
},
25+
1326
Contributing: {
1427
'Bugs and Requests': [{ fileName: 'bug-and-requests' }],
1528
'Frontend Development': [
@@ -32,20 +45,14 @@ export const DOCS_INDEX = {
3245
{ fileName: 'queue' },
3346
],
3447
},
35-
Extending: {
36-
Storybook: [{ fileName: 'storybook' }],
37-
'Rest APIs': [
38-
{ fileName: 'rest-apis' },
39-
{ fileName: 'core-api-rest' },
40-
{ fileName: 'metadata-api-rest' },
41-
],
42-
'GraphQL APIs': [
43-
{ fileName: 'graphql-apis' },
44-
{ fileName: 'core-api-graphql' },
45-
{ fileName: 'metadata-api-graphql' },
48+
49+
'User Guide': {
50+
'Getting Started': [
51+
{ fileName: 'getting-started' },
52+
{ fileName: 'get-section' },
4653
],
4754
},
48-
Components: {
55+
/* Components: {
4956
Display: [
5057
{ fileName: 'display' },
5158
{ fileName: 'checkmark' },
@@ -77,11 +84,5 @@ export const DOCS_INDEX = {
7784
{ fileName: 'navigation-bar' },
7885
{ fileName: 'step-bar' },
7986
],
80-
},
81-
'User Guide': {
82-
'Getting Started': [
83-
{ fileName: 'getting-started' },
84-
{ fileName: 'get-section' },
85-
],
86-
},
87+
}, */
8788
};

packages/twenty-website/src/content/developers/index.mdx

-22
This file was deleted.

packages/twenty-website/src/content/developers/self-hosting/cloud-providers.mdx

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
---
2-
title: Vendor-specific instructions
2+
title: Vendor-Specific Instructions
33
icon: TbCloud
44
image: /images/user-guide/notes/notes_header.png
55
---

packages/twenty-website/src/content/developers/self-hosting/docker-compose.mdx

+7-12
Original file line numberDiff line numberDiff line change
@@ -1,25 +1,20 @@
11
---
2-
title: 1-click Docker Compose
2+
title: 1-Click Docker Compose
33
icon: TbBrandDocker
44
image: /images/user-guide/objects/objects.png
55
---
6-
## Step by step instructions:
76

8-
### One command installation
7+
## Option 1: One-line script
98

10-
Install the project with the command below. By default, it installs the latest version from the main branch.
9+
Install the project with the command below.
10+
It will install the latest stable version.
1111
```bash
1212
bash <(curl -sL https://git.new/20)
1313
```
1414

15-
### Custom Installation:
15+
If you want to install a specific version, you can do so by adding the version number. `VERSION=x.y.z BRANCH=branch-name bash <(curl -sL https://git.new/20)`
1616

17-
Set VERSION for a specific docker image version, BRANCH for a specific clone branch:
18-
```bash
19-
VERSION=x.y.z BRANCH=branch-name bash <(curl -sL https://git.new/20)
20-
```
21-
22-
### Manual installation
17+
## Option 2: Manual steps
2318

2419
1. Copy the [.env.example](https://github.com/twentyhq/twenty/blob/main/packages/twenty-docker/.env.example) into a `.env` in the same directory where your `docker-compose.yml` file will be
2520
2. Run the command `openssl rand -base64 32` four times, make note of the string for each
@@ -36,7 +31,7 @@ FILE_TOKEN_SECRET=replace_me_with_a_random_string_refresh
3631
5. Run the command `docker-compose up -d`
3732
6. Go to http://localhost:3000 and see your docker instance.
3833

39-
### Troubleshooting
34+
## Troubleshooting
4035

4136
#### Not able to login
4237

yarn.lock

+5-5
Original file line numberDiff line numberDiff line change
@@ -4038,9 +4038,9 @@ __metadata:
40384038
languageName: node
40394039
linkType: hard
40404040

4041-
"@codesandbox/sandpack-react@npm:^2.13.10":
4042-
version: 2.13.10
4043-
resolution: "@codesandbox/sandpack-react@npm:2.13.10"
4041+
"@codesandbox/sandpack-react@npm:^2.13.5":
4042+
version: 2.14.0
4043+
resolution: "@codesandbox/sandpack-react@npm:2.14.0"
40444044
dependencies:
40454045
"@codemirror/autocomplete": "npm:^6.4.0"
40464046
"@codemirror/commands": "npm:^6.1.3"
@@ -4064,7 +4064,7 @@ __metadata:
40644064
peerDependencies:
40654065
react: ^16.8.0 || ^17 || ^18
40664066
react-dom: ^16.8.0 || ^17 || ^18
4067-
checksum: c707e5abfa9f19cf8a298656fe41a3245570ea26c3f0cdcb325bf670fd025c303091befdfe1c53d6e1d0bf972067970d6611d637e041cb6ae03eea44f3b6d352
4067+
checksum: d12217e5e3098679ddf483bf2dd32a29e0f18252d1bef3a47c5462ecddb64c503dde1b801dfbe6e3e729285828e06daea270a7e1caddffa84c52a552675866d5
40684068
languageName: node
40694069
linkType: hard
40704070

@@ -46827,7 +46827,7 @@ __metadata:
4682746827
"@blocknote/react": "npm:^0.12.2"
4682846828
"@chakra-ui/accordion": "npm:^2.3.0"
4682946829
"@chakra-ui/system": "npm:^2.6.0"
46830-
"@codesandbox/sandpack-react": "npm:^2.13.10"
46830+
"@codesandbox/sandpack-react": "npm:^2.13.5"
4683146831
"@crxjs/vite-plugin": "npm:^1.0.14"
4683246832
"@dagrejs/dagre": "npm:^1.1.2"
4683346833
"@docusaurus/core": "npm:^3.1.0"

0 commit comments

Comments
 (0)