Skip to content
Open
Show file tree
Hide file tree
Changes from 1 commit
Commits
Show all changes
43 commits
Select commit Hold shift + click to select a range
3168052
feat: add device location height
jona159 Aug 18, 2026
474c18a
fix: dont allow to overwrite an existing height with null
jona159 Aug 19, 2026
0f3ab8f
feat: add helper for geojson position
jona159 Aug 19, 2026
c21cdb9
fix: expect precise value
jona159 Aug 19, 2026
0deee57
feat: change height input to height above ground with automatic terra…
jona159 Aug 19, 2026
20d4679
fix: rm elevation service
jona159 Aug 20, 2026
60aba2c
feat: update readme, env with open topo data config
jona159 Aug 20, 2026
8d83d43
feat: elevation types, calculate height above sea level
jona159 Aug 20, 2026
609faae
feat: add deviceLocationInputSchema. simplify
jona159 Aug 20, 2026
dc13e63
feat: reuse new schema
jona159 Aug 20, 2026
e24d7a6
feat: calculate height when creating new device
jona159 Aug 20, 2026
c2f0cd2
feat: add openapi schema
jona159 Aug 20, 2026
a63a125
feat: add elevation service and resource route
jona159 Aug 20, 2026
080c3c2
feat: use elevation hook
jona159 Aug 20, 2026
a6fd0bf
feat: calculate height in location step and show in summary
jona159 Aug 20, 2026
4209a36
feat: exchange schema
jona159 Aug 20, 2026
fdbb0e8
feat: adjust update device height
jona159 Aug 20, 2026
e73aba7
feat: calculate height when editing device
jona159 Aug 20, 2026
900e51b
format adjustments
jona159 Aug 20, 2026
48c1b7a
feat: translations
jona159 Aug 20, 2026
e8b1eb5
fix: test
jona159 Aug 20, 2026
b795ab4
Merge branch 'dev' into feat/device-location-height
jona159 Aug 21, 2026
8dffece
fix: apply finite check, translation key
jona159 Aug 21, 2026
4de143b
fix: clear previous result before debounce
jona159 Aug 21, 2026
9c8ad07
fix: rm unused
jona159 Aug 21, 2026
99d8fc2
feat: outsource schemas and validate submission
jona159 Aug 21, 2026
46d1e5d
fix: authenticate before parsing
jona159 Aug 21, 2026
bf522b8
feat: bounded queue
jona159 Aug 21, 2026
ffde7d3
feat: improve accessibility
jona159 Aug 21, 2026
a65e6d7
fix: mock elevation service in tests
jona159 Aug 21, 2026
34261de
feat: improve readability
jona159 Aug 21, 2026
ce75850
feat: add comment
jona159 Aug 21, 2026
586f543
fix: rm section from readme
jona159 Aug 21, 2026
7432dab
fix: type
jona159 Aug 21, 2026
80a9083
feat: add and reuse longitude and latitude schemas for openapi docs
jona159 Aug 25, 2026
ca905d8
feat: translate location error messages
jona159 Aug 25, 2026
cc43d93
fix: parse watched values through zod schema
jona159 Aug 25, 2026
2a84b64
fix: check location issues seperately to keep returning 422 for inval…
jona159 Aug 25, 2026
3d38277
feat: add height above sea level to device detail box
jona159 Aug 25, 2026
d605705
fix: reversed test coordinates
jona159 Aug 25, 2026
4cd67fa
Merge branch 'dev' into feat/device-location-height
jona159 Aug 25, 2026
32dde02
feat: add reusable HeightAboveSeaLevelSchema, reuse existing schemas
jona159 Aug 25, 2026
93eba6d
refactor: generic height schema, reuse iso date time schema
jona159 Aug 27, 2026
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
25 changes: 24 additions & 1 deletion app/components/device/new/location-info.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -136,7 +136,7 @@ export function LocationStep() {
</BaseMap>
</div>

<div className="bg-background flex w-full items-center justify-around p-4">
<div className="bg-background grid w-full gap-4 p-4 md:grid-cols-2 xl:grid-cols-3">
<div>
<Label htmlFor="latitude">{t('latitude')}</Label>
<Input
Expand Down Expand Up @@ -178,6 +178,29 @@ export function LocationStep() {
</p>
) : null}
</div>

<div>
<Label htmlFor="height">
{t('height')} ({t('optional')})
</Label>
<Input
id="height"
type="number"
step="any"
{...register('height')}
placeholder={t('enter height')}
aria-describedby="height-info height-error"
className="w-full rounded-md border p-2"
/>
<p id="height-info" className="text-muted-foreground mt-1 text-xs">
{t('height_info_text')}
</p>
{errors.height?.message ? (
<p id="height-error" className="mt-1 text-sm text-red-600">
{String(errors.height.message)}
</p>
) : null}
</div>
</div>
</div>
)
Expand Down
27 changes: 25 additions & 2 deletions app/components/device/new/new-device-stepper.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -180,6 +180,19 @@ export default function NewDeviceStepper() {
}
}

const onBack = () => {
const parsed = stepper.current.schema.safeParse(form.getValues())

if (parsed.success) {
setFormData((current) => ({
...current,
[stepper.current.id]: parsed.data,
}))
}

stepper.prev()
}

return (
<Stepper.Provider>
<FormProvider {...form}>
Expand All @@ -196,7 +209,17 @@ export default function NewDeviceStepper() {
<div className="flex gap-2" key={index}>
<BreadcrumbItem key={step.id}>
<BreadcrumbLink
onClick={() => stepper.goTo(step.id)}
onClick={() => {
if (stepper.current.id === step.id) return

void form.handleSubmit((data) => {
setFormData((current) => ({
...current,
[stepper.current.id]: data,
}))
stepper.goTo(step.id)
}, onError)()
}}
className={` ${
stepper.index === step.index
? 'text-foreground font-bold'
Expand Down Expand Up @@ -262,7 +285,7 @@ export default function NewDeviceStepper() {
<Button
type="button"
variant="secondary"
onClick={() => stepper.prev()}
onClick={onBack}
disabled={isFirst || isSubmitting}
>
{t('back')}
Expand Down
5 changes: 5 additions & 0 deletions app/components/device/new/summary-info.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,11 @@ export function SummaryInfo() {
label: 'longitude',
value: parseFloat(formData.longitude).toFixed(4),
},
...(formData.height !== undefined &&
formData.height !== null &&
formData.height !== ''
? [{ label: 'height', value: `${formData.height} m` }]
: []),
],
},
{
Expand Down
1 change: 1 addition & 0 deletions app/db/drizzle/0048_giant_carnage.sql
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
ALTER TABLE "device" ADD COLUMN "height" double precision;
Loading
Loading