-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
7 changed files
with
116 additions
and
112 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
85 changes: 85 additions & 0 deletions
85
src/components/Projekte/Daten/TpopFilter/ActiveFilters.tsx
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,85 @@ | ||
import { useContext } from 'react' | ||
import styled from '@emotion/styled' | ||
import { observer } from 'mobx-react-lite' | ||
import { useParams } from 'react-router-dom' | ||
|
||
import storeContext from '../../../../storeContext.js' | ||
import ErrorBoundary from '../../../shared/ErrorBoundary.jsx' | ||
|
||
const FilterCommentTitle = styled.div` | ||
margin-top: -10px; | ||
margin-bottom: -10px; | ||
padding: 0 10px; | ||
font-size: 0.75em; | ||
font-weight: bold; | ||
color: rgba(0, 0, 0, 0.87); | ||
` | ||
const FilterCommentList = styled.ul`` | ||
const FilterComment = styled.li` | ||
padding: 0 10px; | ||
font-size: 0.75em; | ||
` | ||
|
||
export const ActiveFilters = observer(() => { | ||
const { apId } = useParams() | ||
|
||
const store = useContext(storeContext) | ||
|
||
const { nodeLabelFilter, mapFilter, apFilter, artIsFiltered, popIsFiltered } = | ||
store.tree | ||
|
||
const navApFilterComment = apFilter | ||
? `Navigationsbaum, "nur AP"-Filter: Nur Teil-Populationen von AP-Arten werden berücksichtigt.` | ||
: undefined | ||
const navHiearchyComment = | ||
// popId ? 'Navigationsbaum, Hierarchie-Filter: Im Navigationsbaum ist eine Population gewählt. Es werden nur ihre Teil-Populationen berücksichtigt.' : | ||
apId | ||
? 'Navigationsbaum, Hierarchie-Filter: Im Navigationsbaum ist eine Art gewählt. Es werden nur ihre Teil-Populationen berücksichtigt.' | ||
: undefined | ||
const navLabelComment = nodeLabelFilter.tpop | ||
? `Navigationsbaum, Label-Filter: Das Label der Teil-Populationen wird nach "${nodeLabelFilter.tpop}" gefiltert.` | ||
: undefined | ||
const artHierarchyComment = artIsFiltered | ||
? 'Formular-Filter, Ebene Art: Es werden nur Teil-Populationen berücksichtigt, deren Art die Bedingungen des gesetzten Filters erfüllt.' | ||
: undefined | ||
const popHierarchyComment = popIsFiltered | ||
? 'Formular-Filter, Ebene Population: Es werden nur Teil-Populationen berücksichtigt, deren Population die Bedingungen des gesetzten Filters erfüllt.' | ||
: undefined | ||
const mapFilterComment = mapFilter | ||
? 'Karten-Filter: wird angewendet.' | ||
: undefined | ||
|
||
const showFilterComments = | ||
!!navApFilterComment || | ||
!!navHiearchyComment || | ||
!!navLabelComment || | ||
!!artHierarchyComment || | ||
!!popHierarchyComment || | ||
!!mapFilter | ||
|
||
if (!showFilterComments) return null | ||
|
||
return ( | ||
<ErrorBoundary> | ||
<FilterCommentTitle>Zusätzlich aktive Filter:</FilterCommentTitle> | ||
<FilterCommentList> | ||
{!!navApFilterComment && ( | ||
<FilterComment>{navApFilterComment}</FilterComment> | ||
)} | ||
{!!navHiearchyComment && ( | ||
<FilterComment>{navHiearchyComment}</FilterComment> | ||
)} | ||
{!!navLabelComment && <FilterComment>{navLabelComment}</FilterComment>} | ||
{!!artHierarchyComment && ( | ||
<FilterComment>{artHierarchyComment}</FilterComment> | ||
)} | ||
{!!popHierarchyComment && ( | ||
<FilterComment>{popHierarchyComment}</FilterComment> | ||
)} | ||
{!!mapFilterComment && ( | ||
<FilterComment>{mapFilterComment}</FilterComment> | ||
)} | ||
</FilterCommentList> | ||
</ErrorBoundary> | ||
) | ||
}) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,8 +1,10 @@ | ||
{ | ||
"compilerOptions": { | ||
"composite": true, | ||
"skipLibCheck": true, | ||
"module": "ESNext", | ||
"moduleResolution": "Node" | ||
"moduleResolution": "Node", | ||
"allowSyntheticDefaultImports": true | ||
}, | ||
"include": ["vite.config.ts"] | ||
} |