forked from MapComplete/MapComplete
Refactoring: fix 'delete' and 'move'-buttons as special elements
This commit is contained in:
parent
466dd16568
commit
8a1f0599d9
19 changed files with 317 additions and 296 deletions
|
@ -2,8 +2,22 @@ import { TagRenderingConfigJson } from "../Json/TagRenderingConfigJson"
|
|||
import { Utils } from "../../../Utils"
|
||||
import SpecialVisualizations from "../../../UI/SpecialVisualizations"
|
||||
import { RenderingSpecification, SpecialVisualization } from "../../../UI/SpecialVisualization"
|
||||
import { LayerConfigJson } from "../Json/LayerConfigJson"
|
||||
|
||||
export default class ValidationUtils {
|
||||
public static hasSpecialVisualisation(
|
||||
layer: LayerConfigJson,
|
||||
specialVisualisation: string
|
||||
): boolean {
|
||||
return (
|
||||
layer.tagRenderings?.some((tagRendering) =>
|
||||
ValidationUtils.getSpecialVisualisations(<TagRenderingConfigJson>tagRendering).some(
|
||||
(vis) => vis.funcName === specialVisualisation
|
||||
)
|
||||
) ?? false
|
||||
)
|
||||
}
|
||||
|
||||
/**
|
||||
* Gives all the (function names of) used special visualisations
|
||||
* @param renderingConfig
|
||||
|
@ -15,6 +29,7 @@ export default class ValidationUtils {
|
|||
(spec) => spec["func"]
|
||||
)
|
||||
}
|
||||
|
||||
public static getSpecialVisualsationsWithArgs(
|
||||
renderingConfig: TagRenderingConfigJson
|
||||
): RenderingSpecification[] {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue