Skip to content

Commit

Permalink
Merge pull request #2675 from atmire/multiline-search-filter-badge_main
Browse files Browse the repository at this point in the history
Multiline selected facet badge on search page
  • Loading branch information
tdonohue authored Apr 29, 2024
2 parents 99bfe13 + 5859fc1 commit 13dbd6b
Show file tree
Hide file tree
Showing 5 changed files with 19 additions and 6 deletions.
Original file line number Diff line number Diff line change
@@ -1,7 +1,9 @@
<a class="badge badge-primary mr-1 mb-1"
<a class="badge badge-primary mb-1"
[attr.aria-label]="'search.filters.remove' | translate:{ type: ('search.filters.applied.' + key) | translate, value: normalizeFilterValue(value) }"
[routerLink]="searchLink"
[queryParams]="(removeParameters | async)" queryParamsHandling="merge">
{{('search.filters.applied.' + key) | translate}}: {{'search.filters.' + filterName + '.' + value | translate: {default: normalizeFilterValue(value)} }}
<span aria-hidden="true"> ×</span>
<span class="d-flex">
<span class="flex-grow-1 text-left">{{('search.filters.applied.' + key) | translate}}: {{'search.filters.' + filterName + '.' + value | translate: {default: normalizeFilterValue(value)} }}</span>
<span class="pl-1" aria-hidden="true">×</span>
</span>
</a>
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
.badge {
white-space: inherit;
}
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@ import { stripOperatorFromFilterValue } from '../../search.utils';
@Component({
selector: 'ds-search-label',
templateUrl: './search-label.component.html',
styleUrls: ['./search-label.component.scss'],
standalone: true,
imports: [RouterLink, AsyncPipe, TranslateModule],
})
Expand Down
Original file line number Diff line number Diff line change
@@ -1,3 +1,10 @@
:host {
line-height: 1;
}
.labels {
margin: 0 calc(-1 * var(--bs-spacer)/8);
ds-search-label {
display: inline-block;
padding: 0 calc(var(--bs-spacer)/8);
}
}
}
4 changes: 2 additions & 2 deletions src/app/shared/search/search.component.html
Original file line number Diff line number Diff line change
Expand Up @@ -96,8 +96,8 @@
[inPlaceSearch]="inPlaceSearch"
[searchPlaceholder]="searchFormPlaceholder | translate">
</ds-themed-search-form>
<div class="row mb-3 mb-md-1">
<div class="labels col-sm-9">
<div class="mb-3 mb-md-1">
<div class="labels">
<ds-search-labels [inPlaceSearch]="inPlaceSearch"></ds-search-labels>
</div>
</div>
Expand Down

0 comments on commit 13dbd6b

Please sign in to comment.