Skip to content

Commit be84906

Browse files
authored
Merge pull request #99 from CenterForOpenScience/fix/contributors-page
Fix/contributors page
2 parents 4c0a08a + 92fc248 commit be84906

File tree

59 files changed

+523
-210
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

+523
-210
lines changed

src/app/app.component.html

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,3 @@
11
<router-outlet />
22
<osf-toast></osf-toast>
3+
<osf-full-screen-loader></osf-full-screen-loader>

src/app/app.component.ts

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,23 +1,23 @@
1-
import { Store } from '@ngxs/store';
1+
import { createDispatchMap } from '@ngxs/store';
22

3-
import { ChangeDetectionStrategy, Component, inject, OnInit } from '@angular/core';
3+
import { ChangeDetectionStrategy, Component, OnInit } from '@angular/core';
44
import { RouterOutlet } from '@angular/router';
55

66
import { GetCurrentUser } from '@core/store/user';
77

8-
import { ToastComponent } from './shared/components';
8+
import { FullScreenLoaderComponent, ToastComponent } from './shared/components';
99

1010
@Component({
1111
selector: 'osf-root',
12-
imports: [RouterOutlet, ToastComponent],
12+
imports: [RouterOutlet, ToastComponent, FullScreenLoaderComponent],
1313
templateUrl: './app.component.html',
1414
styleUrl: './app.component.scss',
1515
changeDetection: ChangeDetectionStrategy.OnPush,
1616
})
1717
export class AppComponent implements OnInit {
18-
#store = inject(Store);
18+
actions = createDispatchMap({ getCurrentUser: GetCurrentUser });
1919

2020
ngOnInit(): void {
21-
this.#store.dispatch(GetCurrentUser);
21+
this.actions.getCurrentUser();
2222
}
2323
}

src/app/core/components/footer/footer.component.html

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,8 +8,12 @@
88

99
<div class="footer-socials flex justify-content-center align-items-center" [class]="isWeb() ? 'm-y-12' : 'm-y-24'">
1010
@for (icon of socialIcons; track icon.name) {
11-
<a [href]="icon.url" [attr.aria-label]="'footer.socials.' + icon.name | translate">
12-
<img width="37" height="37" [ngSrc]="'assets/icons/socials/' + icon.name + '.svg'" alt="Social" />
11+
<a
12+
class="social-link flex align-items-center justify-content-center"
13+
[href]="icon.url"
14+
[attr.aria-label]="'footer.socials.' + icon.name | translate"
15+
>
16+
<osf-icon [iconClass]="`${icon.iconName} fa-2xl`"></osf-icon>
1317
</a>
1418
}
1519
</div>

src/app/core/components/footer/footer.component.scss

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,20 @@
1818
color: var.$dark-blue-1;
1919
text-align: center;
2020
}
21+
22+
.social-link {
23+
background-color: var.$pr-blue-1;
24+
border-radius: mix.rem(6px);
25+
color: var.$white;
26+
padding: mix.rem(6px);
27+
width: mix.rem(36px);
28+
height: mix.rem(36px);
29+
30+
&:hover {
31+
background-color: var.$pr-blue-3;
32+
text-decoration: none;
33+
}
34+
}
2135
}
2236

