Initial commit
Closes #3511069
Merge request reports
Activity
- Resolved by Narendra Singh Rathore
added 17 commits
-
a7201a4a...4b49d356 - 9 commits from branch
project:2.0.x
- 3c1746a1 - Initial commit
- 0f06b437 - Apply 1 suggestion(s) to 1 file(s)
- 28e1abfe - Default value added
- 4df5cab7 - Default filter passed in config
- a06c0adc - Test added
- 6ad045d1 - PHPSTAN
- 0bd7bc3c - PHPSTAN again
- cb8cabc3 - Test added for a page
Toggle commit list-
a7201a4a...4b49d356 - 9 commits from branch
added 1 commit
- 269beb79 - Alter Search.svelte to only conditionally show certain parts of the UI chrome
47 47 label: 'Sort options' 48 48 nullable: true 49 49 sequence: 50 type: string 50 type: machine_name This isn't enforced in the source plugin, even if it would be a good idea to stick with it. But instead of A_Z I might want to use A-Z, which could be valid as a option key for the select, but wouldn't be for the block. Even if I'd love this to be a machine name, maybe we need to stick with string.
changed this line in version 15 of the diff
19 } 20 21 /** 22 * {@inheritdoc} 23 */ 24 public function getValue(): bool { 25 return parent::getValue(); 26 } 27 28 /** 29 * {@inheritdoc} 30 */ 31 public function setValue(mixed $value): void { 32 // We're willing to convert a numeric value to boolean. 33 assert(is_bool($value) || is_numeric($value)); 34 parent::setValue((bool) $value); 21 21 const multipleChoiceFilterNames = Object.keys(filterDefinitions).filter( 22 22 (name) => filterDefinitions[name]._type === 'multiple_choice', 23 23 ); 24 const numberOfFilters = Object.keys(filterDefinitions).length; 25 const numberOfSorts = Object.keys(sorts).length; I thought about that, but I prefer these more clearly-worded variables, at least for now, because frankly...the Svelte code is full of terrible variable names that we inherited, so I'm erring on the side of being as drop-dead clear as possible, even if it's a little more verbose.
Edited by Adam G-H
333 333 public function testFiltersShownIfDefinedBySource(): void { 334 if (version_compare(\Drupal::VERSION, '10.3', '<')) { 335 $this->markTestSkipped('This test requires Drupal 10.3 or later.'); 336 } 337 334 $assert_session = $this->assertSession(); 338 335 $this->config('project_browser.admin_settings') 339 336 ->set('enabled_sources', ['project_browser_test_mock']) 340 337 ->save(); 341 338 342 // Make the mock source show no filters, and ensure that we never see any. 339 // Make the mock source show no filters, and ensure that we never see any 340 // after a brief wait. 343 341 \Drupal::state()->set('filters_to_define', []); 344 342 $this->drupalGet('admin/modules/browse/project_browser_test_mock'); 345 $this->assertNull($assert_session->waitForElementVisible('css', '.search__form-filters-container')); 343 $this->assertNull($assert_session->waitForElementVisible('css', '.search__filters', 4000)); 370 $this->assertElementIsVisible('css', self::MAINTENANCE_OPTION_SELECTOR); 371 $this->assertPageHasText('Security advisory coverage'); 372 $this->assertElementIsVisible('css', self::SECURITY_OPTION_SELECTOR); 373 // Make sure no other filters are displayed. 374 $this->assertFalse($assert_session->waitForText('Development status')); 375 $this->assertNull($assert_session->waitForElementVisible('css', self::DEVELOPMENT_OPTION_SELECTOR)); 376 $this->assertFalse($assert_session->waitForText('Filter by category')); 377 // Make sure category filter element is not visible. 378 $this->assertNull($assert_session->waitForElementVisible('css', 'div.search__form-filters-container > div.search__form-filters > section > fieldset > div')); 367 $this->assertElementIsVisible('named', ['field', 'maintenance_status']); 368 $this->assertElementIsVisible('named', ['field', 'security_advisory_coverage']); 369 // Make sure no other filters are displayed after a brief wait. 370 $this->assertNull($assert_session->waitForField('development_status', 4000)); 371 $this->assertFalse($assert_session->waitForText('Filter by category', 4000)); 372 // Make sure category filter element is not visible after a brief wait. 373 $this->assertNull($assert_session->waitForElementVisible('css', 'div.search__form-filters-container > div.search__form-filters > section > fieldset > div', 4000)); - Comment on lines +367 to +373
Just making these "wait for something to NOT appear" assertions less than 10 seconds, which is excessive.
Edited by Adam G-H