Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
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
5 changes: 5 additions & 0 deletions .changeset/calm-walls-wave.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
'@getodk/web-forms': patch
---

Fixes load submission data in maps
2 changes: 1 addition & 1 deletion packages/web-forms/src/components/common/map/AsyncMap.vue
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ interface AsyncMapProps {
disabled: boolean;
singleFeatureType?: SingleFeatureType;
mode: Mode;
savedFeatureValue: string | undefined;
savedFeatureValue: SelectItem | string | undefined;
}

const props = defineProps<AsyncMapProps>();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -124,7 +124,7 @@ const normalizeODKFeature = (odkFeature: SelectItem | string) => {
};

export const createFeatureCollectionAndProps = (
odkFeatures: readonly SelectItem[] | readonly string[] | undefined
odkFeatures: ReadonlyArray<SelectItem | string> | undefined
) => {
const orderedExtraPropsMap = new Map<string, Array<[key: string, value: string]>>();
const features: Feature[] = [];
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,9 +24,9 @@ const savedFeatureValue = computed(() => {
if (!props.question.appearances.map) {
return '';
}

const value = props.question.currentState.value?.[0];
const item = props.question.currentState.valueOptions.find((option) => option.value === value);
return item?.properties.find(([key = '']) => key === 'geometry')?.[1] ?? '';
return props.question.currentState.valueOptions.find((option) => option.value === value);
});

watchEffect(() => {
Expand Down