Skip to content
Snippets Groups Projects
Commit 4c547544 authored by Eric Rubino's avatar Eric Rubino Committed by Chris Wells
Browse files

Issue #3487842 by kd_ace, ericrubino, markfelton, chrisfromredfin: Filter by...

Issue #3487842 by kd_ace, ericrubino, markfelton, chrisfromredfin: Filter by category alignment is off by 2 pixels
parent 0597c082
No related branches found
Tags 2.0.0-alpha5
No related merge requests found
/* WIP: Move from the style tags. */ /* WIP: Move from the style tags. */
/* <Filter> */ /* <Filter> */
.pb-filter__fieldset {
margin: 0;
padding: 0;
}
.pb-filter__summary { .pb-filter__summary {
padding: 1rem; padding: 1rem;
cursor: pointer; cursor: pointer;
......
...@@ -133,21 +133,21 @@ class RandomDataPlugin extends ProjectBrowserSourceBase { ...@@ -133,21 +133,21 @@ class RandomDataPlugin extends ProjectBrowserSourceBase {
TRUE, TRUE,
$this->t('Show projects covered by a security policy'), $this->t('Show projects covered by a security policy'),
$this->t('Show all'), $this->t('Show all'),
$this->t('Security Advisory Coverage'), $this->t('Security advisory coverage'),
NULL, NULL,
); );
$filters['maintenanceStatus'] = new BooleanFilter( $filters['maintenanceStatus'] = new BooleanFilter(
TRUE, TRUE,
$this->t('Show actively maintained projects'), $this->t('Show actively maintained projects'),
$this->t('Show all'), $this->t('Show all'),
$this->t('Maintenance Status'), $this->t('Maintenance status'),
NULL, NULL,
); );
$filters['developmentStatus'] = new BooleanFilter( $filters['developmentStatus'] = new BooleanFilter(
TRUE, TRUE,
$this->t('Show projects under active development'), $this->t('Show projects under active development'),
$this->t('Show all'), $this->t('Show all'),
$this->t('Development Status'), $this->t('Development status'),
NULL, NULL,
); );
......
...@@ -251,21 +251,21 @@ class DrupalDotOrgJsonApi extends ProjectBrowserSourceBase { ...@@ -251,21 +251,21 @@ class DrupalDotOrgJsonApi extends ProjectBrowserSourceBase {
TRUE, TRUE,
$this->t('Show projects covered by a security policy'), $this->t('Show projects covered by a security policy'),
$this->t('Show all'), $this->t('Show all'),
$this->t('Security Advisory Coverage'), $this->t('Security advisory coverage'),
NULL, NULL,
); );
$filters['maintenanceStatus'] = new BooleanFilter( $filters['maintenanceStatus'] = new BooleanFilter(
TRUE, TRUE,
$this->t('Show actively maintained projects'), $this->t('Show actively maintained projects'),
$this->t('Show all'), $this->t('Show all'),
$this->t('Maintenance Status'), $this->t('Maintenance status'),
NULL, NULL,
); );
$filters['developmentStatus'] = new BooleanFilter( $filters['developmentStatus'] = new BooleanFilter(
TRUE, TRUE,
$this->t('Show projects under active development'), $this->t('Show projects under active development'),
$this->t('Show all'), $this->t('Show all'),
$this->t('Development Status'), $this->t('Development status'),
NULL, NULL,
); );
......
File suppressed by a .gitattributes entry or the file's encoding is unsupported.
File suppressed by a .gitattributes entry or the file's encoding is unsupported.
...@@ -151,57 +151,50 @@ ...@@ -151,57 +151,50 @@
}); });
</script> </script>
<section <div class="filter-group__filter-options form-item">
aria-label={Drupal.t('Filter by category')} <label for="pb-text" class="form-item__label"
class="search__form-item js-form-item form-item js-form-type-select form-type--select" >{Drupal.t('Filter by category')}</label
> >
<fieldset class="pb-filter__fieldset"> {#await apiModuleCategory then categoryList}
<label for="pb-text" class="form-item__label" <div
>{Drupal.t('Filter by category')}</label role="button"
tabindex="0"
class="pb-filter__multi-dropdown form-element form-element--type-select"
on:click={() => {
showHideFilter();
}}
on:blur={onBlur}
on:keydown={onKeyDown}
> >
{#await apiModuleCategory then categoryList} <span class="pb-filter__multi-dropdown__label"
>{$moduleCategoryFilter.length
? $moduleCategoryFilter
.map((category) => $moduleCategoryVocabularies[category])
.join(', ')
: Drupal.t('Select categories')}</span
>
<div <div
role="button" class="pb-filter__multi-dropdown__items
tabindex="0" pb-filter__multi-dropdown__items--{filterVisible ? 'visible' : 'hidden'}"
class="pb-filter__multi-dropdown form-element form-element--type-select"
on:click={() => {
showHideFilter();
}}
on:blur={onBlur}
on:keydown={onKeyDown}
> >
<span class="pb-filter__multi-dropdown__label" {#each categoryList[$activeTab] as dt}
>{$moduleCategoryFilter.length <div class="pb-filter__checkbox-label">
? $moduleCategoryFilter <input
.map((category) => $moduleCategoryVocabularies[category]) type="checkbox"
.join(', ') id={dt.id}
: Drupal.t('Select categories')}</span class="pb-filter__checkbox form-checkbox form-boolean form-boolean--type-checkbox"
> bind:group={$moduleCategoryFilter}
<div on:change={onSelectCategory}
class="pb-filter__multi-dropdown__items on:blur={onBlur}
pb-filter__multi-dropdown__items--{filterVisible on:keydown={onKeyDown}
? 'visible' value={dt.id}
: 'hidden'}" />
> <label for={dt.id} class="pb-filter__checkbox-label-txt">
{#each categoryList[$activeTab] as dt} {dt.name}
<div class="pb-filter__checkbox-label"> </label>
<input </div>
type="checkbox" {/each}
id={dt.id}
class="pb-filter__checkbox form-checkbox form-boolean form-boolean--type-checkbox"
bind:group={$moduleCategoryFilter}
on:change={onSelectCategory}
on:blur={onBlur}
on:keydown={onKeyDown}
value={dt.id}
/>
<label for={dt.id} class="pb-filter__checkbox-label-txt">
{dt.name}
</label>
</div>
{/each}
</div>
</div> </div>
{/await} </div>
</fieldset> {/await}
</section> </div>
...@@ -353,21 +353,21 @@ class ProjectBrowserTestMock extends ProjectBrowserSourceBase { ...@@ -353,21 +353,21 @@ class ProjectBrowserTestMock extends ProjectBrowserSourceBase {
TRUE, TRUE,
$this->t('Show projects covered by a security policy'), $this->t('Show projects covered by a security policy'),
$this->t('Show all'), $this->t('Show all'),
$this->t('Security Advisory Coverage'), $this->t('Security advisory coverage'),
NULL, NULL,
); );
$filters['maintenanceStatus'] = new BooleanFilter( $filters['maintenanceStatus'] = new BooleanFilter(
TRUE, TRUE,
$this->t('Show actively maintained projects'), $this->t('Show actively maintained projects'),
$this->t('Show all'), $this->t('Show all'),
$this->t('Maintenance Status'), $this->t('Maintenance status'),
NULL, NULL,
); );
$filters['developmentStatus'] = new BooleanFilter( $filters['developmentStatus'] = new BooleanFilter(
TRUE, TRUE,
$this->t('Show projects under active development'), $this->t('Show projects under active development'),
$this->t('Show all'), $this->t('Show all'),
$this->t('Development Status'), $this->t('Development status'),
NULL, NULL,
); );
......
...@@ -472,12 +472,12 @@ class ProjectBrowserUiTestJsonApi extends WebDriverTestBase { ...@@ -472,12 +472,12 @@ class ProjectBrowserUiTestJsonApi extends WebDriverTestBase {
// Drupal.org test mock defines only two filters (actively maintained filter // Drupal.org test mock defines only two filters (actively maintained filter
// and security coverage filter). // and security coverage filter).
$assert_session->waitForElementVisible('css', '.search__form-filters-container'); $assert_session->waitForElementVisible('css', '.search__form-filters-container');
$this->assertTrue($assert_session->waitForText('Maintenance Status')); $this->assertTrue($assert_session->waitForText('Maintenance status'));
$assert_session->waitForElementVisible('css', self::MAINTENANCE_OPTION_SELECTOR); $assert_session->waitForElementVisible('css', self::MAINTENANCE_OPTION_SELECTOR);
$this->assertTrue($assert_session->waitForText('Security Advisory Coverage')); $this->assertTrue($assert_session->waitForText('Security advisory coverage'));
$assert_session->waitForElementVisible('css', self::SECURITY_OPTION_SELECTOR); $assert_session->waitForElementVisible('css', self::SECURITY_OPTION_SELECTOR);
// Make sure no other filters are displayed. // Make sure no other filters are displayed.
$this->assertFalse($assert_session->waitForText('Development Status')); $this->assertFalse($assert_session->waitForText('Development status'));
$this->assertNull($assert_session->waitForElementVisible('css', self::DEVELOPMENT_OPTION_SELECTOR)); $this->assertNull($assert_session->waitForElementVisible('css', self::DEVELOPMENT_OPTION_SELECTOR));
$this->assertFalse($assert_session->waitForText('Filter by category')); $this->assertFalse($assert_session->waitForText('Filter by category'));
// Make sure category filter element is not visible. // Make sure category filter element is not visible.
......
...@@ -195,7 +195,7 @@ module.exports = { ...@@ -195,7 +195,7 @@ module.exports = {
'Assert category checkboxes are hidden again.', 'Assert category checkboxes are hidden again.',
); );
assertFocus( assertFocus(
'.filter-group__filter-options:first-of-type .search__filter-select', '.filter-group__filter-options:nth-child(2) .search__filter-select',
'Assert that focus has moved to next filter drop-down.', 'Assert that focus has moved to next filter drop-down.',
); );
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment