Compare commits

...
Sign in to create a new pull request.

1 commit

Author SHA1 Message Date
f4477c9ab3 Fix: apply refactoring 2024-11-25 00:57:12 +01:00
2 changed files with 24 additions and 22 deletions

View file

@ -53,7 +53,7 @@
* Ids of skipped questions * Ids of skipped questions
*/ */
let skippedQuestions = new UIEventSource<Set<string>>(new Set<string>()) let skippedQuestions = new UIEventSource<Set<string>>(new Set<string>())
let layerDisabledForTheme = state.userRelatedState.getThemeDisabled(state.layout.id, layer.id) let layerDisabledForTheme = state.userRelatedState.getThemeDisabled(state.theme.id, layer.id)
layerDisabledForTheme.addCallbackAndRunD(disabled => { layerDisabledForTheme.addCallbackAndRunD(disabled => {
skippedQuestions.set(new Set(disabled.concat(Array.from(skippedQuestions.data)))) skippedQuestions.set(new Set(disabled.concat(Array.from(skippedQuestions.data))))
}) })

View file

@ -93,7 +93,7 @@
return !m.hideInAnswer.matchesProperties(tgs) return !m.hideInAnswer.matchesProperties(tgs)
}) })
selectedMapping = mappings?.findIndex( selectedMapping = mappings?.findIndex(
(mapping) => mapping.if.matchesProperties(tgs) || mapping.alsoShowIf?.matchesProperties(tgs) (mapping) => mapping.if.matchesProperties(tgs) || mapping.alsoShowIf?.matchesProperties(tgs),
) )
if (selectedMapping < 0) { if (selectedMapping < 0) {
selectedMapping = undefined selectedMapping = undefined
@ -201,7 +201,7 @@
if (freeformValue?.length > 0) { if (freeformValue?.length > 0) {
selectedMapping = config.mappings.length selectedMapping = config.mappings.length
} }
}) }),
) )
$: { $: {
@ -219,7 +219,7 @@
$freeformInput, $freeformInput,
selectedMapping, selectedMapping,
checkedMappings, checkedMappings,
tags.data tags.data,
) )
if (featureSwitchIsDebugging?.data) { if (featureSwitchIsDebugging?.data) {
console.log( console.log(
@ -231,7 +231,7 @@
currentTags: tags.data, currentTags: tags.data,
}, },
" --> ", " --> ",
selectedTags selectedTags,
) )
} }
} catch (e) { } catch (e) {
@ -253,7 +253,7 @@
selectedTags = new And([...selectedTags.and, ...extraTagsArray]) selectedTags = new And([...selectedTags.and, ...extraTagsArray])
} else { } else {
console.error( console.error(
"selectedTags is not of type Tag or And, it is a " + JSON.stringify(selectedTags) "selectedTags is not of type Tag or And, it is a " + JSON.stringify(selectedTags),
) )
} }
} }
@ -322,7 +322,7 @@
onDestroy( onDestroy(
state.osmConnection?.userDetails?.addCallbackAndRun((ud) => { state.osmConnection?.userDetails?.addCallbackAndRun((ud) => {
numberOfCs = ud.csCount numberOfCs = ud.csCount
}) }),
) )
} }
@ -341,7 +341,7 @@
.catch(console.error) .catch(console.error)
} }
let disabledInTheme = state.userRelatedState.getThemeDisabled(state.layout.id, layer?.id) let disabledInTheme = state.userRelatedState.getThemeDisabled(state.theme.id, layer?.id)
let menuIsOpened = new UIEventSource(false) let menuIsOpened = new UIEventSource(false)
function disableQuestion() { function disableQuestion() {
@ -361,6 +361,7 @@
<div class={clss}> <div class={clss}>
{#if layer.isNormal()} {#if layer.isNormal()}
<LoginToggle {state}>
<DotMenu hideBackground={true} open={menuIsOpened}> <DotMenu hideBackground={true} open={menuIsOpened}>
<SidebarUnit> <SidebarUnit>
{#if $disabledInTheme.indexOf(config.id) >= 0} {#if $disabledInTheme.indexOf(config.id) >= 0}
@ -374,6 +375,7 @@
{/if} {/if}
</SidebarUnit> </SidebarUnit>
</DotMenu> </DotMenu>
</LoginToggle>
{/if} {/if}
<form <form
class="relative flex flex-col overflow-y-auto px-4" class="relative flex flex-col overflow-y-auto px-4"