Refactoring: fix metatagging

This commit is contained in:
Pieter Vander Vennet 2023-05-16 03:27:49 +02:00
parent 177697fe0a
commit 8fd3fbc0b7
34 changed files with 378 additions and 265 deletions

View file

@ -37,12 +37,12 @@
]
},
"calculatedTags": [
"_total_comments:=feat.get('comments').length",
"_first_comment:=feat.get('comments')[0].text",
"_opened_by_anonymous_user:=feat.get('comments')[0].user === undefined",
"_first_user:=feat.get('comments')[0].user",
"_last_user:=(() => {const comms = feat.get('comments'); return comms[comms.length - 1].user})()",
"_first_user_id:=feat.get('comments')[0].uid",
"_total_comments:=get(feat)('comments').length",
"_first_comment:=get(feat)('comments')[0].text",
"_opened_by_anonymous_user:=get(feat)('comments')[0].user === undefined",
"_first_user:=get(feat)('comments')[0].user",
"_last_user:=(() => {const comms = get(feat)('comments'); return comms[comms.length - 1].user})()",
"_first_user_id:=get(feat)('comments')[0].uid",
"_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": [
@ -341,4 +341,4 @@
]
}
]
}
}