From 1d6102f6dea21cdd98d0730492650601e3dcab3a Mon Sep 17 00:00:00 2001 From: pietervdvn Date: Sun, 26 Sep 2021 17:54:49 +0200 Subject: [PATCH] Add id to tagRenderingConfig --- Models/ThemeConfig/Json/TagRenderingConfigJson.ts | 7 +++++++ Models/ThemeConfig/TagRenderingConfig.ts | 2 ++ 2 files changed, 9 insertions(+) diff --git a/Models/ThemeConfig/Json/TagRenderingConfigJson.ts b/Models/ThemeConfig/Json/TagRenderingConfigJson.ts index 9152bf463..ab4552534 100644 --- a/Models/ThemeConfig/Json/TagRenderingConfigJson.ts +++ b/Models/ThemeConfig/Json/TagRenderingConfigJson.ts @@ -5,6 +5,13 @@ import {AndOrTagConfigJson} from "./TagConfigJson"; * If the desired tags are missing and a question is defined, a question will be shown instead. */ export interface TagRenderingConfigJson { + + /** + * The id of the tagrendering, should be an unique string. + * Used to keep the translations in sync + */ + id?: string, + /** * Renders this value. Note that "{key}"-parts are substituted by the corresponding values of the element. * If neither 'textFieldQuestion' nor 'mappings' are defined, this text is simply shown as default value. diff --git a/Models/ThemeConfig/TagRenderingConfig.ts b/Models/ThemeConfig/TagRenderingConfig.ts index 912152c2e..af092e462 100644 --- a/Models/ThemeConfig/TagRenderingConfig.ts +++ b/Models/ThemeConfig/TagRenderingConfig.ts @@ -13,6 +13,7 @@ import {Utils} from "../../Utils"; */ export default class TagRenderingConfig { + readonly id?: string; readonly render?: Translation; readonly question?: Translation; readonly condition?: TagsFilter; @@ -56,6 +57,7 @@ export default class TagRenderingConfig { return; } + this.id = json.id ?? ""; this.render = Translations.T(json.render, context + ".render"); this.question = Translations.T(json.question, context + ".question"); this.roaming = json.roaming ?? false;