forked from MapComplete/MapComplete
Fix(favourites): don't show 'toilet at {name}' for the review overview
This commit is contained in:
parent
1ba3c5d6f3
commit
6a200e04bc
4 changed files with 25 additions and 2 deletions
|
@ -319,6 +319,9 @@
|
|||
],
|
||||
"allowMove": true,
|
||||
"#": "Use 'sauna_at_leisure.sauna_grouped' in a layer.tagRenderings to add the 'sauna information' expandle block (incl 'has sauna'); use 'sauna_at_leisure.expanded' to get all sauna questions directly (which does _not_ include the 'has sauna' question)",
|
||||
"labels": [
|
||||
"favourite:ignore"
|
||||
],
|
||||
"credits": "Osmwithspace",
|
||||
"credits:uid": 8770388
|
||||
}
|
||||
|
|
|
@ -274,5 +274,8 @@
|
|||
]
|
||||
}
|
||||
}
|
||||
],
|
||||
"labels": [
|
||||
"favourite:ignore"
|
||||
]
|
||||
}
|
||||
|
|
|
@ -38,6 +38,23 @@ export class GenerateFavouritesLayer extends Script {
|
|||
this.layers.push(layerConfig)
|
||||
}
|
||||
}
|
||||
// Sort the layers, low priority items to the back
|
||||
this.layers.sort((a, b) => {
|
||||
const aI= a.labels?.indexOf("favourite:low_priority") >= 0
|
||||
const bI= b.labels?.indexOf("favourite:low_priority") >= 0
|
||||
if(aI == bI){
|
||||
return 0
|
||||
}
|
||||
if(aI){
|
||||
return 1
|
||||
}
|
||||
if(bI){
|
||||
return -1
|
||||
}
|
||||
|
||||
})
|
||||
this.layers = this.layers.filter(l => !l.labels?.some(label => label === "favourite:ignore"))
|
||||
console.log(">>> layer order:", this.layers.map(l => l.id).join(", "))
|
||||
}
|
||||
|
||||
async main(args: string[]): Promise<void> {
|
||||
|
|
|
@ -17,7 +17,7 @@ import { QuestionableTagRenderingConfigJson } from "../Models/ThemeConfig/Json/Q
|
|||
import { ThemeConfigJson } from "../Models/ThemeConfig/Json/ThemeConfigJson"
|
||||
import { ValidateThemeAndLayers } from "../Models/ThemeConfig/Conversion/ValidateThemeAndLayers"
|
||||
import * as theme_overview from "../assets/generated/theme_overview.json"
|
||||
|
||||
import * as favourite_layer from "../../assets/layers/favourite/favourite.json"
|
||||
export default class DetermineTheme {
|
||||
private static readonly _knownImages = new Set(Array.from(licenses).map((l) => l.path))
|
||||
private static readonly loadCustomThemeParam = QueryParameters.GetQueryParameter(
|
||||
|
@ -122,6 +122,7 @@ export default class DetermineTheme {
|
|||
1000 * 60 * 60 * 60
|
||||
)
|
||||
const withDefault = new PrepareTheme(this.createConversionContext()).convertStrict(config)
|
||||
withDefault.layers.push(<LayerConfigJson> favourite_layer)
|
||||
return new ThemeConfig(withDefault, true)
|
||||
}
|
||||
|
||||
|
@ -180,7 +181,6 @@ export default class DetermineTheme {
|
|||
|
||||
json = new FixLegacyTheme().convertStrict(json)
|
||||
const raw = json
|
||||
|
||||
json = new FixImages(DetermineTheme._knownImages).convertStrict(json)
|
||||
json.enableNoteImports = json.enableNoteImports ?? false
|
||||
const convertState = this.createConversionContext()
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue