Use case invariant search in all filters

This commit is contained in:
Pieter Vander Vennet 2022-06-07 03:36:22 +02:00
parent ec1c206f84
commit 0a81dd7e10
7 changed files with 42 additions and 74 deletions

View file

@ -33,12 +33,11 @@
}, },
"calculatedTags": [ "calculatedTags": [
"_total_comments:=feat.get('comments').length", "_total_comments:=feat.get('comments').length",
"_first_comment:=feat.get('comments')[0].text.toLowerCase()", "_first_comment:=feat.get('comments')[0].text",
"_opened_by_anonymous_user:=feat.get('comments')[0].user === undefined", "_opened_by_anonymous_user:=feat.get('comments')[0].user === undefined",
"_first_user:=feat.get('comments')[0].user", "_first_user:=feat.get('comments')[0].user",
"_first_user_lc:=feat.get('comments')[0].user?.toLowerCase()", "_last_user:=(() => {const comms = feat.get('comments'); return comms[comms.length - 1].user})()",
"_first_user_id:=feat.get('comments')[0].uid", "_first_user_id:=feat.get('comments')[0].uid",
"_last_user_lc:=(() => {const comms = feat.get('comments'); return comms[comms.length - 1].user?.toLowerCase()})()",
"_is_import_note:=(() => {const lines = feat.properties['_first_comment'].split('\\n'); const matchesMapCompleteURL = lines.map(l => l.match(\".*https://mapcomplete.osm.be/\\([a-zA-Z_-]+\\)\\(.html\\).*#import\")); const matchedIndexes = matchesMapCompleteURL.map((doesMatch, i) => [doesMatch !== null, i]).filter(v => v[0]).map(v => v[1]); return matchedIndexes[0] })()" "_is_import_note:=(() => {const lines = feat.properties['_first_comment'].split('\\n'); const matchesMapCompleteURL = lines.map(l => l.match(\".*https://mapcomplete.osm.be/\\([a-zA-Z_-]+\\)\\(.html\\).*#import\")); const matchedIndexes = matchesMapCompleteURL.map((doesMatch, i) => [doesMatch !== null, i]).filter(v => v[0]).map(v => v[1]); return matchedIndexes[0] })()"
], ],
"titleIcons": [ "titleIcons": [
@ -123,7 +122,7 @@
"id": "search", "id": "search",
"options": [ "options": [
{ {
"osmTags": "_first_comment~.*{search}.*", "osmTags": "_first_comment~i~.*{search}.*",
"fields": [ "fields": [
{ {
"name": "search" "name": "search"
@ -141,7 +140,7 @@
"id": "not", "id": "not",
"options": [ "options": [
{ {
"osmTags": "_first_comment!~.*{search}.*", "osmTags": "_first_comment!~i~.*{search}.*",
"fields": [ "fields": [
{ {
"name": "search" "name": "search"
@ -159,7 +158,7 @@
"id": "opened_by", "id": "opened_by",
"options": [ "options": [
{ {
"osmTags": "_first_user_lc~.*{search}.*", "osmTags": "_first_user~i~.*{search}.*",
"fields": [ "fields": [
{ {
"name": "search" "name": "search"
@ -177,7 +176,7 @@
"id": "not_opened_by", "id": "not_opened_by",
"options": [ "options": [
{ {
"osmTags": "_first_user_lc!~.*{search}.*", "osmTags": "_first_user!~i~.*{search}.*",
"fields": [ "fields": [
{ {
"name": "search" "name": "search"
@ -195,7 +194,7 @@
"id": "edited_by", "id": "edited_by",
"options": [ "options": [
{ {
"osmTags": "_last_user_lc~.*{search}.*", "osmTags": "_last_user~i~.*{search}.*",
"fields": [ "fields": [
{ {
"name": "search" "name": "search"
@ -213,7 +212,7 @@
"id": "not_edited_by", "id": "not_edited_by",
"options": [ "options": [
{ {
"osmTags": "_last_user_lc!~.*{search}.*", "osmTags": "_last_user!~i~.*{search}.*",
"fields": [ "fields": [
{ {
"name": "search" "name": "search"

View file

@ -467,7 +467,7 @@
"options": [ "options": [
{ {
"question": "Kinderboeken aanwezig?", "question": "Kinderboeken aanwezig?",
"osmTags": "books~.*children.*" "osmTags": "books~i~.*children.*"
} }
] ]
}, },
@ -476,7 +476,7 @@
"options": [ "options": [
{ {
"question": "Boeken voor volwassenen aanwezig?", "question": "Boeken voor volwassenen aanwezig?",
"osmTags": "books~.*adults.*" "osmTags": "books~i~.*adults.*"
} }
] ]
}, },

View file

@ -432,7 +432,7 @@
"type": "string" "type": "string"
} }
], ],
"osmTags": "shop~^.*{search}.*$", "osmTags": "shop~i~.*{search}.*",
"question": { "question": {
"en": "Only show shops selling {search}", "en": "Only show shops selling {search}",
"de": "Nur Geschäfte, die {search} verkaufen", "de": "Nur Geschäfte, die {search} verkaufen",
@ -451,7 +451,7 @@
"type": "string" "type": "string"
} }
], ],
"osmTags": "name~^.*{search}.*$", "osmTags": "name~i~.*{search}.*",
"question": { "question": {
"en": "Only show shops with name {search}", "en": "Only show shops with name {search}",
"de": "Nur Geschäfte mit dem Namen {search} anzeigen", "de": "Nur Geschäfte mit dem Namen {search} anzeigen",

View file

@ -203,7 +203,7 @@
"nl": "Vuilnisbak voor sigarettenpeuken", "nl": "Vuilnisbak voor sigarettenpeuken",
"de": "Mülleimer für Zigaretten" "de": "Mülleimer für Zigaretten"
}, },
"osmTags": "waste~.*cigarettes.*" "osmTags": "waste~i~.*cigarettes.*"
}, },
{ {
"question": { "question": {
@ -211,7 +211,7 @@
"nl": "Vuilnisbak voor (vervallen) medicatie en drugs", "nl": "Vuilnisbak voor (vervallen) medicatie en drugs",
"de": "Mülleimer für Drogen" "de": "Mülleimer für Drogen"
}, },
"osmTags": "waste~.*drugs.*" "osmTags": "waste~i~.*drugs.*"
}, },
{ {
"question": { "question": {
@ -219,7 +219,7 @@
"nl": "Vuilnisbak voor hondenuitwerpselen", "nl": "Vuilnisbak voor hondenuitwerpselen",
"de": "Mülleimer für Hundekot" "de": "Mülleimer für Hundekot"
}, },
"osmTags": "waste~.*dog_excrement.*" "osmTags": "waste~i~.*dog_excrement.*"
}, },
{ {
"question": { "question": {
@ -227,7 +227,7 @@
"nl": "Vuilnisbak voor zwerfvuil", "nl": "Vuilnisbak voor zwerfvuil",
"de": "Mülleimer für allgemeinen Müll" "de": "Mülleimer für allgemeinen Müll"
}, },
"osmTags": "waste~.*trash.*" "osmTags": "waste~i~.*trash.*"
}, },
{ {
"question": { "question": {
@ -235,7 +235,7 @@
"nl": "Vuilnisbak voor injectienaalden en andere scherpe voorwerpen", "nl": "Vuilnisbak voor injectienaalden en andere scherpe voorwerpen",
"de": "Mülleimer für Nadeln und andere scharfe Gegenstände" "de": "Mülleimer für Nadeln und andere scharfe Gegenstände"
}, },
"osmTags": "waste~.*sharps.*" "osmTags": "waste~i~.*sharps.*"
}, },
{ {
"question": { "question": {
@ -243,7 +243,7 @@
"nl": "Vuilnisbak voor plastic", "nl": "Vuilnisbak voor plastic",
"de": "Mülleimer für Plastik" "de": "Mülleimer für Plastik"
}, },
"osmTags": "waste~.*plastic.*" "osmTags": "waste~i~.*plastic.*"
} }
] ]
}, },

View file

@ -128,7 +128,7 @@
"options": [ "options": [
{ {
"question": "Name contains 'alt'", "question": "Name contains 'alt'",
"osmTags": "name~.*[aA]lt.*" "osmTags": "name~i~.*alt.*"
} }
] ]
}, },
@ -137,7 +137,7 @@
"options": [ "options": [
{ {
"question": "Name contains 'wenslijn'", "question": "Name contains 'wenslijn'",
"osmTags": "name~.*[wW]enslijn.*" "osmTags": "name~i~.*wenslijn.*"
} }
] ]
}, },
@ -146,7 +146,7 @@
"options": [ "options": [
{ {
"question": "Name contains 'omleiding'", "question": "Name contains 'omleiding'",
"osmTags": "name~.*[oO]mleiding.*" "osmTags": "name~i~.*omleiding.*"
} }
] ]
}, },
@ -155,7 +155,7 @@
"options": [ "options": [
{ {
"question": "Reference contains 'alt'", "question": "Reference contains 'alt'",
"osmTags": "ref~.*[aA]lt.*" "osmTags": "ref~i~.*aAlt.*"
} }
] ]
}, },

View file

@ -1,21 +1,13 @@
{ {
"id": "mapcomplete-changes", "id": "mapcomplete-changes",
"title": { "title": {
"en": "Changes made with MapComplete", "en": "Changes made with MapComplete"
"de": "Änderungen mit MapComplete",
"es": "Cambios hechos con MapComplete",
"nb_NO": "Endringer utført med MapComplete"
}, },
"shortDescription": { "shortDescription": {
"en": "Shows changes made by MapComplete", "en": "Shows changes made by MapComplete"
"de": "Zeigt Änderungen von MapComplete",
"es": "Muestra los cambios hechos por MapComplete",
"nb_NO": "Vis endringer utført med MapComplete"
}, },
"description": { "description": {
"en": "This maps shows all the changes made with MapComplete", "en": "This maps shows all the changes made with MapComplete"
"de": "Diese Karte zeigt alle Änderungen die mit MapComplete gemacht wurden",
"es": "Este mapa muestra todos los cambios hechos con MapComplete"
}, },
"maintainer": "", "maintainer": "",
"icon": "./assets/svg/logo.svg", "icon": "./assets/svg/logo.svg",
@ -30,10 +22,7 @@
{ {
"id": "mapcomplete-changes", "id": "mapcomplete-changes",
"name": { "name": {
"en": "Changeset centers", "en": "Changeset centers"
"de": "Schwerpunkte von Änderungssätzen",
"es": "Centros de conjuntos de cambios",
"nb_NO": "Endringssettsenter"
}, },
"minzoom": 0, "minzoom": 0,
"source": { "source": {
@ -47,47 +36,35 @@
], ],
"title": { "title": {
"render": { "render": {
"en": "Changeset for {theme}", "en": "Changeset for {theme}"
"de": "Änderungen für {theme}",
"es": "Conjunto de cambios para {theme}",
"nb_NO": "Endringssett for {theme}"
} }
}, },
"description": { "description": {
"en": "Shows all MapComplete changes", "en": "Shows all MapComplete changes"
"de": "Zeigt alle MapComplete Änderungen",
"es": "Muestra todos los cambios de MapComplete"
}, },
"tagRenderings": [ "tagRenderings": [
{ {
"id": "render_id", "id": "render_id",
"render": { "render": {
"en": "Changeset <a href='https://openstreetmap.org/changeset/{id}' target='_blank'>{id}</a>", "en": "Changeset <a href='https://openstreetmap.org/changeset/{id}' target='_blank'>{id}</a>"
"de": "Änderung <a href='https://openstreetmap.org/changeset/{id}' target='_blank'>{id}</a>",
"es": "Conjunto de cambios <a href='https://openstreetmap.org/changeset/{id}' target='_blank'>{id}</a>",
"nb_NO": "Endringssett <a href='https://openstreetmap.org/changeset/{id}' target='_blank'>{id}</a>"
} }
}, },
{ {
"id": "contributor", "id": "contributor",
"render": { "render": {
"en": "Change made by <a href='https://openstreetmap.org/user/{_last_edit:contributor}' target='_blank'>{_last_edit:contributor}</a>", "en": "Change made by <a href='https://openstreetmap.org/user/{_last_edit:contributor}' target='_blank'>{_last_edit:contributor}</a>"
"de": "Änderung wurde von <a href='https://openstreetmap.org/user/{_last_edit:contributor}' target='_blank'>{_last_edit:contributor}</a> gemacht",
"es": "Cambio hecho por <a href='https://openstreetmap.org/user/{_last_edit:contributor}' target='_blank'>{_last_edit:contributor}</a>"
} }
}, },
{ {
"id": "theme", "id": "theme",
"render": { "render": {
"en": "Change with theme <a href='https://mapcomplete.osm.be/{theme}'>{theme}</a>", "en": "Change with theme <a href='https://mapcomplete.osm.be/{theme}'>{theme}</a>"
"de": "Änderung mit Thema <a href='https://mapcomplete.osm.be/{theme}'>{theme}</a>"
}, },
"mappings": [ "mappings": [
{ {
"if": "theme~http.*", "if": "theme~http.*",
"then": { "then": {
"en": "Change with <b>unofficial</b> theme <a href='https://mapcomplete.osm.be/theme.html?userlayout={theme}'>{theme}</a>", "en": "Change with <b>unofficial</b> theme <a href='https://mapcomplete.osm.be/theme.html?userlayout={theme}'>{theme}</a>"
"de": "Änderung mit <b>inoffiziellem</b> Thema <a href='https://mapcomplete.osm.be/theme.html?userlayout={theme}'>{theme}</a>"
} }
} }
] ]
@ -348,16 +325,14 @@
"id": "theme-search", "id": "theme-search",
"options": [ "options": [
{ {
"osmTags": "theme~.*{search}.*", "osmTags": "theme~i~.*{search}.*",
"fields": [ "fields": [
{ {
"name": "search" "name": "search"
} }
], ],
"question": { "question": {
"en": "Themename contains {search}", "en": "Themename contains {search}"
"de": "Themenname enthält {search}",
"nb_NO": "Temanavn inneholder {search}"
} }
} }
] ]
@ -366,16 +341,14 @@
"id": "created_by", "id": "created_by",
"options": [ "options": [
{ {
"osmTags": "_last_edit:contributor:lc~.*{search}.*", "osmTags": "_last_edit:contributor:lc~i~.*{search}.*",
"fields": [ "fields": [
{ {
"name": "search" "name": "search"
} }
], ],
"question": { "question": {
"en": "Made by contributor {search}", "en": "Made by contributor {search}"
"de": "Erstellt von {search}",
"es": "Hecho por contributor/a {search}"
} }
} }
] ]
@ -384,16 +357,14 @@
"id": "not_created_by", "id": "not_created_by",
"options": [ "options": [
{ {
"osmTags": "_last_edit:contributor:lc!~.*{search}.*", "osmTags": "_last_edit:contributor:lc!~i~.*{search}.*",
"fields": [ "fields": [
{ {
"name": "search" "name": "search"
} }
], ],
"question": { "question": {
"en": "<b>Not</b> made by contributor {search}", "en": "<b>Not</b> made by contributor {search}"
"de": "<b>Nicht</b> erstellt von {search}",
"es": "<b>No</b> hecho por contributor/a {search}"
} }
} }
] ]
@ -408,9 +379,7 @@
{ {
"id": "link_to_more", "id": "link_to_more",
"render": { "render": {
"en": "More statistics can be found <a href='https://github.com/pietervdvn/MapComplete/tree/develop/Docs/Tools/graphs' target='_blank'>here</a>", "en": "More statistics can be found <a href='https://github.com/pietervdvn/MapComplete/tree/develop/Docs/Tools/graphs' target='_blank'>here</a>"
"de": "Weitere Statistiken finden Sie <a href='https://github.com/pietervdvn/MapComplete/tree/develop/Docs/Tools/graphs' target='_blank'>hier</a>",
"es": "Se pueden encontrar más estadísticas <a href='https://github.com/pietervdvn/MapComplete/tree/develop/Docs/Tools/graphs' target='_blank'>aquí</a>"
} }
}, },
{ {

View file

@ -87,7 +87,7 @@
"id": "theme-search", "id": "theme-search",
"options": [ "options": [
{ {
"osmTags": "theme~.*{search}.*", "osmTags": "theme~i~.*{search}.*",
"fields": [ "fields": [
{ {
"name": "search" "name": "search"
@ -103,7 +103,7 @@
"id": "created_by", "id": "created_by",
"options": [ "options": [
{ {
"osmTags": "_last_edit:contributor:lc~.*{search}.*", "osmTags": "_last_edit:contributor:lc~i~.*{search}.*",
"fields": [ "fields": [
{ {
"name": "search" "name": "search"
@ -119,7 +119,7 @@
"id": "not_created_by", "id": "not_created_by",
"options": [ "options": [
{ {
"osmTags": "_last_edit:contributor:lc!~.*{search}.*", "osmTags": "_last_edit:contributor:lc!~i~.*{search}.*",
"fields": [ "fields": [
{ {
"name": "search" "name": "search"