Full code cleanup

This commit is contained in:
Pieter Vander Vennet 2021-11-07 16:34:51 +01:00
parent 8e6ee8c87f
commit bd21212eba
246 changed files with 19418 additions and 11729 deletions

View file

@ -9,16 +9,16 @@ export class AllKnownLayouts {
public static allKnownLayouts: Map<string, LayoutConfig> = AllKnownLayouts.AllLayouts();
public static layoutsList: LayoutConfig[] = AllKnownLayouts.GenerateOrderedList(AllKnownLayouts.allKnownLayouts);
public static AllPublicLayers(){
const allLayers : LayerConfig[] = []
public static AllPublicLayers() {
const allLayers: LayerConfig[] = []
const seendIds = new Set<string>()
const publicLayouts = AllKnownLayouts.layoutsList.filter(l => !l.hideFromOverview)
for (const layout of publicLayouts) {
if(layout.hideFromOverview){
if (layout.hideFromOverview) {
continue
}
for (const layer of layout.layers) {
if(seendIds.has(layer.id)){
if (seendIds.has(layer.id)) {
continue
}
seendIds.add(layer.id)
@ -28,7 +28,7 @@ export class AllKnownLayouts {
}
return allLayers
}
private static GenerateOrderedList(allKnownLayouts: Map<string, LayoutConfig>): LayoutConfig[] {
const keys = ["personal", "cyclofix", "hailhydrant", "bookcases", "toilets", "aed"]
const list = []

View file

@ -15,7 +15,7 @@ export default class SharedTagRenderings {
const d = new Map<string, TagRenderingConfig>()
for (const key of Array.from(configJsons.keys())) {
try {
d.set(key, new TagRenderingConfig(configJsons.get(key), `SharedTagRenderings.${key}`))
d.set(key, new TagRenderingConfig(configJsons.get(key), `SharedTagRenderings.${key}`))
} catch (e) {
if (!Utils.runningFromConsole) {
console.error("BUG: could not parse", key, " from questions.json or icons.json - this error happened during the build step of the SharedTagRenderings", e)