forked from MapComplete/MapComplete
Studio: fix bug which prevented saving, allow setting a 'snapName'
This commit is contained in:
parent
f801e89fc1
commit
612e71a4b6
2 changed files with 7 additions and 13 deletions
|
@ -619,7 +619,7 @@ export interface LayerConfigJson {
|
|||
*
|
||||
* In the move wizard, the option `snap object onto {snapName}` is shown
|
||||
*
|
||||
* group: hidden
|
||||
* group: expert
|
||||
*/
|
||||
snapName?: Translatable
|
||||
|
||||
|
|
|
@ -1,12 +1,7 @@
|
|||
import { ConfigMeta } from "./configMeta"
|
||||
import { Store, UIEventSource } from "../../Logic/UIEventSource"
|
||||
import { LayerConfigJson } from "../../Models/ThemeConfig/Json/LayerConfigJson"
|
||||
import {
|
||||
Conversion,
|
||||
ConversionMessage,
|
||||
DesugaringContext,
|
||||
Pipe,
|
||||
} from "../../Models/ThemeConfig/Conversion/Conversion"
|
||||
import { Conversion, ConversionMessage, DesugaringContext, Pipe } from "../../Models/ThemeConfig/Conversion/Conversion"
|
||||
import { PrepareLayer } from "../../Models/ThemeConfig/Conversion/PrepareLayer"
|
||||
import { PrevalidateTheme, ValidateLayer } from "../../Models/ThemeConfig/Conversion/Validation"
|
||||
import { AllSharedLayers } from "../../Customizations/AllSharedLayers"
|
||||
|
@ -24,6 +19,7 @@ import { ConversionContext } from "../../Models/ThemeConfig/Conversion/Conversio
|
|||
import { LocalStorageSource } from "../../Logic/Web/LocalStorageSource"
|
||||
import { TagRenderingConfigJson } from "../../Models/ThemeConfig/Json/TagRenderingConfigJson"
|
||||
import { ValidateTheme } from "../../Models/ThemeConfig/Conversion/ValidateTheme"
|
||||
import * as questions from "../../assets/generated/layers/questions.json"
|
||||
|
||||
export interface HighlightedTagRendering {
|
||||
path: ReadonlyArray<string | number>
|
||||
|
@ -449,11 +445,10 @@ export default class EditLayerState extends EditJsonState<LayerConfigJson> {
|
|||
configuration: Partial<LayerConfigJson>
|
||||
): Promise<ConversionMessage[]> {
|
||||
const layers = AllSharedLayers.getSharedLayersConfigs()
|
||||
|
||||
const questions = layers.get("questions")
|
||||
const questionsLayer = questions
|
||||
const sharedQuestions = new Map<string, QuestionableTagRenderingConfigJson>()
|
||||
for (const question of questions.tagRenderings) {
|
||||
sharedQuestions.set(question["id"], <QuestionableTagRenderingConfigJson>question)
|
||||
for (const question of questionsLayer.tagRenderings) {
|
||||
sharedQuestions.set(question["id"], <QuestionableTagRenderingConfigJson><unknown>question)
|
||||
}
|
||||
const state: DesugaringContext = {
|
||||
tagRenderings: sharedQuestions,
|
||||
|
@ -527,10 +522,9 @@ export class EditThemeState extends EditJsonState<ThemeConfigJson> {
|
|||
layers.set(l, config)
|
||||
}
|
||||
|
||||
const questions = layers.get("questions")
|
||||
const sharedQuestions = new Map<string, QuestionableTagRenderingConfigJson>()
|
||||
for (const question of questions.tagRenderings) {
|
||||
sharedQuestions.set(question["id"], <QuestionableTagRenderingConfigJson>question)
|
||||
sharedQuestions.set(question["id"], <QuestionableTagRenderingConfigJson><unknown>question)
|
||||
}
|
||||
const state: DesugaringContext = {
|
||||
tagRenderings: sharedQuestions,
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue