From bccbdee349c223c4b86fa6093a59b2fa06d74b7c Mon Sep 17 00:00:00 2001 From: He4eT Date: Mon, 31 Mar 2025 17:58:47 +0200 Subject: [PATCH] Hackspace: add location --- .../content-types/hackspace/schema.json | 5 +++ src/components/hackspace/location.json | 34 +++++++++++++++++++ src/components/location/area.json | 20 +++++++++++ 3 files changed, 59 insertions(+) create mode 100644 src/components/hackspace/location.json create mode 100644 src/components/location/area.json diff --git a/src/api/hackspace/content-types/hackspace/schema.json b/src/api/hackspace/content-types/hackspace/schema.json index a50e750..0da4d6c 100644 --- a/src/api/hackspace/content-types/hackspace/schema.json +++ b/src/api/hackspace/content-types/hackspace/schema.json @@ -32,6 +32,11 @@ "repeatable": false, "component": "hackspace.contacts", "required": true + }, + "location": { + "type": "component", + "repeatable": false, + "component": "hackspace.location" } } } diff --git a/src/components/hackspace/location.json b/src/components/hackspace/location.json new file mode 100644 index 0000000..4f17a0e --- /dev/null +++ b/src/components/hackspace/location.json @@ -0,0 +1,34 @@ +{ + "collectionName": "components_hackspace_locations", + "info": { + "displayName": "location", + "icon": "pinMap", + "description": "" + }, + "options": {}, + "attributes": { + "address": { + "type": "string" + }, + "lat": { + "type": "decimal" + }, + "lon": { + "type": "decimal" + }, + "timezone": { + "type": "string" + }, + "country_code": { + "type": "string" + }, + "hint": { + "type": "text" + }, + "areas": { + "type": "component", + "repeatable": true, + "component": "location.area" + } + } +} diff --git a/src/components/location/area.json b/src/components/location/area.json new file mode 100644 index 0000000..45e806e --- /dev/null +++ b/src/components/location/area.json @@ -0,0 +1,20 @@ +{ + "collectionName": "components_location_areas", + "info": { + "displayName": "area", + "icon": "layout" + }, + "options": {}, + "attributes": { + "name": { + "type": "string" + }, + "description": { + "type": "text" + }, + "square_meters": { + "type": "decimal", + "required": true + } + } +}