Let roaming tagrenderings appear together with the questions

This commit is contained in:
Pieter Vander Vennet 2021-03-15 16:23:04 +01:00
parent 2177f7ac3b
commit bad2248658
3 changed files with 19 additions and 7 deletions

View file

@ -176,7 +176,15 @@ export default class LayerConfig {
iconOverlays: { "if": TagsFilter, then: TagRenderingConfig, badge: boolean }[] iconOverlays: { "if": TagsFilter, then: TagRenderingConfig, badge: boolean }[]
}): LayerConfig { }): LayerConfig {
this.tagRenderings.push(...addAll.tagRenderings);
let insertionPoint = this.tagRenderings.map(tr => tr.IsQuestionBoxElement()).indexOf(true)
if (insertionPoint < 0) {
// No 'questions' defined - we just add them all to the end
insertionPoint = this.tagRenderings.length;
}
this.tagRenderings.splice(insertionPoint, 0, ...addAll.tagRenderings);
this.iconOverlays.push(...addAll.iconOverlays); this.iconOverlays.push(...addAll.iconOverlays);
for (const icon of addAll.titleIcons) { for (const icon of addAll.titleIcons) {
this.titleIcons.splice(0, 0, icon); this.titleIcons.splice(0, 0, icon);

View file

@ -218,6 +218,10 @@ export default class TagRenderingConfig {
return false; return false;
} }
public IsQuestionBoxElement(): boolean{
return this.question === null && this.condition === null;
}
/** /**
* Gets the correct rendering value (or undefined if not known) * Gets the correct rendering value (or undefined if not known)
* @constructor * @constructor

View file

@ -2,7 +2,7 @@ import { Utils } from "../Utils";
export default class Constants { export default class Constants {
public static vNumber = "0.5.11"; public static vNumber = "0.5.12";
// The user journey states thresholds when a new feature gets unlocked // The user journey states thresholds when a new feature gets unlocked
public static userJourney = { public static userJourney = {