Skip to content
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
1 change: 1 addition & 0 deletions src/app/core/components/header/header.component.html
Original file line number Diff line number Diff line change
@@ -1 +1,2 @@
<osf-breadcrumb />
<a [routerLink]="authButtonLink()" class="p-button">{{ authButtonText() }}</a>
8 changes: 6 additions & 2 deletions src/app/core/components/header/header.component.scss
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,12 @@
:host {
position: absolute;
height: 4.5rem;
padding-right: 1.5rem;
padding: 0 1.7rem;
width: 100%;
@include mix.flex-center-right;
@include mix.flex-center-between;
gap: 1rem;

a {
border-radius: 0.42rem;
}
}
4 changes: 2 additions & 2 deletions src/app/core/components/header/header.component.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,15 +4,15 @@ import {
computed,
inject,
} from '@angular/core';
import { Button } from 'primeng/button';
import { Router, RouterLink } from '@angular/router';
import { toSignal } from '@angular/core/rxjs-interop';
import { map } from 'rxjs';
import { BreadcrumbComponent } from '@core/components/breadcrumb/breadcrumb.component';

@Component({
standalone: true,
selector: 'osf-header',
imports: [Button, RouterLink],
imports: [RouterLink, BreadcrumbComponent],
templateUrl: './header.component.html',
styleUrl: './header.component.scss',
changeDetection: ChangeDetectionStrategy.OnPush,
Expand Down
4 changes: 2 additions & 2 deletions src/app/core/components/root/root.component.scss
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
flex: 1;
overflow-y: auto;
margin: 6px;
background-color: white;
background-color: var.$bg-blue-3;
border-radius: 1rem;

.content {
Expand All @@ -34,8 +34,8 @@
width: 100%;
height: 100%;
flex: 1;
background-color: white;
overflow-y: auto;
background-color: var.$bg-blue-3;

.content {
position: relative;
Expand Down

This file was deleted.

Empty file.

This file was deleted.

201 changes: 104 additions & 97 deletions src/app/features/home/home.component.html
Original file line number Diff line number Diff line change
Expand Up @@ -8,114 +8,121 @@
<!--<p-button label="Default" severity="info"/>-->
<!--<p-button label="Default" class="btn-icon-text"/>-->
<!--<p-button label="Default" class="btn-icon-text-success"/>-->
<div class="dashboard-header">
<img
ngSrc="assets/icons/system/home.svg"
alt="dashboard"
width="36"
height="36"
/>
<span class="dashboard-title">Dashboard</span>
<p-button>Create New Project</p-button>
</div>

<div class="quick-search-container">
<p class="text-center">
Go to <a routerLink="/myprojects">My Projects</a> to organize your work or
<a routerLink="/search">search</a> OSF
</p>
<section
class="home-container"
[class.mobile]="isXSmall()"
[class.portrait]="isPortrait()"
>
<osf-sub-header
[showButton]="true"
[title]="'Dashboard'"
[icon]="'home'"
[buttonLabel]="'Create New Project'"
/>

<div class="search-container">
<i class="osf-icon-search"></i>
<input
class="search-input"
type="text"
placeholder="Search in your projects"
pInputText
[(ngModel)]="searchValue"
/>
</div>
<div class="quick-search-container">
<p class="text-center">
Go to <a routerLink="/myprojects">My Projects</a> to organize your work or
<a routerLink="/search">search</a> OSF
</p>

<p-table
[value]="filteredProjects()"
[rows]="5"
[rowsPerPageOptions]="[2, 5, 10]"
[paginator]="true"
[resizableColumns]="true"
[autoLayout]="true"
[scrollable]="true"
>
<ng-template #header>
<tr>
<th pSortableColumn="title">Title <p-sortIcon field="title" /></th>
<th>Contributors</th>
<th pSortableColumn="modified">
Modified <p-sortIcon field="modified" />
</th>
</tr>
</ng-template>
<ng-template #body let-project>
<tr>
<td>{{ project.title }}</td>
<td>{{ getContributorsList(project) }}</td>
<td>{{ project.dateModified | date: "MMM d, y, h:mm a" }}</td>
</tr>
</ng-template>
</p-table>
</div>
<div class="search-container">
<i class="osf-icon-search"></i>
<input
class="search-input"
type="text"
placeholder="Search in your projects"
pInputText
[(ngModel)]="searchValue"
/>
</div>

<div class="public-projects-container">
<i class="osf-icon-search"></i>
<div class="title-container">
<h1>Discover Public Projects</h1>
<p-table
[value]="filteredProjects()"
[rows]="5"
[rowsPerPageOptions]="[2, 5, 10]"
[paginator]="true"
[resizableColumns]="true"
[autoLayout]="true"
[scrollable]="true"
>
<ng-template #header>
<tr>
<th pSortableColumn="title">
Title
<p-sortIcon field="title" />
</th>
<th>Contributors</th>
<th pSortableColumn="modified">
Modified
<p-sortIcon field="modified" />
</th>
</tr>
</ng-template>
<ng-template #body let-project>
<tr>
<td>{{ project.title }}</td>
<td>{{ getContributorsList(project) }}</td>
<td>{{ project.dateModified | date: "MMM d, y, h:mm a" }}</td>
</tr>
</ng-template>
</p-table>
</div>
</div>

<div class="noteworthy-container">
<div class="news-section">
<h2>New And Noteworthy</h2>
@for (block of noteworthy; track block.title) {
<div class="news-block">
<p class="title">{{ block.title }}</p>
<br />
<p class="authors">{{ block.authors }}</p>
</div>
}
<div class="public-projects-container">
<i class="osf-icon-search"></i>
<div class="title-container">
<h1>Discover Public Projects</h1>
</div>
</div>
<div class="news-section">
<h2>Most Popular</h2>
@for (block of mostPopular; track block.title) {
<div class="news-block">
<p class="title">{{ block.title }}</p>
<br />
<p class="authors">{{ block.authors }}</p>
</div>
}

<div class="noteworthy-container">
<div class="news-section">
<h2>New And Noteworthy</h2>
@for (block of noteworthy; track block.title) {
<div class="news-block">
<p class="title">{{ block.title }}</p>
<br />
<p class="authors">{{ block.authors }}</p>
</div>
}
</div>
<div class="news-section">
<h2>Most Popular</h2>
@for (block of mostPopular; track block.title) {
<div class="news-block">
<p class="title">{{ block.title }}</p>
<br />
<p class="authors">{{ block.authors }}</p>
</div>
}
</div>
</div>
</div>

<div class="latest-research-container">
<div class="content">
<div class="text-container">
<h1>Browse the latest research</h1>
<h2>
Check out the latest preprints hosted on OSF covering a variety of
research areas
</h2>
<div class="latest-research-container">
<div class="content">
<div class="text-container">
<h1>Browse the latest research</h1>
<h2>
Check out the latest preprints hosted on OSF covering a variety of
research areas
</h2>
</div>
<p-button label="View Preprints" severity="success" />
</div>
<p-button label="View Preprints" severity="success" />
</div>
</div>

<div class="hosting-container">
<div class="content">
<div class="text-container">
<h1>Hosting a conference or meeting?</h1>
<h2>
Use the OSF for Meetings service to provide a central location for
conference submissions
</h2>
<div class="hosting-container">
<div class="content">
<div class="text-container">
<h1>Hosting a conference or meeting?</h1>
<h2>
Use the OSF for Meetings service to provide a central location for
conference submissions
</h2>
</div>
<p-button label="View Meetings" severity="success" />
</div>
<p-button label="View Meetings" severity="success" />
</div>
</div>
</section>
22 changes: 6 additions & 16 deletions src/app/features/home/home.component.scss
Original file line number Diff line number Diff line change
Expand Up @@ -10,22 +10,8 @@
:host {
@include flex-container(column);

.dashboard-header {
@include flex-container(row, start);
width: 100%;
padding: 7.14rem 1.71rem 3.43rem 1.71rem;
background: var.$gradient-1;

.dashboard-title {
font-size: 1.71rem;
color: var.$dark-blue-1;
font-weight: 700;
margin-left: 0.86rem;
}

p-button {
margin-left: auto;
}
.home-container {
margin-top: 4.5rem;
}

.quick-search-container {
Expand Down Expand Up @@ -207,4 +193,8 @@
align-self: center;
}
}

.portrait {
margin-top: 0;
}
}
13 changes: 10 additions & 3 deletions src/app/features/home/home.component.ts
Original file line number Diff line number Diff line change
@@ -1,11 +1,14 @@
import { Component, computed, signal } from '@angular/core';
import { Component, computed, inject, signal } from '@angular/core';
import { InputTextModule } from 'primeng/inputtext';
import { FormsModule } from '@angular/forms';
import { TableModule } from 'primeng/table';
import { Project } from '@osf/features/home/models/project.entity';
import { DatePipe, NgOptimizedImage } from '@angular/common';
import { DatePipe } from '@angular/common';
import { RouterLink } from '@angular/router';
import { Button } from 'primeng/button';
import { SubHeaderComponent } from '@shared/components/sub-header/sub-header.component';
import { IS_PORTRAIT, IS_XSMALL } from '@shared/utils/breakpoints.tokens';
import { toSignal } from '@angular/core/rxjs-interop';

@Component({
selector: 'osf-home',
Expand All @@ -15,14 +18,18 @@ import { Button } from 'primeng/button';
FormsModule,
TableModule,
DatePipe,
NgOptimizedImage,
RouterLink,
Button,
SubHeaderComponent,
],
templateUrl: './home.component.html',
styleUrl: './home.component.scss',
})
export class HomeComponent {
#isPortrait$ = inject(IS_PORTRAIT);
#isXSmall$ = inject(IS_XSMALL);
isPortrait = toSignal(this.#isPortrait$);
isXSmall = toSignal(this.#isXSmall$);
projects: Project[] = [
{
id: '1',
Expand Down
Loading