Skip to content
Merged
Show file tree
Hide file tree
Changes from 12 commits
Commits
Show all changes
26 commits
Select commit Hold shift + click to select a range
5a18e2f
trying ideas
latin-panda Dec 17, 2025
dbc8036
experimenting
latin-panda Dec 18, 2025
de3570b
Merge branch 'main' of https://github.com/getodk/web-forms into add-s…
latin-panda Dec 23, 2025
835f4d6
merge
latin-panda Dec 23, 2025
0b9610c
Implementation engine and scenario
latin-panda Dec 23, 2025
9e75c40
Adds missing scenario utility
latin-panda Dec 23, 2025
5d5c87e
changeset
latin-panda Dec 23, 2025
05a6660
add test case in scenario
latin-panda Dec 23, 2025
883a086
adds geolocation service in client
latin-panda Dec 26, 2025
147c4be
only cache request if no empty
latin-panda Dec 26, 2025
eba3248
fixes xforms-value-changed
latin-panda Dec 26, 2025
91f6799
fixes lint
latin-panda Dec 26, 2025
32a9e7f
Merge branch 'main' of https://github.com/getodk/web-forms into add-s…
latin-panda Jan 13, 2026
6760c17
Fixes scenario tests
latin-panda Jan 13, 2026
15f1dc4
Feedback
latin-panda Jan 13, 2026
e6e25a5
Feedback - rename of function and exit early
latin-panda Jan 14, 2026
2710a6c
Removes cache for point, gets a new point for repeats and value change
latin-panda Jan 14, 2026
851631b
fixes CI
latin-panda Jan 14, 2026
c0dac71
resolves async before submit
latin-panda Jan 14, 2026
2a2c599
removes unnecessary type
latin-panda Jan 14, 2026
de7cdbe
prints error
latin-panda Jan 14, 2026
698360d
Merge branch 'main' of https://github.com/getodk/web-forms into add-s…
latin-panda Jan 22, 2026
8ef7f38
Feedback
latin-panda Jan 22, 2026
149bcf6
Feedback
latin-panda Jan 22, 2026
cb1da70
refactor geolocation service
latin-panda Jan 23, 2026
2283fdf
rename function
latin-panda Jan 26, 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
7 changes: 7 additions & 0 deletions .changeset/wet-seas-taste.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
---
'@getodk/xforms-engine': minor
'@getodk/web-forms': minor
'@getodk/scenario': patch
---

Adds support for setgeopoint
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ This section is auto generated. Please update `feature-matrix.json` and then run
<summary>

<!-- prettier-ignore -->
##### Question types (basic functionality)<br/>🟩🟩🟩🟩🟩🟩🟩🟩🟩🟩⬜⬜⬜⬜⬜ 67\%
##### Question types (basic functionality)<br/>🟩🟩🟩🟩🟩🟩🟩🟩🟩🟩⬜⬜⬜⬜⬜ 70\%

</summary>
<br/>
Expand All @@ -54,7 +54,7 @@ This section is auto generated. Please update `feature-matrix.json` and then run
| geopoint | ✅ |
| geotrace | ✅ |
| geoshape | ✅ |
| start-geopoint | |
| start-geopoint | |
| range | ✅ |
| image | ✅ |
| barcode | |
Expand Down
2 changes: 1 addition & 1 deletion feature-matrix.json
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
"geopoint": "✅",
"geotrace": "✅",
"geoshape": "✅",
"start-geopoint": "",
"start-geopoint": "",
"range": "✅",
"image": "✅",
"barcode": "",
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
<?xml version="1.0" encoding="utf-8"?>
<h:html xmlns="http://www.w3.org/2002/xforms" xmlns:h="http://www.w3.org/1999/xhtml" xmlns:ev="http://www.w3.org/2001/xml-events" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:jr="http://openrosa.org/javarosa" xmlns:odk="http://www.opendatakit.org/xforms">
<h:head>
<h:title>setgeopoint-action-new-repeat</h:title>
<model>
<instance>
<data id="setgeopoint-action-new-repeat">
<person jr:template="">
<age />
<location />
</person>
</data>
</instance>
<bind nodeset="/data/person/age" type="integer" />
<bind nodeset="/data/person/location" type="string" readonly="true()" />
</model>
</h:head>
<h:body>
<group ref="/data/person">
<label>Person Repeat Group</label>
<repeat nodeset="/data/person">
<input ref="/data/person/age">
<label>Age</label>
</input>

<odk:setgeopoint event="odk-new-repeat" ref="/data/person/location" />

<input ref="/data/person/location">
<label>Location (auto-captured and prefilled on new repeat instance)</label>
</input>
</repeat>
</group>
</h:body>
</h:html>
4 changes: 4 additions & 0 deletions packages/common/src/test/fixtures/xform-dsl/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -338,6 +338,10 @@ export const setvalue = (event: string, ref: string, value?: string): XFormsElem
return t(`setvalue event="${event}" ref="${ref}"${valueAttribute}`);
};

export const setgeopoint = (event: string, ref: string): XFormsElement => {
return t(`odk:setgeopoint event="${event}" ref="${ref}"`);
};

export const setvalueLiteral = (event: string, ref: string, innerHtml: string): XFormsElement => {
return t(`setvalue event="${event}" ref="${ref}"`, innerHtml);
};
Expand Down
3 changes: 3 additions & 0 deletions packages/scenario/src/client/init.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
import type { JRResourceService } from '@getodk/common/jr-resources/JRResourceService.ts';
import type {
FormResource,
GeolocationProvider,
InstanceAttachmentsConfig,
LoadFormOptions,
LoadFormSuccessResult,
Expand Down Expand Up @@ -29,6 +30,7 @@ export interface TestFormOptions {
readonly stateFactory: OpaqueReactiveObjectFactory;
readonly instanceAttachments: InstanceAttachmentsConfig;
readonly preloadProperties: PreloadProperties;
readonly geolocationProvider: GeolocationProvider;
}

const defaultConfig = {
Expand Down Expand Up @@ -65,6 +67,7 @@ export const initializeTestForm = async (
stateFactory: options.stateFactory,
instanceAttachments: options.instanceAttachments,
preloadProperties: options.preloadProperties,
geolocationProvider: options.geolocationProvider,
},
});
});
Expand Down
3 changes: 3 additions & 0 deletions packages/scenario/src/jr/Scenario.ts
Original file line number Diff line number Diff line change
Expand Up @@ -176,6 +176,9 @@ export class Scenario {
...overrideOptions?.instanceAttachments,
},
preloadProperties: overrideOptions?.preloadProperties ?? {},
geolocationProvider: overrideOptions?.geolocationProvider ?? {
getLocation: () => Promise.resolve(''),
},
};
}

Expand Down
Loading