diff --git a/protected/humhub/docs/CHANGELOG_DEV.md b/protected/humhub/docs/CHANGELOG_DEV.md index c9468ed6f4..2a3061de73 100644 --- a/protected/humhub/docs/CHANGELOG_DEV.md +++ b/protected/humhub/docs/CHANGELOG_DEV.md @@ -17,3 +17,4 @@ HumHub Change Log - Enh: Added `humhub\modules\ui\form\widgets\ActiveField:preventRendering` to manage render state within field classes - Enh: Added `humhub\modules\ui\form\widgets\JsInputWidget:emptyResult()` helper to manage render state of JsInputWidget - Enh: Added `humhub\modules\ui\form\widgets\JsInputWidget:field` in order to access ActiveField instances within JsInputWidget +- Enh #4216: Added `humhub\modules\ui\filter\widgets\DropdownFilterInput` in order to support dropdown stream filters diff --git a/protected/humhub/modules/ui/filter/resources/js/humhub.ui.filter.js b/protected/humhub/modules/ui/filter/resources/js/humhub.ui.filter.js index ecbf49659e..c9606b8c96 100644 --- a/protected/humhub/modules/ui/filter/resources/js/humhub.ui.filter.js +++ b/protected/humhub/modules/ui/filter/resources/js/humhub.ui.filter.js @@ -156,6 +156,7 @@ humhub.module('ui.filter', function(module, require, $) { 'checkbox': CheckBoxInput, 'radio': RadioInput, 'picker': PickerInput, + 'dropdown': TextInput, // don't need a custom input type here 'text': TextInput }; diff --git a/protected/humhub/modules/ui/filter/widgets/DropdownFilterInput.php b/protected/humhub/modules/ui/filter/widgets/DropdownFilterInput.php new file mode 100644 index 0000000000..671927214b --- /dev/null +++ b/protected/humhub/modules/ui/filter/widgets/DropdownFilterInput.php @@ -0,0 +1,61 @@ +options['data-action-change'] = 'inputChange'; + Html::addCssClass($this->options, 'form-control'); + } + + /** + * @inheritdoc + */ + protected function getWidgetOptions() + { + return array_merge(parent::getWidgetOptions(), [ + 'selection' => $this->selection, + 'items' => $this->items + ]); + } +} diff --git a/protected/humhub/modules/ui/filter/widgets/views/dropdownInput.php b/protected/humhub/modules/ui/filter/widgets/views/dropdownInput.php new file mode 100644 index 0000000000..1bc8c53eb4 --- /dev/null +++ b/protected/humhub/modules/ui/filter/widgets/views/dropdownInput.php @@ -0,0 +1,18 @@ + +
+ +