Skip to content

Commit

Permalink
90686
Browse files Browse the repository at this point in the history
  • Loading branch information
remyvdwereld committed Sep 21, 2023
1 parent 264103f commit a5a1793
Show file tree
Hide file tree
Showing 4 changed files with 34 additions and 41 deletions.
1 change: 0 additions & 1 deletion src/app/components/cases/Cases/Cases.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -82,7 +82,6 @@ const Cases: React.FC = () => {
** housingCorporations to avoid a stale selection:
*/
if (key === "theme") {
casesContextItem.housingCorporations = []
casesContextItem.reason = ""
casesContextItem.projects = []
casesContextItem.subjects = []
Expand Down
25 changes: 11 additions & 14 deletions src/app/components/cases/CasesFilter/CasesFilter.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@ import scaffoldDate from "./scaffoldDate"
import scaffoldTheme from "./scaffoldTheme"
import scaffoldPageSize from "./scaffoldPageSize"
import scaffoldReason from "./scaffoldReason"
import MultipleOptionsFilter from "app/components/filters/MultipleOptionsFilter/MultipleOptionsFilter"
import MultipleOptionsFilterBox from "app/components/filters/MultipleOptionsFilterBox/MultipleOptionsFilterBox"

type Props = {
Expand Down Expand Up @@ -45,20 +44,21 @@ const CasesFilter: React.FC<Props> = ({
<ScaffoldForm>
<ScaffoldFields { ...scaffoldTheme(theme, themes, setTheme) } />
</ScaffoldForm>
{ theme === "Onderhuur" && (
<MultipleOptionsFilter
label="Corporaties"
options={ corporations }
selectedOptions={ selectedCorporations }
setSelectedOptions={ setSelectedCorporations }
byId
/>
)}
<ScaffoldForm>
<ScaffoldFields { ...scaffoldDate(date, setDate) } />
</ScaffoldForm>
{ reasons === undefined ? <Spinner /> : (
<ScaffoldForm>
<ScaffoldFields { ...scaffoldReason(reason, setReason, reasons) } />
</ScaffoldForm>
)}
<MultipleOptionsFilterBox
label="Corporaties"
options={ corporations }
selectedOptions={ selectedCorporations }
setSelectedOptions={ setSelectedCorporations }
byId
/>
{ projects !== undefined && (
<MultipleOptionsFilterBox
label="Projecten"
Expand All @@ -77,10 +77,7 @@ const CasesFilter: React.FC<Props> = ({
byId
/>
)}
<ScaffoldForm>
<ScaffoldFields { ...scaffoldDate(date, setDate) } />
</ScaffoldForm>
<MultipleOptionsFilter
<MultipleOptionsFilterBox
label="Stadsdelen"
options={ districts }
selectedOptions={ districtNames }
Expand Down
1 change: 0 additions & 1 deletion src/app/components/tasks/Tasks/Tasks.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -135,7 +135,6 @@ const Tasks: React.FC = () => {
** housingCorporations to avoid a stale selection:
*/
if (key === "theme") {
tasksContextItem.housingCorporations = []
tasksContextItem.projects = []
tasksContextItem.reason = ""
tasksContextItem.subjects = []
Expand Down
48 changes: 23 additions & 25 deletions src/app/components/tasks/TasksFilter/TasksFilter.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,6 @@ import scaffoldRole from "./scaffoldRole"
import scaffoldPageSize from "./scaffoldPageSize"
import scaffoldMyTasks from "./scaffoldMyTasks"
import scaffoldReasons from "./scaffoldReasons"
import MultipleOptionsFilter from "app/components/filters/MultipleOptionsFilter/MultipleOptionsFilter"
import MultipleOptionsFilterBox from "app/components/filters/MultipleOptionsFilterBox/MultipleOptionsFilterBox"

type Props = {
Expand Down Expand Up @@ -62,21 +61,6 @@ const TasksFilter: React.FC<Props> = ({
</ScaffoldForm>
)
}
{ theme === "Onderhuur" && (
<MultipleOptionsFilter
label="Corporaties"
options={ corporations }
selectedOptions={ selectedCorporations }
setSelectedOptions={ setSelectedCorporations }
byId
/>
)}
{ reasons === undefined ? <Spinner /> : (
<ScaffoldForm>
<ScaffoldFields { ...scaffoldReasons(reason, setReason, reasons) } />
</ScaffoldForm>
)
}
{ roles === undefined
? <Spinner />
: (
Expand All @@ -85,14 +69,10 @@ const TasksFilter: React.FC<Props> = ({
</ScaffoldForm>
)
}
{ projects !== undefined && (
<MultipleOptionsFilterBox
label="Projecten"
options={ projects }
selectedOptions={ selectedProjects }
setSelectedOptions={ setSelectedProjects }
byId
/>
{ reasons === undefined ? <Spinner /> : (
<ScaffoldForm>
<ScaffoldFields { ...scaffoldReasons(reason, setReason, reasons) } />
</ScaffoldForm>
)}
{ taskNames === undefined ? <Spinner /> : (
<MultipleOptionsFilterBox
Expand All @@ -102,6 +82,24 @@ const TasksFilter: React.FC<Props> = ({
setSelectedOptions={ setSelectedTaskNames }
/>
)}
<MultipleOptionsFilterBox
label="Corporaties"
options={ corporations }
selectedOptions={ selectedCorporations }
setSelectedOptions={ setSelectedCorporations }
byId
/>

{ projects !== undefined && (
<MultipleOptionsFilterBox
label="Projecten"
options={ projects }
selectedOptions={ selectedProjects }
setSelectedOptions={ setSelectedProjects }
byId
/>
)}

{ subjects !== undefined && (
<MultipleOptionsFilterBox
label="Onderwerpen"
Expand All @@ -111,7 +109,7 @@ const TasksFilter: React.FC<Props> = ({
byId
/>
)}
<MultipleOptionsFilter
<MultipleOptionsFilterBox
label="Stadsdelen"
options={ districts }
selectedOptions={ districtNames }
Expand Down

0 comments on commit a5a1793

Please sign in to comment.