mirror of
https://github.com/utopia-os/utopia-ui.git
synced 2026-04-06 01:25:33 +00:00
Merge branch 'main' into test-text-area-input
This commit is contained in:
commit
bf7ab08772
@ -40,6 +40,7 @@ export default [
|
|||||||
}),
|
}),
|
||||||
typescript({
|
typescript({
|
||||||
tsconfig: './tsconfig.json',
|
tsconfig: './tsconfig.json',
|
||||||
|
noEmitOnError: true,
|
||||||
}),
|
}),
|
||||||
svg({ base64: true }),
|
svg({ base64: true }),
|
||||||
],
|
],
|
||||||
|
|||||||
@ -53,6 +53,13 @@ export function ItemFormPopup(props: ItemFormPopupProps) {
|
|||||||
})
|
})
|
||||||
formItem.position = { type: 'Point', coordinates: [props.position.lng, props.position.lat] }
|
formItem.position = { type: 'Point', coordinates: [props.position.lng, props.position.lat] }
|
||||||
evt.preventDefault()
|
evt.preventDefault()
|
||||||
|
|
||||||
|
const name = formItem.name ? formItem.name : user?.first_name
|
||||||
|
if (!name) {
|
||||||
|
toast.error('Name is must be defined')
|
||||||
|
return
|
||||||
|
}
|
||||||
|
|
||||||
setSpinner(true)
|
setSpinner(true)
|
||||||
|
|
||||||
formItem.text &&
|
formItem.text &&
|
||||||
@ -98,8 +105,8 @@ export function ItemFormPopup(props: ItemFormPopupProps) {
|
|||||||
;(!props.layer.userProfileLayer || !item) &&
|
;(!props.layer.userProfileLayer || !item) &&
|
||||||
(await props.layer.api?.createItem!({
|
(await props.layer.api?.createItem!({
|
||||||
...formItem,
|
...formItem,
|
||||||
|
name,
|
||||||
id: uuid,
|
id: uuid,
|
||||||
name: formItem.name ? formItem.name : user?.first_name,
|
|
||||||
}))
|
}))
|
||||||
success = true
|
success = true
|
||||||
// eslint-disable-next-line no-catch-all/no-catch-all
|
// eslint-disable-next-line no-catch-all/no-catch-all
|
||||||
|
|||||||
@ -82,7 +82,6 @@ function useItemsManager(initialItems: Item[]): {
|
|||||||
},
|
},
|
||||||
})
|
})
|
||||||
result.map((item) => {
|
result.map((item) => {
|
||||||
// eslint-disable-next-line @typescript-eslint/no-unsafe-assignment
|
|
||||||
dispatch({ type: 'ADD', item: { ...item, layer } })
|
dispatch({ type: 'ADD', item: { ...item, layer } })
|
||||||
return null
|
return null
|
||||||
})
|
})
|
||||||
|
|||||||
3
src/types/LayerProps.d.ts
vendored
3
src/types/LayerProps.d.ts
vendored
@ -18,8 +18,7 @@ export interface LayerProps {
|
|||||||
markerShape: string
|
markerShape: string
|
||||||
markerDefaultColor: string
|
markerDefaultColor: string
|
||||||
markerDefaultColor2?: string
|
markerDefaultColor2?: string
|
||||||
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
api?: ItemsApi<Item>
|
||||||
api?: ItemsApi<any>
|
|
||||||
itemType: ItemType
|
itemType: ItemType
|
||||||
userProfileLayer?: boolean
|
userProfileLayer?: boolean
|
||||||
customEditLink?: string
|
customEditLink?: string
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user