)}
@@ -136,7 +136,7 @@ function MapContainer({ layers, map }: { layers: LayerProps[]; map: any }) {
// layer.public_edit_items &&
}
{layer.itemType.custom_text && (
-
+
{layer.itemType.custom_text}
)}
diff --git a/frontend/src/routes/sidebar.tsx b/frontend/src/routes/sidebar.tsx
index 672c100a..66203665 100644
--- a/frontend/src/routes/sidebar.tsx
+++ b/frontend/src/routes/sidebar.tsx
@@ -1,6 +1,8 @@
import { MapIcon } from '@heroicons/react/24/outline'
import { SVG } from 'utopia-ui'
+import type { Route } from '#components/AppShell/SideBar'
+
export const routes = [
{
path: '/',
@@ -43,7 +45,7 @@ export const getBottomRoutes = (currentUrl: string) => {
const url = new URL(currentUrl)
const isEmbedded = url.searchParams.get('embedded') === 'true'
- const bottomRoutes = [
+ const bottomRoutes: Route[] = [
// Other routes can be added here
]
@@ -51,13 +53,13 @@ export const getBottomRoutes = (currentUrl: string) => {
bottomRoutes.push(
{
path: 'https://github.com/utopia-os/utopia-ui', // url
- icon:
,
+ icon:
,
name: 'GitHub', // name that appear in Sidebar
blank: true,
},
{
path: 'https://opencollective.com/utopia-project', // url
- icon:
,
+ icon:
,
name: 'Open Collective', // name that appear in Sidebar
blank: true,
},
diff --git a/frontend/tsconfig.json b/frontend/tsconfig.json
index 9720a1eb..5469587c 100644
--- a/frontend/tsconfig.json
+++ b/frontend/tsconfig.json
@@ -1,23 +1,24 @@
{
+ "extends": "../tsconfig.base.json",
"compilerOptions": {
- "target": "ESNext",
- "lib": ["DOM", "DOM.Iterable", "ESNext"],
- "module": "ESNext",
- "skipLibCheck": true,
-
- /* Bundler mode */
"moduleResolution": "bundler",
"allowImportingTsExtensions": true,
"resolveJsonModule": true,
"isolatedModules": true,
"noEmit": true,
"jsx": "react-jsx",
-
- /* Linting */
- "strict": true,
"noUnusedLocals": true,
"noUnusedParameters": true,
- "noFallthroughCasesInSwitch": true
+ "noFallthroughCasesInSwitch": true,
+ "paths": {
+ "utopia-ui": ["../lib/src"],
+ "#components/*": ["../lib/src/Components/*"],
+ "#utils/*": ["../lib/src/Utils/*"],
+ "#types/*": ["../lib/src/types/*"],
+ "#assets/*": ["../lib/src/assets/*"],
+ "#src/*": ["../lib/src/*"],
+ "#root/*": ["../lib/*"]
+ }
},
"include": ["src"],
"references": [{ "path": "./tsconfig.node.json" }]
diff --git a/frontend/vite.config.ts b/frontend/vite.config.ts
index e9533b8f..0bb7f880 100644
--- a/frontend/vite.config.ts
+++ b/frontend/vite.config.ts
@@ -22,26 +22,43 @@ export default defineConfig({
react(),
tailwindcss(),
],
+ resolve: {
+ dedupe: ['react', 'react-dom', 'react-router-dom'],
+ alias: {
+ 'utopia-ui': path.resolve(__dirname, '../lib/src'),
+ '#components': path.resolve(__dirname, '../lib/src/Components'),
+ '#utils': path.resolve(__dirname, '../lib/src/Utils'),
+ '#types': path.resolve(__dirname, '../lib/src/types'),
+ '#assets': path.resolve(__dirname, '../lib/src/assets'),
+ '#src': path.resolve(__dirname, '../lib/src'),
+ '#root': path.resolve(__dirname, '../lib'),
+ }
+ },
build: {
+ sourcemap: true,
rollupOptions: {
output: {
- manualChunks(id) {
- if (
- id.includes('node_modules/utopia-ui/dist/Profile') &&
- /\.(esm|cjs)\.js$/.test(id)
- ) {
- return 'profile-form'
+ manualChunks: (id) => {
+ if (id.includes('lib/src')) {
+ return 'utopia-ui'
}
-
- if (id.includes('node_modules/utopia-ui/')) {
- return 'utopia-ui-vendor'
- }
-
- if (id.includes('node_modules/')) {
- return 'vendor'
+ if (id.includes('node_modules')) {
+ if (id.includes('react')) {
+ return 'react';
+ }
+ if (id.includes('tiptap')) {
+ return 'tiptap';
+ }
+ if (id.includes('leaflet')) {
+ return 'leaflet';
+ }
+ if (id.includes('lib/node_modules')) {
+ return 'utopia-ui-vendor'
+ }
+ else return 'vendor';
}
}
- }
- }
- }
+ },
+ },
+ },
});
diff --git a/lib/package-lock.json b/lib/package-lock.json
index 17479aa6..d6cd9828 100644
--- a/lib/package-lock.json
+++ b/lib/package-lock.json
@@ -1,12 +1,12 @@
{
"name": "utopia-ui",
- "version": "3.0.110",
+ "version": "3.0.111",
"lockfileVersion": 3,
"requires": true,
"packages": {
"": {
"name": "utopia-ui",
- "version": "3.0.110",
+ "version": "3.0.111",
"license": "GPL-3.0-only",
"dependencies": {
"@heroicons/react": "^2.0.17",
@@ -37,7 +37,7 @@
"react-leaflet-cluster": "^2.1.0",
"react-markdown": "^9.0.1",
"react-photo-album": "^3.0.2",
- "react-router-dom": "^6.16.0",
+ "react-router-dom": "^6.23.0",
"react-toastify": "^9.1.3",
"remark-breaks": "^4.0.0",
"tiptap-markdown": "^0.8.10",
diff --git a/lib/package.json b/lib/package.json
index f663a4d3..0601b494 100644
--- a/lib/package.json
+++ b/lib/package.json
@@ -1,6 +1,6 @@
{
"name": "utopia-ui",
- "version": "3.0.110",
+ "version": "3.0.111",
"description": "Reuseable React Components to build mapping apps for real life communities and networks",
"repository": "https://github.com/utopia-os/utopia-ui",
"homepage": "https://utopia-os.org/",
@@ -125,7 +125,7 @@
"react-leaflet-cluster": "^2.1.0",
"react-markdown": "^9.0.1",
"react-photo-album": "^3.0.2",
- "react-router-dom": "^6.16.0",
+ "react-router-dom": "^6.23.0",
"react-toastify": "^9.1.3",
"remark-breaks": "^4.0.0",
"tiptap-markdown": "^0.8.10",
diff --git a/lib/src/Components/Auth/index.tsx b/lib/src/Components/Auth/index.tsx
index c8fe3b90..d1029e26 100644
--- a/lib/src/Components/Auth/index.tsx
+++ b/lib/src/Components/Auth/index.tsx
@@ -1,5 +1,7 @@
-export { AuthProvider, UserApi, UserItem } from './useAuth'
+export { AuthProvider } from './useAuth'
export { LoginPage } from './LoginPage'
export { SignupPage } from './SignupPage'
export { RequestPasswordPage } from './RequestPasswordPage'
export { SetNewPasswordPage } from './SetNewPasswordPage'
+export type { UserItem } from '#types/UserItem'
+export type { UserApi } from '#types/UserApi'
diff --git a/lib/src/Components/Auth/useAuth.tsx b/lib/src/Components/Auth/useAuth.tsx
index 60a8679f..83c416b0 100644
--- a/lib/src/Components/Auth/useAuth.tsx
+++ b/lib/src/Components/Auth/useAuth.tsx
@@ -3,9 +3,6 @@ import { createContext, useState, useContext, useEffect } from 'react'
import type { UserApi } from '#types/UserApi'
import type { UserItem } from '#types/UserItem'
-export type { UserApi } from '#types/UserApi'
-export type { UserItem } from '#types/UserItem'
-
interface AuthProviderProps {
userApi: UserApi
children?: React.ReactNode
diff --git a/lib/src/Components/Input/Autocomplete.tsx b/lib/src/Components/Input/Autocomplete.tsx
index f98dca30..2bb97d2c 100644
--- a/lib/src/Components/Input/Autocomplete.tsx
+++ b/lib/src/Components/Input/Autocomplete.tsx
@@ -1,4 +1,3 @@
-/* eslint-disable @typescript-eslint/no-unused-vars */
/* eslint-disable @typescript-eslint/no-unsafe-return */
/* eslint-disable @typescript-eslint/no-unsafe-member-access */
/* eslint-disable @typescript-eslint/no-unsafe-call */
@@ -35,8 +34,6 @@ export const Autocomplete = ({
const inputRef = useRef
()
- const getSuggestionValue = (suggestion) => suggestion.name
-
const getSuggestions = (value) => {
const inputValue = value.trim().toLowerCase()
const inputLength = inputValue.length
diff --git a/lib/src/Components/Map/Subcomponents/ItemPopupComponents/HeaderView.tsx b/lib/src/Components/Map/Subcomponents/ItemPopupComponents/HeaderView.tsx
index dca14fc4..64b8d07b 100644
--- a/lib/src/Components/Map/Subcomponents/ItemPopupComponents/HeaderView.tsx
+++ b/lib/src/Components/Map/Subcomponents/ItemPopupComponents/HeaderView.tsx
@@ -74,7 +74,7 @@ export function HeaderView({
<>
-
+
{avatar && (
}}
loading={loading}
/>
-
+
{props.children ?? }
diff --git a/lib/src/Components/Profile/Subcomponents/GalleryForm.tsx b/lib/src/Components/Profile/Subcomponents/GalleryForm.tsx
index e252d790..ee5586bc 100644
--- a/lib/src/Components/Profile/Subcomponents/GalleryForm.tsx
+++ b/lib/src/Components/Profile/Subcomponents/GalleryForm.tsx
@@ -76,7 +76,9 @@ export const GalleryForm = ({ state, setState }: Props) => {
const images = state.gallery
.map((image) => ({
- src: appState.assetsApi.url + `${image.directus_files_id.id}.jpg`,
+ src:
+ typeof image.directus_files_id !== 'string' &&
+ appState.assetsApi.url + `${image.directus_files_id.id}.jpg`,
state: 'uploaded',
}))
.concat(
@@ -99,7 +101,7 @@ export const GalleryForm = ({ state, setState }: Props) => {
{images.map((image, index) => (

{
const [index, setIndex] = useState(-1)
const appState = useAppState()
const images =
- item.gallery?.map(({ directus_files_id: { id, type, width, height } }, index) => ({
- src: `${appState.assetsApi.url}${id}${getExtension(type)}`,
- width,
- height,
- index,
- })) ?? []
+ item.gallery?.flatMap((g, index) => {
+ const file = g.directus_files_id
+ if (typeof file === 'string') return []
+ const { id, type, width, height } = file
+ return [
+ {
+ src: `${appState.assetsApi.url}${id}${getExtension(type)}`,
+ width,
+ height,
+ index,
+ },
+ ]
+ }) ?? []
if (images.length > 0)
return (
diff --git a/lib/src/Components/Profile/index.tsx b/lib/src/Components/Profile/index.tsx
index 595a9c7f..33bef075 100644
--- a/lib/src/Components/Profile/index.tsx
+++ b/lib/src/Components/Profile/index.tsx
@@ -1,4 +1,3 @@
export { UserSettings } from './UserSettings'
-// export { PlusButton } from './Subcomponents/PlusButton'
export { ProfileView } from './ProfileView'
export { ProfileForm } from './ProfileForm'
diff --git a/lib/src/Components/Profile/itemFunctions.ts b/lib/src/Components/Profile/itemFunctions.ts
index 7f3d2dd3..51045c04 100644
--- a/lib/src/Components/Profile/itemFunctions.ts
+++ b/lib/src/Components/Profile/itemFunctions.ts
@@ -200,7 +200,7 @@ export const onUpdateItem = async (
...(state.needs.length > 0 && { needs: needsUpdates }),
...(state.openCollectiveSlug && { openCollectiveSlug: state.openCollectiveSlug }),
gallery: state.gallery.map((i) => ({
- directus_files_id: i.directus_files_id.id,
+ directus_files_id: typeof i.directus_files_id !== 'string' && i.directus_files_id.id,
})),
}
diff --git a/lib/src/Components/Templates/OverlayItemsIndexPage.tsx b/lib/src/Components/Templates/OverlayItemsIndexPage.tsx
index 19d2c70b..094ec95f 100644
--- a/lib/src/Components/Templates/OverlayItemsIndexPage.tsx
+++ b/lib/src/Components/Templates/OverlayItemsIndexPage.tsx
@@ -32,7 +32,6 @@ import type { Item } from '#types/Item'
export const OverlayItemsIndexPage = ({
url,
layerName,
- parameterField,
}: {
layerName: string
url: string
@@ -40,8 +39,6 @@ export const OverlayItemsIndexPage = ({
}) => {
const [loading, setLoading] = useState
(false)
const [addItemPopupOpen, setAddItemPopupOpen] = useState(false)
- // eslint-disable-next-line @typescript-eslint/no-unused-vars
- const parameterFieldDummy = parameterField
const tabRef = useRef(null)
diff --git a/lib/src/index.tsx b/lib/src/index.tsx
index 498db190..8a9d5e89 100644
--- a/lib/src/index.tsx
+++ b/lib/src/index.tsx
@@ -8,6 +8,7 @@ export * from './Components/Gaming'
export * from './Components/Templates'
export * from './Components/Input'
export * from './Components/Item'
+export * from './Components/Profile'
declare global {
interface Window {
diff --git a/lib/src/types/Item.d.ts b/lib/src/types/Item.d.ts
index be3d6194..7dd9dcf1 100644
--- a/lib/src/types/Item.d.ts
+++ b/lib/src/types/Item.d.ts
@@ -8,12 +8,14 @@ import type { Point } from 'geojson'
type TagIds = { tags_id: string }[]
interface GalleryItem {
- directus_files_id: {
- id: string
- width: number
- height: number
- type: string
- }
+ directus_files_id:
+ | {
+ id: string
+ width: number
+ height: number
+ type: string
+ }
+ | string
}
/**
diff --git a/lib/tsconfig.json b/lib/tsconfig.json
index 50c23024..1d591088 100644
--- a/lib/tsconfig.json
+++ b/lib/tsconfig.json
@@ -1,24 +1,19 @@
{
+ "extends": "../tsconfig.base.json",
"compilerOptions": {
"outDir": "dist",
"declaration": true,
"declarationDir": "dist/types", // š¹ Muss innerhalb von dist/ liegen
"emitDeclarationOnly": true, // Nur `.d.ts` generieren, kein JavaScript
- "module": "esnext",
- "target": "ESNext",
- "lib": ["es6", "dom","es2015", "es2016", "es2017", "es2020"],
"sourceMap": false,
"allowJs": false,
- "jsx": "react-jsx",
- "moduleResolution": "node",
"forceConsistentCasingInFileNames": true,
"noImplicitReturns": true,
"noImplicitThis": true,
"strictNullChecks": true,
- "noUnusedLocals": false,
+ "noUnusedLocals": true,
"noUnusedParameters": true,
"allowSyntheticDefaultImports": true,
- "skipLibCheck": true,
"paths": {
"#assets/*": ["./src/assets/*"],
"#components/*": ["./src/Components/*"],
@@ -29,7 +24,7 @@
}
},
"include": ["src", "vite.config.ts", "setupTest.ts", "cypress.config.ts", "cypress/support/commands.ts", "cypress/support/component.ts"],
- "exclude": ["node_modules", "dist", "example", "rollup.config.mjss"],
+ "exclude": ["node_modules", "dist", "example"],
"typeRoots": [
"./src/types",
"./node_modules/@types/"
diff --git a/tsconfig.base.json b/tsconfig.base.json
new file mode 100644
index 00000000..a2acbf22
--- /dev/null
+++ b/tsconfig.base.json
@@ -0,0 +1,12 @@
+{
+ "compilerOptions": {
+ "target": "ESNext",
+ "module": "ESNext",
+ "lib": ["DOM", "DOM.Iterable", "ESNext"],
+ "moduleResolution": "Node",
+ "jsx": "react-jsx",
+ "esModuleInterop": true,
+ "skipLibCheck": true,
+ "strictNullChecks": true,
+ }
+ }
\ No newline at end of file
From 729f97f38ae0d14f3f96448e21798880bb88157a Mon Sep 17 00:00:00 2001
From: Anton Tranelis <31516529+antontranelis@users.noreply.github.com>
Date: Tue, 1 Jul 2025 16:51:46 +0200
Subject: [PATCH 3/7] refactor(app): rename frontend directory (#273)
---
.github/workflows/test.lint.frontend.yml | 10 +++++-----
.github/workflows/test.lint.pr.yml | 2 +-
{frontend => app}/.env | 0
{frontend => app}/.eslintignore | 0
{frontend => app}/.eslintrc.cjs | 0
{frontend => app}/.gitignore | 0
{frontend => app}/.prettierrc.json | 0
{frontend => app}/docker-compose.yml | 2 +-
{frontend => app}/index.html | 0
{frontend => app}/localhost-cert.pem | 0
{frontend => app}/localhost-key.pem | 0
{frontend => app}/package-lock.json | 0
{frontend => app}/package.json | 0
{frontend => app}/public/3markers-globe.svg | 0
{frontend => app}/public/bg1.webp | Bin
{frontend => app}/public/github.svg | 0
{frontend => app}/public/opencollective.svg | 0
{frontend => app}/public/style.css | 0
{frontend => app}/src/App.css | 0
{frontend => app}/src/App.tsx | 0
{frontend => app}/src/ModalContent.tsx | 0
{frontend => app}/src/api/assetsApi.ts | 0
{frontend => app}/src/api/directus.ts | 0
{frontend => app}/src/api/itemsApi.ts | 0
{frontend => app}/src/api/layersApi.ts | 0
{frontend => app}/src/api/mapApi.ts | 0
{frontend => app}/src/api/permissionsApi.ts | 0
{frontend => app}/src/api/readUserApi.ts | 0
{frontend => app}/src/api/refiBcnApi.ts | 0
{frontend => app}/src/api/userApi.ts | 0
{frontend => app}/src/index.css | 0
{frontend => app}/src/main.tsx | 0
{frontend => app}/src/pages/Concept.tsx | 0
{frontend => app}/src/pages/ConceptDE.tsx | 0
{frontend => app}/src/pages/Landingpage.tsx | 0
{frontend => app}/src/pages/MapContainer.tsx | 0
{frontend => app}/src/pages/data.ts | 0
{frontend => app}/src/routes/sidebar.tsx | 0
{frontend => app}/src/vite-env.d.ts | 0
{frontend => app}/tailwind.config.js | 0
{frontend => app}/tsconfig.json | 0
{frontend => app}/tsconfig.node.json | 0
{frontend => app}/video_preview.png | Bin
{frontend => app}/vite.config.ts | 0
backend/README.md | 2 +-
45 files changed, 8 insertions(+), 8 deletions(-)
rename {frontend => app}/.env (100%)
rename {frontend => app}/.eslintignore (100%)
rename {frontend => app}/.eslintrc.cjs (100%)
rename {frontend => app}/.gitignore (100%)
rename {frontend => app}/.prettierrc.json (100%)
rename {frontend => app}/docker-compose.yml (98%)
rename {frontend => app}/index.html (100%)
rename {frontend => app}/localhost-cert.pem (100%)
rename {frontend => app}/localhost-key.pem (100%)
rename {frontend => app}/package-lock.json (100%)
rename {frontend => app}/package.json (100%)
rename {frontend => app}/public/3markers-globe.svg (100%)
rename {frontend => app}/public/bg1.webp (100%)
rename {frontend => app}/public/github.svg (100%)
rename {frontend => app}/public/opencollective.svg (100%)
rename {frontend => app}/public/style.css (100%)
rename {frontend => app}/src/App.css (100%)
rename {frontend => app}/src/App.tsx (100%)
rename {frontend => app}/src/ModalContent.tsx (100%)
rename {frontend => app}/src/api/assetsApi.ts (100%)
rename {frontend => app}/src/api/directus.ts (100%)
rename {frontend => app}/src/api/itemsApi.ts (100%)
rename {frontend => app}/src/api/layersApi.ts (100%)
rename {frontend => app}/src/api/mapApi.ts (100%)
rename {frontend => app}/src/api/permissionsApi.ts (100%)
rename {frontend => app}/src/api/readUserApi.ts (100%)
rename {frontend => app}/src/api/refiBcnApi.ts (100%)
rename {frontend => app}/src/api/userApi.ts (100%)
rename {frontend => app}/src/index.css (100%)
rename {frontend => app}/src/main.tsx (100%)
rename {frontend => app}/src/pages/Concept.tsx (100%)
rename {frontend => app}/src/pages/ConceptDE.tsx (100%)
rename {frontend => app}/src/pages/Landingpage.tsx (100%)
rename {frontend => app}/src/pages/MapContainer.tsx (100%)
rename {frontend => app}/src/pages/data.ts (100%)
rename {frontend => app}/src/routes/sidebar.tsx (100%)
rename {frontend => app}/src/vite-env.d.ts (100%)
rename {frontend => app}/tailwind.config.js (100%)
rename {frontend => app}/tsconfig.json (100%)
rename {frontend => app}/tsconfig.node.json (100%)
rename {frontend => app}/video_preview.png (100%)
rename {frontend => app}/vite.config.ts (100%)
diff --git a/.github/workflows/test.lint.frontend.yml b/.github/workflows/test.lint.frontend.yml
index 93364ca7..ab7229f4 100644
--- a/.github/workflows/test.lint.frontend.yml
+++ b/.github/workflows/test.lint.frontend.yml
@@ -1,10 +1,10 @@
-name: test:lint:frontend
+name: test:lint:app
on: push
jobs:
files-changed:
- name: Detect File Changes - lint - frontend
+ name: Detect File Changes - lint - app
runs-on: ubuntu-latest
outputs:
lint: ${{ steps.filter.outputs.lint }}
@@ -16,11 +16,11 @@ jobs:
filters: |
lint:
- '.github/workflows/**/*'
- - 'frontend/**/*'
+ - 'app/**/*'
lint:
if: needs.files-changed.outputs.lint == 'true'
- name: Lint - frontend
+ name: Lint - app
needs: files-changed
runs-on: ubuntu-latest
steps:
@@ -30,4 +30,4 @@ jobs:
node-version-file: '.tool-versions'
- name: Lint
run: npm install && npm run test:lint:eslint
- working-directory: frontend/
+ working-directory: app/
diff --git a/.github/workflows/test.lint.pr.yml b/.github/workflows/test.lint.pr.yml
index 43f8438d..8e24a2c7 100644
--- a/.github/workflows/test.lint.pr.yml
+++ b/.github/workflows/test.lint.pr.yml
@@ -30,7 +30,7 @@ jobs:
# Append a scope for each service here
scopes: |
backend
- frontend
+ app
lib
docu
docker
diff --git a/frontend/.env b/app/.env
similarity index 100%
rename from frontend/.env
rename to app/.env
diff --git a/frontend/.eslintignore b/app/.eslintignore
similarity index 100%
rename from frontend/.eslintignore
rename to app/.eslintignore
diff --git a/frontend/.eslintrc.cjs b/app/.eslintrc.cjs
similarity index 100%
rename from frontend/.eslintrc.cjs
rename to app/.eslintrc.cjs
diff --git a/frontend/.gitignore b/app/.gitignore
similarity index 100%
rename from frontend/.gitignore
rename to app/.gitignore
diff --git a/frontend/.prettierrc.json b/app/.prettierrc.json
similarity index 100%
rename from frontend/.prettierrc.json
rename to app/.prettierrc.json
diff --git a/frontend/docker-compose.yml b/app/docker-compose.yml
similarity index 98%
rename from frontend/docker-compose.yml
rename to app/docker-compose.yml
index 829739ed..ff7d9f5e 100644
--- a/frontend/docker-compose.yml
+++ b/app/docker-compose.yml
@@ -38,7 +38,7 @@ services:
backend:
container_name: backend
build:
- context: ./backend
+ context: ../backend
depends_on:
database:
condition: service_healthy
diff --git a/frontend/index.html b/app/index.html
similarity index 100%
rename from frontend/index.html
rename to app/index.html
diff --git a/frontend/localhost-cert.pem b/app/localhost-cert.pem
similarity index 100%
rename from frontend/localhost-cert.pem
rename to app/localhost-cert.pem
diff --git a/frontend/localhost-key.pem b/app/localhost-key.pem
similarity index 100%
rename from frontend/localhost-key.pem
rename to app/localhost-key.pem
diff --git a/frontend/package-lock.json b/app/package-lock.json
similarity index 100%
rename from frontend/package-lock.json
rename to app/package-lock.json
diff --git a/frontend/package.json b/app/package.json
similarity index 100%
rename from frontend/package.json
rename to app/package.json
diff --git a/frontend/public/3markers-globe.svg b/app/public/3markers-globe.svg
similarity index 100%
rename from frontend/public/3markers-globe.svg
rename to app/public/3markers-globe.svg
diff --git a/frontend/public/bg1.webp b/app/public/bg1.webp
similarity index 100%
rename from frontend/public/bg1.webp
rename to app/public/bg1.webp
diff --git a/frontend/public/github.svg b/app/public/github.svg
similarity index 100%
rename from frontend/public/github.svg
rename to app/public/github.svg
diff --git a/frontend/public/opencollective.svg b/app/public/opencollective.svg
similarity index 100%
rename from frontend/public/opencollective.svg
rename to app/public/opencollective.svg
diff --git a/frontend/public/style.css b/app/public/style.css
similarity index 100%
rename from frontend/public/style.css
rename to app/public/style.css
diff --git a/frontend/src/App.css b/app/src/App.css
similarity index 100%
rename from frontend/src/App.css
rename to app/src/App.css
diff --git a/frontend/src/App.tsx b/app/src/App.tsx
similarity index 100%
rename from frontend/src/App.tsx
rename to app/src/App.tsx
diff --git a/frontend/src/ModalContent.tsx b/app/src/ModalContent.tsx
similarity index 100%
rename from frontend/src/ModalContent.tsx
rename to app/src/ModalContent.tsx
diff --git a/frontend/src/api/assetsApi.ts b/app/src/api/assetsApi.ts
similarity index 100%
rename from frontend/src/api/assetsApi.ts
rename to app/src/api/assetsApi.ts
diff --git a/frontend/src/api/directus.ts b/app/src/api/directus.ts
similarity index 100%
rename from frontend/src/api/directus.ts
rename to app/src/api/directus.ts
diff --git a/frontend/src/api/itemsApi.ts b/app/src/api/itemsApi.ts
similarity index 100%
rename from frontend/src/api/itemsApi.ts
rename to app/src/api/itemsApi.ts
diff --git a/frontend/src/api/layersApi.ts b/app/src/api/layersApi.ts
similarity index 100%
rename from frontend/src/api/layersApi.ts
rename to app/src/api/layersApi.ts
diff --git a/frontend/src/api/mapApi.ts b/app/src/api/mapApi.ts
similarity index 100%
rename from frontend/src/api/mapApi.ts
rename to app/src/api/mapApi.ts
diff --git a/frontend/src/api/permissionsApi.ts b/app/src/api/permissionsApi.ts
similarity index 100%
rename from frontend/src/api/permissionsApi.ts
rename to app/src/api/permissionsApi.ts
diff --git a/frontend/src/api/readUserApi.ts b/app/src/api/readUserApi.ts
similarity index 100%
rename from frontend/src/api/readUserApi.ts
rename to app/src/api/readUserApi.ts
diff --git a/frontend/src/api/refiBcnApi.ts b/app/src/api/refiBcnApi.ts
similarity index 100%
rename from frontend/src/api/refiBcnApi.ts
rename to app/src/api/refiBcnApi.ts
diff --git a/frontend/src/api/userApi.ts b/app/src/api/userApi.ts
similarity index 100%
rename from frontend/src/api/userApi.ts
rename to app/src/api/userApi.ts
diff --git a/frontend/src/index.css b/app/src/index.css
similarity index 100%
rename from frontend/src/index.css
rename to app/src/index.css
diff --git a/frontend/src/main.tsx b/app/src/main.tsx
similarity index 100%
rename from frontend/src/main.tsx
rename to app/src/main.tsx
diff --git a/frontend/src/pages/Concept.tsx b/app/src/pages/Concept.tsx
similarity index 100%
rename from frontend/src/pages/Concept.tsx
rename to app/src/pages/Concept.tsx
diff --git a/frontend/src/pages/ConceptDE.tsx b/app/src/pages/ConceptDE.tsx
similarity index 100%
rename from frontend/src/pages/ConceptDE.tsx
rename to app/src/pages/ConceptDE.tsx
diff --git a/frontend/src/pages/Landingpage.tsx b/app/src/pages/Landingpage.tsx
similarity index 100%
rename from frontend/src/pages/Landingpage.tsx
rename to app/src/pages/Landingpage.tsx
diff --git a/frontend/src/pages/MapContainer.tsx b/app/src/pages/MapContainer.tsx
similarity index 100%
rename from frontend/src/pages/MapContainer.tsx
rename to app/src/pages/MapContainer.tsx
diff --git a/frontend/src/pages/data.ts b/app/src/pages/data.ts
similarity index 100%
rename from frontend/src/pages/data.ts
rename to app/src/pages/data.ts
diff --git a/frontend/src/routes/sidebar.tsx b/app/src/routes/sidebar.tsx
similarity index 100%
rename from frontend/src/routes/sidebar.tsx
rename to app/src/routes/sidebar.tsx
diff --git a/frontend/src/vite-env.d.ts b/app/src/vite-env.d.ts
similarity index 100%
rename from frontend/src/vite-env.d.ts
rename to app/src/vite-env.d.ts
diff --git a/frontend/tailwind.config.js b/app/tailwind.config.js
similarity index 100%
rename from frontend/tailwind.config.js
rename to app/tailwind.config.js
diff --git a/frontend/tsconfig.json b/app/tsconfig.json
similarity index 100%
rename from frontend/tsconfig.json
rename to app/tsconfig.json
diff --git a/frontend/tsconfig.node.json b/app/tsconfig.node.json
similarity index 100%
rename from frontend/tsconfig.node.json
rename to app/tsconfig.node.json
diff --git a/frontend/video_preview.png b/app/video_preview.png
similarity index 100%
rename from frontend/video_preview.png
rename to app/video_preview.png
diff --git a/frontend/vite.config.ts b/app/vite.config.ts
similarity index 100%
rename from frontend/vite.config.ts
rename to app/vite.config.ts
diff --git a/backend/README.md b/backend/README.md
index f796ee30..7d280167 100644
--- a/backend/README.md
+++ b/backend/README.md
@@ -1,4 +1,4 @@
-In order to pull data from your locally running backend (see [docker-compose](../docker-compose.yml)) to your local harddrive, you can run the following command
+In order to pull data from your locally running backend (see [docker-compose](../app/docker-compose.yml)) to your local harddrive, you can run the following command
```
npx directus-sync pull \
From c92695eea76ba0bc9994a761dab92cb18b577a39 Mon Sep 17 00:00:00 2001
From: Max
Date: Thu, 3 Jul 2025 09:21:31 +0200
Subject: [PATCH 4/7] fix(frontend): update directus collections (#269)
* Update directus collections
* item_secrets is not a collection we call via directus client
---------
Co-authored-by: Anton Tranelis <31516529+antontranelis@users.noreply.github.com>
---
.github/workflows/test.build.lib.yml | 2 +-
app/src/api/directus.ts | 5 +++++
app/src/api/itemsApi.ts | 14 +++++---------
3 files changed, 11 insertions(+), 10 deletions(-)
diff --git a/.github/workflows/test.build.lib.yml b/.github/workflows/test.build.lib.yml
index 2c7c26b6..00e82f3b 100644
--- a/.github/workflows/test.build.lib.yml
+++ b/.github/workflows/test.build.lib.yml
@@ -37,7 +37,7 @@ jobs:
build-examples:
if: needs.files-changed.outputs.build == 'true'
name: Test Example Apps
- needs: build
+ needs: [build, files-changed]
runs-on: ubuntu-latest
strategy:
matrix:
diff --git a/app/src/api/directus.ts b/app/src/api/directus.ts
index 032be4b4..c49a10f5 100644
--- a/app/src/api/directus.ts
+++ b/app/src/api/directus.ts
@@ -6,6 +6,7 @@ import { createDirectus, rest, authentication } from '@directus/sdk'
import type { AuthenticationData, AuthenticationStorage } from '@directus/sdk'
import type { Point } from 'geojson'
+import type { Item } from 'utopia-ui'
export interface Place {
id: string
@@ -57,6 +58,10 @@ export interface MyCollections {
tags: Tag[]
projects: Project[]
directus_users: CustomUserFields[]
+ items: Item[]
+ team: any[]
+ features: any[]
+ attestations: any[]
}
export const authLocalStorage = (mainKey = 'directus_storage') =>
diff --git a/app/src/api/itemsApi.ts b/app/src/api/itemsApi.ts
index c67ccc5f..854734ab 100644
--- a/app/src/api/itemsApi.ts
+++ b/app/src/api/itemsApi.ts
@@ -12,14 +12,14 @@ import type { MyCollections } from './directus'
import type { ItemsApi } from 'utopia-ui'
export class itemsApi implements ItemsApi {
- collectionName: string
+ collectionName: keyof MyCollections
filter: any
layerId: string | undefined
mapId: string | undefined
customParameter: any
constructor(
- collectionName: string,
+ collectionName: keyof MyCollections,
layerId?: string | undefined,
mapId?: string | undefined,
filter?: any,
@@ -81,7 +81,7 @@ export class itemsApi implements ItemsApi {
async createItem(item: T & { id?: string }): Promise {
try {
const result = await directusClient.request(
- createItem(this.collectionName as keyof MyCollections, {
+ createItem(this.collectionName, {
...item,
...(this.customParameter && this.customParameter),
...(this.layerId && { layer: this.layerId }),
@@ -99,9 +99,7 @@ export class itemsApi implements ItemsApi {
async updateItem(item: T & { id?: string }): Promise {
try {
- const result = await directusClient.request(
- updateItem(this.collectionName as keyof MyCollections, item.id!, item),
- )
+ const result = await directusClient.request(updateItem(this.collectionName, item.id!, item))
return result as T
} catch (error: any) {
console.log(error)
@@ -112,9 +110,7 @@ export class itemsApi implements ItemsApi {
async deleteItem(id: string): Promise {
try {
- const result = await directusClient.request(
- deleteItem(this.collectionName as keyof MyCollections, id),
- )
+ const result = await directusClient.request(deleteItem(this.collectionName, id))
return result as unknown as boolean
} catch (error: any) {
console.log(error)
From 045ec726eb71abcf3e8312fd57c95386e792786b Mon Sep 17 00:00:00 2001
From: Anton Tranelis <31516529+antontranelis@users.noreply.github.com>
Date: Thu, 3 Jul 2025 13:18:10 +0200
Subject: [PATCH 5/7] fix(lib): auto close update position toast (#277)
* add close button to custom info modal
* auto close update position toat
* Revert "add close button to custom info modal"
This reverts commit cf5b9a407effe0772ed622ce2369cf16e0b82175.
* fix: reset position for new items without text
---
.../Map/Subcomponents/SelectPosition.tsx | 2 +-
.../Map/hooks/useSelectPosition.tsx | 57 ++++++++++++++++---
2 files changed, 49 insertions(+), 10 deletions(-)
diff --git a/lib/src/Components/Map/Subcomponents/SelectPosition.tsx b/lib/src/Components/Map/Subcomponents/SelectPosition.tsx
index 6f4eccbe..ceae1c72 100644
--- a/lib/src/Components/Map/Subcomponents/SelectPosition.tsx
+++ b/lib/src/Components/Map/Subcomponents/SelectPosition.tsx
@@ -20,7 +20,7 @@ export const SelectPosition = ({
- {selectNewItemPosition && 'text' in selectNewItemPosition && (
+ {selectNewItemPosition && 'layer' in selectNewItemPosition && (
Select new position of {selectNewItemPosition.name} on the map!
diff --git a/lib/src/Components/Map/hooks/useSelectPosition.tsx b/lib/src/Components/Map/hooks/useSelectPosition.tsx
index 0b7a56ab..6868fb09 100644
--- a/lib/src/Components/Map/hooks/useSelectPosition.tsx
+++ b/lib/src/Components/Map/hooks/useSelectPosition.tsx
@@ -69,7 +69,7 @@ function useSelectPositionManager(): {
})
setSelectPosition(null)
}
- if ('text' in selectPosition) {
+ if ('layer' in selectPosition) {
// if selectPosition is an Item
const position =
mapClicked?.position.lng &&
@@ -101,9 +101,9 @@ function useSelectPositionManager(): {
success = true
} catch (error: unknown) {
if (error instanceof Error) {
- toast.update(toastId, { render: error.message, type: 'error' })
+ toast.update(toastId, { render: error.message, type: 'error', autoClose: 5000 })
} else if (typeof error === 'string') {
- toast.update(toastId, { render: error, type: 'error' })
+ toast.update(toastId, { render: error, type: 'error', autoClose: 5000 })
} else {
throw error
}
@@ -115,6 +115,7 @@ function useSelectPositionManager(): {
render: 'Item position updated',
type: 'success',
isLoading: false,
+ autoClose: 5000,
})
setSelectPosition(null)
setMarkerClicked(null)
@@ -125,6 +126,8 @@ function useSelectPositionManager(): {
render: "you don't have permission to add items to " + markerClicked?.name,
type: 'error',
isLoading: false,
+ autoClose: 5000,
+ closeButton: true,
})
}
}
@@ -140,16 +143,34 @@ function useSelectPositionManager(): {
success = true
} catch (error: unknown) {
if (error instanceof Error) {
- toast.update(toastId, { render: error.message, type: 'error', isLoading: false })
+ toast.update(toastId, {
+ render: error.message,
+ type: 'error',
+ isLoading: false,
+ autoClose: 5000,
+ closeButton: true,
+ })
} else if (typeof error === 'string') {
- toast.update(toastId, { render: error, type: 'error', isLoading: false })
+ toast.update(toastId, {
+ render: error,
+ type: 'error',
+ isLoading: false,
+ autoClose: 5000,
+ closeButton: true,
+ })
} else {
throw error
}
}
if (success) {
updateItem(updatedItem)
- toast.update(toastId, { render: 'Item position updated', type: 'success', isLoading: false })
+ toast.update(toastId, {
+ render: 'Item position updated',
+ type: 'success',
+ isLoading: false,
+ autoClose: 5000,
+ closeButton: true,
+ })
}
}
@@ -168,16 +189,34 @@ function useSelectPositionManager(): {
success = true
} catch (error: unknown) {
if (error instanceof Error) {
- toast.update(toastId, { render: error.message, type: 'error', isLoading: false })
+ toast.update(toastId, {
+ render: error.message,
+ type: 'error',
+ isLoading: false,
+ autoClose: 5000,
+ closeButton: true,
+ })
} else if (typeof error === 'string') {
- toast.update(toastId, { render: error, type: 'error', isLoading: false })
+ toast.update(toastId, {
+ render: error,
+ type: 'error',
+ isLoading: false,
+ autoClose: 5000,
+ closeButton: true,
+ })
} else {
throw error
}
}
if (success) {
updateItem({ ...markerClicked, relations: newRelations })
- toast.update(toastId, { render: 'Item linked', type: 'success', isLoading: false })
+ toast.update(toastId, {
+ render: 'Item linked',
+ type: 'success',
+ isLoading: false,
+ autoClose: 5000,
+ closeButton: true,
+ })
}
}
}
From 12aba6a67eda1277d99731a68a663f63253ff0c7 Mon Sep 17 00:00:00 2001
From: Anton Tranelis <31516529+antontranelis@users.noreply.github.com>
Date: Fri, 4 Jul 2025 08:36:11 +0200
Subject: [PATCH 6/7] fix(lib): fix labels (#278)
* fix labels
* more lables
* and the rest of the lables
* updated snapshots
* fix linting
---
lib/src/Components/Input/InputLabel.tsx | 9 +
lib/src/Components/Input/RichTextEditor.tsx | 10 +-
lib/src/Components/Input/TextAreaInput.tsx | 12 +-
lib/src/Components/Input/TextInput.tsx | 12 +-
.../__snapshots__/TextAreaInput.spec.tsx.snap | 5 +-
.../__snapshots__/TextInput.spec.tsx.snap | 5 +-
lib/src/Components/Input/index.tsx | 2 +
.../PopupStartEndInput.tsx | 4 -
.../Profile/Subcomponents/ContactInfoForm.tsx | 16 +-
.../Subcomponents/CrowdfundingForm.tsx | 9 +-
.../Profile/Subcomponents/GalleryForm.tsx | 11 +-
.../Subcomponents/GroupSubheaderForm.tsx | 15 +-
.../Profile/Subcomponents/ProfileTextForm.tsx | 14 +-
.../__snapshots__/GalleryForm.spec.tsx.snap | 408 ++++++++++--------
.../Components/Profile/Templates/TabsForm.tsx | 2 -
15 files changed, 268 insertions(+), 266 deletions(-)
create mode 100644 lib/src/Components/Input/InputLabel.tsx
diff --git a/lib/src/Components/Input/InputLabel.tsx b/lib/src/Components/Input/InputLabel.tsx
new file mode 100644
index 00000000..a8283b6b
--- /dev/null
+++ b/lib/src/Components/Input/InputLabel.tsx
@@ -0,0 +1,9 @@
+export const InputLabel = ({ label }: { label: string }) => {
+ return (
+
+ )
+}
diff --git a/lib/src/Components/Input/RichTextEditor.tsx b/lib/src/Components/Input/RichTextEditor.tsx
index 268cbe04..539ad28b 100644
--- a/lib/src/Components/Input/RichTextEditor.tsx
+++ b/lib/src/Components/Input/RichTextEditor.tsx
@@ -10,6 +10,7 @@ import { StarterKit } from '@tiptap/starter-kit'
import { useEffect } from 'react'
import { Markdown } from 'tiptap-markdown'
+import { InputLabel } from './InputLabel'
import { TextEditorMenu } from './TextEditorMenu'
interface RichTextEditorProps {
@@ -27,7 +28,6 @@ interface RichTextEditorProps {
*/
export function RichTextEditor({
labelTitle,
- labelStyle,
containerStyle,
defaultValue,
placeholder,
@@ -88,13 +88,7 @@ export function RichTextEditor({
- {labelTitle ? (
-
- ) : null}
+ {labelTitle ?
: null}
diff --git a/lib/src/Components/Input/TextAreaInput.tsx b/lib/src/Components/Input/TextAreaInput.tsx
index 2ab53264..6a880b84 100644
--- a/lib/src/Components/Input/TextAreaInput.tsx
+++ b/lib/src/Components/Input/TextAreaInput.tsx
@@ -1,8 +1,9 @@
import { useEffect, useRef, useState } from 'react'
+import { InputLabel } from './InputLabel'
+
interface TextAreaProps {
labelTitle?: string
- labelStyle?: string
containerStyle?: string
dataField?: string
inputStyle?: string
@@ -18,7 +19,6 @@ interface TextAreaProps {
export function TextAreaInput({
labelTitle,
dataField,
- labelStyle,
containerStyle,
inputStyle,
defaultValue,
@@ -43,13 +43,7 @@ export function TextAreaInput({
return (
- {labelTitle ? (
-
- ) : null}
+ {labelTitle ?
: null}