mirror of
https://github.com/utopia-os/utopia-ui.git
synced 2025-12-13 07:46:10 +00:00
Merge branch 'main' into login-request-password
This commit is contained in:
commit
ea27788cf6
@ -3,5 +3,6 @@ VITE_API_URL=http://localhost:8055/
|
||||
#VITE_API_URL=https://api.utopia-lab.org
|
||||
VITE_MAP_URL=http://local.development
|
||||
#VITE_MAP_URL=CURRENT_WINDOW_LOCATION
|
||||
#VITE_DIRECTUS_ADMIN_ROLE=
|
||||
VITE_VALIDATE_INVITE_FLOW_ID=01d61db0-25aa-4bfa-bc24-c6a8f208a455
|
||||
VITE_REDEEM_INVITE_FLOW_ID=cc80ec73-ecf5-4789-bee5-1127fb1a6ed4
|
||||
|
||||
11
app/README.md
Normal file
11
app/README.md
Normal file
@ -0,0 +1,11 @@
|
||||
# App
|
||||
|
||||
## Troubleshooting
|
||||
|
||||
Map doesn't load and the Error `You must define the Admin roll in the .env file!` shows in the console.
|
||||
|
||||
In order to get the map running you need to define the correct uuid of the admin roll in the `.env` file.
|
||||
|
||||
Go to http://localhost:8055 and login with the admin credentials. Navigate to http://localhost:8055/admin/settings/roles and click `Administrator` and copy the UUID from the URL.
|
||||
|
||||
Put this UUID in the `.env` as `VITE_DIRECTUS_ADMIN_ROLE=UUID`
|
||||
@ -155,11 +155,9 @@ function App() {
|
||||
appName={map.name}
|
||||
embedded={embedded}
|
||||
openCollectiveApiKey={config.openCollectiveApiKey}
|
||||
hideSignup={map.hide_signup}
|
||||
>
|
||||
<Permissions
|
||||
api={permissionsApiInstance}
|
||||
adminRole='8ed0b24e-3320-48cd-8444-bc152304e580'
|
||||
></Permissions>
|
||||
<Permissions api={permissionsApiInstance} adminRole={config.adminRole} />
|
||||
{tagsApi && <Tags api={tagsApi}></Tags>}
|
||||
<Modal>
|
||||
<ModalContent map={map} />
|
||||
|
||||
@ -1,6 +1,7 @@
|
||||
export const config = {
|
||||
apiUrl: String(import.meta.env.VITE_API_URL ?? 'http://localhost:8055/'),
|
||||
mapUrl: String(import.meta.env.VITE_MAP_URL ?? 'http://local.development'),
|
||||
adminRole: String(import.meta.env.VITE_DIRECTUS_ADMIN_ROLE ?? ''),
|
||||
validateInviteFlowId: String(
|
||||
import.meta.env.VITE_VALIDATE_INVITE_FLOW_ID ?? '01d61db0-25aa-4bfa-bc24-c6a8f208a455',
|
||||
),
|
||||
@ -10,4 +11,8 @@ export const config = {
|
||||
openCollectiveApiKey: String(import.meta.env.VITE_OPEN_COLLECTIVE_API_KEY ?? ''),
|
||||
}
|
||||
|
||||
if (config.adminRole === '') {
|
||||
throw Error('You must define the Admin roll in the .env file!')
|
||||
}
|
||||
|
||||
export type Config = typeof config
|
||||
|
||||
@ -12,12 +12,7 @@ npx directus-sync push \
|
||||
--directus-email admin@it4c.dev \
|
||||
--directus-password admin123
|
||||
|
||||
npx directus-sync seed push \
|
||||
--directus-url http://localhost:8055 \
|
||||
--directus-email admin@it4c.dev \
|
||||
--directus-password admin123
|
||||
|
||||
./directus-config/manual/seed.sh
|
||||
./seed.sh
|
||||
```
|
||||
|
||||
## Pull Data from Docker to Harddrive
|
||||
@ -44,27 +39,7 @@ npx directus-sync push \
|
||||
|
||||
## Seed Data for local development
|
||||
|
||||
Seed the development data via:
|
||||
```
|
||||
npx directus-sync seed push \
|
||||
--directus-url http://localhost:8055 \
|
||||
--directus-email admin@it4c.dev \
|
||||
--directus-password admin123
|
||||
```
|
||||
|
||||
## Seed Data - find differences
|
||||
|
||||
In order so see what changes would appear when seeding, you can execute:
|
||||
```
|
||||
npx directus-sync seed diff \
|
||||
--directus-url http://localhost:8055 \
|
||||
--directus-email admin@it4c.dev \
|
||||
--directus-password admin123
|
||||
```
|
||||
|
||||
## Manual Seed
|
||||
|
||||
In order to seed files and additional data not covered by `directus-sync` run the script `backend/directus-config/manual/seed.sh`.
|
||||
In order to seed the development data, run the script `backend/seed.sh`.
|
||||
|
||||
## Backup Database
|
||||
|
||||
|
||||
@ -1697,7 +1697,7 @@
|
||||
"permissions": null,
|
||||
"validation": null,
|
||||
"presets": {
|
||||
"role": "cccbc503-ecab-4ef1-8cf9-b6ac0f2be240"
|
||||
"role": "REPLACEME-WITH-REGISTRATED-ROLE_UUID"
|
||||
},
|
||||
"fields": [
|
||||
"first_name",
|
||||
|
||||
@ -93,7 +93,7 @@
|
||||
"app_access": false,
|
||||
"roles": [
|
||||
{
|
||||
"role": "9865ace7-27fe-4d1f-be88-99ee6410fca2",
|
||||
"role": "role-registrated",
|
||||
"sort": 1
|
||||
}
|
||||
],
|
||||
|
||||
@ -11,7 +11,7 @@
|
||||
"icon": "paragliding",
|
||||
"description": null,
|
||||
"parent": null,
|
||||
"_syncId": "9865ace7-27fe-4d1f-be88-99ee6410fca2"
|
||||
"_syncId": "role-registrated"
|
||||
},
|
||||
{
|
||||
"name": "Editor",
|
||||
|
||||
@ -1,20 +0,0 @@
|
||||
#!/bin/sh
|
||||
|
||||
# base setup
|
||||
SCRIPT_PATH=$(realpath $0)
|
||||
SCRIPT_DIR=$(dirname $SCRIPT_PATH)
|
||||
ROOT_DIR=$SCRIPT_DIR/../../..
|
||||
|
||||
DATA_DIR=$ROOT_DIR/data
|
||||
DATA_UPLOADS_DIR=$DATA_DIR/uploads
|
||||
|
||||
SEED_FILES_DIR=$SCRIPT_DIR/files
|
||||
SEED_SQL_DIR=$SCRIPT_DIR/sql
|
||||
|
||||
# copy files
|
||||
cp $SEED_FILES_DIR/* $DATA_UPLOADS_DIR/
|
||||
|
||||
# apply database updates
|
||||
for filename in $SEED_SQL_DIR/*.sql; do
|
||||
docker exec -i utopia-map-database-1 /bin/bash -c "PGPASSWORD=directus psql -v ON_ERROR_STOP=1 --username directus directus" < $filename
|
||||
done
|
||||
@ -1,7 +0,0 @@
|
||||
DELETE FROM public.directus_files WHERE id = '412c25dc-a3b7-4114-b64b-cac2d6b46db3';
|
||||
|
||||
COPY public.directus_files (id, storage, filename_disk, filename_download, title, type, folder, uploaded_by, created_on, modified_by, modified_on, charset, filesize, width, height, duration, embed, description, location, tags, metadata, focal_point_x, focal_point_y, tus_id, tus_data, uploaded_on) FROM stdin;
|
||||
412c25dc-a3b7-4114-b64b-cac2d6b46db3 local 412c25dc-a3b7-4114-b64b-cac2d6b46db3.svg utopia-logo.svg utopia-logo image/svg+xml \N \N 2025-08-12 11:26:36.539+00 \N 2025-08-12 11:27:07.646+00 \N 22906 \N \N \N \N \N \N \N \N \N \N \N \N 2025-08-12 11:26:36.555+00
|
||||
\.
|
||||
|
||||
UPDATE public.directus_settings SET project_logo = '412c25dc-a3b7-4114-b64b-cac2d6b46db3';
|
||||
3
backend/directus-config/seeds/.gitignore
vendored
Normal file
3
backend/directus-config/seeds/.gitignore
vendored
Normal file
@ -0,0 +1,3 @@
|
||||
/*
|
||||
!development/
|
||||
!.gitignore
|
||||
@ -0,0 +1,14 @@
|
||||
{
|
||||
"collection": "directus_files",
|
||||
"data": [
|
||||
{
|
||||
"_sync_id": "utopia-logo",
|
||||
"_file_path": "./files/utopia-logo.svg",
|
||||
"storage": "local",
|
||||
"filename_download": "utopia-logo.svg",
|
||||
"title": "Utopia Logo",
|
||||
"tags": [],
|
||||
"description": "Utopia Logo"
|
||||
}
|
||||
]
|
||||
}
|
||||
|
Before Width: | Height: | Size: 22 KiB After Width: | Height: | Size: 22 KiB |
@ -0,0 +1 @@
|
||||
UPDATE public.directus_settings SET project_logo = (SELECT id FROM directus_files WHERE filename_download = 'utopia-logo.svg');
|
||||
@ -0,0 +1,5 @@
|
||||
UPDATE public.directus_permissions
|
||||
SET presets = jsonb_set(presets::jsonb,'{role}', to_jsonb((SELECT id FROM public.directus_roles WHERE name = 'Registrated')), true)
|
||||
WHERE policy = (SELECT id FROM public.directus_policies WHERE name = '$t:public_label')
|
||||
AND collection = 'directus_users'
|
||||
AND action = 'create';
|
||||
@ -0,0 +1,45 @@
|
||||
{
|
||||
"collection": "maps",
|
||||
"field": "hide_signup",
|
||||
"type": "boolean",
|
||||
"meta": {
|
||||
"collection": "maps",
|
||||
"conditions": null,
|
||||
"display": null,
|
||||
"display_options": null,
|
||||
"field": "hide_signup",
|
||||
"group": null,
|
||||
"hidden": false,
|
||||
"interface": "boolean",
|
||||
"note": null,
|
||||
"options": null,
|
||||
"readonly": false,
|
||||
"required": false,
|
||||
"sort": 17,
|
||||
"special": [
|
||||
"cast-boolean"
|
||||
],
|
||||
"translations": null,
|
||||
"validation": null,
|
||||
"validation_message": null,
|
||||
"width": "full"
|
||||
},
|
||||
"schema": {
|
||||
"name": "hide_signup",
|
||||
"table": "maps",
|
||||
"data_type": "boolean",
|
||||
"default_value": false,
|
||||
"max_length": null,
|
||||
"numeric_precision": null,
|
||||
"numeric_scale": null,
|
||||
"is_nullable": true,
|
||||
"is_unique": false,
|
||||
"is_indexed": false,
|
||||
"is_primary_key": false,
|
||||
"is_generated": false,
|
||||
"generation_expression": null,
|
||||
"has_auto_increment": false,
|
||||
"foreign_key_table": null,
|
||||
"foreign_key_column": null
|
||||
}
|
||||
}
|
||||
@ -11,6 +11,10 @@ type Query {
|
||||
oceannomads_profiles_by_id(id: ID!, version: String): oceannomads_profiles
|
||||
oceannomads_profiles_aggregated(groupBy: [String], filter: oceannomads_profiles_filter, limit: Int, offset: Int, page: Int, search: String, sort: [String]): [oceannomads_profiles_aggregated!]!
|
||||
oceannomads_profiles_by_version(version: String!, id: ID!): version_oceannomads_profiles
|
||||
maps(filter: maps_filter, sort: [String], limit: Int, offset: Int, page: Int, search: String): [maps!]!
|
||||
maps_by_id(id: ID!, version: String): maps
|
||||
maps_aggregated(groupBy: [String], filter: maps_filter, limit: Int, offset: Int, page: Int, search: String, sort: [String]): [maps_aggregated!]!
|
||||
maps_by_version(version: String!, id: ID!): version_maps
|
||||
attestations(filter: attestations_filter, sort: [String], limit: Int, offset: Int, page: Int, search: String): [attestations!]!
|
||||
attestations_by_id(id: ID!, version: String): attestations
|
||||
attestations_aggregated(groupBy: [String], filter: attestations_filter, limit: Int, offset: Int, page: Int, search: String, sort: [String]): [attestations_aggregated!]!
|
||||
@ -111,10 +115,6 @@ type Query {
|
||||
layers_maps_by_id(id: ID!, version: String): layers_maps
|
||||
layers_maps_aggregated(groupBy: [String], filter: layers_maps_filter, limit: Int, offset: Int, page: Int, search: String, sort: [String]): [layers_maps_aggregated!]!
|
||||
layers_maps_by_version(version: String!, id: ID!): version_layers_maps
|
||||
maps(filter: maps_filter, sort: [String], limit: Int, offset: Int, page: Int, search: String): [maps!]!
|
||||
maps_by_id(id: ID!, version: String): maps
|
||||
maps_aggregated(groupBy: [String], filter: maps_filter, limit: Int, offset: Int, page: Int, search: String, sort: [String]): [maps_aggregated!]!
|
||||
maps_by_version(version: String!, id: ID!): version_maps
|
||||
Themes(filter: Themes_filter, sort: [String], limit: Int, offset: Int, page: Int, search: String): [Themes!]!
|
||||
Themes_by_id(id: ID!, version: String): Themes
|
||||
Themes_aggregated(groupBy: [String], filter: Themes_filter, limit: Int, offset: Int, page: Int, search: String, sort: [String]): [Themes_aggregated!]!
|
||||
@ -144,6 +144,8 @@ type Mutation {
|
||||
create_relations_item(data: create_relations_input!): relations
|
||||
create_oceannomads_profiles_items(filter: oceannomads_profiles_filter, sort: [String], limit: Int, offset: Int, page: Int, search: String, data: [create_oceannomads_profiles_input!]): [oceannomads_profiles!]!
|
||||
create_oceannomads_profiles_item(data: create_oceannomads_profiles_input!): oceannomads_profiles
|
||||
create_maps_items(filter: maps_filter, sort: [String], limit: Int, offset: Int, page: Int, search: String, data: [create_maps_input!]): [maps!]!
|
||||
create_maps_item(data: create_maps_input!): maps
|
||||
create_attestations_items(filter: attestations_filter, sort: [String], limit: Int, offset: Int, page: Int, search: String, data: [create_attestations_input!]): [attestations!]!
|
||||
create_attestations_item(data: create_attestations_input!): attestations
|
||||
create_attestations_directus_users_items(filter: attestations_directus_users_filter, sort: [String], limit: Int, offset: Int, page: Int, search: String, data: [create_attestations_directus_users_input!]): [attestations_directus_users!]!
|
||||
@ -194,8 +196,6 @@ type Mutation {
|
||||
create_layers_files_item(data: create_layers_files_input!): layers_files
|
||||
create_layers_maps_items(filter: layers_maps_filter, sort: [String], limit: Int, offset: Int, page: Int, search: String, data: [create_layers_maps_input!]): [layers_maps!]!
|
||||
create_layers_maps_item(data: create_layers_maps_input!): layers_maps
|
||||
create_maps_items(filter: maps_filter, sort: [String], limit: Int, offset: Int, page: Int, search: String, data: [create_maps_input!]): [maps!]!
|
||||
create_maps_item(data: create_maps_input!): maps
|
||||
create_Themes_items(filter: Themes_filter, sort: [String], limit: Int, offset: Int, page: Int, search: String, data: [create_Themes_input!]): [Themes!]!
|
||||
create_Themes_item(data: create_Themes_input!): Themes
|
||||
create_startEnd_items(filter: startEnd_filter, sort: [String], limit: Int, offset: Int, page: Int, search: String, data: [create_startEnd_input!]): [startEnd!]!
|
||||
@ -215,6 +215,9 @@ type Mutation {
|
||||
update_oceannomads_profiles_items(filter: oceannomads_profiles_filter, sort: [String], limit: Int, offset: Int, page: Int, search: String, ids: [ID]!, data: update_oceannomads_profiles_input!): [oceannomads_profiles!]!
|
||||
update_oceannomads_profiles_batch(filter: oceannomads_profiles_filter, sort: [String], limit: Int, offset: Int, page: Int, search: String, data: [update_oceannomads_profiles_input!]): [oceannomads_profiles!]!
|
||||
update_oceannomads_profiles_item(id: ID!, data: update_oceannomads_profiles_input!): oceannomads_profiles
|
||||
update_maps_items(filter: maps_filter, sort: [String], limit: Int, offset: Int, page: Int, search: String, ids: [ID]!, data: update_maps_input!): [maps!]!
|
||||
update_maps_batch(filter: maps_filter, sort: [String], limit: Int, offset: Int, page: Int, search: String, data: [update_maps_input!]): [maps!]!
|
||||
update_maps_item(id: ID!, data: update_maps_input!): maps
|
||||
update_attestations_items(filter: attestations_filter, sort: [String], limit: Int, offset: Int, page: Int, search: String, ids: [ID]!, data: update_attestations_input!): [attestations!]!
|
||||
update_attestations_batch(filter: attestations_filter, sort: [String], limit: Int, offset: Int, page: Int, search: String, data: [update_attestations_input!]): [attestations!]!
|
||||
update_attestations_item(id: ID!, data: update_attestations_input!): attestations
|
||||
@ -290,9 +293,6 @@ type Mutation {
|
||||
update_layers_maps_items(filter: layers_maps_filter, sort: [String], limit: Int, offset: Int, page: Int, search: String, ids: [ID]!, data: update_layers_maps_input!): [layers_maps!]!
|
||||
update_layers_maps_batch(filter: layers_maps_filter, sort: [String], limit: Int, offset: Int, page: Int, search: String, data: [update_layers_maps_input!]): [layers_maps!]!
|
||||
update_layers_maps_item(id: ID!, data: update_layers_maps_input!): layers_maps
|
||||
update_maps_items(filter: maps_filter, sort: [String], limit: Int, offset: Int, page: Int, search: String, ids: [ID]!, data: update_maps_input!): [maps!]!
|
||||
update_maps_batch(filter: maps_filter, sort: [String], limit: Int, offset: Int, page: Int, search: String, data: [update_maps_input!]): [maps!]!
|
||||
update_maps_item(id: ID!, data: update_maps_input!): maps
|
||||
update_Themes_items(filter: Themes_filter, sort: [String], limit: Int, offset: Int, page: Int, search: String, ids: [ID]!, data: update_Themes_input!): [Themes!]!
|
||||
update_Themes_batch(filter: Themes_filter, sort: [String], limit: Int, offset: Int, page: Int, search: String, data: [update_Themes_input!]): [Themes!]!
|
||||
update_Themes_item(id: ID!, data: update_Themes_input!): Themes
|
||||
@ -314,6 +314,8 @@ type Mutation {
|
||||
delete_relations_item(id: ID!): delete_one
|
||||
delete_oceannomads_profiles_items(ids: [ID]!): delete_many
|
||||
delete_oceannomads_profiles_item(id: ID!): delete_one
|
||||
delete_maps_items(ids: [ID]!): delete_many
|
||||
delete_maps_item(id: ID!): delete_one
|
||||
delete_attestations_items(ids: [ID]!): delete_many
|
||||
delete_attestations_item(id: ID!): delete_one
|
||||
delete_attestations_directus_users_items(ids: [ID]!): delete_many
|
||||
@ -364,8 +366,6 @@ type Mutation {
|
||||
delete_layers_files_item(id: ID!): delete_one
|
||||
delete_layers_maps_items(ids: [ID]!): delete_many
|
||||
delete_layers_maps_item(id: ID!): delete_one
|
||||
delete_maps_items(ids: [ID]!): delete_many
|
||||
delete_maps_item(id: ID!): delete_one
|
||||
delete_Themes_items(ids: [ID]!): delete_many
|
||||
delete_Themes_item(id: ID!): delete_one
|
||||
delete_startEnd_items(ids: [ID]!): delete_many
|
||||
@ -403,6 +403,7 @@ type Subscription {
|
||||
directus_policies_mutated(event: EventEnum): directus_policies_mutated
|
||||
relations_mutated(event: EventEnum): relations_mutated
|
||||
oceannomads_profiles_mutated(event: EventEnum): oceannomads_profiles_mutated
|
||||
maps_mutated(event: EventEnum): maps_mutated
|
||||
attestations_mutated(event: EventEnum): attestations_mutated
|
||||
attestations_directus_users_mutated(event: EventEnum): attestations_directus_users_mutated
|
||||
contactInfos_mutated(event: EventEnum): contactInfos_mutated
|
||||
@ -428,7 +429,6 @@ type Subscription {
|
||||
layers_directus_users_1_mutated(event: EventEnum): layers_directus_users_1_mutated
|
||||
layers_files_mutated(event: EventEnum): layers_files_mutated
|
||||
layers_maps_mutated(event: EventEnum): layers_maps_mutated
|
||||
maps_mutated(event: EventEnum): maps_mutated
|
||||
Themes_mutated(event: EventEnum): Themes_mutated
|
||||
startEnd_mutated(event: EventEnum): startEnd_mutated
|
||||
team_mutated(event: EventEnum): team_mutated
|
||||
@ -1954,6 +1954,7 @@ type maps {
|
||||
tile_server_url: String
|
||||
url: String
|
||||
zoom: Int
|
||||
hide_signup: Boolean
|
||||
layers(filter: layers_maps_filter, sort: [String], limit: Int, offset: Int, page: Int, search: String): [layers_maps]
|
||||
layers_func: count_functions
|
||||
}
|
||||
@ -2000,6 +2001,7 @@ type maps_aggregated_count {
|
||||
tile_server_url: Int
|
||||
url: Int
|
||||
zoom: Int
|
||||
hide_signup: Int
|
||||
layers: Int
|
||||
}
|
||||
|
||||
@ -2673,6 +2675,7 @@ type version_maps {
|
||||
tile_server_url: String
|
||||
url: String
|
||||
zoom: Int
|
||||
hide_signup: Boolean
|
||||
layers: JSON
|
||||
}
|
||||
|
||||
@ -3221,6 +3224,7 @@ input create_maps_input {
|
||||
tile_server_url: String
|
||||
url: String
|
||||
zoom: Int
|
||||
hide_signup: Boolean
|
||||
layers: [create_layers_maps_input]
|
||||
}
|
||||
|
||||
@ -4200,6 +4204,7 @@ input maps_filter {
|
||||
tile_server_url: string_filter_operators
|
||||
url: string_filter_operators
|
||||
zoom: number_filter_operators
|
||||
hide_signup: boolean_filter_operators
|
||||
layers: layers_maps_quantifier_filter
|
||||
layers_func: count_function_filter_operators
|
||||
_and: [maps_filter]
|
||||
@ -4764,6 +4769,7 @@ input update_maps_input {
|
||||
tile_server_url: String
|
||||
url: String
|
||||
zoom: Int
|
||||
hide_signup: Boolean
|
||||
layers: [update_layers_maps_input]
|
||||
}
|
||||
|
||||
|
||||
File diff suppressed because it is too large
Load Diff
@ -265,6 +265,7 @@ type Subscription {
|
||||
directus_policies_mutated(event: EventEnum): directus_policies_mutated
|
||||
relations_mutated(event: EventEnum): relations_mutated
|
||||
oceannomads_profiles_mutated(event: EventEnum): oceannomads_profiles_mutated
|
||||
maps_mutated(event: EventEnum): maps_mutated
|
||||
attestations_mutated(event: EventEnum): attestations_mutated
|
||||
attestations_directus_users_mutated(event: EventEnum): attestations_directus_users_mutated
|
||||
contactInfos_mutated(event: EventEnum): contactInfos_mutated
|
||||
@ -290,7 +291,6 @@ type Subscription {
|
||||
layers_directus_users_1_mutated(event: EventEnum): layers_directus_users_1_mutated
|
||||
layers_files_mutated(event: EventEnum): layers_files_mutated
|
||||
layers_maps_mutated(event: EventEnum): layers_maps_mutated
|
||||
maps_mutated(event: EventEnum): maps_mutated
|
||||
Themes_mutated(event: EventEnum): Themes_mutated
|
||||
startEnd_mutated(event: EventEnum): startEnd_mutated
|
||||
team_mutated(event: EventEnum): team_mutated
|
||||
@ -2039,6 +2039,7 @@ type maps {
|
||||
tile_server_url: String
|
||||
url: String
|
||||
zoom: Int
|
||||
hide_signup: Boolean
|
||||
layers(filter: layers_maps_filter, sort: [String], limit: Int, offset: Int, page: Int, search: String): [layers_maps]
|
||||
layers_func: count_functions
|
||||
}
|
||||
@ -2783,6 +2784,7 @@ input create_maps_input {
|
||||
tile_server_url: String
|
||||
url: String
|
||||
zoom: Int
|
||||
hide_signup: Boolean
|
||||
layers: [create_layers_maps_input]
|
||||
}
|
||||
|
||||
@ -3746,6 +3748,7 @@ input maps_filter {
|
||||
tile_server_url: string_filter_operators
|
||||
url: string_filter_operators
|
||||
zoom: number_filter_operators
|
||||
hide_signup: boolean_filter_operators
|
||||
layers: layers_maps_quantifier_filter
|
||||
layers_func: count_function_filter_operators
|
||||
_and: [maps_filter]
|
||||
@ -4304,6 +4307,7 @@ input update_maps_input {
|
||||
tile_server_url: String
|
||||
url: String
|
||||
zoom: Int
|
||||
hide_signup: Boolean
|
||||
layers: [update_layers_maps_input]
|
||||
}
|
||||
|
||||
|
||||
@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "directus-extensions",
|
||||
"dependencies": {
|
||||
"directus-extension-sync": "^3.0.3"
|
||||
"directus-extension-sync": "^3.0.4"
|
||||
}
|
||||
}
|
||||
31
backend/seed.sh
Executable file
31
backend/seed.sh
Executable file
@ -0,0 +1,31 @@
|
||||
#!/bin/sh
|
||||
|
||||
# base setup
|
||||
SCRIPT_PATH=$(realpath $0)
|
||||
SCRIPT_DIR=$(dirname $SCRIPT_PATH)
|
||||
|
||||
DIRECTUS_URL="${DIRECTUS_URL:-http://localhost:8055}"
|
||||
DIRECTUS_EMAIL="${DIRECTUS_EMAIL:-admin@it4c.dev}"
|
||||
DIRECTUS_PASSWORD="${DIRECTUS_PASSWORD:-admin123}"
|
||||
|
||||
PGPASSWORD="${PGPASSWORD:-'directus'}"
|
||||
PGUSER="${PGUSER:-'directus'}"
|
||||
PGDATABASE="${PGDATABASE:-'directus'}"
|
||||
|
||||
PROJECT_NAME="${PROJECT:-development}"
|
||||
PROJECT_FOLDER=$SCRIPT_DIR/directus-config/seeds/$PROJECT_NAME
|
||||
|
||||
|
||||
npx directus-sync seed push \
|
||||
--directus-url $DIRECTUS_URL \
|
||||
--directus-email $DIRECTUS_EMAIL \
|
||||
--directus-password $DIRECTUS_PASSWORD \
|
||||
--seed-path $PROJECT_FOLDER/directus
|
||||
|
||||
|
||||
SEED_SQL_DIR=$PROJECT_FOLDER/manual
|
||||
|
||||
# apply database updates
|
||||
for filename in $SEED_SQL_DIR/*.sql; do
|
||||
docker exec -i utopia-map-database-1 /bin/bash -c "PGPASSWORD=$PGPASSWORD psql -v ON_ERROR_STOP=1 --username $PGUSER $PGDATABASE" < $filename
|
||||
done
|
||||
@ -15,12 +15,14 @@ export function AppShell({
|
||||
assetsApi,
|
||||
embedded,
|
||||
openCollectiveApiKey,
|
||||
hideSignup,
|
||||
}: {
|
||||
appName: string
|
||||
children: React.ReactNode
|
||||
assetsApi: AssetsApi
|
||||
embedded?: boolean
|
||||
openCollectiveApiKey?: string
|
||||
hideSignup?: boolean
|
||||
}) {
|
||||
return (
|
||||
<ContextWrapper>
|
||||
@ -29,6 +31,7 @@ export function AppShell({
|
||||
assetsApi={assetsApi}
|
||||
embedded={embedded}
|
||||
openCollectiveApiKey={openCollectiveApiKey}
|
||||
hideSignup={hideSignup}
|
||||
/>
|
||||
<NavBar appName={appName}></NavBar>
|
||||
<div id='app-content' className='tw:flex'>
|
||||
|
||||
@ -8,10 +8,12 @@ export const SetAppState = ({
|
||||
assetsApi,
|
||||
embedded,
|
||||
openCollectiveApiKey,
|
||||
hideSignup,
|
||||
}: {
|
||||
assetsApi: AssetsApi
|
||||
embedded?: boolean
|
||||
openCollectiveApiKey?: string
|
||||
hideSignup?: boolean
|
||||
}) => {
|
||||
const setAppState = useSetAppState()
|
||||
|
||||
@ -27,5 +29,9 @@ export const SetAppState = ({
|
||||
setAppState({ openCollectiveApiKey })
|
||||
}, [openCollectiveApiKey, setAppState])
|
||||
|
||||
useEffect(() => {
|
||||
setAppState({ hideSignup: hideSignup ?? false })
|
||||
}, [hideSignup, setAppState])
|
||||
|
||||
return <></>
|
||||
}
|
||||
|
||||
@ -93,9 +93,11 @@ export const UserControl = () => {
|
||||
<div className='tw:self-center tw:btn tw:btn-ghost tw:mr-2'>Login</div>
|
||||
</Link>
|
||||
|
||||
<Link to={'/signup'}>
|
||||
<div className='tw:btn tw:btn-ghost tw:mr-2'>Sign Up</div>
|
||||
</Link>
|
||||
{!appState.hideSignup && (
|
||||
<Link to={'/signup'}>
|
||||
<div className='tw:btn tw:btn-ghost tw:mr-2'>Sign Up</div>
|
||||
</Link>
|
||||
)}
|
||||
</div>
|
||||
<div className='tw:dropdown tw:dropdown-end'>
|
||||
<label tabIndex={1} className='tw:btn tw:btn-ghost tw:md:hidden'>
|
||||
@ -108,9 +110,11 @@ export const UserControl = () => {
|
||||
<li>
|
||||
<Link to={'/login'}>Login</Link>
|
||||
</li>
|
||||
<li>
|
||||
<Link to={'/signup'}>Sign Up</Link>
|
||||
</li>
|
||||
{!appState.hideSignup && (
|
||||
<li>
|
||||
<Link to={'/signup'}>Sign Up</Link>
|
||||
</li>
|
||||
)}
|
||||
</ul>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
@ -11,6 +11,7 @@ interface AppState {
|
||||
showThemeControl: boolean
|
||||
embedded: boolean
|
||||
openCollectiveApiKey: string
|
||||
hideSignup: boolean
|
||||
}
|
||||
|
||||
type UseAppManagerResult = ReturnType<typeof useAppManager>
|
||||
@ -22,6 +23,7 @@ const initialAppState: AppState = {
|
||||
showThemeControl: false,
|
||||
embedded: false,
|
||||
openCollectiveApiKey: '',
|
||||
hideSignup: false,
|
||||
}
|
||||
|
||||
const AppContext = createContext<UseAppManagerResult>({
|
||||
|
||||
1
lib/src/types/UtopiaMapProps.d.ts
vendored
1
lib/src/types/UtopiaMapProps.d.ts
vendored
@ -21,4 +21,5 @@ export interface UtopiaMapProps {
|
||||
tileServerUrl?: string
|
||||
tileServerAttribution?: string
|
||||
show_request_password?: boolean
|
||||
hideSignup?: boolean
|
||||
}
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user