Add feature switches to layouts, add option to remove a layout from more-screen
This commit is contained in:
parent
21dd38c3c7
commit
7882747424
7 changed files with 19 additions and 8 deletions
|
@ -31,6 +31,13 @@ export class Layout {
|
||||||
public startLat: number;
|
public startLat: number;
|
||||||
|
|
||||||
public locationContains: string[];
|
public locationContains: string[];
|
||||||
|
|
||||||
|
public enableAdd: boolean = true;
|
||||||
|
public enableUserBadge: boolean = true;
|
||||||
|
public enableSearch: boolean = true;
|
||||||
|
public enableLayers: boolean = true;
|
||||||
|
|
||||||
|
public hideFromOverview : boolean = false;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
*
|
*
|
||||||
|
|
|
@ -15,5 +15,6 @@ export class All extends Layout{
|
||||||
"Please log in",
|
"Please log in",
|
||||||
""
|
""
|
||||||
);
|
);
|
||||||
|
this.hideFromOverview = true;
|
||||||
}
|
}
|
||||||
}
|
}
|
|
@ -18,5 +18,6 @@ export class GRB extends Layout {
|
||||||
|
|
||||||
,
|
,
|
||||||
"", "");
|
"", "");
|
||||||
|
this.hideFromOverview = true;
|
||||||
}
|
}
|
||||||
}
|
}
|
|
@ -87,6 +87,10 @@ export class StreetWidth extends Layout{
|
||||||
"<li>Voorzie in elke straat enkele parkeerplaatsen voor kortparkeren. Zo kunnen leveringen, iemand afzetten,... gebeuren zonder dat er een fietspad of een straat geblokkeerd wordt</li>" +
|
"<li>Voorzie in elke straat enkele parkeerplaatsen voor kortparkeren. Zo kunnen leveringen, iemand afzetten,... gebeuren zonder dat er een fietspad of een straat geblokkeerd wordt</li>" +
|
||||||
"</ul>");
|
"</ul>");
|
||||||
this.icon = "assets/bug.svg";
|
this.icon = "assets/bug.svg";
|
||||||
|
this.enableSearch = false;
|
||||||
|
this.enableUserBadge = false;
|
||||||
|
this.enableAdd = false;
|
||||||
|
this.hideFromOverview = true;
|
||||||
|
|
||||||
}
|
}
|
||||||
}
|
}
|
|
@ -69,6 +69,7 @@ export class InitUiElements {
|
||||||
new FixedUiElement(`<div class='collapse-button-img' class="shadow"><img src='assets/help.svg' alt='help'></div>`).onClick(() => {
|
new FixedUiElement(`<div class='collapse-button-img' class="shadow"><img src='assets/help.svg' alt='help'></div>`).onClick(() => {
|
||||||
fullScreenMessage.setData(fullOptions2)
|
fullScreenMessage.setData(fullOptions2)
|
||||||
}).AttachTo("help-button-mobile");
|
}).AttachTo("help-button-mobile");
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -22,10 +22,8 @@ export class MoreScreen extends UIElement {
|
||||||
|
|
||||||
const els: UIElement[] = []
|
const els: UIElement[] = []
|
||||||
for (const k in AllKnownLayouts.allSets) {
|
for (const k in AllKnownLayouts.allSets) {
|
||||||
if (k === "all") {
|
|
||||||
continue;
|
|
||||||
}
|
|
||||||
const layout = AllKnownLayouts.allSets[k]
|
const layout = AllKnownLayouts.allSets[k]
|
||||||
|
if(layout.hideFromOverview){continue}
|
||||||
|
|
||||||
const linkText =
|
const linkText =
|
||||||
`https://pietervdvn.github.io/MapComplete/${layout.name}.html?z=${this.currentLocation.data.zoom}&lat=${this.currentLocation.data.lat}&lon=${this.currentLocation.data.lon}
|
`https://pietervdvn.github.io/MapComplete/${layout.name}.html?z=${this.currentLocation.data.zoom}&lat=${this.currentLocation.data.lat}&lon=${this.currentLocation.data.lon}
|
||||||
|
|
9
index.ts
9
index.ts
|
@ -112,12 +112,11 @@ const lat = QueryParameters.GetQueryParameter("lat", "" + layoutToUse.startLat)
|
||||||
const lon = QueryParameters.GetQueryParameter("lon", "" + layoutToUse.startLon)
|
const lon = QueryParameters.GetQueryParameter("lon", "" + layoutToUse.startLon)
|
||||||
.syncWith(LocalStorageSource.Get("lon"));
|
.syncWith(LocalStorageSource.Get("lon"));
|
||||||
|
|
||||||
const featureSwitchUserbadge = QueryParameters.GetQueryParameter("fs-userbadge", "true");
|
const featureSwitchUserbadge = QueryParameters.GetQueryParameter("fs-userbadge", ""+layoutToUse.enableUserBadge);
|
||||||
const featureSwitchSearch = QueryParameters.GetQueryParameter("fs-search", "true");
|
const featureSwitchSearch = QueryParameters.GetQueryParameter("fs-search", ""+layoutToUse.enableSearch);
|
||||||
const featureSwitchWelcomeMessage = QueryParameters.GetQueryParameter("fs-welcome-message", "true");
|
const featureSwitchWelcomeMessage = QueryParameters.GetQueryParameter("fs-welcome-message", "true");
|
||||||
const featureSwitchLayers = QueryParameters.GetQueryParameter("fs-layers", "true");
|
const featureSwitchLayers = QueryParameters.GetQueryParameter("fs-layers", ""+layoutToUse.enableLayers);
|
||||||
const featureSwitchEmbedded = QueryParameters.GetQueryParameter("fs-embedded", "true");
|
const featureSwitchAddNew = QueryParameters.GetQueryParameter("fs-add-new", ""+layoutToUse.enableAdd);
|
||||||
const featureSwitchAddNew = QueryParameters.GetQueryParameter("fs-add-new", "true");
|
|
||||||
const featureSwitchIframe = QueryParameters.GetQueryParameter("fs-iframe", "false");
|
const featureSwitchIframe = QueryParameters.GetQueryParameter("fs-iframe", "false");
|
||||||
|
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue