Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Public-18: Allow Notifications in news list #697

Merged
merged 1 commit into from
Sep 17, 2024
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
18 changes: 16 additions & 2 deletions src/app/home/home.component.html
Original file line number Diff line number Diff line change
Expand Up @@ -71,14 +71,21 @@ <h2 tabindex="0" class="mb-4">Recent Activities & Updates</h2>
<td>
<div class="title-container">
<h3 class="title-container__title">
<span class="font-weight-bold" *ngIf="item.project">
<span
class="font-weight-bold"
*ngIf="item.project">
{{ item.project?.name }}
</span>
<span
*ngIf="item.notificationName"
class="font-weight-bold"
>{{ item.notificationName }}</span
>
<span
class="font-weight-bold"
*ngIf="item.projectNotification">
{{ item.projectNotification?.name }}
</span>
<span class="home-news-feed__headline">{{
item.headline
}}</span>
Expand All @@ -94,11 +101,18 @@ <h3 class="title-container__title">
></div>
</div>
<div>
<a
*ngIf="item.type === 'Project Notification News'"
class="btn btn-sm content-btn-alt"
title="View Projects Notifications Page"
href="/project-notifications"
>View Project Notifications Page
</a>
<a
class="btn btn-sm content-btn-alt"
title="View more information about {{ item.project.name }}"
[routerLink]="['/p', item.project?._id]"
*ngIf="item.project?._id"
*ngIf="item.type !== 'Project Notification News' && item.project?._id"
>
Project Info
</a>
Expand Down
3 changes: 3 additions & 0 deletions src/app/models/news.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
import { Project } from './project';
import { ProjectNotification } from './projectNotification';

export class News {
_id: number;
Expand All @@ -8,6 +9,7 @@ export class News {
project: Project;
type: string;
pcp: string;
projectNotification: ProjectNotification;
dateAdded: string;
dateUpdated: string;
contentUrl: string;
Expand All @@ -20,6 +22,7 @@ export class News {
this.project = obj && obj.project || null;
this.type = obj && obj.type || null;
this.pcp = obj && obj.pcp || null;
this.projectNotification = obj && obj.projectNotification || null;
this.active = obj && obj.active || null;
this.dateAdded = obj && obj.dateAdded || null;
this.dateUpdated = obj && obj.dateUpdated || null;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,11 +13,16 @@
<span [innerHtml]="rowData.content"></span>
<br>
<br>
<a *ngIf="rowData.project && rowData.project._id"
<a *ngIf="rowData.project && rowData.project._id && rowData.type !== 'Project Notification News'"
class="btn content-btn-alt mr-1"
[routerLink]="['/p', rowData.project._id ]">
<span>Project Info</span>
</a>
<a *ngIf="rowData.project && rowData.project._id && rowData.type === 'Project Notification News'"
class="btn content-btn-alt mr-1"
href="/project-notifications">
<span>View Project Notifications Page</span>
</a>
<a *ngIf="isSingleDoc(rowData?.documentUrl) && !rowData?.documentUrl.includes('docs?folder')"
class="btn content-btn-alt mr-1"
href="{{rowData.documentUrl}}">
Expand Down
Loading