From 879dbf16314f535953b9e6254a609f5416ea55b8 Mon Sep 17 00:00:00 2001 From: Anton Tranelis <31516529+antontranelis@users.noreply.github.com> Date: Fri, 5 Sep 2025 22:26:26 +0200 Subject: [PATCH] refactor(backend): simplified icon config (#359) * simplified icon config * fixed linting * fixed linting * fix linting and searchControl * adjust useSelectPosition * adjust useSelectPosition * fixed presets * removed menuIcon artefacts * fix example * adjust icon size in addButton --- app/src/App.tsx | 8 +- app/src/pages/MapContainer.tsx | 2 - .../directus-config/collections/presets.json | 101 +- .../directus/files/icons/outline/user.svg | 4 + .../development/directus/marker_icons.json | 16 +- .../snapshot/fields/layers/Add_Button.json | 32 - .../fields/layers/divider-yaul5v.json | 2 +- .../snapshot/fields/layers/listed.json | 2 +- .../snapshot/fields/layers/menuText.json | 4 +- .../fields/layers/public_edit_items.json | 2 +- .../snapshot/fields/layers/sort.json | 4 +- .../snapshot/fields/marker_icons/image.json | 4 +- .../image_outline.json} | 16 +- .../snapshot/fields/marker_icons/size.json | 4 +- .../size_outline.json} | 38 +- .../snapshot/relations/layers/indexIcon.json | 25 - .../image_outline.json} | 14 +- backend/directus-config/specs/item.graphql | 65 +- backend/directus-config/specs/openapi.json | 912 +++++++++--------- backend/directus-config/specs/system.graphql | 30 +- lib/examples/2-static-layers/src/App.tsx | 2 - lib/src/Components/Map/Layer.tsx | 3 - .../Map/Subcomponents/AddButton.tsx | 12 +- .../Controls/LocateControl.spec.tsx | 1 - .../Subcomponents/Controls/SearchControl.tsx | 28 +- .../Map/Subcomponents/SelectPosition.tsx | 2 +- .../Map/hooks/useSelectPosition.tsx | 4 +- .../Components/Profile/ItemFunctions.spec.tsx | 1 - lib/src/types/LayerProps.d.ts | 1 - lib/src/types/MarkerIcon.d.ts | 2 + 30 files changed, 690 insertions(+), 651 deletions(-) create mode 100644 backend/directus-config/seeds/development/directus/files/icons/outline/user.svg delete mode 100644 backend/directus-config/snapshot/fields/layers/Add_Button.json rename backend/directus-config/snapshot/fields/{layers/indexIcon.json => marker_icons/image_outline.json} (76%) rename backend/directus-config/snapshot/fields/{layers/menuIcon.json => marker_icons/size_outline.json} (51%) delete mode 100644 backend/directus-config/snapshot/relations/layers/indexIcon.json rename backend/directus-config/snapshot/relations/{layers/menuIcon.json => marker_icons/image_outline.json} (63%) diff --git a/app/src/App.tsx b/app/src/App.tsx index 124b9723..c46d151e 100644 --- a/app/src/App.tsx +++ b/app/src/App.tsx @@ -12,7 +12,7 @@ /* eslint-disable @typescript-eslint/no-unsafe-assignment */ /* eslint-disable @typescript-eslint/no-unsafe-member-access */ /* eslint-disable @typescript-eslint/no-unsafe-call */ -import type { Tag } from 'utopia-ui' +import type { Tag, LayerProps } from 'utopia-ui' import { AppShell, @@ -111,12 +111,12 @@ function App() { layers && setLayers(layers) setLayerPageRoutes( layers - ?.filter((l: any) => l.listed) - .map((l: any) => ({ + ?.filter((l: LayerProps) => l.listed) + .map((l: LayerProps) => ({ path: '/' + l.name, // url icon: ( code.replace(/stroke=".*?"/g, 'stroke="currentColor"') diff --git a/app/src/pages/MapContainer.tsx b/app/src/pages/MapContainer.tsx index db739438..b6b454cb 100644 --- a/app/src/pages/MapContainer.tsx +++ b/app/src/pages/MapContainer.tsx @@ -23,7 +23,6 @@ import { } from 'utopia-ui' import { itemsApi } from '../api/itemsApi' -import { config } from '../config' import type { Place } from '../api/directus' import type { LayerProps } from 'utopia-ui' @@ -95,7 +94,6 @@ function MapContainer({ layers, map }: { layers: LayerProps[]; map: any }) { id={layer.id} key={layer.id} name={layer.name} - menuIcon={config.apiUrl + 'assets/' + layer.menuIcon} menuText={layer.menuText} menuColor={layer.menuColor} markerIcon={layer.markerIcon} diff --git a/backend/directus-config/collections/presets.json b/backend/directus-config/collections/presets.json index 34ab3107..fbab7234 100644 --- a/backend/directus-config/collections/presets.json +++ b/backend/directus-config/collections/presets.json @@ -1,4 +1,34 @@ [ + { + "bookmark": null, + "role": null, + "collection": "items", + "search": null, + "layout": null, + "layout_query": { + "tabular": { + "page": 1, + "fields": [ + "name", + "layer.name", + "date_created", + "date_updated", + "user_created", + "user_updated" + ] + } + }, + "layout_options": { + "tabular": { + "widths": {} + } + }, + "refresh_interval": null, + "filter": null, + "icon": "bookmark", + "color": null, + "_syncId": "053f9b93-aa94-4ad8-b64e-babb69f0ea6c" + }, { "bookmark": null, "role": null, @@ -51,7 +81,6 @@ "layout_options": { "tabular": { "widths": { - "menuIcon.$thumbnail": 32, "maps.maps_id.name": 1003.888916015625 }, "spacing": "compact" @@ -63,6 +92,36 @@ "color": null, "_syncId": "1b452db1-8add-4a5e-948d-b380d99121c3" }, + { + "bookmark": null, + "role": null, + "collection": "marker_icons", + "search": null, + "layout": null, + "layout_query": { + "tabular": { + "page": 1, + "fields": [ + "id", + "image.$thumbnail", + "size", + "image_outline.$thumbnail", + "size_outline" + ], + "limit": 500 + } + }, + "layout_options": { + "tabular": { + "widths": {} + } + }, + "refresh_interval": null, + "filter": null, + "icon": "bookmark", + "color": null, + "_syncId": "2a1656b7-d6d2-4b47-bd22-41babc8bf828" + }, { "bookmark": null, "role": null, @@ -124,5 +183,45 @@ "icon": "bookmark", "color": null, "_syncId": "3789cfe7-78f9-428e-9770-d8e1c5de1145" + }, + { + "bookmark": null, + "role": null, + "collection": "layers", + "search": "", + "layout": "tabular", + "layout_query": { + "tabular": { + "page": 1, + "fields": [ + "sort", + "markerIcon.image.$thumbnail", + "menuColor", + "name", + "itemType.name", + "maps.maps_id.name" + ], + "sort": [ + "sort" + ] + } + }, + "layout_options": { + "tabular": { + "widths": { + "sort": 91.5, + "markerIcon.image.$thumbnail": 58, + "menuColor": 65.5, + "itemType.name": 235, + "maps.maps_id.name": 248 + }, + "spacing": "compact" + } + }, + "refresh_interval": null, + "filter": null, + "icon": "bookmark", + "color": null, + "_syncId": "85c6dba0-1906-4c16-a245-4a8eab8a6855" } ] diff --git a/backend/directus-config/seeds/development/directus/files/icons/outline/user.svg b/backend/directus-config/seeds/development/directus/files/icons/outline/user.svg new file mode 100644 index 00000000..e0dd9261 --- /dev/null +++ b/backend/directus-config/seeds/development/directus/files/icons/outline/user.svg @@ -0,0 +1,4 @@ + + + + diff --git a/backend/directus-config/seeds/development/directus/marker_icons.json b/backend/directus-config/seeds/development/directus/marker_icons.json index b9560131..b168ac1c 100644 --- a/backend/directus-config/seeds/development/directus/marker_icons.json +++ b/backend/directus-config/seeds/development/directus/marker_icons.json @@ -19,7 +19,9 @@ "_sync_id": "marker-boat", "id": "boat", "size": "18.00000", - "image": "boat-solid" + "image": "boat-solid", + "size_outline": "18.00000", + "image_outline": "boat-outline" }, { "_sync_id": "marker-cafe", @@ -31,7 +33,9 @@ "_sync_id": "marker-calendar", "id": "calendar", "size": "14.00000", - "image": "calendar-solid" + "image": "calendar-solid", + "size_outline": "18.00000", + "image_outline": "calendar-outline" }, { "_sync_id": "marker-camp", @@ -91,7 +95,9 @@ "_sync_id": "marker-house", "id": "house", "size": "16.00000", - "image": "house-solid" + "image": "house-solid", + "size_outline": "16.00000", + "image_outline": "house-outline" }, { "_sync_id": "marker-liebevoll.jetzt", @@ -181,7 +187,9 @@ "_sync_id": "marker-user", "id": "user", "size": "12.00000", - "image": "user-solid" + "image": "user-solid", + "size_outline": "18.00000", + "image_outline": "user-outline" } ] } diff --git a/backend/directus-config/snapshot/fields/layers/Add_Button.json b/backend/directus-config/snapshot/fields/layers/Add_Button.json deleted file mode 100644 index 917f1405..00000000 --- a/backend/directus-config/snapshot/fields/layers/Add_Button.json +++ /dev/null @@ -1,32 +0,0 @@ -{ - "collection": "layers", - "field": "Add_Button", - "type": "alias", - "meta": { - "collection": "layers", - "conditions": null, - "display": null, - "display_options": null, - "field": "Add_Button", - "group": null, - "hidden": false, - "interface": "group-detail", - "note": null, - "options": { - "headerColor": null, - "headerIcon": null - }, - "readonly": false, - "required": false, - "sort": 8, - "special": [ - "alias", - "no-data", - "group" - ], - "translations": null, - "validation": null, - "validation_message": null, - "width": "full" - } -} diff --git a/backend/directus-config/snapshot/fields/layers/divider-yaul5v.json b/backend/directus-config/snapshot/fields/layers/divider-yaul5v.json index 00be3c0a..d4aebc91 100644 --- a/backend/directus-config/snapshot/fields/layers/divider-yaul5v.json +++ b/backend/directus-config/snapshot/fields/layers/divider-yaul5v.json @@ -15,7 +15,7 @@ "options": null, "readonly": false, "required": false, - "sort": 9, + "sort": 10, "special": [ "alias", "no-data" diff --git a/backend/directus-config/snapshot/fields/layers/listed.json b/backend/directus-config/snapshot/fields/layers/listed.json index 2881da64..9ffbbf4d 100644 --- a/backend/directus-config/snapshot/fields/layers/listed.json +++ b/backend/directus-config/snapshot/fields/layers/listed.json @@ -9,7 +9,7 @@ "display_options": null, "field": "listed", "group": null, - "hidden": false, + "hidden": true, "interface": "boolean", "note": null, "options": null, diff --git a/backend/directus-config/snapshot/fields/layers/menuText.json b/backend/directus-config/snapshot/fields/layers/menuText.json index 62cd2dc3..32d3d0e2 100644 --- a/backend/directus-config/snapshot/fields/layers/menuText.json +++ b/backend/directus-config/snapshot/fields/layers/menuText.json @@ -8,14 +8,14 @@ "display": null, "display_options": null, "field": "menuText", - "group": "Add_Button", + "group": null, "hidden": false, "interface": "input", "note": null, "options": null, "readonly": false, "required": false, - "sort": 1, + "sort": 8, "special": null, "translations": null, "validation": null, diff --git a/backend/directus-config/snapshot/fields/layers/public_edit_items.json b/backend/directus-config/snapshot/fields/layers/public_edit_items.json index 4a796acb..22e8e3ea 100644 --- a/backend/directus-config/snapshot/fields/layers/public_edit_items.json +++ b/backend/directus-config/snapshot/fields/layers/public_edit_items.json @@ -9,7 +9,7 @@ "display_options": null, "field": "public_edit_items", "group": null, - "hidden": false, + "hidden": true, "interface": "boolean", "note": null, "options": null, diff --git a/backend/directus-config/snapshot/fields/layers/sort.json b/backend/directus-config/snapshot/fields/layers/sort.json index 96567703..c5b222a2 100644 --- a/backend/directus-config/snapshot/fields/layers/sort.json +++ b/backend/directus-config/snapshot/fields/layers/sort.json @@ -15,12 +15,12 @@ "options": null, "readonly": false, "required": false, - "sort": 18, + "sort": 9, "special": null, "translations": null, "validation": null, "validation_message": null, - "width": "full" + "width": "half" }, "schema": { "name": "sort", diff --git a/backend/directus-config/snapshot/fields/marker_icons/image.json b/backend/directus-config/snapshot/fields/marker_icons/image.json index 1f20ebcf..9ba03843 100644 --- a/backend/directus-config/snapshot/fields/marker_icons/image.json +++ b/backend/directus-config/snapshot/fields/marker_icons/image.json @@ -17,14 +17,14 @@ }, "readonly": false, "required": false, - "sort": 3, + "sort": 2, "special": [ "file" ], "translations": null, "validation": null, "validation_message": null, - "width": "full" + "width": "half" }, "schema": { "name": "image", diff --git a/backend/directus-config/snapshot/fields/layers/indexIcon.json b/backend/directus-config/snapshot/fields/marker_icons/image_outline.json similarity index 76% rename from backend/directus-config/snapshot/fields/layers/indexIcon.json rename to backend/directus-config/snapshot/fields/marker_icons/image_outline.json index 94440bd4..960ceaca 100644 --- a/backend/directus-config/snapshot/fields/layers/indexIcon.json +++ b/backend/directus-config/snapshot/fields/marker_icons/image_outline.json @@ -1,23 +1,23 @@ { - "collection": "layers", - "field": "indexIcon", + "collection": "marker_icons", + "field": "image_outline", "type": "uuid", "meta": { - "collection": "layers", + "collection": "marker_icons", "conditions": null, "display": null, "display_options": null, - "field": "indexIcon", + "field": "image_outline", "group": null, "hidden": false, "interface": "file-image", "note": null, "options": { - "folder": "0b66498d-8ee3-48fc-8fe7-72b6f86d8d0f" + "folder": "f255d3a7-8ecc-4ee0-b584-dee753317415" }, "readonly": false, "required": false, - "sort": 10, + "sort": 4, "special": [ "file" ], @@ -27,8 +27,8 @@ "width": "half" }, "schema": { - "name": "indexIcon", - "table": "layers", + "name": "image_outline", + "table": "marker_icons", "data_type": "uuid", "default_value": null, "max_length": null, diff --git a/backend/directus-config/snapshot/fields/marker_icons/size.json b/backend/directus-config/snapshot/fields/marker_icons/size.json index 2c8dc06d..ec945236 100644 --- a/backend/directus-config/snapshot/fields/marker_icons/size.json +++ b/backend/directus-config/snapshot/fields/marker_icons/size.json @@ -17,12 +17,12 @@ }, "readonly": false, "required": false, - "sort": 2, + "sort": 3, "special": null, "translations": null, "validation": null, "validation_message": null, - "width": "full" + "width": "half" }, "schema": { "name": "size", diff --git a/backend/directus-config/snapshot/fields/layers/menuIcon.json b/backend/directus-config/snapshot/fields/marker_icons/size_outline.json similarity index 51% rename from backend/directus-config/snapshot/fields/layers/menuIcon.json rename to backend/directus-config/snapshot/fields/marker_icons/size_outline.json index 74ccc330..d6a9bf58 100644 --- a/backend/directus-config/snapshot/fields/layers/menuIcon.json +++ b/backend/directus-config/snapshot/fields/marker_icons/size_outline.json @@ -1,39 +1,35 @@ { - "collection": "layers", - "field": "menuIcon", - "type": "uuid", + "collection": "marker_icons", + "field": "size_outline", + "type": "decimal", "meta": { - "collection": "layers", + "collection": "marker_icons", "conditions": null, "display": null, "display_options": null, - "field": "menuIcon", - "group": "Add_Button", + "field": "size_outline", + "group": null, "hidden": false, - "interface": "file-image", + "interface": "input", "note": null, - "options": { - "folder": "a97106b4-218b-45df-adc9-36184886e285" - }, + "options": null, "readonly": false, "required": false, - "sort": 2, - "special": [ - "file" - ], + "sort": 5, + "special": null, "translations": null, "validation": null, "validation_message": null, "width": "half" }, "schema": { - "name": "menuIcon", - "table": "layers", - "data_type": "uuid", + "name": "size_outline", + "table": "marker_icons", + "data_type": "numeric", "default_value": null, "max_length": null, - "numeric_precision": null, - "numeric_scale": null, + "numeric_precision": 10, + "numeric_scale": 5, "is_nullable": true, "is_unique": false, "is_indexed": false, @@ -41,7 +37,7 @@ "is_generated": false, "generation_expression": null, "has_auto_increment": false, - "foreign_key_table": "directus_files", - "foreign_key_column": "id" + "foreign_key_table": null, + "foreign_key_column": null } } diff --git a/backend/directus-config/snapshot/relations/layers/indexIcon.json b/backend/directus-config/snapshot/relations/layers/indexIcon.json deleted file mode 100644 index 9b00d8cc..00000000 --- a/backend/directus-config/snapshot/relations/layers/indexIcon.json +++ /dev/null @@ -1,25 +0,0 @@ -{ - "collection": "layers", - "field": "indexIcon", - "related_collection": "directus_files", - "meta": { - "junction_field": null, - "many_collection": "layers", - "many_field": "indexIcon", - "one_allowed_collections": null, - "one_collection": "directus_files", - "one_collection_field": null, - "one_deselect_action": "nullify", - "one_field": null, - "sort_field": null - }, - "schema": { - "table": "layers", - "column": "indexIcon", - "foreign_key_table": "directus_files", - "foreign_key_column": "id", - "constraint_name": "layers_indexicon_foreign", - "on_update": "NO ACTION", - "on_delete": "SET NULL" - } -} diff --git a/backend/directus-config/snapshot/relations/layers/menuIcon.json b/backend/directus-config/snapshot/relations/marker_icons/image_outline.json similarity index 63% rename from backend/directus-config/snapshot/relations/layers/menuIcon.json rename to backend/directus-config/snapshot/relations/marker_icons/image_outline.json index facd048b..51689393 100644 --- a/backend/directus-config/snapshot/relations/layers/menuIcon.json +++ b/backend/directus-config/snapshot/relations/marker_icons/image_outline.json @@ -1,11 +1,11 @@ { - "collection": "layers", - "field": "menuIcon", + "collection": "marker_icons", + "field": "image_outline", "related_collection": "directus_files", "meta": { "junction_field": null, - "many_collection": "layers", - "many_field": "menuIcon", + "many_collection": "marker_icons", + "many_field": "image_outline", "one_allowed_collections": null, "one_collection": "directus_files", "one_collection_field": null, @@ -14,11 +14,11 @@ "sort_field": null }, "schema": { - "table": "layers", - "column": "menuIcon", + "table": "marker_icons", + "column": "image_outline", "foreign_key_table": "directus_files", "foreign_key_column": "id", - "constraint_name": "layers_menuicon_foreign", + "constraint_name": "marker_icons_image_outline_foreign", "on_update": "NO ACTION", "on_delete": "SET NULL" } diff --git a/backend/directus-config/specs/item.graphql b/backend/directus-config/specs/item.graphql index cc6a25d6..a955b669 100644 --- a/backend/directus-config/specs/item.graphql +++ b/backend/directus-config/specs/item.graphql @@ -15,6 +15,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 + marker_icons(filter: marker_icons_filter, sort: [String], limit: Int, offset: Int, page: Int, search: String): [marker_icons!]! + marker_icons_by_id(id: ID!, version: String): marker_icons + marker_icons_aggregated(groupBy: [String], filter: marker_icons_filter, limit: Int, offset: Int, page: Int, search: String, sort: [String]): [marker_icons_aggregated!]! + marker_icons_by_version(version: String!, id: ID!): version_marker_icons 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!]! @@ -51,10 +55,6 @@ type Query { groupTypes_by_id(id: ID!, version: String): groupTypes groupTypes_aggregated(groupBy: [String], filter: groupTypes_filter, limit: Int, offset: Int, page: Int, search: String, sort: [String]): [groupTypes_aggregated!]! groupTypes_by_version(version: String!, id: ID!): version_groupTypes - marker_icons(filter: marker_icons_filter, sort: [String], limit: Int, offset: Int, page: Int, search: String): [marker_icons!]! - marker_icons_by_id(id: ID!, version: String): marker_icons - marker_icons_aggregated(groupBy: [String], filter: marker_icons_filter, limit: Int, offset: Int, page: Int, search: String, sort: [String]): [marker_icons_aggregated!]! - marker_icons_by_version(version: String!, id: ID!): version_marker_icons inviteLinks(filter: inviteLinks_filter, sort: [String], limit: Int, offset: Int, page: Int, search: String): [inviteLinks!]! inviteLinks_by_id(id: ID!, version: String): inviteLinks inviteLinks_aggregated(groupBy: [String], filter: inviteLinks_filter, limit: Int, offset: Int, page: Int, search: String, sort: [String]): [inviteLinks_aggregated!]! @@ -150,6 +150,8 @@ type Mutation { create_oceannomads_events_item(data: create_oceannomads_events_input!): oceannomads_events 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_marker_icons_items(filter: marker_icons_filter, sort: [String], limit: Int, offset: Int, page: Int, search: String, data: [create_marker_icons_input!]): [marker_icons!]! + create_marker_icons_item(data: create_marker_icons_input!): marker_icons 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!]! @@ -168,8 +170,6 @@ type Mutation { create_groupSubheaders_groupTypes_item(data: create_groupSubheaders_groupTypes_input!): groupSubheaders_groupTypes create_groupTypes_items(filter: groupTypes_filter, sort: [String], limit: Int, offset: Int, page: Int, search: String, data: [create_groupTypes_input!]): [groupTypes!]! create_groupTypes_item(data: create_groupTypes_input!): groupTypes - create_marker_icons_items(filter: marker_icons_filter, sort: [String], limit: Int, offset: Int, page: Int, search: String, data: [create_marker_icons_input!]): [marker_icons!]! - create_marker_icons_item(data: create_marker_icons_input!): marker_icons create_inviteLinks_items(filter: inviteLinks_filter, sort: [String], limit: Int, offset: Int, page: Int, search: String, data: [create_inviteLinks_input!]): [inviteLinks!]! create_inviteLinks_item(data: create_inviteLinks_input!): inviteLinks create_items_items(filter: items_filter, sort: [String], limit: Int, offset: Int, page: Int, search: String, data: [create_items_input!]): [items!]! @@ -224,6 +224,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_marker_icons_items(filter: marker_icons_filter, sort: [String], limit: Int, offset: Int, page: Int, search: String, ids: [ID]!, data: update_marker_icons_input!): [marker_icons!]! + update_marker_icons_batch(filter: marker_icons_filter, sort: [String], limit: Int, offset: Int, page: Int, search: String, data: [update_marker_icons_input!]): [marker_icons!]! + update_marker_icons_item(id: ID!, data: update_marker_icons_input!): marker_icons 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 @@ -251,9 +254,6 @@ type Mutation { update_groupTypes_items(filter: groupTypes_filter, sort: [String], limit: Int, offset: Int, page: Int, search: String, ids: [ID]!, data: update_groupTypes_input!): [groupTypes!]! update_groupTypes_batch(filter: groupTypes_filter, sort: [String], limit: Int, offset: Int, page: Int, search: String, data: [update_groupTypes_input!]): [groupTypes!]! update_groupTypes_item(id: ID!, data: update_groupTypes_input!): groupTypes - update_marker_icons_items(filter: marker_icons_filter, sort: [String], limit: Int, offset: Int, page: Int, search: String, ids: [ID]!, data: update_marker_icons_input!): [marker_icons!]! - update_marker_icons_batch(filter: marker_icons_filter, sort: [String], limit: Int, offset: Int, page: Int, search: String, data: [update_marker_icons_input!]): [marker_icons!]! - update_marker_icons_item(id: ID!, data: update_marker_icons_input!): marker_icons update_inviteLinks_items(filter: inviteLinks_filter, sort: [String], limit: Int, offset: Int, page: Int, search: String, ids: [ID]!, data: update_inviteLinks_input!): [inviteLinks!]! update_inviteLinks_batch(filter: inviteLinks_filter, sort: [String], limit: Int, offset: Int, page: Int, search: String, data: [update_inviteLinks_input!]): [inviteLinks!]! update_inviteLinks_item(id: ID!, data: update_inviteLinks_input!): inviteLinks @@ -325,6 +325,8 @@ type Mutation { delete_oceannomads_events_item(id: ID!): delete_one delete_oceannomads_profiles_items(ids: [ID]!): delete_many delete_oceannomads_profiles_item(id: ID!): delete_one + delete_marker_icons_items(ids: [ID]!): delete_many + delete_marker_icons_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 @@ -343,8 +345,6 @@ type Mutation { delete_groupSubheaders_groupTypes_item(id: ID!): delete_one delete_groupTypes_items(ids: [ID]!): delete_many delete_groupTypes_item(id: ID!): delete_one - delete_marker_icons_items(ids: [ID]!): delete_many - delete_marker_icons_item(id: ID!): delete_one delete_inviteLinks_items(ids: [ID]!): delete_many delete_inviteLinks_item(id: ID!): delete_one delete_items_items(ids: [ID]!): delete_many @@ -415,6 +415,7 @@ type Subscription { relations_mutated(event: EventEnum): relations_mutated oceannomads_events_mutated(event: EventEnum): oceannomads_events_mutated oceannomads_profiles_mutated(event: EventEnum): oceannomads_profiles_mutated + marker_icons_mutated(event: EventEnum): marker_icons_mutated attestations_mutated(event: EventEnum): attestations_mutated attestations_directus_users_mutated(event: EventEnum): attestations_directus_users_mutated contactInfos_mutated(event: EventEnum): contactInfos_mutated @@ -424,7 +425,6 @@ type Subscription { groupSubheaders_mutated(event: EventEnum): groupSubheaders_mutated groupSubheaders_groupTypes_mutated(event: EventEnum): groupSubheaders_groupTypes_mutated groupTypes_mutated(event: EventEnum): groupTypes_mutated - marker_icons_mutated(event: EventEnum): marker_icons_mutated inviteLinks_mutated(event: EventEnum): inviteLinks_mutated items_mutated(event: EventEnum): items_mutated itemSecrets_mutated(event: EventEnum): itemSecrets_mutated @@ -1782,7 +1782,6 @@ type junction_directus_users_tags_mutated { type layers { id: ID! - indexIcon(filter: directus_files_filter, sort: [String], limit: Int, offset: Int, page: Int, search: String): directus_files index_plus_button: Boolean itemType(filter: types_filter, sort: [String], limit: Int, offset: Int, page: Int, search: String): types item_presets: JSON @@ -1792,17 +1791,16 @@ type layers { markerIcon(filter: marker_icons_filter, sort: [String], limit: Int, offset: Int, page: Int, search: String): marker_icons markerShape: String menuColor: String - menuIcon(filter: directus_files_filter, sort: [String], limit: Int, offset: Int, page: Int, search: String): directus_files menuText: String name: String onlyOnePerOwner: Boolean public_edit_items: Boolean sort: Int userProfileLayer: Boolean - maps(filter: layers_maps_filter, sort: [String], limit: Int, offset: Int, page: Int, search: String): [layers_maps] - maps_func: count_functions notifications(filter: layers_directus_users_1_filter, sort: [String], limit: Int, offset: Int, page: Int, search: String): [layers_directus_users_1] notifications_func: count_functions + maps(filter: layers_maps_filter, sort: [String], limit: Int, offset: Int, page: Int, search: String): [layers_maps] + maps_func: count_functions } type layers_aggregated { @@ -1820,7 +1818,6 @@ type layers_aggregated { type layers_aggregated_count { id: Int - indexIcon: Int index_plus_button: Int itemType: Int item_presets: Int @@ -1829,15 +1826,14 @@ type layers_aggregated_count { markerIcon: Int markerShape: Int menuColor: Int - menuIcon: Int menuText: Int name: Int onlyOnePerOwner: Int public_edit_items: Int sort: Int userProfileLayer: Int - maps: Int notifications: Int + maps: Int } type layers_aggregated_fields { @@ -2050,6 +2046,8 @@ type marker_icons { id: ID! image(filter: directus_files_filter, sort: [String], limit: Int, offset: Int, page: Int, search: String): directus_files size: Float + image_outline(filter: directus_files_filter, sort: [String], limit: Int, offset: Int, page: Int, search: String): directus_files + size_outline: Float } type marker_icons_aggregated { @@ -2069,10 +2067,13 @@ type marker_icons_aggregated_count { id: Int image: Int size: Int + image_outline: Int + size_outline: Int } type marker_icons_aggregated_fields { size: Float + size_outline: Float } type marker_icons_mutated { @@ -2691,7 +2692,6 @@ type version_junction_directus_users_tags_1 { """""" type version_layers { id: ID - indexIcon: JSON index_plus_button: Boolean itemType: JSON item_presets: JSON @@ -2700,15 +2700,14 @@ type version_layers { markerIcon: JSON markerShape: String menuColor: String - menuIcon: JSON menuText: String name: String onlyOnePerOwner: Boolean public_edit_items: Boolean sort: Int userProfileLayer: Boolean - maps: JSON notifications: JSON + maps: JSON } """""" @@ -2770,6 +2769,8 @@ type version_marker_icons { id: ID image: JSON size: Float + image_outline: JSON + size_outline: Float } """""" @@ -3278,7 +3279,6 @@ input create_layers_files_input { input create_layers_input { id: ID - indexIcon: create_directus_files_input index_plus_button: Boolean itemType: create_types_input item_presets: JSON @@ -3287,15 +3287,14 @@ input create_layers_input { markerIcon: create_marker_icons_input markerShape: String menuColor: String - menuIcon: create_directus_files_input menuText: String name: String onlyOnePerOwner: Boolean public_edit_items: Boolean sort: Int userProfileLayer: Boolean - maps: [create_layers_maps_input] notifications: [create_layers_directus_users_1_input] + maps: [create_layers_maps_input] } input create_layers_maps_input { @@ -3340,6 +3339,8 @@ input create_marker_icons_input { id: ID! image: create_directus_files_input size: Float + image_outline: create_directus_files_input + size_outline: Float } input create_oceannomads_events_input { @@ -4267,7 +4268,6 @@ input layers_files_filter { input layers_filter { id: id_filter_operators - indexIcon: directus_files_filter index_plus_button: boolean_filter_operators itemType: types_filter item_presets: string_filter_operators @@ -4277,17 +4277,16 @@ input layers_filter { markerIcon: marker_icons_filter markerShape: string_filter_operators menuColor: string_filter_operators - menuIcon: directus_files_filter menuText: string_filter_operators name: string_filter_operators onlyOnePerOwner: boolean_filter_operators public_edit_items: boolean_filter_operators sort: number_filter_operators userProfileLayer: boolean_filter_operators - maps: layers_maps_quantifier_filter - maps_func: count_function_filter_operators notifications: layers_directus_users_1_quantifier_filter notifications_func: count_function_filter_operators + maps: layers_maps_quantifier_filter + maps_func: count_function_filter_operators _and: [layers_filter] _or: [layers_filter] } @@ -4345,6 +4344,8 @@ input marker_icons_filter { id: string_filter_operators image: directus_files_filter size: number_filter_operators + image_outline: directus_files_filter + size_outline: number_filter_operators _and: [marker_icons_filter] _or: [marker_icons_filter] } @@ -4872,7 +4873,6 @@ input update_layers_files_input { input update_layers_input { id: ID - indexIcon: update_directus_files_input index_plus_button: Boolean itemType: update_types_input item_presets: JSON @@ -4881,15 +4881,14 @@ input update_layers_input { markerIcon: update_marker_icons_input markerShape: String menuColor: String - menuIcon: update_directus_files_input menuText: String name: String onlyOnePerOwner: Boolean public_edit_items: Boolean sort: Int userProfileLayer: Boolean - maps: [update_layers_maps_input] notifications: [update_layers_directus_users_1_input] + maps: [update_layers_maps_input] } input update_layers_maps_input { @@ -4934,6 +4933,8 @@ input update_marker_icons_input { id: ID image: update_directus_files_input size: Float + image_outline: update_directus_files_input + size_outline: Float } input update_oceannomads_events_input { diff --git a/backend/directus-config/specs/openapi.json b/backend/directus-config/specs/openapi.json index 854fe89d..a389e67f 100644 --- a/backend/directus-config/specs/openapi.json +++ b/backend/directus-config/specs/openapi.json @@ -9067,6 +9067,395 @@ ] } }, + "/items/marker_icons": { + "post": { + "summary": "Create an Item", + "description": "Create a new marker_icons item.", + "tags": [ + "Items", + "ItemsMarkerIcons" + ], + "operationId": "createItemsMarkerIcons", + "parameters": [ + { + "$ref": "#/components/parameters/Meta" + } + ], + "requestBody": { + "content": { + "application/json": { + "schema": { + "oneOf": [ + { + "type": "array", + "items": { + "$ref": "#/components/schemas/ItemsMarkerIcons" + } + }, + { + "$ref": "#/components/schemas/ItemsMarkerIcons" + } + ] + } + } + } + }, + "responses": { + "200": { + "description": "Successful request", + "content": { + "application/json": { + "schema": { + "type": "object", + "properties": { + "data": { + "type": "array", + "items": { + "$ref": "#/components/schemas/ItemsMarkerIcons" + } + } + } + } + } + } + }, + "401": { + "$ref": "#/components/responses/UnauthorizedError" + } + } + }, + "get": { + "summary": "List Items", + "description": "List the marker_icons items.", + "tags": [ + "Items", + "ItemsMarkerIcons" + ], + "operationId": "readItemsMarkerIcons", + "security": [ + { + "Auth": [] + } + ], + "parameters": [ + { + "$ref": "#/components/parameters/Fields" + }, + { + "$ref": "#/components/parameters/Limit" + }, + { + "$ref": "#/components/parameters/Meta" + }, + { + "$ref": "#/components/parameters/Offset" + }, + { + "$ref": "#/components/parameters/Sort" + }, + { + "$ref": "#/components/parameters/Filter" + }, + { + "$ref": "#/components/parameters/Search" + } + ], + "responses": { + "200": { + "description": "Successful request", + "content": { + "application/json": { + "schema": { + "type": "object", + "properties": { + "data": { + "type": "array", + "items": { + "type": "object", + "$ref": "#/components/schemas/ItemsMarkerIcons" + } + }, + "meta": { + "$ref": "#/components/schemas/x-metadata" + } + } + } + } + } + }, + "401": { + "$ref": "#/components/responses/UnauthorizedError" + } + } + }, + "patch": { + "summary": "Update Multiple Items", + "description": "Update multiple marker_icons items at the same time.", + "tags": [ + "Items", + "ItemsMarkerIcons" + ], + "operationId": "updateItemsMarkerIcons", + "parameters": [ + { + "$ref": "#/components/parameters/Fields" + }, + { + "$ref": "#/components/parameters/Limit" + }, + { + "$ref": "#/components/parameters/Meta" + }, + { + "$ref": "#/components/parameters/Offset" + }, + { + "$ref": "#/components/parameters/Sort" + }, + { + "$ref": "#/components/parameters/Filter" + }, + { + "$ref": "#/components/parameters/Search" + } + ], + "requestBody": { + "content": { + "application/json": { + "schema": { + "oneOf": [ + { + "type": "array", + "items": { + "$ref": "#/components/schemas/ItemsMarkerIcons" + } + }, + { + "$ref": "#/components/schemas/ItemsMarkerIcons" + } + ] + } + } + } + }, + "responses": { + "200": { + "description": "Successful request", + "content": { + "application/json": { + "schema": { + "properties": { + "data": { + "type": "array", + "items": { + "$ref": "#/components/schemas/ItemsMarkerIcons" + } + } + } + } + } + } + } + } + }, + "delete": { + "summary": "Delete Multiple Items", + "description": "Delete multiple existing marker_icons items.", + "tags": [ + "Items", + "ItemsMarkerIcons" + ], + "operationId": "deleteItemsMarkerIcons", + "responses": { + "200": { + "description": "Successful request" + }, + "401": { + "$ref": "#/components/responses/UnauthorizedError" + } + }, + "parameters": [] + } + }, + "/items/marker_icons/{id}": { + "get": { + "summary": "Retrieve an Item", + "description": "Retrieve a single marker_icons item by unique identifier.", + "tags": [ + "Items", + "ItemsMarkerIcons" + ], + "operationId": "readSingleItemsMarkerIcons", + "parameters": [ + { + "$ref": "#/components/parameters/Fields" + }, + { + "$ref": "#/components/parameters/Meta" + }, + { + "$ref": "#/components/parameters/Version" + }, + { + "name": "id", + "description": "Index of the item.", + "in": "path", + "required": true, + "schema": { + "oneOf": [ + { + "type": "integer", + "description": "Incremental index of the item.", + "example": 1 + }, + { + "type": "string", + "description": "Unique identifier of the item.", + "example": "8cbb43fe-4cdf-4991-8352-c461779cec02" + } + ] + } + } + ], + "responses": { + "200": { + "description": "Successful request", + "content": { + "application/json": { + "schema": { + "type": "object", + "properties": { + "data": { + "type": "object", + "$ref": "#/components/schemas/ItemsMarkerIcons" + } + } + } + } + } + }, + "401": { + "$ref": "#/components/responses/UnauthorizedError" + }, + "404": { + "$ref": "#/components/responses/NotFoundError" + } + } + }, + "patch": { + "summary": "Update an Item", + "description": "Update an existing marker_icons item.", + "tags": [ + "Items", + "ItemsMarkerIcons" + ], + "operationId": "updateSingleItemsMarkerIcons", + "parameters": [ + { + "$ref": "#/components/parameters/Fields" + }, + { + "$ref": "#/components/parameters/Meta" + }, + { + "name": "id", + "description": "Index of the item.", + "in": "path", + "required": true, + "schema": { + "oneOf": [ + { + "type": "integer", + "description": "Incremental index of the item.", + "example": 1 + }, + { + "type": "string", + "description": "Unique identifier of the item.", + "example": "8cbb43fe-4cdf-4991-8352-c461779cec02" + } + ] + } + } + ], + "requestBody": { + "content": { + "application/json": { + "schema": { + "type": "object", + "$ref": "#/components/schemas/ItemsMarkerIcons" + } + } + } + }, + "responses": { + "200": { + "description": "Successful request", + "content": { + "application/json": { + "schema": { + "type": "object", + "properties": { + "data": { + "type": "object", + "$ref": "#/components/schemas/ItemsMarkerIcons" + } + } + } + } + } + }, + "401": { + "$ref": "#/components/responses/UnauthorizedError" + }, + "404": { + "$ref": "#/components/responses/NotFoundError" + } + } + }, + "delete": { + "summary": "Delete an Item", + "description": "Delete an existing marker_icons item.", + "tags": [ + "Items", + "ItemsMarkerIcons" + ], + "operationId": "deleteSingleItemsMarkerIcons", + "responses": { + "200": { + "description": "Successful request" + }, + "401": { + "$ref": "#/components/responses/UnauthorizedError" + }, + "404": { + "$ref": "#/components/responses/NotFoundError" + } + }, + "parameters": [ + { + "name": "id", + "description": "Index of the item.", + "in": "path", + "required": true, + "schema": { + "oneOf": [ + { + "type": "integer", + "description": "Incremental index of the item.", + "example": 1 + }, + { + "type": "string", + "description": "Unique identifier of the item.", + "example": "8cbb43fe-4cdf-4991-8352-c461779cec02" + } + ] + } + } + ] + } + }, "/items/attestations": { "post": { "summary": "Create an Item", @@ -12568,395 +12957,6 @@ ] } }, - "/items/marker_icons": { - "post": { - "summary": "Create an Item", - "description": "Create a new marker_icons item.", - "tags": [ - "Items", - "ItemsMarkerIcons" - ], - "operationId": "createItemsMarkerIcons", - "parameters": [ - { - "$ref": "#/components/parameters/Meta" - } - ], - "requestBody": { - "content": { - "application/json": { - "schema": { - "oneOf": [ - { - "type": "array", - "items": { - "$ref": "#/components/schemas/ItemsMarkerIcons" - } - }, - { - "$ref": "#/components/schemas/ItemsMarkerIcons" - } - ] - } - } - } - }, - "responses": { - "200": { - "description": "Successful request", - "content": { - "application/json": { - "schema": { - "type": "object", - "properties": { - "data": { - "type": "array", - "items": { - "$ref": "#/components/schemas/ItemsMarkerIcons" - } - } - } - } - } - } - }, - "401": { - "$ref": "#/components/responses/UnauthorizedError" - } - } - }, - "get": { - "summary": "List Items", - "description": "List the marker_icons items.", - "tags": [ - "Items", - "ItemsMarkerIcons" - ], - "operationId": "readItemsMarkerIcons", - "security": [ - { - "Auth": [] - } - ], - "parameters": [ - { - "$ref": "#/components/parameters/Fields" - }, - { - "$ref": "#/components/parameters/Limit" - }, - { - "$ref": "#/components/parameters/Meta" - }, - { - "$ref": "#/components/parameters/Offset" - }, - { - "$ref": "#/components/parameters/Sort" - }, - { - "$ref": "#/components/parameters/Filter" - }, - { - "$ref": "#/components/parameters/Search" - } - ], - "responses": { - "200": { - "description": "Successful request", - "content": { - "application/json": { - "schema": { - "type": "object", - "properties": { - "data": { - "type": "array", - "items": { - "type": "object", - "$ref": "#/components/schemas/ItemsMarkerIcons" - } - }, - "meta": { - "$ref": "#/components/schemas/x-metadata" - } - } - } - } - } - }, - "401": { - "$ref": "#/components/responses/UnauthorizedError" - } - } - }, - "patch": { - "summary": "Update Multiple Items", - "description": "Update multiple marker_icons items at the same time.", - "tags": [ - "Items", - "ItemsMarkerIcons" - ], - "operationId": "updateItemsMarkerIcons", - "parameters": [ - { - "$ref": "#/components/parameters/Fields" - }, - { - "$ref": "#/components/parameters/Limit" - }, - { - "$ref": "#/components/parameters/Meta" - }, - { - "$ref": "#/components/parameters/Offset" - }, - { - "$ref": "#/components/parameters/Sort" - }, - { - "$ref": "#/components/parameters/Filter" - }, - { - "$ref": "#/components/parameters/Search" - } - ], - "requestBody": { - "content": { - "application/json": { - "schema": { - "oneOf": [ - { - "type": "array", - "items": { - "$ref": "#/components/schemas/ItemsMarkerIcons" - } - }, - { - "$ref": "#/components/schemas/ItemsMarkerIcons" - } - ] - } - } - } - }, - "responses": { - "200": { - "description": "Successful request", - "content": { - "application/json": { - "schema": { - "properties": { - "data": { - "type": "array", - "items": { - "$ref": "#/components/schemas/ItemsMarkerIcons" - } - } - } - } - } - } - } - } - }, - "delete": { - "summary": "Delete Multiple Items", - "description": "Delete multiple existing marker_icons items.", - "tags": [ - "Items", - "ItemsMarkerIcons" - ], - "operationId": "deleteItemsMarkerIcons", - "responses": { - "200": { - "description": "Successful request" - }, - "401": { - "$ref": "#/components/responses/UnauthorizedError" - } - }, - "parameters": [] - } - }, - "/items/marker_icons/{id}": { - "get": { - "summary": "Retrieve an Item", - "description": "Retrieve a single marker_icons item by unique identifier.", - "tags": [ - "Items", - "ItemsMarkerIcons" - ], - "operationId": "readSingleItemsMarkerIcons", - "parameters": [ - { - "$ref": "#/components/parameters/Fields" - }, - { - "$ref": "#/components/parameters/Meta" - }, - { - "$ref": "#/components/parameters/Version" - }, - { - "name": "id", - "description": "Index of the item.", - "in": "path", - "required": true, - "schema": { - "oneOf": [ - { - "type": "integer", - "description": "Incremental index of the item.", - "example": 1 - }, - { - "type": "string", - "description": "Unique identifier of the item.", - "example": "8cbb43fe-4cdf-4991-8352-c461779cec02" - } - ] - } - } - ], - "responses": { - "200": { - "description": "Successful request", - "content": { - "application/json": { - "schema": { - "type": "object", - "properties": { - "data": { - "type": "object", - "$ref": "#/components/schemas/ItemsMarkerIcons" - } - } - } - } - } - }, - "401": { - "$ref": "#/components/responses/UnauthorizedError" - }, - "404": { - "$ref": "#/components/responses/NotFoundError" - } - } - }, - "patch": { - "summary": "Update an Item", - "description": "Update an existing marker_icons item.", - "tags": [ - "Items", - "ItemsMarkerIcons" - ], - "operationId": "updateSingleItemsMarkerIcons", - "parameters": [ - { - "$ref": "#/components/parameters/Fields" - }, - { - "$ref": "#/components/parameters/Meta" - }, - { - "name": "id", - "description": "Index of the item.", - "in": "path", - "required": true, - "schema": { - "oneOf": [ - { - "type": "integer", - "description": "Incremental index of the item.", - "example": 1 - }, - { - "type": "string", - "description": "Unique identifier of the item.", - "example": "8cbb43fe-4cdf-4991-8352-c461779cec02" - } - ] - } - } - ], - "requestBody": { - "content": { - "application/json": { - "schema": { - "type": "object", - "$ref": "#/components/schemas/ItemsMarkerIcons" - } - } - } - }, - "responses": { - "200": { - "description": "Successful request", - "content": { - "application/json": { - "schema": { - "type": "object", - "properties": { - "data": { - "type": "object", - "$ref": "#/components/schemas/ItemsMarkerIcons" - } - } - } - } - } - }, - "401": { - "$ref": "#/components/responses/UnauthorizedError" - }, - "404": { - "$ref": "#/components/responses/NotFoundError" - } - } - }, - "delete": { - "summary": "Delete an Item", - "description": "Delete an existing marker_icons item.", - "tags": [ - "Items", - "ItemsMarkerIcons" - ], - "operationId": "deleteSingleItemsMarkerIcons", - "responses": { - "200": { - "description": "Successful request" - }, - "401": { - "$ref": "#/components/responses/UnauthorizedError" - }, - "404": { - "$ref": "#/components/responses/NotFoundError" - } - }, - "parameters": [ - { - "name": "id", - "description": "Index of the item.", - "in": "path", - "required": true, - "schema": { - "oneOf": [ - { - "type": "integer", - "description": "Incremental index of the item.", - "example": 1 - }, - { - "type": "string", - "description": "Unique identifier of the item.", - "example": "8cbb43fe-4cdf-4991-8352-c461779cec02" - } - ] - } - } - ] - } - }, "/items/inviteLinks": { "post": { "summary": "Create an Item", @@ -21266,6 +21266,10 @@ "name": "ItemsOceannomadsProfiles", "x-collection": "oceannomads_profiles" }, + { + "name": "ItemsMarkerIcons", + "x-collection": "marker_icons" + }, { "name": "ItemsAttestations", "x-collection": "attestations" @@ -21302,10 +21306,6 @@ "name": "ItemsGroupTypes", "x-collection": "groupTypes" }, - { - "name": "ItemsMarkerIcons", - "x-collection": "marker_icons" - }, { "name": "ItemsInviteLinks", "x-collection": "inviteLinks" @@ -23439,6 +23439,51 @@ "id" ] }, + "ItemsMarkerIcons": { + "type": "object", + "properties": { + "id": { + "nullable": false, + "type": "string" + }, + "image": { + "nullable": true, + "oneOf": [ + { + "type": "string", + "format": "uuid" + }, + { + "$ref": "#/components/schemas/Files" + } + ] + }, + "size": { + "nullable": true, + "type": "number" + }, + "image_outline": { + "nullable": true, + "oneOf": [ + { + "type": "string", + "format": "uuid" + }, + { + "$ref": "#/components/schemas/Files" + } + ] + }, + "size_outline": { + "nullable": true, + "type": "number" + } + }, + "x-collection": "marker_icons", + "required": [ + "id" + ] + }, "ItemsAttestations": { "type": "object", "properties": { @@ -23935,35 +23980,6 @@ "id" ] }, - "ItemsMarkerIcons": { - "type": "object", - "properties": { - "id": { - "nullable": false, - "type": "string" - }, - "image": { - "nullable": true, - "oneOf": [ - { - "type": "string", - "format": "uuid" - }, - { - "$ref": "#/components/schemas/Files" - } - ] - }, - "size": { - "nullable": true, - "type": "number" - } - }, - "x-collection": "marker_icons", - "required": [ - "id" - ] - }, "ItemsInviteLinks": { "type": "object", "properties": { @@ -24285,18 +24301,6 @@ "type": "string", "format": "uuid" }, - "indexIcon": { - "nullable": true, - "oneOf": [ - { - "type": "string", - "format": "uuid" - }, - { - "$ref": "#/components/schemas/Files" - } - ] - }, "index_plus_button": { "nullable": true, "type": "boolean" @@ -24343,18 +24347,6 @@ "nullable": true, "type": "string" }, - "menuIcon": { - "nullable": true, - "oneOf": [ - { - "type": "string", - "format": "uuid" - }, - { - "$ref": "#/components/schemas/Files" - } - ] - }, "menuText": { "nullable": true, "type": "string" @@ -24379,20 +24371,6 @@ "nullable": true, "type": "boolean" }, - "maps": { - "nullable": true, - "type": "array", - "items": { - "oneOf": [ - { - "type": "integer" - }, - { - "$ref": "#/components/schemas/ItemsLayersMaps" - } - ] - } - }, "notifications": { "nullable": true, "type": "array", @@ -24406,6 +24384,20 @@ } ] } + }, + "maps": { + "nullable": true, + "type": "array", + "items": { + "oneOf": [ + { + "type": "integer" + }, + { + "$ref": "#/components/schemas/ItemsLayersMaps" + } + ] + } } }, "x-collection": "layers", diff --git a/backend/directus-config/specs/system.graphql b/backend/directus-config/specs/system.graphql index 622c6c4d..d97fc0de 100644 --- a/backend/directus-config/specs/system.graphql +++ b/backend/directus-config/specs/system.graphql @@ -266,6 +266,7 @@ type Subscription { relations_mutated(event: EventEnum): relations_mutated oceannomads_events_mutated(event: EventEnum): oceannomads_events_mutated oceannomads_profiles_mutated(event: EventEnum): oceannomads_profiles_mutated + marker_icons_mutated(event: EventEnum): marker_icons_mutated attestations_mutated(event: EventEnum): attestations_mutated attestations_directus_users_mutated(event: EventEnum): attestations_directus_users_mutated contactInfos_mutated(event: EventEnum): contactInfos_mutated @@ -275,7 +276,6 @@ type Subscription { groupSubheaders_mutated(event: EventEnum): groupSubheaders_mutated groupSubheaders_groupTypes_mutated(event: EventEnum): groupSubheaders_groupTypes_mutated groupTypes_mutated(event: EventEnum): groupTypes_mutated - marker_icons_mutated(event: EventEnum): marker_icons_mutated inviteLinks_mutated(event: EventEnum): inviteLinks_mutated items_mutated(event: EventEnum): items_mutated itemSecrets_mutated(event: EventEnum): itemSecrets_mutated @@ -1951,7 +1951,6 @@ type junction_directus_users_tags_mutated { type layers { id: ID! - indexIcon(filter: directus_files_filter, sort: [String], limit: Int, offset: Int, page: Int, search: String): directus_files index_plus_button: Boolean itemType(filter: types_filter, sort: [String], limit: Int, offset: Int, page: Int, search: String): types item_presets: JSON @@ -1961,17 +1960,16 @@ type layers { markerIcon(filter: marker_icons_filter, sort: [String], limit: Int, offset: Int, page: Int, search: String): marker_icons markerShape: String menuColor: String - menuIcon(filter: directus_files_filter, sort: [String], limit: Int, offset: Int, page: Int, search: String): directus_files menuText: String name: String onlyOnePerOwner: Boolean public_edit_items: Boolean sort: Int userProfileLayer: Boolean - maps(filter: layers_maps_filter, sort: [String], limit: Int, offset: Int, page: Int, search: String): [layers_maps] - maps_func: count_functions notifications(filter: layers_directus_users_1_filter, sort: [String], limit: Int, offset: Int, page: Int, search: String): [layers_directus_users_1] notifications_func: count_functions + maps(filter: layers_maps_filter, sort: [String], limit: Int, offset: Int, page: Int, search: String): [layers_maps] + maps_func: count_functions } type layers_directus_users_1 { @@ -2060,6 +2058,8 @@ type marker_icons { id: ID! image(filter: directus_files_filter, sort: [String], limit: Int, offset: Int, page: Int, search: String): directus_files size: Float + image_outline(filter: directus_files_filter, sort: [String], limit: Int, offset: Int, page: Int, search: String): directus_files + size_outline: Float } type marker_icons_mutated { @@ -2765,7 +2765,6 @@ input create_layers_directus_users_1_input { input create_layers_input { id: ID - indexIcon: create_directus_files_input index_plus_button: Boolean itemType: create_types_input item_presets: JSON @@ -2774,15 +2773,14 @@ input create_layers_input { markerIcon: create_marker_icons_input markerShape: String menuColor: String - menuIcon: create_directus_files_input menuText: String name: String onlyOnePerOwner: Boolean public_edit_items: Boolean sort: Int userProfileLayer: Boolean - maps: [create_layers_maps_input] notifications: [create_layers_directus_users_1_input] + maps: [create_layers_maps_input] } input create_layers_maps_input { @@ -2827,6 +2825,8 @@ input create_marker_icons_input { id: ID! image: create_directus_files_input size: Float + image_outline: create_directus_files_input + size_outline: Float } input create_Themes_input { @@ -3726,7 +3726,6 @@ input layers_directus_users_1_quantifier_filter { input layers_filter { id: id_filter_operators - indexIcon: directus_files_filter index_plus_button: boolean_filter_operators itemType: types_filter item_presets: string_filter_operators @@ -3736,17 +3735,16 @@ input layers_filter { markerIcon: marker_icons_filter markerShape: string_filter_operators menuColor: string_filter_operators - menuIcon: directus_files_filter menuText: string_filter_operators name: string_filter_operators onlyOnePerOwner: boolean_filter_operators public_edit_items: boolean_filter_operators sort: number_filter_operators userProfileLayer: boolean_filter_operators - maps: layers_maps_quantifier_filter - maps_func: count_function_filter_operators notifications: layers_directus_users_1_quantifier_filter notifications_func: count_function_filter_operators + maps: layers_maps_quantifier_filter + maps_func: count_function_filter_operators _and: [layers_filter] _or: [layers_filter] } @@ -3804,6 +3802,8 @@ input marker_icons_filter { id: string_filter_operators image: directus_files_filter size: number_filter_operators + image_outline: directus_files_filter + size_outline: number_filter_operators _and: [marker_icons_filter] _or: [marker_icons_filter] } @@ -4305,7 +4305,6 @@ input update_layers_directus_users_1_input { input update_layers_input { id: ID - indexIcon: update_directus_files_input index_plus_button: Boolean itemType: update_types_input item_presets: JSON @@ -4314,15 +4313,14 @@ input update_layers_input { markerIcon: update_marker_icons_input markerShape: String menuColor: String - menuIcon: update_directus_files_input menuText: String name: String onlyOnePerOwner: Boolean public_edit_items: Boolean sort: Int userProfileLayer: Boolean - maps: [update_layers_maps_input] notifications: [update_layers_directus_users_1_input] + maps: [update_layers_maps_input] } input update_layers_maps_input { @@ -4367,6 +4365,8 @@ input update_marker_icons_input { id: ID image: update_directus_files_input size: Float + image_outline: update_directus_files_input + size_outline: Float } input update_Themes_input { diff --git a/lib/examples/2-static-layers/src/App.tsx b/lib/examples/2-static-layers/src/App.tsx index 16812b0c..52df3b23 100644 --- a/lib/examples/2-static-layers/src/App.tsx +++ b/lib/examples/2-static-layers/src/App.tsx @@ -50,7 +50,6 @@ function App() { markerShape='square' markerDefaultColor='#700' data={events} - menuIcon="calendar" menuColor="#700" menuText="events" itemType={itemTypeEvent} @@ -64,7 +63,6 @@ function App() { markerShape='circle' markerDefaultColor='#007' data={places} - menuIcon="point" menuColor="#007" menuText="places" itemType={itemTypePlace} diff --git a/lib/src/Components/Map/Layer.tsx b/lib/src/Components/Map/Layer.tsx index ed907fd7..7239a7b3 100644 --- a/lib/src/Components/Map/Layer.tsx +++ b/lib/src/Components/Map/Layer.tsx @@ -21,7 +21,6 @@ export const Layer = ({ data, children, name = 'places', - menuIcon = 'MapPinIcon', menuText = 'add new place', menuColor = '#2E7D32', markerIcon, @@ -51,7 +50,6 @@ export const Layer = ({ data, children, name, - menuIcon, menuText, menuColor, markerIcon, @@ -74,7 +72,6 @@ export const Layer = ({ data, children, name, - menuIcon, menuText, menuColor, markerIcon, diff --git a/lib/src/Components/Map/Subcomponents/AddButton.tsx b/lib/src/Components/Map/Subcomponents/AddButton.tsx index 5781a1ab..320f5352 100644 --- a/lib/src/Components/Map/Subcomponents/AddButton.tsx +++ b/lib/src/Components/Map/Subcomponents/AddButton.tsx @@ -3,6 +3,7 @@ import SVG from 'react-inlinesvg' import PlusSVG from '#assets/plus.svg' +import { useAppState } from '#components/AppShell/hooks/useAppState' import { useLayers } from '#components/Map/hooks/useLayers' import { useHasUserPermission } from '#components/Map/hooks/usePermissions' @@ -13,6 +14,7 @@ export default function AddButton({ }) { const layers = useLayers() const hasUserPermission = useHasUserPermission() + const appState = useAppState() const canAddItems = () => { let canAdd = false @@ -49,7 +51,7 @@ export default function AddButton({
diff --git a/lib/src/Components/Map/Subcomponents/Controls/LocateControl.spec.tsx b/lib/src/Components/Map/Subcomponents/Controls/LocateControl.spec.tsx index 5fdec8e9..8bfbfd5c 100644 --- a/lib/src/Components/Map/Subcomponents/Controls/LocateControl.spec.tsx +++ b/lib/src/Components/Map/Subcomponents/Controls/LocateControl.spec.tsx @@ -114,7 +114,6 @@ const mockItemType: ItemType = { const mockLayer: Layer = { id: 'layer-1', name: 'Users', - menuIcon: 'user', menuColor: '#ff0000', menuText: 'Users', markerIcon: mockMarkerIcon, diff --git a/lib/src/Components/Map/Subcomponents/Controls/SearchControl.tsx b/lib/src/Components/Map/Subcomponents/Controls/SearchControl.tsx index f82a3693..1193cbe2 100644 --- a/lib/src/Components/Map/Subcomponents/Controls/SearchControl.tsx +++ b/lib/src/Components/Map/Subcomponents/Controls/SearchControl.tsx @@ -177,26 +177,26 @@ export const SearchControl = () => { } }} > - {item.layer?.menuIcon ? ( - { - code = code.replace(/fill=".*?"/g, 'fill="currentColor"') - code = code.replace(/stroke=".*?"/g, 'stroke="currentColor"') - return code - }} - /> + {item.layer?.markerIcon.image ? ( +
+ { + code = code.replace(/fill=".*?"/g, 'fill="currentColor"') + code = code.replace(/stroke=".*?"/g, 'stroke="currentColor"') + return code + }} + /> +
) : ( -
+
)}
{item.name}
-
- {item.text} -
))} diff --git a/lib/src/Components/Map/Subcomponents/SelectPosition.tsx b/lib/src/Components/Map/Subcomponents/SelectPosition.tsx index ceae1c72..7b3727af 100644 --- a/lib/src/Components/Map/Subcomponents/SelectPosition.tsx +++ b/lib/src/Components/Map/Subcomponents/SelectPosition.tsx @@ -25,7 +25,7 @@ export const SelectPosition = ({ Select new position of {selectNewItemPosition.name} on the map! )} - {selectNewItemPosition && 'menuIcon' in selectNewItemPosition && ( + {selectNewItemPosition && 'markerIcon' in selectNewItemPosition && ( Select position on the map! )}
diff --git a/lib/src/Components/Map/hooks/useSelectPosition.tsx b/lib/src/Components/Map/hooks/useSelectPosition.tsx index 467a917c..26435915 100644 --- a/lib/src/Components/Map/hooks/useSelectPosition.tsx +++ b/lib/src/Components/Map/hooks/useSelectPosition.tsx @@ -97,11 +97,11 @@ function useSelectPositionManager(): { useEffect(() => { if (selectPosition != null) { // selectPosition can be null, Layer or Item - if ('menuIcon' in selectPosition) { + if ('markerIcon' in selectPosition) { // if selectPosition is a Layer mapClicked && mapClicked.setItemFormPopup({ - layer: selectPosition, + layer: selectPosition as LayerProps, position: mapClicked.position, }) setSelectPosition(null) diff --git a/lib/src/Components/Profile/ItemFunctions.spec.tsx b/lib/src/Components/Profile/ItemFunctions.spec.tsx index 5b430d8f..9644e507 100644 --- a/lib/src/Components/Profile/ItemFunctions.spec.tsx +++ b/lib/src/Components/Profile/ItemFunctions.spec.tsx @@ -36,7 +36,6 @@ describe('linkItem', () => { getItems: vi.fn(), }, name: '', - menuIcon: '', menuColor: '', menuText: '', markerIcon: { diff --git a/lib/src/types/LayerProps.d.ts b/lib/src/types/LayerProps.d.ts index 3839d721..40aa6196 100644 --- a/lib/src/types/LayerProps.d.ts +++ b/lib/src/types/LayerProps.d.ts @@ -11,7 +11,6 @@ export interface LayerProps { data?: Item[] children?: React.ReactNode name: string - menuIcon: string menuColor: string menuText: string markerIcon: MarkerIcon diff --git a/lib/src/types/MarkerIcon.d.ts b/lib/src/types/MarkerIcon.d.ts index 052311c8..cde3cdf4 100644 --- a/lib/src/types/MarkerIcon.d.ts +++ b/lib/src/types/MarkerIcon.d.ts @@ -1,4 +1,6 @@ export interface MarkerIcon { image: string size?: number + image_outline?: string + size_outline?: number }