Skip to content

Commit 22ef67d

Browse files
authored
Merge pull request #156 from CenterForOpenScience/fix/searh-buttons
fix(search-buttons): updated search buttons
2 parents f175a72 + 4be9207 commit 22ef67d

File tree

10 files changed

+29
-102
lines changed

10 files changed

+29
-102
lines changed

src/app/features/collections/components/collections-main-content/collections-main-content.component.html

Lines changed: 2 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -31,29 +31,9 @@ <h3 class="highlight">{{ 'collections.searchResults.noResults' | translate }}</h
3131
</ng-template>
3232
</p-select>
3333
} @else {
34-
<img
35-
ngSrc="assets/icons/colored/filter.svg"
36-
class="custom-dark-hover cursor-pointer"
37-
tabindex="0"
38-
role="button"
39-
alt="filter by"
40-
width="44"
41-
height="44"
42-
(keydown.enter)="openFilters()"
43-
(click)="openFilters()"
44-
/>
34+
<p-button severity="secondary" icon="fas fa-sliders" size="large" (click)="openFilters()"></p-button>
4535

46-
<img
47-
ngSrc="assets/icons/colored/sort.svg"
48-
tabindex="0"
49-
role="button"
50-
alt="sort by"
51-
width="44"
52-
height="44"
53-
class="custom-dark-hover cursor-pointer ml-2"
54-
(keydown.enter)="openSorting()"
55-
(click)="openSorting()"
56-
/>
36+
<p-button severity="secondary" icon="fas fa-filter" size="large" (click)="openSorting()"></p-button>
5737
}
5838
</div>
5939
</div>

src/app/features/collections/components/collections-main-content/collections-main-content.component.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,10 +2,10 @@ import { createDispatchMap, select } from '@ngxs/store';
22

33
import { TranslatePipe } from '@ngx-translate/core';
44

5+
import { Button } from 'primeng/button';
56
import { Select } from 'primeng/select';
67
import { Skeleton } from 'primeng/skeleton';
78

