Skip to content

Commit 4671318

Browse files
authored
Feat/181,191 - Preprint provider discover (#108)
* refactor(preprint-hero): Extracted logic of handling search input * feat(preprints-discover): Added discover page, registered route, basic template * refactor(resource-req-type): Moved enum to shared * refactor(resource-filter-label): Moved model to shared * refactor(search-state-defaults): Moved constant to shared * refactor(resource-filters-defaults): Moved constant to shared * feat(preprints-resources-filters-state): Implemented state * refactor(preprints-state): Moved to separate folder * fix(shared-const-index): Fixed index file * feat(preprints-search-state): Implemented state for preprints discover page * feat(preprints-resources-filters-options): Implemented state for preprints resources filters options * feat(preprints-filters-chips): Implemented filters chips component * feat(preprints-date-created-filter): Implemented filter component * fix(preprints-search-state): Created new state to fix strange error * fix(state-provider): Providing states on route level * refactor(sort-options): extracted to shared constants * feat(store): Added selectors to simplify logic * refactor(resource-card-service): Moved to shared * fix(preprints-filter-chips): Add PrimeTemplate import * feat(preprints-resources): Implemented section to handle sorting, filters, search cards * feat(filters-store): Added new filter to the store * fix(style): Fix styles for preprints resources component * feat(preprints-hero): Added ability to pass search control * fix(resource-card): Loading user related counts only for items with ResourceType.Agent * fix(resource-card): Removed link to my projects for almost all resources * feat(home): Added links to already exising preprints and meetings page * feat(preprint-filters): Added all filters needed, Implemented discover page logic * fix(preprint-filters-tests): Fixed imports * fix(preprint-resources-filters): Fixed anyOptionsCount signal * fix(preprint-filters): Added export to index file, fixed imports * fix(resource-card): Removed global styles, added styles to shared component * feat(preprints-discover): Added iri prop to PreprintProviderDetails, used in search requests * fix(filters-chips): Reordered chips, removed unused * fix(preprints-discover): Minor fixes
1 parent 0114b09 commit 4671318

File tree

113 files changed

+2885
-652
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

113 files changed

+2885
-652
lines changed

src/app/core/constants/ngxs-states.constant.ts

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,6 @@ import { CollectionsState } from '@osf/features/collections/store';
44
import { InstitutionsState } from '@osf/features/institutions/store';
55
import { MeetingsState } from '@osf/features/meetings/store';
66
import { MyProjectsState } from '@osf/features/my-projects/store';
7-
import { PreprintsState } from '@osf/features/preprints/store';
87
import { AnalyticsState } from '@osf/features/project/analytics/store';
98
import { ProjectOverviewState } from '@osf/features/project/overview/store';
109
import { RegistrationsState } from '@osf/features/project/registrations/store';
@@ -35,5 +34,4 @@ export const STATES = [
3534
WikiState,
3635
MeetingsState,
3736
RegistrationsState,
38-
PreprintsState,
3937
];

src/app/features/home/home.component.html

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,7 @@ <h1>{{ 'home.loggedIn.latestResearch.title' | translate }}</h1>
4545
<p class="m-t-12">{{ 'home.loggedIn.latestResearch.subtitle' | translate }}</p>
4646
</div>
4747

48-
<p-button [label]="'home.loggedIn.latestResearch.button' | translate" severity="success" />
48+
<p-button routerLink="/preprints" [label]="'home.loggedIn.latestResearch.button' | translate" severity="success" />
4949
</div>
5050

5151
<div class="hosting-container flex flex-column py-6 px-3 md:px-4 xl:flex-row xl:justify-content-between">
@@ -54,6 +54,6 @@ <h1>{{ 'home.loggedIn.hosting.title' | translate }}</h1>
5454
<p class="m-t-12">{{ 'home.loggedIn.hosting.subtitle' | translate }}</p>
5555
</div>
5656

57-
<p-button [label]="'home.loggedIn.hosting.button' | translate" severity="success" />
57+
<p-button routerLink="/meetings" [label]="'home.loggedIn.hosting.button' | translate" severity="success" />
5858
</div>
5959
</section>
Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
11
export * from './filters';
22
export { MyProfileFilterChipsComponent } from './my-profile-filter-chips/my-profile-filter-chips.component';
3-
export { MyProfileResourceCardComponent } from './my-profile-resource-card/my-profile-resource-card.component';
43
export { MyProfileResourceFiltersComponent } from './my-profile-resource-filters/my-profile-resource-filters.component';
54
export { MyProfileResourcesComponent } from './my-profile-resources/my-profile-resources.component';
65
export { MyProfileSearchComponent } from './my-profile-search/my-profile-search.component';

src/app/features/my-profile/components/my-profile-resource-card/my-profile-resource-card.component.html

Lines changed: 0 additions & 182 deletions
This file was deleted.

src/app/features/my-profile/components/my-profile-resource-card/my-profile-resource-card.component.scss

Lines changed: 0 additions & 1 deletion
This file was deleted.

src/app/features/my-profile/components/my-profile-resource-card/my-profile-resource-card.component.spec.ts

Lines changed: 0 additions & 22 deletions
This file was deleted.

src/app/features/my-profile/components/my-profile-resource-card/my-profile-resource-card.component.ts

Lines changed: 0 additions & 75 deletions
This file was deleted.
Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
import { ResourceFilterLabel } from '@shared/models';
2+
13
export interface MyProfileResourceFiltersStateModel {
24
creator: ResourceFilterLabel;
35
dateCreated: ResourceFilterLabel;
@@ -9,9 +11,3 @@ export interface MyProfileResourceFiltersStateModel {
911
provider: ResourceFilterLabel;
1012
partOfCollection: ResourceFilterLabel;
1113
}
12-
13-
export interface ResourceFilterLabel {
14-
filterName: string;
15-
label?: string;
16-
value?: string;
17-
}

src/app/features/my-profile/components/my-profile-resource-filters/store/my-profile-resource-filters.selectors.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
import { Selector } from '@ngxs/store';
22

33
import { ResourceFiltersStateModel } from '@osf/features/search/components/resource-filters/store';
4+
import { ResourceFilterLabel } from '@shared/models';
45

5-
import { ResourceFilterLabel } from './my-profile-resource-filters.model';
66
import { MyProfileResourceFiltersState } from './my-profile-resource-filters.state';
77

88
export class MyProfileResourceFiltersSelectors {

src/app/features/my-profile/components/my-profile-resource-filters/store/my-profile-resource-filters.state.ts

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,8 @@ import { Action, NgxsOnInit, State, StateContext, Store } from '@ngxs/store';
33
import { inject, Injectable } from '@angular/core';
44

55
import { UserSelectors } from '@osf/core/store/user';
6-
import { FilterLabelsModel, resourceFiltersDefaultsModel } from '@osf/shared/models';
6+
import { FilterLabelsModel } from '@osf/shared/models';
7+
import { resourceFiltersDefaults } from '@shared/constants';
78

89
import {
910
SetCreator,
@@ -21,7 +22,7 @@ import { MyProfileResourceFiltersStateModel } from './my-profile-resource-filter
2122
// Store for user selected filters values
2223
@State<MyProfileResourceFiltersStateModel>({
2324
name: 'myProfileResourceFilters',
24-
defaults: resourceFiltersDefaultsModel,
25+
defaults: resourceFiltersDefaults,
2526
})
2627
@Injectable()
2728
export class MyProfileResourceFiltersState implements NgxsOnInit {
@@ -41,6 +42,7 @@ export class MyProfileResourceFiltersState implements NgxsOnInit {
4142
}
4243
});
4344
}
45+
4446
@Action(SetCreator)
4547
setCreator(ctx: StateContext<MyProfileResourceFiltersStateModel>, action: SetCreator) {
4648
ctx.patchState({

0 commit comments

Comments
 (0)