forked from MapComplete/MapComplete
Formatting
This commit is contained in:
parent
99ba26e3a2
commit
b251fd7b69
8 changed files with 69 additions and 62 deletions
|
@ -22,8 +22,8 @@ import { TiledStaticFeatureSource } from "../FeatureSource/Sources/StaticFeature
|
|||
import { Translation, TypedTranslation } from "../../UI/i18n/Translation"
|
||||
import { Tag } from "../Tags/Tag"
|
||||
import { OsmConnection } from "../Osm/OsmConnection"
|
||||
import {Feature, GeoJSON, LineString} from "geojson";
|
||||
import {OsmTags} from "../../Models/OsmFeature";
|
||||
import { Feature, GeoJSON, LineString } from "geojson"
|
||||
import { OsmTags } from "../../Models/OsmFeature"
|
||||
|
||||
export interface GlobalFilter {
|
||||
filter: FilterState
|
||||
|
|
|
@ -4,7 +4,7 @@ import { TagsFilter } from "./TagsFilter"
|
|||
export class Tag extends TagsFilter {
|
||||
public key: string
|
||||
public value: string
|
||||
public static newlyCreated = new Tag("_newly_created","yes") ;
|
||||
public static newlyCreated = new Tag("_newly_created", "yes")
|
||||
constructor(key: string, value: string) {
|
||||
super()
|
||||
this.key = key
|
||||
|
|
|
@ -27,7 +27,7 @@ import Loading from "../Base/Loading"
|
|||
import Hash from "../../Logic/Web/Hash"
|
||||
import { GlobalFilter } from "../../Logic/State/MapState"
|
||||
import { WayId } from "../../Models/OsmFeature"
|
||||
import {Tag} from "../../Logic/Tags/Tag";
|
||||
import { Tag } from "../../Logic/Tags/Tag"
|
||||
|
||||
/*
|
||||
* The SimpleAddUI is a single panel, which can have multiple states:
|
||||
|
@ -111,7 +111,9 @@ export default class SimpleAddUI extends Toggle {
|
|||
await state.changes.applyAction(newElementAction)
|
||||
selectedPreset.setData(undefined)
|
||||
isShown.setData(false)
|
||||
const selectedFeature = state.allElements.ContainingFeatures.get(newElementAction.newElementId)
|
||||
const selectedFeature = state.allElements.ContainingFeatures.get(
|
||||
newElementAction.newElementId
|
||||
)
|
||||
state.selectedElement.setData(selectedFeature)
|
||||
Hash.hash.setData(newElementAction.newElementId)
|
||||
}
|
||||
|
|
|
@ -116,9 +116,7 @@ export default class ConfirmLocationOfPoint extends Combine {
|
|||
|
||||
let confirmButton: BaseUIElement = new SubtleButton(
|
||||
preset.icon(),
|
||||
new Combine([
|
||||
confirmText,
|
||||
]).SetClass("flex flex-col")
|
||||
new Combine([confirmText]).SetClass("flex flex-col")
|
||||
)
|
||||
.SetClass("font-bold break-words")
|
||||
.onClick(() => {
|
||||
|
@ -138,7 +136,9 @@ export default class ConfirmLocationOfPoint extends Combine {
|
|||
)
|
||||
})
|
||||
|
||||
const warn = Translations.t.general.add.warnVisibleForEveryone.Clone().SetClass("alert w-full block");
|
||||
const warn = Translations.t.general.add.warnVisibleForEveryone
|
||||
.Clone()
|
||||
.SetClass("alert w-full block")
|
||||
if (preciseInput !== undefined) {
|
||||
confirmButton = new Combine([preciseInput, warn, confirmButton])
|
||||
} else {
|
||||
|
|
|
@ -17,9 +17,9 @@ import MoveWizard from "./MoveWizard"
|
|||
import Toggle from "../Input/Toggle"
|
||||
import Lazy from "../Base/Lazy"
|
||||
import FeaturePipelineState from "../../Logic/State/FeaturePipelineState"
|
||||
import {Tag} from "../../Logic/Tags/Tag";
|
||||
import Svg from "../../Svg";
|
||||
import Translations from "../i18n/Translations";
|
||||
import { Tag } from "../../Logic/Tags/Tag"
|
||||
import Svg from "../../Svg"
|
||||
import Translations from "../i18n/Translations"
|
||||
|
||||
export default class FeatureInfoBox extends ScrollableFullScreen {
|
||||
public constructor(
|
||||
|
@ -101,19 +101,24 @@ export default class FeatureInfoBox extends ScrollableFullScreen {
|
|||
}
|
||||
}
|
||||
|
||||
const withQuestion = layerConfig.tagRenderings.filter(tr => tr.question !== undefined).length
|
||||
const withQuestion = layerConfig.tagRenderings.filter(
|
||||
(tr) => tr.question !== undefined
|
||||
).length
|
||||
|
||||
const allRenderings: BaseUIElement[] = [
|
||||
new VariableUiElement(
|
||||
tags.map(data => data[Tag.newlyCreated.key]).map(isCreated => {
|
||||
tags
|
||||
.map((data) => data[Tag.newlyCreated.key])
|
||||
.map((isCreated) => {
|
||||
if (isCreated !== Tag.newlyCreated.value) {
|
||||
return undefined
|
||||
}
|
||||
const els = []
|
||||
const thanks =
|
||||
new Combine([
|
||||
Svg.party_svg().SetClass("w-12 h-12 shrink-0 p-1 m-1 bg-white rounded-full block"),
|
||||
t.newlyCreated
|
||||
const thanks = new Combine([
|
||||
Svg.party_svg().SetClass(
|
||||
"w-12 h-12 shrink-0 p-1 m-1 bg-white rounded-full block"
|
||||
),
|
||||
t.newlyCreated,
|
||||
]).SetClass("flex w-full thanks content-center")
|
||||
els.push(thanks)
|
||||
if (withQuestion > 0) {
|
||||
|
@ -122,7 +127,7 @@ export default class FeatureInfoBox extends ScrollableFullScreen {
|
|||
|
||||
return new Combine(els).SetClass("pb-4 mb-4 border-b block border-black")
|
||||
})
|
||||
)
|
||||
),
|
||||
]
|
||||
for (let i = 0; i < allGroupNames.length; i++) {
|
||||
const groupName = allGroupNames[i]
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue