Performance improvements

This commit is contained in:
Pieter Vander Vennet 2021-02-05 16:32:37 +01:00
parent 49f78d5604
commit 8f8ef690a4
11 changed files with 125 additions and 101 deletions

View file

@ -1,10 +1,10 @@
import {UIEventSource} from "../../Logic/UIEventSource";
import TagRenderingConfig from "../../Customizations/JSON/TagRenderingConfig";
import {UIElement} from "../UIElement";
import {SubstitutedTranslation} from "../SpecialVisualizations";
import {Utils} from "../../Utils";
import Combine from "../Base/Combine";
import {TagUtils} from "../../Logic/Tags";
import {SubstitutedTranslation} from "../SubstitutedTranslation";
/***
* Displays the correct value for a known tagrendering
@ -64,7 +64,7 @@ export default class TagRenderingAnswer extends UIElement {
const tr = this._configuration.GetRenderValue(tags);
if (tr !== undefined) {
this._content = new SubstitutedTranslation(tr, this._tags);
this._content = SubstitutedTranslation.construct(tr, this._tags);
return this._content.Render();
}

View file

@ -6,7 +6,6 @@ import {InputElement} from "../Input/InputElement";
import {And, Tag, TagsFilter, TagUtils} from "../../Logic/Tags";
import ValidatedTextField from "../Input/ValidatedTextField";
import {FixedInputElement} from "../Input/FixedInputElement";
import {SubstitutedTranslation} from "../SpecialVisualizations";
import {RadioButton} from "../Input/RadioButton";
import {Utils} from "../../Utils";
import CheckBoxes from "../Input/Checkboxes";
@ -19,6 +18,7 @@ import Translations from "../i18n/Translations";
import {FixedUiElement} from "../Base/FixedUiElement";
import {Translation} from "../i18n/Translation";
import Constants from "../../Models/Constants";
import {SubstitutedTranslation} from "../SubstitutedTranslation";
/**
* Shows the question element.
@ -203,7 +203,7 @@ export default class TagRenderingQuestion extends UIElement {
return undefined;
}
return new FixedInputElement(
new SubstitutedTranslation(mapping.then, this._tags),
SubstitutedTranslation.construct(mapping.then, this._tags),
mapping.if,
(t0, t1) => t1.isEquivalent(t0));
}