forked from MapComplete/MapComplete
Tweaks to question box
This commit is contained in:
parent
cce14564dc
commit
64532d1faf
7 changed files with 97 additions and 18 deletions
|
@ -620,6 +620,10 @@ export default class TagRenderingConfig {
|
|||
singleSelectedMapping: number,
|
||||
multiSelectedMapping: boolean[] | undefined
|
||||
): UploadableTag {
|
||||
freeformValue = freeformValue?.trim()
|
||||
if (freeformValue === "") {
|
||||
freeformValue = undefined
|
||||
}
|
||||
if (
|
||||
freeformValue === undefined &&
|
||||
singleSelectedMapping === undefined &&
|
||||
|
@ -627,6 +631,7 @@ export default class TagRenderingConfig {
|
|||
) {
|
||||
return undefined
|
||||
}
|
||||
|
||||
if (this.mappings === undefined && freeformValue === undefined) {
|
||||
return undefined
|
||||
}
|
||||
|
@ -663,7 +668,13 @@ export default class TagRenderingConfig {
|
|||
}
|
||||
return TagUtils.FlattenMultiAnswer([...selectedMappings, ...unselectedMappings])
|
||||
} else {
|
||||
if (singleSelectedMapping === undefined) {
|
||||
return undefined
|
||||
}
|
||||
if (singleSelectedMapping === this.mappings.length) {
|
||||
if (freeformValue === undefined) {
|
||||
return undefined
|
||||
}
|
||||
return new And([
|
||||
new Tag(this.freeform.key, freeformValue),
|
||||
...(this.freeform.addExtraTags ?? []),
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue