Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix: consistent style an dtext on datasets list page #1492

Merged
merged 4 commits into from
Jun 7, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -12,17 +12,24 @@
</mat-form-field>
<div class="search-button-group">
<button
mat-flat-button
color="accent"
mat-raised-button
color="primary"
class="full-text-search-button"
data-cy="search-button"
(click)="onSearch()"
>
<mat-icon>search</mat-icon>
Search
</button>
<button mat-flat-button data-cy="search-clear-button" (click)="onClear()">
<mat-icon>close</mat-icon>
Clear
<button
mat-raised-button
color="primary"
class="full-text-clear-button"
data-cy="search-clear-button"
(click)="onClear()"
>
<mat-icon>clear</mat-icon>
Clear Text
</button>
</div>
</div>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,4 +16,8 @@ mat-card {
mat-form-field.full-text-search-field {
flex: 1;
}
.full-text-search-button,
.full-text-clear-button {
margin:0 2px;
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -87,7 +87,7 @@ export class FullTextSearchBarComponent implements OnInit, OnDestroy {
onClear(): void {
this.searchTerm = "";
this.searchTermSubject.next(undefined);
this.searchClickSubject.next();
//this.searchClickSubject.next();
}

ngOnDestroy(): void {
Expand Down
24 changes: 13 additions & 11 deletions src/app/datasets/datasets-filter/datasets-filter.component.html
Original file line number Diff line number Diff line change
@@ -1,15 +1,6 @@
<mat-card>
<mat-card-header class="section-container">
<mat-card-title>Filter by...</mat-card-title>
<button
[disabled]="(hasAppliedFilters$ | async) === false"
mat-button
class="clear-button"
color="primary"
(click)="clearFacets()"
>
<mat-icon>clear_all</mat-icon> Reset
</button>
</mat-card-header>

<mat-card-content>
Expand Down Expand Up @@ -207,11 +198,22 @@
<button
mat-raised-button
color="primary"
class="applyButton"
class="datasets-filters-search-button"
(click)="applyFilters()"
>
Apply
<mat-icon>search</mat-icon>
Search
</button>
<button
[disabled]="(hasAppliedFilters$ | async) === false"
mat-raised-button
color="primary"
class="datasets-filters-clear-all-button"
(click)="clearFacets()"
>
<mat-icon>clear_all</mat-icon>
Clear All Filters
</button>
</div>
</mat-card-content>
</mat-card>
Original file line number Diff line number Diff line change
Expand Up @@ -35,8 +35,13 @@ mat-card {
word-break: break-all;
}

.applyButton {
width: 100%;
.datasets-filters-search-button {
width: 49%;
}

.datasets-filters-clear-all-button {
width: 49%;
margin-left: 1%;
}
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -160,10 +160,16 @@ describe("DatasetsFilterComponent", () => {
expect(type).toBeTruthy();
});

it("should contain a clear button", () => {
it("should contain a clear all button", () => {
const compiled = fixture.debugElement.nativeElement;
const btn = compiled.querySelector(".clear-button");
expect(btn.textContent).toContain("Reset");
const btn = compiled.querySelector(".datasets-filters-clear-all-button");
expect(btn.textContent).toContain("Clear All Filters");
});

it("should contain a search button", () => {
const compiled = fixture.debugElement.nativeElement;
const btn = compiled.querySelector(".datasets-filters-search-button");
expect(btn.textContent).toContain("Search");
});

describe("#getFacetId()", () => {
Expand Down
Loading