2337
.footer-links {
Lines changed: 4 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -1,43 +1,22 @@
11
import { TranslateModule } from '@ngx-translate/core';
22

3-
import { NgOptimizedImage } from '@angular/common';
43
import { ChangeDetectionStrategy, Component, inject } from '@angular/core';
54
import { toSignal } from '@angular/core/rxjs-interop';
65
import { RouterLink } from '@angular/router';
76

8-
import { SocialIcon } from '@osf/shared/models';
7+
import { SOCIAL_ICONS } from '@osf/core/constants';
8+
import { IconComponent } from '@osf/shared/components';
99
import { IS_WEB } from '@shared/utils';
1010

1111
@Component({
1212
selector: 'osf-footer',
13-
imports: [RouterLink, NgOptimizedImage, TranslateModule],
13+
imports: [RouterLink, TranslateModule, IconComponent],
1414
templateUrl: './footer.component.html',
1515
styleUrl: './footer.component.scss',
1616
changeDetection: ChangeDetectionStrategy.OnPush,
1717
})
1818
export class FooterComponent {
1919
isWeb = toSignal(inject(IS_WEB));
2020

21-
protected readonly socialIcons: SocialIcon[] = [
22-
{
23-
name: 'x',
24-
url: 'https://x.com/OSFramework',
25-
ariaLabel: 'X (formerly Twitter)',
26-
},
27-
{
28-
name: 'facebook',
29-
url: 'https://www.facebook.com/CenterForOpenScience/',
30-
ariaLabel: 'Facebook',
31-
},
32-
{
33-
name: 'group',
34-
url: 'https://groups.google.com/g/openscienceframework',
35-
ariaLabel: 'Group',
36-
},
37-
{
38-
name: 'github',
39-
url: 'https://github.com/centerforopenscience',
40-
ariaLabel: 'GitHub',
41-
},
42-
];
21+
protected readonly socialIcons = SOCIAL_ICONS;
4322
}

src/app/core/components/header/header.component.html

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@
33

44
<div class="dropdown-button ml-auto">
55
<p-button
6+
class="custom-dark-hover"
67
icon="fas fa-chevron-down"
78
iconPos="right"
89
[label]="currentUser()?.fullName"

src/app/core/components/index.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,4 +2,5 @@ export { BreadcrumbComponent } from './breadcrumb/breadcrumb.component';
22
export { FooterComponent } from './footer/footer.component';
33
export { HeaderComponent } from './header/header.component';
44
export { RootComponent } from './root/root.component';
5+
export { SidenavComponent } from './sidenav/sidenav.component';
56
export { TopnavComponent } from './topnav/topnav.component';
Lines changed: 53 additions & 57 deletions
Original file line numberDiff line numberDiff line change
@@ -1,58 +1,54 @@
1-
<aside class="custom-scrollbar flex flex-column p-4 h-full">
2-
<img ngSrc="assets/images/logo.svg" alt="OSF Logo" height="36" width="106" />
3-
4-
<nav class="nav-menu m-t-36">
5-
<p-panelMenu [model]="mainMenuItems" [multiple]="false">
6-
<ng-template #item let-item>
7-
<a
8-
[routerLink]="item.routerLink"
9-
routerLinkActive="active"
10-
[routerLinkActiveOptions]="{
11-
exact: item.label !== 'navigation.myProjects' ? item.useExactMatch : true,
12-
}"
13-
class="nav-link flex align-items-center"
14-
[class.mt-5]="item.label === 'navigation.settings' || item.label === 'navigation.myProjects'"
15-
(click)="goToLink(item)"
16-
>
17-
@if (item.icon) {
18-
<osf-icon [iconClass]="`nav-icon ${item.icon}`"></osf-icon>
19-
}
20-
<span>{{ item.label | translate }}</span>
21-
@if (item.items) {
22-
<osf-icon
23-
class="ml-auto pt-1"
24-
[iconClass]="item.expanded ? `fas fa-chevron-down fa-sm` : `fas fa-chevron-right fa-sm`"
25-
></osf-icon>
26-
}
27-
</a>
28-
29-
@if (item.label === 'navigation.myProjects' && isProjectRoute()) {
30-
<div class="ml-4">
31-
<p-panelMenu [model]="myProjectMenuItems" [multiple]="false">
32-
<ng-template #item let-item>
33-
<a
34-
[routerLink]="item.routerLink ? ['/my-projects', currentProjectId(), item.routerLink] : null"
35-
[routerLinkActive]="item.routerLink ? 'active' : ''"
36-
[routerLinkActiveOptions]="{ exact: true }"
37-
class="nav-link flex align-items-center"
38-
(click)="goToLink(item)"
39-
>
40-
@if (item.icon) {
41-
<osf-icon [iconClass]="`nav-icon ${item.icon}`"></osf-icon>
42-
}
43-
<span>{{ item.label | translate }}</span>
44-
@if (item.items) {
45-
<osf-icon
46-
class="ml-auto pt-1"
47-
[iconClass]="item.expanded ? `fas fa-chevron-down fa-sm` : `fas fa-chevron-right fa-sm`"
48-
></osf-icon>
49-
}
50-
</a>
51-
</ng-template>
52-
</p-panelMenu>
53-
</div>
1+
<nav class="nav-menu">
2+
<p-panelMenu [model]="mainMenuItems" [multiple]="false">
3+
<ng-template #item let-item>
4+
<a
5+
[routerLink]="item.routerLink"
6+
routerLinkActive="active"
7+
[routerLinkActiveOptions]="{
8+
exact: item.label !== 'navigation.myProjects' ? item.useExactMatch : true,
9+
}"
10+
class="nav-link flex align-items-center"
11+
[class.mt-5]="item.label === 'navigation.settings' || item.label === 'navigation.myProjects'"
12+
(click)="goToLink(item)"
13+
>
14+
@if (item.icon) {
15+
<osf-icon [iconClass]="`nav-icon ${item.icon}`"></osf-icon>
5416
}
55-
</ng-template>
56-
</p-panelMenu>
57-
</nav>
58-
</aside>
17+
<span>{{ item.label | translate }}</span>
18+
@if (item.items) {
19+
<osf-icon
20+
class="ml-auto pt-1"
21+
[iconClass]="item.expanded ? `fas fa-chevron-down fa-sm` : `fas fa-chevron-right fa-sm`"
22+
></osf-icon>
23+
}
24+
</a>
25+
26+
@if (item.label === 'navigation.myProjects' && isProjectRoute()) {
27+
<div class="ml-4">
28+
<p-panelMenu [model]="myProjectMenuItems" [multiple]="false">
29+
<ng-template #item let-item>
30+
<a
31+
[routerLink]="item.routerLink ? ['/my-projects', currentProjectId(), item.routerLink] : null"
32+
[routerLinkActive]="item.routerLink ? 'active' : ''"
33+
[routerLinkActiveOptions]="{ exact: true }"
34+
class="nav-link flex align-items-center"
35+
(click)="goToLink(item)"
36+
>
37+
@if (item.icon) {
38+
<osf-icon [iconClass]="`nav-icon ${item.icon}`"></osf-icon>
39+
}
40+
<span>{{ item.label | translate }}</span>
41+
@if (item.items) {
42+
<osf-icon
43+
class="ml-auto pt-1"
44+
[iconClass]="item.expanded ? `fas fa-chevron-down fa-sm` : `fas fa-chevron-right fa-sm`"
45+
></osf-icon>
46+
}
47+
</a>
48+
</ng-template>
49+
</p-panelMenu>
50+
</div>
51+
}
52+
</ng-template>
53+
</p-panelMenu>
54+
</nav>