8-
import { NgOptimizedImage } from '@angular/common';
99
import { ChangeDetectionStrategy, Component, computed, inject, signal } from '@angular/core';
1010
import { toSignal } from '@angular/core/rxjs-interop';
1111
import { FormsModule } from '@angular/forms';
@@ -21,7 +21,7 @@ import { CollectionsSearchResultsComponent } from '../collections-search-results
2121
@Component({
2222
selector: 'osf-collections-main-content',
2323
imports: [
24-
NgOptimizedImage,
24+
Button,
2525
Select,
2626
FormsModule,
2727
TranslatePipe,

src/app/features/institutions/institutions.component.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
/>
88

99
@if (institutionsLoading()) {
10-
<div class="flex-1 mt-4 md:mt-8 lg:pt-5 bg-white">
10+
<div class="flex-1 mt-4 bg-white md:mt-8 lg:pt-5">
1111
<osf-loading-spinner />
1212
</div>
1313
} @else {

src/app/features/my-profile/components/my-profile-resources/my-profile-resources.component.html

Lines changed: 3 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -31,28 +31,10 @@ <h3>Sort by:</h3>
3131
></p-select>
3232
} @else {
3333
@if (isAnyFilterOptions()) {
34-
<img
35-
ngSrc="assets/icons/colored/filter.svg"
36-
tabindex="0"
37-
role="button"
38-
alt="filter by"
39-
width="44"
40-
height="44"
41-
(keydown.enter)="openFilters()"
42-
(click)="openFilters()"
43-
/>
34+
<p-button severity="secondary" icon="fas fa-sliders" size="large" (click)="openFilters()"></p-button>
4435
}
45-
<img
46-
ngSrc="assets/icons/colored/sort.svg"
47-
tabindex="0"
48-
role="button"
49-
alt="sort by"
50-
width="44"
51-
height="44"
52-
class="ml-2"
53-
(keydown.enter)="openSorting()"
54-
(click)="openSorting()"
55-
/>
36+
37+
<p-button class="ml-2" severity="secondary" icon="fas fa-filter" size="large" (click)="openSorting()"></p-button>
5638
}
5739
</div>
5840
</div>

src/app/features/my-profile/components/my-profile-resources/my-profile-resources.component.ts

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,6 @@ import { Button } from 'primeng/button';
44
import { DataView } from 'primeng/dataview';
55
import { Select } from 'primeng/select';
66

7-
import { NgOptimizedImage } from '@angular/common';
87
import { ChangeDetectionStrategy, Component, computed, effect, inject, signal, untracked } from '@angular/core';
98
import { toSignal } from '@angular/core/rxjs-interop';
109
import { FormsModule } from '@angular/forms';
@@ -24,7 +23,6 @@ import { MyProfileResourceFiltersSelectors } from '../my-profile-resource-filter
2423
imports: [
2524
DataView,
2625
MyProfileFilterChipsComponent,
27-
NgOptimizedImage,
2826
MyProfileResourceFiltersComponent,
2927
Select,
3028
FormsModule,

src/app/features/preprints/components/filters/preprints-resources/preprints-resources.component.html

Lines changed: 11 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -22,28 +22,21 @@ <h4>Sort by:</h4>
2222
/>
2323
} @else {
2424
@if (isAnyFilterOptions()) {
25-
<img
26-
ngSrc="assets/icons/colored/filter.svg"
27-
tabindex="0"
28-
role="button"
29-
alt="filter by"
30-
width="44"
31-
height="44"
32-
(keydown.enter)="switchMobileFiltersSectionVisibility()"
25+
<p-button
26+
severity="secondary"
27+
icon="fas fa-sliders"
28+
size="large"
3329
(click)="switchMobileFiltersSectionVisibility()"
34-
/>
30+
></p-button>
3531
}
36-
<img
37-
ngSrc="assets/icons/colored/sort.svg"
38-
tabindex="0"
39-
role="button"
40-
alt="sort by"
41-
width="44"
42-
height="44"
32+
33+
<p-button
4334
class="ml-2"
44-
(keydown.enter)="switchMobileSortingSectionVisibility()"
35+
severity="secondary"
36+
icon="fas fa-filter"
37+
size="large"
4538
(click)="switchMobileSortingSectionVisibility()"
46-
/>
39+
></p-button>
4740
}
4841
</div>
4942
</section>

src/app/features/preprints/components/filters/preprints-resources/preprints-resources.component.ts

Lines changed: 6 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -4,30 +4,26 @@ import { Button } from 'primeng/button';
44
import { DataView } from 'primeng/dataview';
55
import { Select } from 'primeng/select';
66

7-
import { NgOptimizedImage } from '@angular/common';
87
import { ChangeDetectionStrategy, Component, HostBinding, inject, signal } from '@angular/core';
98
import { toSignal } from '@angular/core/rxjs-interop';
109
import { FormsModule } from '@angular/forms';
1110

1211
import { Primitive } from '@core/helpers';
12+
import { SetSortBy } from '@osf/features/collections/store';
13+
import { GetResourcesByLink } from '@osf/features/my-profile/store';
1314
import { PreprintsFilterChipsComponent, PreprintsResourcesFiltersComponent } from '@osf/features/preprints/components';
14-
import {
15-
GetResourcesByLink,
16-
PreprintsDiscoverSelectors,
17-
SetSortBy,
18-
} from '@osf/features/preprints/store/preprints-discover';
15+
import { PreprintsDiscoverSelectors } from '@osf/features/preprints/store/preprints-discover';
1916
import { PreprintsResourcesFiltersSelectors } from '@osf/features/preprints/store/preprints-resources-filters';
2017
import { PreprintsResourcesFiltersOptionsSelectors } from '@osf/features/preprints/store/preprints-resources-filters-options';
21-
import { ResourceCardComponent } from '@shared/components';
22-
import { searchSortingOptions } from '@shared/constants';
23-
import { IS_WEB, IS_XSMALL } from '@shared/utils';
18+
import { ResourceCardComponent } from '@osf/shared/components';
19+
import { searchSortingOptions } from '@osf/shared/constants';
20+
import { IS_WEB, IS_XSMALL } from '@osf/shared/utils';
2421

2522
@Component({
2623
selector: 'osf-preprints-resources',
2724
imports: [
2825
Select,
2926
FormsModule,
30-
NgOptimizedImage,
3127
PreprintsResourcesFiltersComponent,
3228
PreprintsFilterChipsComponent,
3329
DataView,

src/app/features/search/components/resources/resources.component.html

Lines changed: 3 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -32,29 +32,10 @@ <h3>0 results</h3>
3232
></p-select>
3333
} @else {
3434
@if (isAnyFilterOptions()) {
35-
<img
36-
class="custom-dark-hover cursor-pointer"
37-
ngSrc="assets/icons/colored/filter.svg"
38-
tabindex="0"
39-
role="button"
40-
alt="filter by"
41-
width="44"
42-
height="44"
43-
(keydown.enter)="openFilters()"
44-
(click)="openFilters()"
45-
/>
35+
<p-button severity="secondary" icon="fas fa-sliders" size="large" (click)="openFilters()"></p-button>
4636
}
47-
<img
48-
class="custom-dark-hover cursor-pointer ml-2"
49-
ngSrc="assets/icons/colored/sort.svg"
50-
tabindex="0"
51-
role="button"
52-
alt="sort by"
53-
width="44"
54-
height="44"
55-
(keydown.enter)="openSorting()"
56-
(click)="openSorting()"
57-
/>
37+
38+
<p-button class="ml-2" severity="secondary" icon="fas fa-filter" size="large" (click)="openSorting()"></p-button>
5839
}
5940
</div>
6041
</div>

src/app/features/search/components/resources/resources.component.ts

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,6 @@ import { DataViewModule } from 'primeng/dataview';
66
import { Select } from 'primeng/select';
77
import { TableModule } from 'primeng/table';
88

9-
import { NgOptimizedImage } from '@angular/common';
109
import { ChangeDetectionStrategy, Component, computed, effect, inject, signal, untracked } from '@angular/core';
1110
import { toSignal } from '@angular/core/rxjs-interop';
1211
import { FormsModule, ReactiveFormsModule } from '@angular/forms';
@@ -32,7 +31,6 @@ import { ResourceFiltersSelectors } from '../resource-filters/store';
3231
DataViewModule,
3332
FilterChipsComponent,
3433
Select,
35-
NgOptimizedImage,
3634
ResourceCardComponent,
3735
Button,
3836
],

src/app/features/settings/tokens/store/tokens.state.ts

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import { Action, State, StateContext, Store } from '@ngxs/store';
1+
import { Action, State, StateContext } from '@ngxs/store';
22

33
import { catchError, of, tap, throwError } from 'rxjs';
44

@@ -28,7 +28,6 @@ import { TokensStateModel } from './tokens.models';
2828
@Injectable()
2929
export class TokensState {
3030
tokensService = inject(TokensService);
31-
store = inject(Store);
3231

3332
@Action(GetScopes)
3433
getScopes(ctx: StateContext<TokensStateModel>) {

0 commit comments

Comments
 (0)