Fix various bugs; improve UK-addresses theme

This commit is contained in:
Pieter Vander Vennet 2022-01-17 21:33:03 +01:00
parent e20cf0abfa
commit 8ca9e4f36c
20 changed files with 357 additions and 164 deletions

View file

@ -23,8 +23,8 @@ export default class EditableTagRendering extends Toggle {
) {
// The tagrendering is hidden if:
// The answer is unknown. The questionbox will then show the question
// There is a condition hiding the answer
// - The answer is unknown. The questionbox will then show the question
// - There is a condition hiding the answer
const renderingIsShown = tags.map(tags =>
configuration.IsKnown(tags) &&
(configuration?.condition?.matchesProperties(tags) ?? true))

View file

@ -216,7 +216,7 @@ export default class FeatureInfoBox extends ScrollableFullScreen {
/**
* Returns true if this tag rendering has a minimap in some language.
* Note: this might be hidden by conditions
* Note: this minimap can be hidden by conditions
*/
private static hasMinimap(renderingConfig: TagRenderingConfig): boolean {
const translations: Translation[] = Utils.NoNull([renderingConfig.render, ...(renderingConfig.mappings ?? []).map(m => m.then)]);

View file

@ -68,10 +68,11 @@ export default class QuestionBox extends VariableUiElement {
if (tagRendering.IsKnown(tags)) {
continue;
}
if (tagRendering.condition &&
!tagRendering.condition.matchesProperties(tags)) {
// Filtered away by the condition, so it is kindof known
continue;
if (tagRendering.condition) {
if (!tagRendering.condition.matchesProperties(tags)) {
// Filtered away by the condition, so it is kindof known
continue;
}
}
// this value is NOT known - this is the question we have to show!
@ -79,7 +80,7 @@ export default class QuestionBox extends VariableUiElement {
}
return undefined; // The questions are depleted
}, [skippedQuestions]);
const questionsToAsk: UIEventSource<BaseUIElement[]> = tagsSource.map(tags => {
if (tags === undefined) {
return [];