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 {
@ -83,6 +83,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()){
return false;

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;
}

View file

@ -49,7 +49,7 @@ export class ConfirmDialog extends UIElement {
}
protected InnerRender(): string {
InnerRender(): string {
if (!this._source.data) {
return "";
}

View file

@ -104,7 +104,7 @@ export class FeatureInfoBox extends UIElement {
info.push(infobox);
} else if (infobox.IsQuestioning()) {
questions.push(infobox);
} else {
} else if(infobox.IsSkipped()){
// This question is neither known nor questioning -> it was skipped
skippedQuestions++;
}

View file

@ -127,6 +127,10 @@ export class ImageCarousel extends TagDependantUIElement {
return false;
}
IsSkipped(): boolean {
return false;
}
Priority(): number {
return 0;
}

View file

@ -66,6 +66,10 @@ class ImageCarouselWithUpload extends TagDependantUIElement {
return false;
}
IsSkipped(): boolean {
return false;
}
Priority(): number {
return 0;
}

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

Binary file not shown.

After

Width:  |  Height:  |  Size: 40 KiB

BIN
assets/logos/logo512.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 159 KiB

View file

@ -216,7 +216,8 @@ form {
}
#topleft-tools {
margin: 0.5em;
margin: 0.2em !important;
margin-top: 0.3em !important;;
}
#userbadge {

View file

@ -9,6 +9,7 @@
integrity="sha512-xwE/Az9zrjBIphAcBb3F6JVqxf46+CDLwfLMHloNu6KEQCAWi6HcDUbeOfBIptF7tcCzusKFjFw2yuvEpDL9wQ=="
crossorigin=""/>
<link rel="stylesheet" href="./index.css"/>
<link rel="manifest" href="./manifest.webmanifest">
<!--
<meta property="og:image" content="https://buurtnatuur.be/assets/BuurtnatuurFront.jpg">

View file

@ -53,7 +53,7 @@ if (location.hostname === "localhost" || location.hostname === "127.0.0.1") {
// ----------------- 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

View file

@ -1,2 +0,0 @@
{
}

25
manifest.webmanifest Normal file
View 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"
}
]
}