Fix skipped question count
This commit is contained in:
parent
3efcc4d456
commit
a39d21a5a9
16 changed files with 3365 additions and 11 deletions
|
@ -17,7 +17,6 @@ export class AllKnownLayouts {
|
||||||
public static allSets = AllKnownLayouts.AllLayouts();
|
public static allSets = AllKnownLayouts.AllLayouts();
|
||||||
|
|
||||||
private static AllLayouts(): Map<string, Layout> {
|
private static AllLayouts(): Map<string, Layout> {
|
||||||
const all = new All();
|
|
||||||
const layouts: Layout[] = [
|
const layouts: Layout[] = [
|
||||||
new Groen(),
|
new Groen(),
|
||||||
new GRB(),
|
new GRB(),
|
||||||
|
@ -27,15 +26,26 @@ export class AllKnownLayouts {
|
||||||
new MetaMap(),
|
new MetaMap(),
|
||||||
new StreetWidth(),
|
new StreetWidth(),
|
||||||
new Natuurpunt(),
|
new Natuurpunt(),
|
||||||
all
|
|
||||||
/*new Toilets(),
|
/*new Toilets(),
|
||||||
new Statues(),
|
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();
|
const allSets: Map<string, Layout> = new Map();
|
||||||
for (const layout of layouts) {
|
for (const layout of layouts) {
|
||||||
allSets[layout.name] = layout;
|
allSets[layout.name] = layout;
|
||||||
all.layers = all.layers.concat(layout.layers);
|
|
||||||
}
|
}
|
||||||
return allSets;
|
return allSets;
|
||||||
}
|
}
|
||||||
|
|
|
@ -64,7 +64,7 @@ class OnlyShowIf extends UIElement implements TagDependantUIElement {
|
||||||
return this._filter.matches(TagUtils.proprtiesToKV(this._source.data));
|
return this._filter.matches(TagUtils.proprtiesToKV(this._source.data));
|
||||||
}
|
}
|
||||||
|
|
||||||
protected InnerRender(): string {
|
InnerRender(): string {
|
||||||
if (this.Matches()) {
|
if (this.Matches()) {
|
||||||
return this._embedded.Render();
|
return this._embedded.Render();
|
||||||
} else {
|
} else {
|
||||||
|
@ -82,6 +82,13 @@ class OnlyShowIf extends UIElement implements TagDependantUIElement {
|
||||||
}
|
}
|
||||||
return this._embedded.IsKnown();
|
return this._embedded.IsKnown();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
IsSkipped(): boolean {
|
||||||
|
if(!this.Matches()){
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
return this._embedded.IsSkipped();
|
||||||
|
}
|
||||||
|
|
||||||
IsQuestioning(): boolean {
|
IsQuestioning(): boolean {
|
||||||
if(!this.Matches()){
|
if(!this.Matches()){
|
||||||
|
|
|
@ -15,7 +15,6 @@ import {FixedInputElement} from "../UI/Input/FixedInputElement";
|
||||||
import {RadioButton} from "../UI/Input/RadioButton";
|
import {RadioButton} from "../UI/Input/RadioButton";
|
||||||
import Translations from "../UI/i18n/Translations";
|
import Translations from "../UI/i18n/Translations";
|
||||||
import Locale from "../UI/i18n/Locale";
|
import Locale from "../UI/i18n/Locale";
|
||||||
import {FloatField, IntField, StringField} from "../UI/Input/PhoneField";
|
|
||||||
|
|
||||||
export class TagRenderingOptions implements TagDependantUIElementConstructor {
|
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;
|
return this._freeform !== undefined && this._source.data[this._freeform.key] !== undefined;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
IsSkipped(): boolean {
|
||||||
|
return this._questionSkipped.data;
|
||||||
|
}
|
||||||
|
|
||||||
private CurrentValue(): TagsFilter {
|
private CurrentValue(): TagsFilter {
|
||||||
const tags = TagUtils.proprtiesToKV(this._source.data);
|
const tags = TagUtils.proprtiesToKV(this._source.data);
|
||||||
|
|
||||||
|
|
|
@ -19,4 +19,5 @@ export abstract class TagDependantUIElement extends UIElement {
|
||||||
|
|
||||||
abstract Priority() : number;
|
abstract Priority() : number;
|
||||||
|
|
||||||
|
abstract IsSkipped() : boolean;
|
||||||
}
|
}
|
|
@ -49,7 +49,7 @@ export class ConfirmDialog extends UIElement {
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
protected InnerRender(): string {
|
InnerRender(): string {
|
||||||
if (!this._source.data) {
|
if (!this._source.data) {
|
||||||
return "";
|
return "";
|
||||||
}
|
}
|
||||||
|
|
|
@ -104,7 +104,7 @@ export class FeatureInfoBox extends UIElement {
|
||||||
info.push(infobox);
|
info.push(infobox);
|
||||||
} else if (infobox.IsQuestioning()) {
|
} else if (infobox.IsQuestioning()) {
|
||||||
questions.push(infobox);
|
questions.push(infobox);
|
||||||
} else {
|
} else if(infobox.IsSkipped()){
|
||||||
// This question is neither known nor questioning -> it was skipped
|
// This question is neither known nor questioning -> it was skipped
|
||||||
skippedQuestions++;
|
skippedQuestions++;
|
||||||
}
|
}
|
||||||
|
|
|
@ -126,6 +126,10 @@ export class ImageCarousel extends TagDependantUIElement {
|
||||||
IsQuestioning(): boolean {
|
IsQuestioning(): boolean {
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
IsSkipped(): boolean {
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
Priority(): number {
|
Priority(): number {
|
||||||
return 0;
|
return 0;
|
||||||
|
|
|
@ -65,6 +65,10 @@ class ImageCarouselWithUpload extends TagDependantUIElement {
|
||||||
IsQuestioning(): boolean {
|
IsQuestioning(): boolean {
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
IsSkipped(): boolean {
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
Priority(): number {
|
Priority(): number {
|
||||||
return 0;
|
return 0;
|
||||||
|
|
3300
assets/logos/logo.svg
Normal file
3300
assets/logos/logo.svg
Normal file
File diff suppressed because one or more lines are too long
After Width: | Height: | Size: 162 KiB |
BIN
assets/logos/logo192.png
Normal file
BIN
assets/logos/logo192.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 40 KiB |
BIN
assets/logos/logo512.png
Normal file
BIN
assets/logos/logo512.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 159 KiB |
|
@ -216,7 +216,8 @@ form {
|
||||||
}
|
}
|
||||||
|
|
||||||
#topleft-tools {
|
#topleft-tools {
|
||||||
margin: 0.5em;
|
margin: 0.2em !important;
|
||||||
|
margin-top: 0.3em !important;;
|
||||||
}
|
}
|
||||||
|
|
||||||
#userbadge {
|
#userbadge {
|
||||||
|
|
|
@ -9,6 +9,7 @@
|
||||||
integrity="sha512-xwE/Az9zrjBIphAcBb3F6JVqxf46+CDLwfLMHloNu6KEQCAWi6HcDUbeOfBIptF7tcCzusKFjFw2yuvEpDL9wQ=="
|
integrity="sha512-xwE/Az9zrjBIphAcBb3F6JVqxf46+CDLwfLMHloNu6KEQCAWi6HcDUbeOfBIptF7tcCzusKFjFw2yuvEpDL9wQ=="
|
||||||
crossorigin=""/>
|
crossorigin=""/>
|
||||||
<link rel="stylesheet" href="./index.css"/>
|
<link rel="stylesheet" href="./index.css"/>
|
||||||
|
<link rel="manifest" href="./manifest.webmanifest">
|
||||||
|
|
||||||
<!--
|
<!--
|
||||||
<meta property="og:image" content="https://buurtnatuur.be/assets/BuurtnatuurFront.jpg">
|
<meta property="og:image" content="https://buurtnatuur.be/assets/BuurtnatuurFront.jpg">
|
||||||
|
|
2
index.ts
2
index.ts
|
@ -53,7 +53,7 @@ if (location.hostname === "localhost" || location.hostname === "127.0.0.1") {
|
||||||
|
|
||||||
// ----------------- SELECT THE RIGHT QUESTSET -----------------
|
// ----------------- SELECT THE RIGHT QUESTSET -----------------
|
||||||
|
|
||||||
let defaultLayout = "walkbybrussels"
|
let defaultLayout = "all"
|
||||||
|
|
||||||
|
|
||||||
// Run over all questsets. If a part of the URL matches a searched-for part in the layout, it'll take that as the default
|
// Run over all questsets. If a part of the URL matches a searched-for part in the layout, it'll take that as the default
|
||||||
|
|
|
@ -1,2 +0,0 @@
|
||||||
{
|
|
||||||
}
|
|
25
manifest.webmanifest
Normal file
25
manifest.webmanifest
Normal file
|
@ -0,0 +1,25 @@
|
||||||
|
{
|
||||||
|
"name": "MapComplete",
|
||||||
|
"short_name": "MapComplete",
|
||||||
|
"start_url": ".",
|
||||||
|
"display": "standalone",
|
||||||
|
"background_color": "#fff",
|
||||||
|
"description": "Easily edit OpenStreetMap",
|
||||||
|
"icons": [
|
||||||
|
{
|
||||||
|
"src": "assets/logos/logo192.png",
|
||||||
|
"sizes": "192x192",
|
||||||
|
"type": "image/png"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"src": "assets/logos/logo512.png",
|
||||||
|
"sizes": "512x512",
|
||||||
|
"type": "image/png"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"src": "assets/logos/logo.svg",
|
||||||
|
"sizes": "513x513",
|
||||||
|
"type": "image/svg"
|
||||||
|
}
|
||||||
|
]
|
||||||
|
}
|
Loading…
Reference in a new issue