Fixed reviews for named elements

This commit is contained in:
pietervdvn 2020-12-31 22:41:52 +01:00
parent e7dcd350fe
commit 287470acff
4 changed files with 14 additions and 7 deletions

View file

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

View file

@ -38,7 +38,7 @@ export class SubstitutedTranslation extends UIElement {
self.content = self.CreateContent();
self.Update();
});
}
InnerRender(): string {
@ -93,7 +93,7 @@ export class SubstitutedTranslation extends UIElement {
return [...partBefore, element, ...partAfter]
} catch (e) {
console.error(e);
return [...partBefore,new FixedUiElement(`Failed loading ${knownSpecial.funcName}(${matched[2]}): ${e}`) , ...partAfter]
return [...partBefore, new FixedUiElement(`Failed loading ${knownSpecial.funcName}(${matched[2]}): ${e}`), ...partAfter]
}
}
}
@ -163,10 +163,17 @@ export default class SpecialVisualizations {
{
funcName: "reviews",
docs: "Adds an overview of the mangrove-reviews of this object. IMPORTANT: the _name_ of the object should be defined for this to work!",
args: [{name:"subject", doc:"The identifier used for this value; by default the name of the reviewed object"}],
args: [{
name: "subject",
doc: "The identifier used for this value; by default the name of the reviewed object"
}],
constr: (tags, args) => {
const tgs = tags.data;
const subject = args[0] ?? tgs.name ?? "";
console.log("Args[0]", args[0])
const subject = tgs.name ?? "";
if (args[0] !== undefined && args[0] !== "") {
subject = args[0];
}
if (subject === "") {
return Translations.t.reviews.name_required;
}

View file

@ -20,7 +20,7 @@
"startZoom": 10,
"widenFactor": 0.05,
"socialImage": "",
"hideInoverview": true,
"hideFromOverview": true,
"layers": [
{
"id": "playgrounds",

View file

@ -86,7 +86,7 @@ function generateWikiEntry(layout: LayoutConfig){
auth=`Yes, by ${layout.maintainer};`
}
return `{{service_item
|name= [https://mapcomplete.osm.be/${layout.id}.html ${layout.id}]
|name= [https://mapcomplete.osm.be/${layout.id} ${layout.id}]
|region= Worldwide
|lang= ${languages}
|descr= A MapComplete theme: ${Translations.W(layout.description)