forked from MapComplete/MapComplete
Fixes to contribution panel
This commit is contained in:
parent
6763c682ab
commit
f837d60756
3 changed files with 8 additions and 4 deletions
|
@ -32,7 +32,7 @@ export default class LayoutConfig {
|
||||||
};
|
};
|
||||||
|
|
||||||
public readonly hideFromOverview: boolean;
|
public readonly hideFromOverview: boolean;
|
||||||
public readonly lockLocation: boolean | [[number, number], [number, number]];
|
public lockLocation: boolean | [[number, number], [number, number]];
|
||||||
public readonly enableUserBadge: boolean;
|
public readonly enableUserBadge: boolean;
|
||||||
public readonly enableShareScreen: boolean;
|
public readonly enableShareScreen: boolean;
|
||||||
public readonly enableMoreQuests: boolean;
|
public readonly enableMoreQuests: boolean;
|
||||||
|
@ -174,7 +174,7 @@ export default class LayoutConfig {
|
||||||
if (json.hideInOverview) {
|
if (json.hideInOverview) {
|
||||||
throw "The json for " + this.id + " contains a 'hideInOverview'. Did you mean hideFromOverview instead?"
|
throw "The json for " + this.id + " contains a 'hideInOverview'. Did you mean hideFromOverview instead?"
|
||||||
}
|
}
|
||||||
this.lockLocation = json.lockLocation ?? false;
|
this.lockLocation = json.lockLocation ?? undefined;
|
||||||
this.enableUserBadge = json.enableUserBadge ?? true;
|
this.enableUserBadge = json.enableUserBadge ?? true;
|
||||||
this.enableShareScreen = json.enableShareScreen ?? true;
|
this.enableShareScreen = json.enableShareScreen ?? true;
|
||||||
this.enableMoreQuests = json.enableMoreQuests ?? true;
|
this.enableMoreQuests = json.enableMoreQuests ?? true;
|
||||||
|
|
|
@ -30,7 +30,7 @@ export default class AttributionPanel extends Combine {
|
||||||
"<br/>",
|
"<br/>",
|
||||||
|
|
||||||
new VariableUiElement(contributions.map(contributions => {
|
new VariableUiElement(contributions.map(contributions => {
|
||||||
const sorted = Array.from(contributions, ([name, value]) => ({name, value}));
|
const sorted = Array.from(contributions, ([name, value]) => ({name, value})).filter(x => x.name !== undefined && x.name !== "undefined");
|
||||||
if (sorted.length === 0) {
|
if (sorted.length === 0) {
|
||||||
return "";
|
return "";
|
||||||
}
|
}
|
||||||
|
@ -77,6 +77,10 @@ export default class AttributionPanel extends Combine {
|
||||||
let contribsStr = filtered.map(c => c.contributor)
|
let contribsStr = filtered.map(c => c.contributor)
|
||||||
.join(", ")
|
.join(", ")
|
||||||
|
|
||||||
|
if(contribsStr === ""){
|
||||||
|
// Hmm, something went wrong loading the contributors list. Lets show nothing
|
||||||
|
return undefined;
|
||||||
|
}
|
||||||
|
|
||||||
return Translations.t.general.attribution.codeContributionsBy.Subs({
|
return Translations.t.general.attribution.codeContributionsBy.Subs({
|
||||||
contributors: contribsStr,
|
contributors: contribsStr,
|
||||||
|
|
|
@ -39,7 +39,7 @@
|
||||||
"builtin": "play_forest",
|
"builtin": "play_forest",
|
||||||
"override": {
|
"override": {
|
||||||
"source": {
|
"source": {
|
||||||
"geoJson": "https://pietervdvn.github.io/speelplekken_cache/speelplekken_{z}_{x}_{y}.geojson",
|
"geoJson": "https://pietervdvn.github.io/speelplekken_cache/speelplekken_{layer}_{z}_{x}_{y}.geojson",
|
||||||
"geoJsonZoomLevel": 14,
|
"geoJsonZoomLevel": 14,
|
||||||
"isOsmCache": true
|
"isOsmCache": true
|
||||||
},
|
},
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue