Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
46 changes: 46 additions & 0 deletions src/components/shared/TableFilters.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -493,6 +493,52 @@ const FilterSwitch = ({
/>
</div>
);
case "freetext":
return (
<div>
<DropDown
creatable={true}
value={secondFilter}
text={secondFilter}
options={
!!filter.options && filter.options.length > 0
? filter.options.map(option => {
if (!filter.translatable) {
return {
...option,
label: option.label.substr(0, 40),
};
} else {
return {
...option,
label: t(option.label as ParseKeys).substr(0, 40),
};
}
})
: []
}
required={true}
handleChange={element => handleChange("secondFilter", element!.value)}
placeholder={
!!filter.options && filter.options.length > 0
? t(
"TABLE_FILTERS.FILTER_VALUE_SELECTION.PLACEHOLDER",
)
: t(
"TABLE_FILTERS.FILTER_SELECTION.NO_OPTIONS",
)
}
autoFocus
defaultOpen
openMenuOnFocus
menuIsOpen={openSecondFilterMenu}
handleMenuIsOpen={setOpenSecondFilterMenu}
skipTranslate={!filter.translatable}
customCSS={{ width: 200, optionPaddingTop: 5 }}
/>
{/* For text filter, there is no secondary filter, so nothing is shown here */}
</div>
);
// This should never happen
default:
return null;
Expand Down
12 changes: 12 additions & 0 deletions src/i18n/org/opencastproject/adminui/languages/lang-en_US.json
Original file line number Diff line number Diff line change
Expand Up @@ -1886,6 +1886,12 @@
},
"WORKFLOW_STATE": {
"LABEL": "Workflow state"
},
"READ_ACCESS": {
"LABEL": "Read Access"
},
"WRITE_ACCESS": {
"LABEL": "Write Access"
}
},
"JOBS": {
Expand Down Expand Up @@ -1930,6 +1936,12 @@
},
"CREATION_DATE": {
"LABEL": "Creation date"
},
"READ_ACCESS": {
"LABEL": "Read Access"
},
"WRITE_ACCESS": {
"LABEL": "Write Access"
}
},
"SERVERS": {
Expand Down
Loading