diff --git a/backend/directus-config/development/collections/settings.json b/backend/directus-config/development/collections/settings.json index 3de70c72..09d708cf 100644 --- a/backend/directus-config/development/collections/settings.json +++ b/backend/directus-config/development/collections/settings.json @@ -60,6 +60,8 @@ "public_registration_role": null, "public_registration_email_filter": null, "visual_editor_urls": null, + "accepted_terms": true, + "project_id": "0199aa52-4dd7-7293-984a-f2af93b5f8fd", "_syncId": "55f04445-0c26-4201-ab9c-d6e0fbadf6bf" } ] diff --git a/backend/directus-config/development/snapshot/fields/types/cta_button_label.json b/backend/directus-config/development/snapshot/fields/types/cta_button_label.json index 33a0d1f0..c5a375d8 100644 --- a/backend/directus-config/development/snapshot/fields/types/cta_button_label.json +++ b/backend/directus-config/development/snapshot/fields/types/cta_button_label.json @@ -24,14 +24,14 @@ "display": null, "display_options": null, "field": "cta_button_label", - "group": "Header", + "group": "header_elements", "hidden": false, "interface": "input", "note": null, "options": null, "readonly": false, "required": false, - "sort": 6, + "sort": 5, "special": null, "translations": null, "validation": null, diff --git a/backend/directus-config/development/snapshot/fields/types/header_elements.json b/backend/directus-config/development/snapshot/fields/types/header_elements.json new file mode 100644 index 00000000..0df97f33 --- /dev/null +++ b/backend/directus-config/development/snapshot/fields/types/header_elements.json @@ -0,0 +1,29 @@ +{ + "collection": "types", + "field": "header_elements", + "type": "alias", + "meta": { + "collection": "types", + "conditions": null, + "display": null, + "display_options": null, + "field": "header_elements", + "group": "Header", + "hidden": false, + "interface": "group-raw", + "note": null, + "options": null, + "readonly": false, + "required": false, + "sort": 3, + "special": [ + "alias", + "no-data", + "group" + ], + "translations": null, + "validation": null, + "validation_message": null, + "width": "full" + } +} diff --git a/backend/directus-config/development/snapshot/fields/types/show_cta_button.json b/backend/directus-config/development/snapshot/fields/types/show_cta_button.json index a57a98d6..35ceacc9 100644 --- a/backend/directus-config/development/snapshot/fields/types/show_cta_button.json +++ b/backend/directus-config/development/snapshot/fields/types/show_cta_button.json @@ -8,14 +8,14 @@ "display": null, "display_options": null, "field": "show_cta_button", - "group": "Header", + "group": "header_elements", "hidden": false, "interface": "boolean", "note": null, "options": null, "readonly": false, "required": false, - "sort": 5, + "sort": 4, "special": [ "cast-boolean" ], diff --git a/backend/directus-config/development/snapshot/fields/types/show_navigation_button.json b/backend/directus-config/development/snapshot/fields/types/show_navigation_button.json index ab9881f8..ac51b712 100644 --- a/backend/directus-config/development/snapshot/fields/types/show_navigation_button.json +++ b/backend/directus-config/development/snapshot/fields/types/show_navigation_button.json @@ -8,14 +8,14 @@ "display": null, "display_options": null, "field": "show_navigation_button", - "group": "Header", + "group": "header_elements", "hidden": false, "interface": "boolean", "note": null, "options": null, "readonly": false, "required": false, - "sort": 4, + "sort": 2, "special": [ "cast-boolean" ], diff --git a/backend/directus-config/development/snapshot/fields/types/show_qr_button.json b/backend/directus-config/development/snapshot/fields/types/show_qr_button.json index b0e4308d..5f95f7e0 100644 --- a/backend/directus-config/development/snapshot/fields/types/show_qr_button.json +++ b/backend/directus-config/development/snapshot/fields/types/show_qr_button.json @@ -8,14 +8,14 @@ "display": null, "display_options": null, "field": "show_qr_button", - "group": "Header", + "group": "header_elements", "hidden": false, "interface": "boolean", "note": null, "options": null, "readonly": false, "required": false, - "sort": 2, + "sort": 1, "special": [ "cast-boolean" ], diff --git a/backend/directus-config/development/snapshot/fields/types/show_share_button.json b/backend/directus-config/development/snapshot/fields/types/show_share_button.json index 5aa4c03d..50fab53c 100644 --- a/backend/directus-config/development/snapshot/fields/types/show_share_button.json +++ b/backend/directus-config/development/snapshot/fields/types/show_share_button.json @@ -8,7 +8,7 @@ "display": null, "display_options": null, "field": "show_share_button", - "group": "Header", + "group": "header_elements", "hidden": false, "interface": "boolean", "note": null, diff --git a/backend/directus-config/development/snapshot/fields/types/subtitle_label.json b/backend/directus-config/development/snapshot/fields/types/subtitle_label.json new file mode 100644 index 00000000..03f0ba86 --- /dev/null +++ b/backend/directus-config/development/snapshot/fields/types/subtitle_label.json @@ -0,0 +1,74 @@ +{ + "collection": "types", + "field": "subtitle_label", + "type": "string", + "meta": { + "collection": "types", + "conditions": [ + { + "hidden": false, + "name": "subtitle=custom", + "readonly": false, + "required": true, + "rule": { + "_and": [ + { + "subtitle_mode": { + "_eq": "custom" + } + } + ] + } + }, + { + "hidden": true, + "name": "subtitle != custom", + "readonly": true, + "required": false, + "rule": { + "_and": [ + { + "subtitle_mode": { + "_neq": "custom" + } + } + ] + } + } + ], + "display": null, + "display_options": null, + "field": "subtitle_label", + "group": "Header", + "hidden": false, + "interface": "input", + "note": null, + "options": null, + "readonly": false, + "required": false, + "sort": 2, + "special": null, + "translations": null, + "validation": null, + "validation_message": null, + "width": "half" + }, + "schema": { + "name": "subtitle_label", + "table": "types", + "data_type": "character varying", + "default_value": "Subname", + "max_length": 255, + "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 + } +} diff --git a/backend/directus-config/development/snapshot/fields/types/show_address.json b/backend/directus-config/development/snapshot/fields/types/subtitle_mode.json similarity index 57% rename from backend/directus-config/development/snapshot/fields/types/show_address.json rename to backend/directus-config/development/snapshot/fields/types/subtitle_mode.json index 0d9cdb20..507c912e 100644 --- a/backend/directus-config/development/snapshot/fields/types/show_address.json +++ b/backend/directus-config/development/snapshot/fields/types/subtitle_mode.json @@ -1,35 +1,48 @@ { "collection": "types", - "field": "show_address", - "type": "boolean", + "field": "subtitle_mode", + "type": "string", "meta": { "collection": "types", "conditions": null, "display": null, "display_options": null, - "field": "show_address", + "field": "subtitle_mode", "group": "Header", "hidden": false, - "interface": "boolean", + "interface": "select-dropdown", "note": null, - "options": null, + "options": { + "choices": [ + { + "text": "address", + "value": "address" + }, + { + "text": "custom", + "value": "custom" + }, + { + "text": "none", + "value": "none" + } + ] + }, "readonly": false, "required": false, "sort": 1, - "special": [ - "cast-boolean" - ], + "special": null, "translations": null, "validation": null, "validation_message": null, "width": "half" }, "schema": { - "name": "show_address", + "name": "subtitle_mode", "table": "types", - "data_type": "boolean", - "default_value": true, - "max_length": null, + "data_type": "character varying", + "default_value": "address", + "max_length": 255, "numeric_precision": null, "numeric_scale": null, "is_nullable": true, diff --git a/lib/src/Components/Map/Subcomponents/ItemPopupComponents/HeaderView/ItemTitle.tsx b/lib/src/Components/Map/Subcomponents/ItemPopupComponents/HeaderView/ItemTitle.tsx index e31c8787..b85834fe 100644 --- a/lib/src/Components/Map/Subcomponents/ItemPopupComponents/HeaderView/ItemTitle.tsx +++ b/lib/src/Components/Map/Subcomponents/ItemPopupComponents/HeaderView/ItemTitle.tsx @@ -12,7 +12,7 @@ interface ItemTitleProps { item: Item big?: boolean truncateSubname?: boolean - showAddress?: boolean + subtitleMode?: 'address' | 'custom' | 'none' hasAvatar?: boolean } @@ -20,7 +20,7 @@ export function ItemTitle({ item, big = false, truncateSubname = true, - showAddress = true, + subtitleMode = 'address', hasAvatar = false, }: ItemTitleProps) { const { distance } = useGeoDistance(item.position ?? undefined) @@ -31,12 +31,13 @@ export function ItemTitle({ const { address } = useReverseGeocode( item.position?.coordinates as [number, number] | undefined, - showAddress, + subtitleMode === 'address', 'municipality', ) const title = item.name ?? item.layer?.item_default_name const subtitle = item.subname + const subtitleLabel = item.layer?.itemType.subtitle_label useEffect(() => { if (!containerRef.current || !title) { @@ -111,7 +112,7 @@ export function ItemTitle({ > {title} - {showAddress && address && ( + {subtitleMode === 'address' && address && (