Fixed #100: allow multiple values in a single wikidata and wikimedia_commons tag

This commit is contained in:
Pieter Vander Vennet 2020-08-25 12:34:17 +02:00
parent 02d55dde66
commit b4f95e5408
4 changed files with 39 additions and 38 deletions

View file

@ -39,7 +39,8 @@ export class ImageSearcher extends UIEventSource<string[]> {
const self = this;
this._wdItem.addCallback(() => {
// Load the wikidata item, then detect usage on 'commons'
let wikidataId = self._wdItem.data;
let allWikidataId = self._wdItem.data.split(";");
for (let wikidataId of allWikidataId) {
// @ts-ignore
if (wikidataId.startsWith("Q")) {
wikidataId = wikidataId.substr(1);
@ -56,11 +57,13 @@ export class ImageSearcher extends UIEventSource<string[]> {
})
})
}
}
);
this._commons.addCallback(() => {
const commons: string = self._commons.data;
const allCommons: string[] = self._commons.data.split(";");
for (const commons of allCommons) {
// @ts-ignore
if (commons.startsWith("Category:")) {
Wikimedia.GetCategoryFiles(commons, (images: ImagesInCategory) => {
@ -76,6 +79,7 @@ export class ImageSearcher extends UIEventSource<string[]> {
self.AddImage(commons);
}
}
}
});

View file

@ -42,14 +42,15 @@ A typical user journey would be:
0. Oh, this is a cool map of _my specific interest_! There is a lot of data already...
* The user might discover the explanation about OSM in the dedicated tab page
* The user might discover the other themes in the other tab
* The user might share the map and/or embed it
* The user might discover the explanation about OSM in the second tab
* The user might share the map and/or embed it in the third tab
* The user might discover the other themes in the last tab
1. The user clicks that big tempting button 'login' in order to answer questions. The user makes an account - a big step.
1. The user clicks that big tempting button 'login' in order to answer questions - there's enough of these login buttons... The user creates an account.
2. The user answers a question! Hooray!
When at least one question is answered (aka: having one changeset on OSM), adding a new point is unlocked
2. The user answers a question! Hooray! The user transformed into a __contributor__ now.
* When at least one question is answered (aka: having one changeset on OSM), adding a new point is unlocked
3. The user adds a new POI somewhere

View file

@ -24,7 +24,7 @@ export class State {
// The singleton of the global state
public static state: State;
public static vNumber = "0.0.6b";
public static vNumber = "0.0.6c";
// The user journey states thresholds when a new feature gets unlocked
public static userJourney = {

View file

@ -58,10 +58,6 @@
"tagRenderings": [
{
"mappings": [
{
"if": "a=b",
"then": "xyz"
},
{
"if": "artwork_type=architecture",
"then": {