Skip to content

Commit c6070cb

Browse files
authored
Feat(design-collections-page): Collections landing page layout (#91)
* feat(design-collections-page): added layout for the collections landing page * feat(design-collections-page): added help dialog, fixed comments * feat(design-collections-page): fixed circular dependency imports issue
1 parent f7644bc commit c6070cb

File tree

59 files changed

+1649
-249
lines changed

Some content is hidden

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

59 files changed

+1649
-249
lines changed

src/app/app.routes.ts

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -64,6 +64,10 @@ export const routes: Routes = [
6464
loadComponent: () =>
6565
import('./features/static/privacy-policy/privacy-policy.component').then((mod) => mod.PrivacyPolicyComponent),
6666
},
67+
{
68+
path: 'collections',
69+
loadChildren: () => import('./features/collections/collections.routes').then((mod) => mod.collectionsRoutes),
70+
},
6771
{
6872
path: 'meetings',
6973
loadComponent: () => import('./features/meetings/meetings.component').then((mod) => mod.MeetingsComponent),

src/app/core/constants/nav-items.constant.ts

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -40,6 +40,12 @@ export const NAV_ITEMS: NavItem[] = [
4040
icon: 'profile',
4141
useExactMatch: true,
4242
},
43+
{
44+
path: '/collections',
45+
label: 'navigation.collections',
46+
icon: 'collections',
47+
useExactMatch: true,
48+
},
4349
{
4450
path: '/meetings',
4551
label: 'navigation.meetings',

src/app/core/interceptors/auth.interceptor.ts

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,8 +7,9 @@ export const authInterceptor: HttpInterceptorFn = (
77
next: HttpHandlerFn
88
): Observable<HttpEvent<unknown>> => {
99
const authToken = 'UlO9O9GNKgVzJD7pUeY53jiQTKJ4U2znXVWNvh0KZQruoENuILx0IIYf9LoDz7Duq72EIm';
10-
// '2rjFZwmdDG4rtKj7hGkEMO6XyHBM2lN7XBbsA1e8OqcFhOWu6Z7fQZiheu9RXtzSeVrgOt';
11-
// 'OBJoUomBgbUuDgQo5JoaSKNya6XaYcd0ojAX1XOLmWi6J2arQPzByxyEi81fHE60drQUWv';
10+
// OBJoUomBgbUuDgQo5JoaSKNya6XaYcd0ojAX1XOLmWi6J2arQPzByxyEi81fHE60drQUWv
11+
// UlO9O9GNKgVzJD7pUeY53jiQTKJ4U2znXVWNvh0KZQruoENuILx0IIYf9LoDz7Duq72EIm kyrylo
12+
// 2rjFZwmdDG4rtKj7hGkEMO6XyHBM2lN7XBbsA1e8OqcFhOWu6Z7fQZiheu9RXtzSeVrgOt roman nastyuk
1213

1314
if (authToken) {
1415
const authReq = req.clone({
Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
<section class="collections flex flex-column flex-1 mt-0 sm:mt-5 xl:mt-7">
2+
<div class="collections-sub-header flex justify-content-between flex-column gap-4 mb-4 sm:mb-6 sm:gap-0 sm:flex-row">
3+
<div class="flex gap-3">
4+
<i class="collections-icon text-white osf-icon-collections"></i>
5+
<h1 class="flex align-items-center text-white">Collection Title</h1>
6+
</div>
7+
8+
<p-button class="collections-heading-btn" [label]="'collections.buttons.addToCollection' | translate" />
9+
</div>
10+
11+
<div class="search-input-container">
12+
<img
13+
ngSrc="assets/icons/colored/question-mark.svg"
14+
alt="better-research"
15+
tabindex="0"
16+
role="button"
17+
height="36"
18+
width="36"
19+
class="cursor-pointer"
20+
(click)="openHelpDialog()"
21+
(keydown.enter)="openHelpDialog()"
22+
/>
23+
<osf-search-input [control]="searchControl" [placeholder]="'collections.searchInput.placeholder' | translate" />
24+
</div>
25+
26+
<div class="content-container flex-1">
27+
<osf-collections-main-content />
28+
</div>
29+
</section>
Lines changed: 40 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,40 @@
1+
@use "assets/styles/variables" as var;
2+
@use "assets/styles/mixins" as mix;
3+
4+
:host {
5+
--collection-bg-color: #013b5c;
6+
display: flex;
7+
flex-direction: column;
8+
flex: 1;
9+
10+
.collections {
11+
background: var(--collection-bg-color);
12+
border: 2px solid var.$white;
13+
border-top: none;
14+
15+
.collections-sub-header {
16+
margin: mix.rem(48px) mix.rem(28px);
17+
18+
.collections-icon {
19+
font-size: mix.rem(42px);
20+
}
21+
}
22+
23+
.search-input-container {
24+
margin: 0 mix.rem(28px) mix.rem(48px) mix.rem(28px);
25+
position: relative;
26+
27+
img {
28+
position: absolute;
29+
right: mix.rem(4px);
30+
top: mix.rem(4px);
31+
z-index: 1;
32+
}
33+
}
34+
35+
.content-container {
36+
background: var.$white;
37+
padding: mix.rem(28px);
38+
}
39+
}
40+
}
Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
import { ComponentFixture, TestBed } from '@angular/core/testing';
2+
3+
import { CollectionsComponent } from './collections.component';
4+
5+
describe('CollectionsComponent', () => {
6+
let component: CollectionsComponent;
7+
let fixture: ComponentFixture<CollectionsComponent>;
8+
9+
beforeEach(async () => {
10+
await TestBed.configureTestingModule({
11+
imports: [CollectionsComponent],
12+
}).compileComponents();
13+
14+
fixture = TestBed.createComponent(CollectionsComponent);
15+
component = fixture.componentInstance;
16+
fixture.detectChanges();
17+
});
18+
19+
it('should create', () => {
20+
expect(component).toBeTruthy();
21+
});
22+
});
Lines changed: 35 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,35 @@
1+
import { TranslatePipe, TranslateService } from '@ngx-translate/core';
2+
3+
import { Button } from 'primeng/button';
4+
import { DialogService } from 'primeng/dynamicdialog';
5+
6+
import { NgOptimizedImage } from '@angular/common';
7+
import { ChangeDetectionStrategy, Component, inject } from '@angular/core';
8+
import { FormControl } from '@angular/forms';
9+
10+
import { CollectionsHelpDialogComponent, CollectionsMainContentComponent } from '@osf/features/collections/components';
11+
import { SearchInputComponent } from '@shared/components';
12+
13+
@Component({
14+
selector: 'osf-collections',
15+
imports: [NgOptimizedImage, SearchInputComponent, TranslatePipe, Button, CollectionsMainContentComponent],
16+
templateUrl: './collections.component.html',
17+
styleUrl: './collections.component.scss',
18+
providers: [DialogService],
19+
changeDetection: ChangeDetectionStrategy.OnPush,
20+
})
21+
export class CollectionsComponent {
22+
protected dialogService = inject(DialogService);
23+
protected translateService = inject(TranslateService);
24+
protected searchControl = new FormControl('');
25+
26+
openHelpDialog() {
27+
this.dialogService.open(CollectionsHelpDialogComponent, {
28+
focusOnShow: false,
29+
header: this.translateService.instant('collections.helpDialog.header'),
30+
closeOnEscape: true,
31+
modal: true,
32+
closable: true,
33+
});
34+
}
35+
}
Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
import { Routes } from '@angular/router';
2+
3+
import { CollectionsComponent } from '@osf/features/collections/collections.component';
4+
5+
export const collectionsRoutes: Routes = [
6+
{
7+
path: '',
8+
component: CollectionsComponent,
9+
},
10+
];
Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
<div class="mb-4 mt-4 flex gap-3 flex-wrap">
2+
@if (activeFilters().programArea.length) {
3+
@for (filter of activeFilters().programArea; track filter) {
4+
<p-chip [label]="filter" [removable]="true" (onRemove)="onRemoveProgramAreaFilter(filter)">
5+
<ng-template pTemplate="removeicon">
6+
<i class="osf-icon-close text-xs font-bold text-align-center" tabindex="0" role="button"></i>
7+
</ng-template>
8+
</p-chip>
9+
}
10+
}
11+
12+
@if (activeFilters().collectedType.length) {
13+
@for (filter of activeFilters().collectedType; track filter) {
14+
<p-chip [label]="filter" [removable]="true" (onRemove)="onRemoveCollectedTypeFilter(filter)">
15+
<ng-template pTemplate="removeicon">
16+
<i class="osf-icon-close text-xs font-bold text-align-center" tabindex="0" role="button"></i>
17+
</ng-template>
18+
</p-chip>
19+
}
20+
}
21+
</div>

src/app/features/collections/components/collections-filter-chips/collections-filter-chips.component.scss

Whitespace-only changes.

0 commit comments

Comments
 (0)