Skip to content
Snippets Groups Projects

#3470540: "Create some front end"

Merge request reports

Loading
Loading

Activity

Filter activity
  • Approvals
  • Assignees & reviewers
  • Comments (from bots)
  • Comments (from users)
  • Commits & branches
  • Edits
  • Labels
  • Lock status
  • Mentions
  • Merge request status
  • Tracking
9 9 */
10 10 final class BooleanFilter extends FilterBase {
11 11
12 public function __construct(public bool $value, mixed ...$arguments) {
12 public function __construct(public bool $value, public readonly array $options, mixed ...$arguments) {
  • :thumbsdown: BooleanFilter should not behave like a set of options. If anything, this should simply allow for a distinct "on label" and "off label", like this:

    Suggested change
    12 public function __construct(public bool $value, public readonly array $options, mixed ...$arguments) {
    12 public function __construct(public bool $value, public readonly string|\Stringable $off_label, public readonly string|\Stringable $on_label, mixed ...$arguments) {

    That said, the intention of BooleanFilter was to display as a single checkbox, so I'm not sure you even need to do this. On the frontend, you could render it like this (pseudo-code):

    <input type="radio" value="1" />${filter_name}
    <input type="radio" value="0" />${Drupal.t('Show all')}

    But having BooleanFilter accept an array of options like this is a misunderstanding of what BooleanFilter is intended to do, so I think we need to correct that before this can proceed.

    Edited by Adam G-H
  • Kunal Sachdev changed this line in version 11 of the diff

    changed this line in version 11 of the diff

  • fixed

  • Please register or sign in to reply
  • 252 filterType="developmentStatus"
    253 changeHandler={onAdvancedFilter}
    254 let:id
    255 let:label
    256 >
    257 <label
    258 slot="label"
    259 class="search__checkbox-label"
    260 for={`developmentStatus${id}`}
    261 >
    262 {label}
    263 </label>
    264 </FilterGroup>
    265 {/if}
    214 {#each Object.entries($sourceFilters) as [type, filter]}
    215 {#if filter._type === 'boolean'}
  • 256 >
    257 <label
    258 slot="label"
    259 class="search__checkbox-label"
    260 for={`developmentStatus${id}`}
    261 >
    262 {label}
    263 </label>
    264 </FilterGroup>
    265 {/if}
    214 {#each Object.entries($sourceFilters) as [type, filter]}
    215 {#if filter._type === 'boolean'}
    216 <BooleanFilter
    217 filterTitle={filter.name}
    218 filterData={filter.options}
    219 filterType={type}
  • Kunal Sachdev added 10 commits

    added 10 commits

    • f7049e1c...50e70d15 - 3 commits from branch project:2.0.x
    • e299bd3d - Rename FilterGroup to BooleanFilter and some refactoring
    • 4a5cbba0 - use prettier
    • d9b62ed4 - refactoring in progress
    • 6fd5306d - change the code related to rendering of sourcefilters
    • 7bde48fc - change getFilterDefinitions() in remaining places
    • b8f1a476 - change getFilterDefinitions() in remaining place
    • 4b89c1f6 - Rename Filter to MultipleChoiceFilter

    Compare with previous version

  • Kunal Sachdev added 1 commit

    added 1 commit

    • c4d0c8c2 - remove $options from BooleanFilter

    Compare with previous version

  • Kunal Sachdev added 1 commit

    added 1 commit

    Compare with previous version

  • Kunal Sachdev added 1 commit

    added 1 commit

    Compare with previous version

  • Kunal Sachdev added 1 commit

    added 1 commit

    Compare with previous version

  • Kunal Sachdev added 1 commit

    added 1 commit

    Compare with previous version

  • Kunal Sachdev added 15 commits

    added 15 commits

    Compare with previous version

  • Kunal Sachdev added 13 commits

    added 13 commits

    Compare with previous version

  • Loading
  • Loading
  • Loading
  • Loading
  • Loading
  • Loading
  • Loading
  • Loading
  • Loading
  • Loading
  • Please register or sign in to reply
    Loading