forked from MapComplete/MapComplete
Scripts: reorder tagRenderings, fix tests
This commit is contained in:
parent
bba8546a55
commit
2e66278291
5 changed files with 50 additions and 9 deletions
|
|
@ -10,7 +10,7 @@ import {
|
|||
SetDefault,
|
||||
} from "./Conversion"
|
||||
import { ThemeConfigJson } from "../Json/ThemeConfigJson"
|
||||
import { PrepareLayer, RewriteSpecial } from "./PrepareLayer"
|
||||
import { OrderLayer, PrepareLayer, RewriteSpecial } from "./PrepareLayer"
|
||||
import { LayerConfigJson } from "../Json/LayerConfigJson"
|
||||
import { Utils } from "../../../Utils"
|
||||
import Constants from "../../Constants"
|
||||
|
|
@ -611,13 +611,15 @@ class PostvalidateTheme extends DesugaringStep<ThemeConfigJson> {
|
|||
return json
|
||||
}
|
||||
}
|
||||
export class OrderTheme extends DesugaringStep<ThemeConfigJson> {
|
||||
export class OrderTheme extends Fuse<ThemeConfigJson> {
|
||||
private static readonly themeAttributesOrder: ReadonlyArray<string> = Utils.Dedup(
|
||||
(<ConfigMeta[]>themeconfig).filter((c) => c.path.length === 1).map((c) => c.path[0])
|
||||
)
|
||||
|
||||
constructor() {
|
||||
super("OrderLayer", "Reorders the layer to the default order")
|
||||
super("Reorders the layer to the default order",
|
||||
new On("layers", new Each(new OrderLayer()))
|
||||
)
|
||||
}
|
||||
|
||||
public convert(json: ThemeConfigJson, context: ConversionContext): ThemeConfigJson {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue