Updated default values for "Default Organization" and "Default Project" to be able to read from a .env file.

This commit is contained in:
Jason Zi Feng Lei committed 2022-04-12 10:12:07 +08:00
1 parent beb03f3063
commit d56aeeb359
10 files changed
+31 -10

No files matched your search

+2
View File
@@ -41,6 +41,8 @@ KONG_HTTPS_PORT=8443
POSTGRES_PORT=5432
# Studio
STUDIO_ORGANIZATION_NAME=Default Organization
STUDIO_PROJECT_NAME=Default Project
## Public REST endpoint - replace this if you intend to use Studio outside of localhost
PUBLIC_REST_URL=http://localhost:8000/rest/v1/
+3
View File
@@ -17,6 +17,9 @@ services:
STUDIO_PG_META_URL: http://meta:8080
POSTGRES_PASSWORD: ${POSTGRES_PASSWORD}
DEFAULT_ORGANIZATION: ${STUDIO_DEFAULT_ORGANIZATION}
DEFAULT_PROJECT: ${STUDIO_DEFAULT_PROJECT}
SUPABASE_URL: http://kong:8000
SUPABASE_REST_URL: ${PUBLIC_REST_URL}
SUPABASE_ANON_KEY: ${ANON_KEY}
+3
View File
@@ -1,6 +1,9 @@
STUDIO_PG_META_URL=http://localhost:8000/pg
POSTGRES_PASSWORD=your-super-secret-and-long-postgres-password
DEFAULT_ORGANIZATION_NAME=Default Organization
DEFAULT_PROJECT_NAME=Default Project
SUPABASE_URL=http://localhost:8000
SUPABASE_REST_URL=http://localhost:8000/rest/v1/
SUPABASE_ANON_KEY=eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyAgCiAgICAicm9sZSI6ICJhbm9uIiwKICAgICJpc3MiOiAic3VwYWJhc2UtZGVtbyIsCiAgICAiaWF0IjogMTY0MTc2OTIwMCwKICAgICJleHAiOiAxNzk5NTM1NjAwCn0.dc_X5iR_VP_qT0zsiyj_I_OZ2T9FtRU2BBNWN8Bu4GE
+7
View File
@@ -73,6 +73,13 @@ npm install
npm run dev
```
If you would like to configure different defaults for "Default Organization" and "Default Project", you will need to update the `.env` in the studio folder with the corresponding values.
```
DEFAULT_ORGANIZATION_NAME=
DEFAULT_PROJECT_NAME=
```
## UI Testing Notes
### `<Popover>` vs `<Dropdown>`
+3 -2
View File
@@ -1,6 +1,7 @@
import apiWrapper from 'lib/api/apiWrapper'
import { NextApiRequest, NextApiResponse } from 'next'
import apiWrapper from 'lib/api/apiWrapper'
export default (req: NextApiRequest, res: NextApiResponse) => apiWrapper(req, res, handler)
async function handler(req: NextApiRequest, res: NextApiResponse) {
@@ -20,7 +21,7 @@ const handleGetAll = async (req: NextApiRequest, res: NextApiResponse) => {
const response = [
{
id: 1,
name: 'Default Organization',
name: 'Default Organization' || process.env.DEFAULT_ORGANIZATION_NAME,
slug: 'default-org-slug',
billing_email: 'billing@supabase.co',
},
+4 -3
View File
@@ -1,7 +1,8 @@
import { NextApiRequest, NextApiResponse } from 'next'
import { IS_PLATFORM } from 'lib/constants'
import { createEncryptedDbConnectionString } from 'lib/api/apiHelpers'
import apiWrapper from 'lib/api/apiWrapper'
import { createEncryptedDbConnectionString } from 'lib/api/apiHelpers'
export default (req: NextApiRequest, res: NextApiResponse) => apiWrapper(req, res, handler)
@@ -28,14 +29,14 @@ const handleGetAll = async (req: NextApiRequest, res: NextApiResponse) => {
organizations: [
{
id: 1,
name: 'Default Organization',
name: 'Default Organization' || process.env.DEFAULT_ORGANIZATION_NAME,
slug: 'default-org-slug',
billing_email: 'billing@supabase.co',
projects: [
{
id: 1,
ref: 'default',
name: 'Default Project',
name: 'Default Project' || process.env.DEFAULT_PROJECT_NAME,
organization_id: 1,
cloud_provider: 'localhost',
status: 'ACTIVE_HEALTHY',
+3 -2
View File
@@ -1,6 +1,7 @@
import apiWrapper from 'lib/api/apiWrapper'
import { NextApiRequest, NextApiResponse } from 'next'
import apiWrapper from 'lib/api/apiWrapper'
export default (req: NextApiRequest, res: NextApiResponse) => apiWrapper(req, res, handler)
async function handler(req: NextApiRequest, res: NextApiResponse) {
@@ -20,7 +21,7 @@ const handleGet = async (req: NextApiRequest, res: NextApiResponse) => {
const response = {
id: 1,
ref: 'default',
name: 'Default Project',
name: 'Default Project' || process.env.DEFAULT_PROJECT_NAME,
organization_id: 1,
cloud_provider: 'localhost',
status: 'ACTIVE_HEALTHY',
+2 -1
View File
@@ -1,4 +1,5 @@
import { NextApiRequest, NextApiResponse } from 'next'
import apiWrapper from 'lib/api/apiWrapper'
export default (req: NextApiRequest, res: NextApiResponse) => apiWrapper(req, res, handler)
@@ -27,7 +28,7 @@ const handleGetAll = async (req: NextApiRequest, res: NextApiResponse) => {
db_user: 'postgres',
id: 1,
inserted_at: undefined,
name: 'Default Project',
name: 'Default Project' || process.env.DEFAULT_PROJECT_NAME,
ref: 'default',
status: 'ACTIVE_HEALTHY',
services: [
@@ -1,4 +1,5 @@
import { NextApiRequest, NextApiResponse } from 'next'
import apiWrapper from 'lib/api/apiWrapper'
export default (req: NextApiRequest, res: NextApiResponse) => apiWrapper(req, res, handler)
@@ -21,7 +22,7 @@ const handleGetAll = async (req: NextApiRequest, res: NextApiResponse) => {
project: {
id: 1,
ref: 'default',
name: 'Default Project',
name: 'Default Project' || process.env.DEFAULT_PROJECT_NAME,
status: 'ACTIVE_HEALTHY',
organization_id: 1,
inserted_at: '2021-08-02T06:40:40.646362',
@@ -1,4 +1,5 @@
import { NextApiRequest, NextApiResponse } from 'next'
import apiWrapper from 'lib/api/apiWrapper'
export default (req: NextApiRequest, res: NextApiResponse) => apiWrapper(req, res, handler)
@@ -29,7 +30,7 @@ const handleGetAll = async (req: NextApiRequest, res: NextApiResponse) => {
id: 1,
inserted_at: undefined,
jwt_secret: '-',
name: 'Default Project',
name: 'Default Project' || process.env.DEFAULT_PROJECT_NAME,
ref: 'default',
region: 'ap-southeast-1',
status: 'ACTIVE_HEALTHY',