mirror of
https://github.com/utopia-os/utopia-ui.git
synced 2025-12-12 23:36:00 +00:00
feat(lib): hide signup option (#329)
* hide signup option * directus pull
This commit is contained in:
parent
0b77d95ae4
commit
1ef562cf3c
@ -155,6 +155,7 @@ function App() {
|
||||
appName={map.name}
|
||||
embedded={embedded}
|
||||
openCollectiveApiKey={config.openCollectiveApiKey}
|
||||
hideSignup={map.hide_signup}
|
||||
>
|
||||
<Permissions api={permissionsApiInstance} adminRole={config.adminRole} />
|
||||
{tagsApi && <Tags api={tagsApi}></Tags>}
|
||||
|
||||
@ -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]
|
||||
}
|
||||
|
||||
|
||||
@ -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
@ -20,4 +20,5 @@ export interface UtopiaMapProps {
|
||||
expandLayerControl?: boolean
|
||||
tileServerUrl?: string
|
||||
tileServerAttribution?: string
|
||||
hideSignup?: boolean
|
||||
}
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user