Skip to content

Commit

Permalink
Merge pull request #799 from dennis531/presenter-filter
Browse files Browse the repository at this point in the history
Fix empty presenters filter field in events
  • Loading branch information
lkiesow authored Jul 9, 2024
2 parents 9f829e5 + 3c77010 commit abcf6c5
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 6 deletions.
10 changes: 5 additions & 5 deletions src/components/shared/TableFilters.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -231,7 +231,7 @@ const TableFilters = ({
// @ts-expect-error TS(7006): Parameter 'filter' implicitly has an 'any' type.
const renderBlueBox = (filter) => {
// @ts-expect-error TS(7006): Parameter 'opt' implicitly has an 'any' type.
let valueLabel = filter.options.find((opt) => opt.value === filter.value)
let valueLabel = filter.options?.find((opt) => opt.value === filter.value)
?.label || filter.value;
return (
<span>
Expand Down Expand Up @@ -336,9 +336,7 @@ const TableFilters = ({
<span>
{
// Use different representation of name and value depending on type of filter
filter.type === "select" ? (
renderBlueBox(filter)
) : filter.type === "period" ? (
filter.type === "period" ? (
<span>
<span>
{t(filter.label).substr(0, 40)}:
Expand All @@ -351,7 +349,9 @@ const TableFilters = ({
})}
</span>
</span>
) : null
) : (
renderBlueBox(filter)
)
}
</span>
{/* Remove icon in blue area around filter */}
Expand Down
6 changes: 5 additions & 1 deletion src/slices/tableFilterSlice.ts
Original file line number Diff line number Diff line change
Expand Up @@ -79,7 +79,11 @@ export const fetchFilters = createAppAsyncThunk('tableFilters/fetchFilters', asy
});

if (resource === "events") {
filtersList.push({ name: "presentersBibliographic" });
filtersList.push({
label: "FILTERS.EVENTS.PRESENTERS_BIBLIOGRAPHIC.LABEL",
name: "presentersBibliographic",
translatable: false
});
}

return { filtersList, resource };
Expand Down

0 comments on commit abcf6c5

Please sign in to comment.