forked from MapComplete/MapComplete
Correctly add elements to featureInfoBox
This commit is contained in:
parent
6af3d41886
commit
09ba1b37c6
1 changed files with 31 additions and 16 deletions
|
@ -12,7 +12,7 @@ import {Tag} from "../../Logic/Tags/Tag";
|
||||||
import Constants from "../../Models/Constants";
|
import Constants from "../../Models/Constants";
|
||||||
import SharedTagRenderings from "../../Customizations/SharedTagRenderings";
|
import SharedTagRenderings from "../../Customizations/SharedTagRenderings";
|
||||||
import BaseUIElement from "../BaseUIElement";
|
import BaseUIElement from "../BaseUIElement";
|
||||||
import AllKnownLayers from "../../Customizations/AllKnownLayers";
|
import {VariableUiElement} from "../Base/VariableUIElement";
|
||||||
|
|
||||||
export default class FeatureInfoBox extends ScrollableFullScreen {
|
export default class FeatureInfoBox extends ScrollableFullScreen {
|
||||||
|
|
||||||
|
@ -71,17 +71,32 @@ export default class FeatureInfoBox extends ScrollableFullScreen {
|
||||||
renderings.push(new TagRenderingAnswer(tags, SharedTagRenderings.SharedTagRendering.get("minimap")))
|
renderings.push(new TagRenderingAnswer(tags, SharedTagRenderings.SharedTagRendering.get("minimap")))
|
||||||
}
|
}
|
||||||
|
|
||||||
if (State.state.osmConnection.userDetails.data.csCount >= Constants.userJourney.historyLinkVisible ||
|
renderings.push(
|
||||||
State.state.featureSwitchIsDebugging.data == true ||
|
new VariableUiElement(
|
||||||
State.state.featureSwitchIsTesting.data == true) {
|
State.state.osmConnection.userDetails.map(userdetails => {
|
||||||
renderings.push(new TagRenderingAnswer( tags, SharedTagRenderings.SharedTagRendering.get("last_edit")))
|
if (userdetails.csCount <= Constants.userJourney.historyLinkVisible
|
||||||
|
&& State.state.featureSwitchIsDebugging.data == false
|
||||||
|
&& State.state.featureSwitchIsTesting.data === false) {
|
||||||
|
return undefined
|
||||||
}
|
}
|
||||||
|
|
||||||
|
return new TagRenderingAnswer(tags, SharedTagRenderings.SharedTagRendering.get("last_edit"));
|
||||||
|
|
||||||
if (State.state.featureSwitchIsDebugging.data) {
|
}, [State.state.featureSwitchIsDebugging])
|
||||||
|
)
|
||||||
|
)
|
||||||
|
|
||||||
|
|
||||||
|
renderings.push(
|
||||||
|
new VariableUiElement(
|
||||||
|
State.state.featureSwitchIsDebugging.map(isDebugging => {
|
||||||
|
if (isDebugging) {
|
||||||
const config: TagRenderingConfig = new TagRenderingConfig({render: "{all_tags()}"}, new Tag("id", ""), "");
|
const config: TagRenderingConfig = new TagRenderingConfig({render: "{all_tags()}"}, new Tag("id", ""), "");
|
||||||
renderings.push(new TagRenderingAnswer(tags, config))
|
return new TagRenderingAnswer(tags, config)
|
||||||
}
|
}
|
||||||
|
})
|
||||||
|
)
|
||||||
|
)
|
||||||
|
|
||||||
return new Combine(renderings).SetClass("block")
|
return new Combine(renderings).SetClass("block")
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue