Fix skipped question count

This commit is contained in:
Pieter Vander Vennet 2020-07-25 01:07:02 +02:00
parent 3efcc4d456
commit a39d21a5a9
16 changed files with 3365 additions and 11 deletions

View file

@ -17,7 +17,6 @@ export class AllKnownLayouts {
public static allSets = AllKnownLayouts.AllLayouts();
private static AllLayouts(): Map<string, Layout> {
const all = new All();
const layouts: Layout[] = [
new Groen(),
new GRB(),
@ -27,15 +26,26 @@ export class AllKnownLayouts {
new MetaMap(),
new StreetWidth(),
new Natuurpunt(),
all
/*new Toilets(),
new Statues(),
*/
];
const all = new All();
for (const layout of layouts) {
for (const layer of layout.layers) {
if (all.layers.indexOf(layer) >= 0) {
continue;
}
all.layers.push(layer);
}
}
layouts.push(all)
const allSets: Map<string, Layout> = new Map();
for (const layout of layouts) {
allSets[layout.name] = layout;
all.layers = all.layers.concat(layout.layers);
}
return allSets;
}

View file

@ -64,7 +64,7 @@ class OnlyShowIf extends UIElement implements TagDependantUIElement {
return this._filter.matches(TagUtils.proprtiesToKV(this._source.data));
}
protected InnerRender(): string {
InnerRender(): string {
if (this.Matches()) {
return this._embedded.Render();
} else {
@ -82,6 +82,13 @@ class OnlyShowIf extends UIElement implements TagDependantUIElement {
}
return this._embedded.IsKnown();
}
IsSkipped(): boolean {
if(!this.Matches()){
return false;
}
return this._embedded.IsSkipped();
}
IsQuestioning(): boolean {
if(!this.Matches()){

View file

@ -15,7 +15,6 @@ import {FixedInputElement} from "../UI/Input/FixedInputElement";
import {RadioButton} from "../UI/Input/RadioButton";
import Translations from "../UI/i18n/Translations";
import Locale from "../UI/i18n/Locale";
import {FloatField, IntField, StringField} from "../UI/Input/PhoneField";
export class TagRenderingOptions implements TagDependantUIElementConstructor {
@ -402,6 +401,10 @@ class TagRendering extends UIElement implements TagDependantUIElement {
return this._freeform !== undefined && this._source.data[this._freeform.key] !== undefined;
}
IsSkipped(): boolean {
return this._questionSkipped.data;
}
private CurrentValue(): TagsFilter {
const tags = TagUtils.proprtiesToKV(this._source.data);

View file

@ -19,4 +19,5 @@ export abstract class TagDependantUIElement extends UIElement {
abstract Priority() : number;
abstract IsSkipped() : boolean;
}