Skip to content

Commit a05b3d7

Browse files
committed
Merge branch 'role-filter' of geichelberger/opencast-admin-interface into r/19.x
Pull request #1522 Add freetext filter input support
2 parents 3ca0643 + f2fb160 commit a05b3d7

2 files changed

Lines changed: 58 additions & 0 deletions

File tree

src/components/shared/TableFilters.tsx

Lines changed: 46 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -493,6 +493,52 @@ const FilterSwitch = ({
493493
/>
494494
</div>
495495
);
496+
case "freetext":
497+
return (
498+
<div>
499+
<DropDown
500+
creatable={true}
501+
value={secondFilter}
502+
text={secondFilter}
503+
options={
504+
!!filter.options && filter.options.length > 0
505+
? filter.options.map(option => {
506+
if (!filter.translatable) {
507+
return {
508+
...option,
509+
label: option.label.substr(0, 40),
510+
};
511+
} else {
512+
return {
513+
...option,
514+
label: t(option.label as ParseKeys).substr(0, 40),
515+
};
516+
}
517+
})
518+
: []
519+
}
520+
required={true}
521+
handleChange={element => handleChange("secondFilter", element!.value)}
522+
placeholder={
523+
!!filter.options && filter.options.length > 0
524+
? t(
525+
"TABLE_FILTERS.FILTER_VALUE_SELECTION.PLACEHOLDER",
526+
)
527+
: t(
528+
"TABLE_FILTERS.FILTER_SELECTION.NO_OPTIONS",
529+
)
530+
}
531+
autoFocus
532+
defaultOpen
533+
openMenuOnFocus
534+
menuIsOpen={openSecondFilterMenu}
535+
handleMenuIsOpen={setOpenSecondFilterMenu}
536+
skipTranslate={!filter.translatable}
537+
customCSS={{ width: 200, optionPaddingTop: 5 }}
538+
/>
539+
{/* For text filter, there is no secondary filter, so nothing is shown here */}
540+
</div>
541+
);
496542
// This should never happen
497543
default:
498544
return null;

src/i18n/org/opencastproject/adminui/languages/lang-en_US.json

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1886,6 +1886,12 @@
18861886
},
18871887
"WORKFLOW_STATE": {
18881888
"LABEL": "Workflow state"
1889+
},
1890+
"READ_ACCESS": {
1891+
"LABEL": "Read Access"
1892+
},
1893+
"WRITE_ACCESS": {
1894+
"LABEL": "Write Access"
18891895
}
18901896
},
18911897
"JOBS": {
@@ -1930,6 +1936,12 @@
19301936
},
19311937
"CREATION_DATE": {
19321938
"LABEL": "Creation date"
1939+
},
1940+
"READ_ACCESS": {
1941+
"LABEL": "Read Access"
1942+
},
1943+
"WRITE_ACCESS": {
1944+
"LABEL": "Write Access"
19331945
}
19341946
},
19351947
"SERVERS": {

0 commit comments

Comments
 (0)