-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #201 from geneontology/sprint-1
Sprint 1
- Loading branch information
Showing
52 changed files
with
532 additions
and
204 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
import { NgModule } from '@angular/core'; | ||
import { CommonModule } from '@angular/common'; | ||
import { AnnouncementPanelComponent } from './components/announcement-panel/announcement-panel.component'; | ||
import { MatIconModule } from '@angular/material/icon'; | ||
import { MatButtonModule } from '@angular/material/button'; | ||
import { MatSidenavModule } from '@angular/material/sidenav'; | ||
import { FlexLayoutModule } from '@angular/flex-layout'; | ||
import { NoctuaSharedModule } from '@noctua/shared.module'; | ||
|
||
@NgModule({ | ||
imports: [ | ||
CommonModule, | ||
MatIconModule, | ||
MatButtonModule, | ||
MatSidenavModule, | ||
FlexLayoutModule, | ||
NoctuaSharedModule | ||
], | ||
exports: [ | ||
AnnouncementPanelComponent | ||
], | ||
declarations: [ | ||
AnnouncementPanelComponent], | ||
}) | ||
export class NoctuaAnnouncementModule { } |
20 changes: 20 additions & 0 deletions
20
src/@noctua.announcement/components/announcement-panel/announcement-panel.component.html
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
<form fxLayout="column" fxLayoutAlign="start stretch" class="noc-cam-form noc-drawer h-100-p"> | ||
<div class="noc-drawer-header" fxLayout="row" fxLayoutAlign="start center"> | ||
<span class="noc-drawer-header-title"> | ||
Announcements</span> | ||
<span fxFlex></span> | ||
<button mat-stroked-button (click)="close()" class="noc-rounded-button noc-sm" color="primary" | ||
aria-label="Close dialog"> | ||
<mat-icon>close</mat-icon> Close | ||
</button> | ||
</div> | ||
<div class="noc-drawer-body w-100-p p-8" noctuaPerfectScrollbar> | ||
<div *ngFor="let announcement of announcements" class="alert alert-{{announcement.level}} w-100-p my-8"> | ||
<strong>{{announcement.title}}</strong><br> | ||
{{announcement.description}} | ||
<a *ngIf="announcement.descriptionUrl" href="{{announcement.descriptionUrl}}" target="_banl"> | ||
More Details | ||
</a> | ||
</div> | ||
</div> | ||
</form> |
46 changes: 46 additions & 0 deletions
46
src/@noctua.announcement/components/announcement-panel/announcement-panel.component.scss
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,46 @@ | ||
@use "@angular/material" as mat; | ||
@import "src/@noctua/scss/noctua"; | ||
@import "src/@noctua.common/scss/noctua.common"; | ||
|
||
:host { | ||
//width: 100%; // display: block; | ||
|
||
background-color: white; | ||
@include mat.elevation(4); | ||
|
||
.noc-cam-form { | ||
@include deep-width(500px); | ||
} | ||
|
||
.noc-header { | ||
@include deep-height(40px); | ||
background-color: #eee; | ||
border-bottom: #ccc solid 1px; | ||
|
||
mat-icon-button { | ||
@include deep-height(40px); | ||
@include deep-width(40px); | ||
line-height: 40px; | ||
} | ||
|
||
.noc-title { | ||
font-size: 10px; | ||
padding: 0 14px; | ||
} | ||
} | ||
|
||
.noc-body { | ||
padding: 0 14px 14px 14px; | ||
} | ||
|
||
.noc-item { | ||
@include deep-width(100%); | ||
font-size: 12px; | ||
|
||
.noc-title { | ||
font-weight: bold; | ||
margin-right: 8px; | ||
color: #999; | ||
} | ||
} | ||
} |
54 changes: 54 additions & 0 deletions
54
src/@noctua.announcement/components/announcement-panel/announcement-panel.component.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,54 @@ | ||
import { Component, Input, OnInit, OnDestroy } from '@angular/core'; | ||
import { MatDrawer, MatSidenav } from '@angular/material/sidenav'; | ||
import { Subject } from 'rxjs'; | ||
import { takeUntil } from 'rxjs/operators'; | ||
import { | ||
NoctuaFormMenuService | ||
} from '@geneontology/noctua-form-base'; | ||
import { NoctuaSearchMenuService } from '@noctua.search/services/search-menu.service'; | ||
import { NoctuaAnnouncementService } from '@noctua.announcement/services/cam.service'; | ||
import { Announcement } from '@noctua.announcement/models/announcement'; | ||
|
||
|
||
@Component({ | ||
selector: 'noc-announcement-panel', | ||
templateUrl: './announcement-panel.component.html', | ||
styleUrls: ['./announcement-panel.component.scss'], | ||
}) | ||
|
||
export class AnnouncementPanelComponent implements OnInit, OnDestroy { | ||
|
||
@Input('sidenav') sidenav: MatSidenav; | ||
announcements: Announcement[]; | ||
|
||
private _unsubscribeAll: Subject<any>; | ||
|
||
constructor( | ||
public noctuaSearchMenuService: NoctuaSearchMenuService, | ||
public noctuaFormMenuService: NoctuaFormMenuService, | ||
private noctuaAnnouncementService: NoctuaAnnouncementService, | ||
) { | ||
this._unsubscribeAll = new Subject(); | ||
} | ||
|
||
ngOnInit(): void { | ||
this.noctuaAnnouncementService.onAnnouncementsChanged.pipe( | ||
takeUntil(this._unsubscribeAll)) | ||
.subscribe((announcements: Announcement[]) => { | ||
if (announcements) { | ||
this.announcements = announcements | ||
} | ||
}); | ||
} | ||
|
||
ngOnDestroy(): void { | ||
this._unsubscribeAll.next(null); | ||
this._unsubscribeAll.complete(); | ||
} | ||
|
||
close() { | ||
this.sidenav.close(); | ||
} | ||
|
||
|
||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
export class Announcement { | ||
type: string; | ||
date: string; | ||
level: string; | ||
title: string; | ||
content: string; | ||
moreContentUrl?: string; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,33 @@ | ||
import { HttpClient } from "@angular/common/http"; | ||
import { Injectable } from "@angular/core"; | ||
import { Announcement } from "@noctua.announcement/models/announcement"; | ||
import { environment } from "environments/environment"; | ||
import { BehaviorSubject } from "rxjs"; | ||
|
||
@Injectable({ | ||
providedIn: 'root' | ||
}) | ||
export class NoctuaAnnouncementService { | ||
cursor = 0; | ||
onAnnouncementsChanged: BehaviorSubject<any>; | ||
onAnnouncementChanged: BehaviorSubject<any>; | ||
|
||
constructor( | ||
private httpClient: HttpClient) { | ||
|
||
this.onAnnouncementsChanged = new BehaviorSubject(null); | ||
this.onAnnouncementChanged = new BehaviorSubject(null); | ||
|
||
} | ||
|
||
getAnnouncement() { | ||
return this.httpClient.get(environment.announcementUrl).subscribe((response: Announcement[]) => { | ||
if (response) { | ||
if (response.length > 0) { | ||
this.onAnnouncementChanged.next(response[this.cursor]); | ||
} | ||
this.onAnnouncementsChanged.next(response); | ||
} | ||
}); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
File renamed without changes.
File renamed without changes.
1 change: 0 additions & 1 deletion
1
...ua-doctor/services/doctor-menu.service.ts → ...ua.doctor/services/doctor-menu.service.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.