src/app/core/components/nav-menu/nav-menu.component.ts

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,6 @@ import { PanelMenuModule } from 'primeng/panelmenu';
55

66
import { filter, map } from 'rxjs';
77

8-
import { NgOptimizedImage } from '@angular/common';
98
import { Component, computed, inject, output } from '@angular/core';
109
import { toSignal } from '@angular/core/rxjs-interop';
1110
import { ActivatedRoute, NavigationEnd, Router, RouterLink, RouterLinkActive } from '@angular/router';
@@ -16,7 +15,7 @@ import { NavItem } from '@osf/shared/models';
1615

1716
@Component({
1817
selector: 'osf-nav-menu',
19-
imports: [NgOptimizedImage, RouterLinkActive, RouterLink, PanelMenuModule, TranslatePipe, IconComponent],
18+
imports: [RouterLinkActive, RouterLink, PanelMenuModule, TranslatePipe, IconComponent],
2019
templateUrl: './nav-menu.component.html',
2120
styleUrl: './nav-menu.component.scss',
2221
})

src/app/core/components/root/root.component.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
@if (isWeb()) {
22
<div class="layout-desktop">
3-
<osf-nav-menu></osf-nav-menu>
3+
<osf-sidenav></osf-sidenav>
44

55
<div class="content-wrapper">
66
<osf-header></osf-header>

0 commit comments

Comments
 (0)