mirror of
https://github.com/utopia-os/utopia-ui.git
synced 2025-12-13 07:46:10 +00:00
merged
This commit is contained in:
commit
fc5be43768
1672
package-lock.json
generated
1672
package-lock.json
generated
File diff suppressed because it is too large
Load Diff
@ -18,7 +18,8 @@
|
|||||||
"react": "^18.2.0",
|
"react": "^18.2.0",
|
||||||
"react-dom": "^18.2.0",
|
"react-dom": "^18.2.0",
|
||||||
"react-rnd": "^10.4.1",
|
"react-rnd": "^10.4.1",
|
||||||
"react-router-dom": "^6.23.0"
|
"react-router-dom": "^6.23.0",
|
||||||
|
"utopia-ui": "^3.0.0"
|
||||||
},
|
},
|
||||||
"devDependencies": {
|
"devDependencies": {
|
||||||
"@types/react": "^18.2.79",
|
"@types/react": "^18.2.79",
|
||||||
|
|||||||
11
src/App.tsx
11
src/App.tsx
@ -1,4 +1,4 @@
|
|||||||
import { AppShell, SideBar, Content, AuthProvider, Modal, LoginPage, SignupPage, Quests, RequestPasswordPage, SetNewPasswordPage, UserSettings, OverlayItemsIndexPage, ProfileView, ProfileForm, Permissions, Tags } from 'utopia-ui'
|
import { AppShell, SideBar, Content, AuthProvider, Modal, LoginPage, SignupPage, Quests, RequestPasswordPage, SetNewPasswordPage, UserSettings, OverlayItemsIndexPage, ProfileView, ProfileForm, Permissions, Tags, SelectUser, AttestationForm } from 'utopia-ui'
|
||||||
import { getBottomRoutes, routes } from './routes/sidebar'
|
import { getBottomRoutes, routes } from './routes/sidebar'
|
||||||
import { Route, Routes } from 'react-router-dom'
|
import { Route, Routes } from 'react-router-dom'
|
||||||
import MapContainer from "./pages/MapContainer"
|
import MapContainer from "./pages/MapContainer"
|
||||||
@ -22,6 +22,8 @@ function App() {
|
|||||||
const [tagsApi, setTagsApi] = useState<itemsApi<Tag>>();
|
const [tagsApi, setTagsApi] = useState<itemsApi<Tag>>();
|
||||||
const [mapApiInstance, setMapApiInstance] = useState<mapApi>();
|
const [mapApiInstance, setMapApiInstance] = useState<mapApi>();
|
||||||
const [layersApiInstance, setLayersApiInstance] = useState<layersApi>();
|
const [layersApiInstance, setLayersApiInstance] = useState<layersApi>();
|
||||||
|
const [attestationApi, setAttestationApi] = useState<itemsApi<any>>();
|
||||||
|
|
||||||
const [map, setMap] = useState<any>();
|
const [map, setMap] = useState<any>();
|
||||||
const [layers, setLayers] = useState<any>();
|
const [layers, setLayers] = useState<any>();
|
||||||
const [layerPageRoutes, setLayerPageRoutes] = useState<any>();
|
const [layerPageRoutes, setLayerPageRoutes] = useState<any>();
|
||||||
@ -31,6 +33,7 @@ function App() {
|
|||||||
useEffect(() => {
|
useEffect(() => {
|
||||||
setPermissionsApiInstance(new permissionsApi());
|
setPermissionsApiInstance(new permissionsApi());
|
||||||
setMapApiInstance(new mapApi(window.location.origin));
|
setMapApiInstance(new mapApi(window.location.origin));
|
||||||
|
setAttestationApi(new itemsApi<any>("attestations"));
|
||||||
}, [])
|
}, [])
|
||||||
|
|
||||||
useEffect(() => {
|
useEffect(() => {
|
||||||
@ -102,11 +105,13 @@ function App() {
|
|||||||
<Route path='signup' element={<SignupPage />} />
|
<Route path='signup' element={<SignupPage />} />
|
||||||
<Route path='reset-password' element={<RequestPasswordPage reset_url={map.url + "/set-new-password/"} />} />
|
<Route path='reset-password' element={<RequestPasswordPage reset_url={map.url + "/set-new-password/"} />} />
|
||||||
<Route path='set-new-password' element={<SetNewPasswordPage />} />
|
<Route path='set-new-password' element={<SetNewPasswordPage />} />
|
||||||
<Route path="item/*" element={<ProfileView userType={map.user_type.name} />} />
|
<Route path="item/*" element={<ProfileView attestationApi={attestationApi} userType={map.user_type.name} />} />
|
||||||
<Route path="edit-item/*" element={<ProfileForm userType={map.user_type.name} />} />
|
<Route path="edit-item/*" element={<ProfileForm userType={map.user_type.name}/>} />
|
||||||
<Route path="user-settings" element={<UserSettings />} />
|
<Route path="user-settings" element={<UserSettings />} />
|
||||||
<Route path="moon-calendar" element={<MoonCalendar />} />
|
<Route path="moon-calendar" element={<MoonCalendar />} />
|
||||||
<Route path="landingpage" element={<Landingpage />} />
|
<Route path="landingpage" element={<Landingpage />} />
|
||||||
|
<Route path="select-user" element={<SelectUser userType={map.user_type.name} />} />
|
||||||
|
<Route path="attestation-form" element={<AttestationForm api={attestationApi}/>} />
|
||||||
{
|
{
|
||||||
layers.map((l: any) =>
|
layers.map((l: any) =>
|
||||||
<Route key={l.id} path={l.name} element={<OverlayItemsIndexPage plusButton={l.index_plus_button} layerName={l.name} url={'/item/'} parameterField={'id'} />} />
|
<Route key={l.id} path={l.name} element={<OverlayItemsIndexPage plusButton={l.index_plus_button} layerName={l.name} url={'/item/'} parameterField={'id'} />} />
|
||||||
|
|||||||
@ -30,7 +30,7 @@ export class itemsApi<T> implements ItemsApi<T>{
|
|||||||
|
|
||||||
async getItems() {
|
async getItems() {
|
||||||
try {
|
try {
|
||||||
return await directusClient.request(readItems(this.collectionName as never, { fields: ['*', "relations.*", "user_created.*", {offers: ['*'], needs: ['*']}] , filter: this.filter, limit: -1 }));
|
return await directusClient.request(readItems(this.collectionName as never, { fields: ['*', 'to.*', "relations.*", "user_created.*", {offers: ['*'], needs: ['*']}] , filter: this.filter, limit: -1 }));
|
||||||
} catch (error: any) {
|
} catch (error: any) {
|
||||||
console.log(error);
|
console.log(error);
|
||||||
if (error.errors[0]?.message)
|
if (error.errors[0]?.message)
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user