+
+
+
+
+
+
+
-
+
}>
- }/>
- }/>
- }/>
- }/>
- } />
- } />
+ } />
+ } />
+ } />
+ } />
+ } />
+ } />
+ } />
+ } />
} />
- } />
- } />
- } />
+ } />
+ } />
+ } />
- } />
- } />
- } />
+ } />
diff --git a/src/ModalContent.tsx b/src/ModalContent.tsx
index fa87f39c..02181713 100644
--- a/src/ModalContent.tsx
+++ b/src/ModalContent.tsx
@@ -8,18 +8,20 @@ type ChapterProps = {
export function Welcome1({ clickAction }: ChapterProps) {
return (
<>
- Welcome, glad you are here!
-
+ Welcome to the Collaboative Finance Map
+
- In the 21st century, humanity is at a special point in its history.
+ This map is a tool for connecting the movement and making projects, local initiatives, people and events visible.
- On the one hand, the people of Planet Earth are facing a multitude of fundamental crises.
+ Help fill this map by adding projects and events to the map.
- On the other hand, we have all the knowledge and technology to heal the planet and live in harmony with Mother Earth.
+
+ Sign up to create your personal profile and add it to the map.
+
- clickAction!()}>Next
+ clickAction!()}>Close
>
)
@@ -101,7 +103,7 @@ export const ModalContent = () => {
const ActiveChapter = () => {
switch (chapter) {
case 1:
- return { setChapter(2) }} />
+ return { close(); }} />
case 2:
return { setChapter(3) }} />
case 3:
diff --git a/src/api/itemsApi.ts b/src/api/itemsApi.ts
index 82d28d1d..032211db 100644
--- a/src/api/itemsApi.ts
+++ b/src/api/itemsApi.ts
@@ -9,10 +9,11 @@ export class itemsApi implements ItemsApi{
collectionName: string;
filter: any;
layerId: string | undefined;
- mapId: string | undefined;
+ mapId: string | undefined;
+ customParameter: any
- constructor(collectionName: string, layerId?: string | undefined, mapId?: string | undefined, filter?: any, ) {
+ constructor(collectionName: string, layerId?: string | undefined, mapId?: string | undefined, filter?: any, customParameter?:any ) {
this.collectionName = collectionName;
if(filter) this.filter = filter;
else this.filter = {};
@@ -23,12 +24,13 @@ export class itemsApi implements ItemsApi{
this.mapId = mapId;
if(mapId) {
this.filter = {... filter, ... { "map" : { "id": { "_eq": mapId }}}}
- }
+ }
+ if(customParameter) this.customParameter = customParameter;
}
async getItems() {
try {
- return await directusClient.request(readItems(this.collectionName as never, { fields: ['*', { user_created: ['*', {offers: ['*'], needs: ['*']}] }], filter: this.filter, limit: 500 }));
+ return await directusClient.request(readItems(this.collectionName as never, { fields: ['*', "relations.*", { user_created: ['*', {offers: ['*'], needs: ['*']}] }], filter: this.filter, limit: 500 }));
} catch (error: any) {
console.log(error);
if (error.errors[0]?.message)
@@ -50,7 +52,7 @@ export class itemsApi implements ItemsApi{
async createItem(item: T & { id?: string }) {
try {
- return await directusClient.request(createItem(this.collectionName as keyof MyCollections, {...item, ...(this.layerId && {layer: this.layerId}), ...(this.layerId && {layer: this.layerId}), ...(this.mapId && {map: this.mapId})}))
+ return await directusClient.request(createItem(this.collectionName as keyof MyCollections, {...item, ...(this.customParameter && this.customParameter), ...(this.layerId && {layer: this.layerId}), ...(this.layerId && {layer: this.layerId}), ...(this.mapId && {map: this.mapId})}))
} catch (error: any) {
console.log(error);
if (error.errors[0]?.message)
diff --git a/src/pages/MapContainer.tsx b/src/pages/MapContainer.tsx
index fcfa061e..558c8e74 100644
--- a/src/pages/MapContainer.tsx
+++ b/src/pages/MapContainer.tsx
@@ -1,32 +1,25 @@
-import { UtopiaMap, Tags, Layer, ItemForm, ItemView, PopupTextAreaInput, PopupTextInput, PopupStartEndInput, TextView, StartEndView, Permissions, PopupButton } from 'utopia-ui'
+import { UtopiaMap, Layer, ItemForm, ItemView, PopupTextAreaInput, PopupTextInput, PopupStartEndInput, TextView, StartEndView, PopupButton } from 'utopia-ui'
import { itemsApi } from '../api/itemsApi';
-import { permissionsApi } from '../api/permissionsApi';
-import { Place, Event, Tag } from '../api/directus';
+import { Place, Event } from '../api/directus';
import { useEffect, useState } from 'react';
-import {CalendarDaysIcon, MapPinIcon, UserIcon} from '@heroicons/react/20/solid'
- import { refiBcnApi } from '../api/refiBcnApi';
+import { CalendarDaysIcon, MapPinIcon, UserIcon } from '@heroicons/react/20/solid'
function MapContainer() {
const [placesApi, setPlacesApi] = useState>();
const [eventsApi, setEventsApi] = useState>();
- const [tagsApi, setTagsApi] = useState>();
- const [permissionsApiInstance, setPermissionsApiInstance] = useState();
const [updatesApiInstance, setUpdatesApiInstance] = useState>();
- const [refiApi, setRefiApi] = useState();
useEffect(() => {
- setPlacesApi(new itemsApi('places',"e31de961-6709-4413-a27d-00e59ccfe472"));
- setEventsApi(new itemsApi('events', "1837e83e-07f1-44c0-88c0-8e9ea8e597db"));
- setUpdatesApiInstance(new itemsApi('updates',"b4dd8b6b-80e8-4173-9682-4a5755e7b9cb", undefined, {"latest":{"_eq": true}}));
- setTagsApi(new itemsApi('tags', undefined, "8bf681a4-1b8d-44ba-afba-c6dbf79a769f"));
- setPermissionsApiInstance(new permissionsApi());
- setRefiApi(new refiBcnApi('refi'));
+ setPlacesApi(new itemsApi('items', undefined, undefined, {"type":{"_eq":"project"}}, {type: "project"}));
+ setEventsApi(new itemsApi('items', undefined, undefined, {"type":{"_eq":"event"}}, {type: "event"}));
+ setUpdatesApiInstance(new itemsApi('updates', "d2e5c850-74db-4789-910b-79d6784ad265", undefined, { "latest": { "_eq": true } }));
+
}, []);
@@ -36,7 +29,7 @@ function MapContainer() {
return (
-
+
@@ -58,15 +52,23 @@ function MapContainer() {
+ api={placesApi}>
+
+
+
+
+
-
Press Save to place your Profile to the Map
+
Press Save to place your Profile to the Map
-
-
-
-
)
}
diff --git a/src/pages/setItemLocation.tsx b/src/pages/setItemLocation.tsx
new file mode 100644
index 00000000..e69de29b
diff --git a/src/routes/sidebar.tsx b/src/routes/sidebar.tsx
index 19d4a9ce..6063d627 100644
--- a/src/routes/sidebar.tsx
+++ b/src/routes/sidebar.tsx
@@ -1,5 +1,6 @@
-import { BookOpenIcon, CheckBadgeIcon, MapIcon } from '@heroicons/react/24/outline'
+import { RectangleGroupIcon } from '@heroicons/react/24/outline'
+import { MapIcon } from '@heroicons/react/24/outline'
//const iconClasses = `h-6 w-6`
//const submenuIconClasses = `h-5 w-5`
@@ -12,9 +13,9 @@ export const routes = [
name: 'Map',
},
{
- path: '/quests', // url
- icon: , // icon component
- name: 'Quests', // name that appear in Sidebar
+ path: '/items', // url
+ icon: , // icon component
+ name: 'Projects', // name that appear in Sidebar
}/**
{
path: '/people', // url
@@ -55,12 +56,7 @@ export const bottomRoutes = [
{
- path: '/concept', // url
- icon: , // icon component
- name: 'Concept', // name that appear in Sidebar
- },
- {
- path: 'https://github.com/utopia-os/utopia-game', // url
+ path: 'https://github.com/utopia-os/utopia-ui', // url
icon: ,
name: 'Github', // name that appear in Sidebar
blank: true