#3470540: "Create some front end"
Merge request reports
Activity
added 1 commit
- f1ff38da - Rename FilterGroup to BooleanFilter and some refactoring
added 1 commit
- 09a061b7 - change the code related to rendering of sourcefilters
added 1 commit
- e71b5831 - change getFilterDefinitions() in remaining places
added 1 commit
- c35d3d59 - change getFilterDefinitions() in remaining place
added 7 commits
-
6cb4b7d7 - 1 commit from branch
project:2.0.x
- dd2fabcd - Rename FilterGroup to BooleanFilter and some refactoring
- a91d569d - use prettier
- 739db589 - refactoring in progress
- 81701b02 - change the code related to rendering of sourcefilters
- 571cdd7a - change getFilterDefinitions() in remaining places
- 7d176c4b - change getFilterDefinitions() in remaining place
Toggle commit list-
6cb4b7d7 - 1 commit from branch
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) { 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: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-Hchanged this line in version 11 of the diff
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} - Comment on lines +217 to +219
changed this line in version 18 of the diff
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
Toggle commit list-
f7049e1c...50e70d15 - 3 commits from branch
added 15 commits
-
f77aba29...0f408503 - 3 commits from branch
project:2.0.x
- 0f408503...c0506d85 - 2 earlier commits
- a4c62796 - refactoring in progress
- 1ac7cd4f - change the code related to rendering of sourcefilters
- c342c055 - change getFilterDefinitions() in remaining places
- 7cb87186 - change getFilterDefinitions() in remaining place
- b022eca8 - Rename Filter to MultipleChoiceFilter
- 3583fce5 - remove $options from BooleanFilter
- e66f51ba - phpcs and cspell fixes
- cf4ac353 - eslint error fix
- 9045b009 - remove comment
- 46842875 - fix tests
Toggle commit list-
f77aba29...0f408503 - 3 commits from branch
added 13 commits
-
d7ac4d3d - 1 commit from branch
project:2.0.x
- d7ac4d3d...dcd21b99 - 2 earlier commits
- 72bdfbbd - refactoring in progress
- 559acb67 - change the code related to rendering of sourcefilters
- 4a491154 - change getFilterDefinitions() in remaining places
- 068ee625 - change getFilterDefinitions() in remaining place
- e4171fde - Rename Filter to MultipleChoiceFilter
- fe3022c3 - remove $options from BooleanFilter
- 10de1f3a - phpcs and cspell fixes
- c646ba7f - eslint error fix
- 177162f9 - remove comment
- 1dfa18da - fix tests
Toggle commit list-
d7ac4d3d - 1 commit from branch
added 4 commits
-
dc9f6482...92710c3a - 2 commits from branch
project:2.0.x
- 79e7f6d5 - Merge branch '2.0.x' into 3470540-create-some-front-end
- f5c403ca - Make assertions use Mink API
-
dc9f6482...92710c3a - 2 commits from branch
6 5 export let changeHandler; 7 export let filterType; 6 export let type; 7 export let description; 8 const { Drupal } = window; 8 9 </script> 9 10 10 11 <div class="filter-group__filter-options form-item"> 11 <label for={filterType} class="form-item__label">{filterTitle}</label> 12 <label for={type} class="form-item__label">{name}</label> 12 13 <select 13 name={filterType} 14 name={type} 14 15 class="search__filter-select form-select form-element form-element--type-select" 15 bind:value={$filters[filterType]} 16 bind:value={$filters[type]} Based on what I'm seeing in Svelte's docs, this should work. The fact that it doesn't, as proven by the tests, suggests that something odd is happening. I wonder if it's a type mismatch? Maybe
$filters[type] === 0
, but theoption
value is'0'
(i.e., zero as a string). That, I bet, would break it, based on what I see in the Svelte docs about this:A value binding corresponds to the value property on the selected , which can be any value (not just strings, as is normally the case in the DOM).
added 1 commit
- 89c69569 - remove $description from FilterBase and $on_label and $off_label in BooleanFilter
added 19 commits
-
605b0104 - 1 commit from branch
project:2.0.x
- 605b0104...374e8872 - 8 earlier commits
- 216bb414 - phpcs and cspell fixes
- 20d218b3 - eslint error fix
- 33cb92df - remove comment
- fe9f7260 - fix tests
- 8a529c4f - change variable names in BooleanFilter
- 28a66456 - nit
- 6ca6c400 - fixing test failures in progress
- 1bcd8f79 - Make assertions use Mink API
- 63c0e1f0 - Unit test coverage
- a3fc162d - remove $description from FilterBase and $on_label and $off_label in BooleanFilter
Toggle commit list-
605b0104 - 1 commit from branch
236 236 ]); 237 237 238 238 // Make sure the second filter applied is the security covered filter. 239 $this->assertEquals('Covered by a security policy', $this->getElementText(self::SECURITY_OPTION_SELECTOR . self::OPTION_CHECKED)); 239 $option = $assert_session->optionExists('securityCoverage', '1'); 240 $this->assertSame('Show projects covered by a security policy', $option->getText()); 241 $this->assertTrue($option->isSelected()); added 24 commits
-
802f8ced...ae255f91 - 3 commits from branch
project:2.0.x
- ae255f91...11765886 - 11 earlier commits
- 264f16e5 - fix tests
- bb54e943 - change variable names in BooleanFilter
- d650c0cf - nit
- 559ea4ab - fixing test failures in progress
- 93c4d9a5 - Make assertions use Mink API
- b0376459 - Unit test coverage
- 45826126 - remove $description from FilterBase and $on_label and $off_label in BooleanFilter
- fe245847 - fix unit test defined for filters
- 20f60e26 - phpcs fix
- ad7c2f76 - change ids of status filters and fix tests
Toggle commit list-
802f8ced...ae255f91 - 3 commits from branch
added 2 commits
added 25 commits
-
ac169540...55907ac3 - 2 commits from branch
project:2.0.x
- 55907ac3...a7372ccb - 13 earlier commits
- 98a02093 - nit
- bd626ffa - fixing test failures in progress
- 145c30f5 - Make assertions use Mink API
- 200190d0 - Unit test coverage
- 3aa33ab8 - remove $description from FilterBase and $on_label and $off_label in BooleanFilter
- 7d24a1b7 - fix unit test defined for filters
- d0bb6bfe - phpcs fix
- 56db0203 - change ids of status filters and fix tests
- 3c1419f3 - better comment for the testing block
- 8247b96d - fix order of the defined source filters
Toggle commit list-
ac169540...55907ac3 - 2 commits from branch
11 11 */ 12 12 enum DevelopmentStatus: string { 13 13 14 case Active = 'active'; 15 case All = 'all'; 14 case Active = '1'; 15 case All = '0'; - Resolved by Chris Wells
- Resolved by Chris Wells
176 176 'Assert second category is selected.', 177 177 ); 178 178 179 // Press space to expand categories drop-down again. 179 // Press tab to navigate to next drop-down. It's too bad that this test is so sensitive to the order in which filters are defined by the source -- yet another artifact of how much of a hard-coded proof of concept Project Browser used to be! But, great job tracking that down as the cause of the test failures. :)
Can you open a follow-up issue to refactor this test so that it's not sensitive to filter order?
I think the problem is with project browser where somewhere in the code we have hard coded the tab index for each filter which needs to be fixed.
And I think the test doesn't need any refactoring as it's testing the right thing which is when we are on the categories filter and we click tab then it shifts to next filter drop down.
Edited by Kunal SachdevCreated the follow up to remove the hard coded tab index for filters https://www.drupal.org/project/project_browser/issues/3483412
Edited by Kunal Sachdev
added 26 commits
-
8247b96d...dbb3b281 - 3 commits from branch
project:2.0.x
- dbb3b281...ed55827e - 13 earlier commits
- 17009cfd - nit
- f5c2b4bd - fixing test failures in progress
- e3d0078c - Make assertions use Mink API
- c4154286 - Unit test coverage
- 8fba8b37 - remove $description from FilterBase and $on_label and $off_label in BooleanFilter
- f9a8bcbb - fix unit test defined for filters
- cef99652 - phpcs fix
- ccd84f49 - change ids of status filters and fix tests
- 2dcd9f1b - better comment for the testing block
- 0f1fb660 - fix order of the defined source filters
Toggle commit list-
8247b96d...dbb3b281 - 3 commits from branch