Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
25 commits
Select commit Hold shift + click to select a range
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
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ margin-bottom:5px;
.content-fix {
min-height: 250px;
padding: 15px 20px;

overflow: scroll;
}

.src-column {
Expand Down
8 changes: 5 additions & 3 deletions src/app/core/app.module.ts
Original file line number Diff line number Diff line change
Expand Up @@ -119,6 +119,8 @@ import { UserQueryListDialogComponent } from '@gsrs-core/bulk-search/user-query-
import { ListCreateDialogComponent } from '@gsrs-core/substances-browse/list-create-dialog/list-create-dialog.component';
import { ImportScrubberComponent } from '@gsrs-core/admin/import-management/import-scrubber/import-scrubber.component';
import { PrivacyStatementModule } from './privacy-statement/privacy-statement.module';
import { FooterComponent } from './footer/footer.component';

import { CsrfTokenInterceptor } from '@gsrs-core/auth/csrf-token.interceptor';
import { CrossEntitySearchModule } from '../fda/cross-entity-search/cross-entity-search.module';
import { FileSelectModule } from './file-select/file-select.module';
Expand Down Expand Up @@ -162,8 +164,8 @@ import { NitrosamineStandaloneModule } from './nitrosamine-standalone/nitrosamin
MergeActionDialogComponent,
UserQueryListDialogComponent,
ListCreateDialogComponent,
ImportScrubberComponent

ImportScrubberComponent,
FooterComponent
],
imports: [
BrowserModule.withServerTransition({ appId: 'gsrs' }),
Expand Down Expand Up @@ -281,4 +283,4 @@ import { NitrosamineStandaloneModule } from './nitrosamine-standalone/nitrosamin
SubstanceStatusPipe
]
})
export class AppModule {}
export class AppModule {}
2 changes: 1 addition & 1 deletion src/app/core/auth/login/login.component.html
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
<div class="login-container">
<mat-card *ngIf="isLoaded">
<mat-card *ngIf="isLoaded && showLogin">
<mat-card-title>
Login
</mat-card-title>
Expand Down
14 changes: 13 additions & 1 deletion src/app/core/auth/login/login.component.ts
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,7 @@ export class LoginComponent implements OnInit, OnDestroy {
private newuserinfo = {};
private emailFormUserRegConf: any = undefined;
public emailFormUserRegActive: boolean = false;
showLogin = false;

constructor(
private authService: AuthService,
Expand All @@ -52,7 +53,18 @@ export class LoginComponent implements OnInit, OnDestroy {

ngOnInit() {
this.loadingService.setLoading(true);
// As we develop more types of userRegistration, make a utility service to provide configuration information.
// As we develop more types of userRegistration, make a utility service to provide configuration information.

if(this.configService.configData.showLogin === undefined) {
this.showLogin = true;
} else {
if(this.configService.configData.showLogin === false) {
this.showLogin = false;
} else {
this.showLogin = true;
}
}

this.loadedComponents = this.configService.configData.loadedComponents || null;
if(typeof this.configService.configData.userRegistration !== "undefined" ) {
this.emailFormUserRegConf =
Expand Down
20 changes: 18 additions & 2 deletions src/app/core/base/base.component.html
Original file line number Diff line number Diff line change
@@ -1,4 +1,10 @@
<div class="base-page-wrapper">
<div *ngIf = "showTopBanner">
<div class = "top-banner">{{bannerText}}</div>
</div>
<div [ngClass]="['base-menu-wrapper', (showTopBanner) ? 'base-menu-wrapper-with-top-banner': '']">
<mat-toolbar class="mat-elevation-z3" color="primary" *ngIf="showHeaderBar === 'true' && (!customToolbarComponent || customToolbarComponent.length == 0)">

<div class="logo-container">
<span class="logo">
<a routerLink="/home" aria-label="home">
Expand Down Expand Up @@ -174,9 +180,11 @@
(closed)="removeZindex()">
</app-substance-text-search>
<div>
<button mat-button class="login-link" (click)="routeToLogin()" *ngIf="!auth && mainPathSegment !== 'login'">
<div *ngIf="showLoginButton">
<button mat-button class="login-link" (click)="routeToLogin()" *ngIf=" showLogin && !auth && mainPathSegment !== 'login'">
Login
</button>
</button>
</div>
<div class="logged-in" *ngIf="auth">
<button aria-label="User Account" class="user-button main-button" mat-icon-button [matMenuTriggerFor]="accountMenu" (click)="increaseMenuZindex()" >
<mat-icon class="user-icon" svgIcon="account_circle" ></mat-icon>
Expand Down Expand Up @@ -221,7 +229,15 @@
<div *ngIf="customToolbarComponent == 'precisionFDA'">
<app-pfda-toolbar></app-pfda-toolbar>
</div>
</div>
<div [ngClass]="['base-main-wrapper', (showTopBanner) ? 'base-main-wrapper-with-top-banner': '']">
<app-main-notification></app-main-notification>
<app-session-expiration></app-session-expiration>
<app-loading></app-loading>
<router-outlet></router-outlet>
</div>
</div>

<div *ngIf="showFooter" class="footer-wrapper">
<app-footer></app-footer>
</div>
55 changes: 54 additions & 1 deletion src/app/core/base/base.component.scss
Original file line number Diff line number Diff line change
@@ -1,5 +1,44 @@
@import '../../../styles/variables';

.base-page-wrapper {
width: 100%;
display: inline;
position: fixed;
top: 0px;
}

.base-menu-wrapper {
width: 100%;
display: inline;

position: fixed;
top: 0px;
}

.base-menu-wrapper-with-top-banner {
top: 32px !important;
}

.base-main-wrapper {
overflow: scroll;
height:100%;
width: 100%;
display: inline;
position: fixed;
top: 64px;
}

.base-main-wrapper-with-top-banner {
top: 102px !important;
}

.base-main-notification-wrapper {
width: 100%;
display: inline;
position: fixed;

}

.version {
color: var(--version-text-color);
font-size: 10pt;
Expand Down Expand Up @@ -110,7 +149,6 @@

.mat-toolbar {
position: fixed;
top: 0;
z-index: 1001;
}

Expand Down Expand Up @@ -256,4 +294,19 @@
}
}

.top-banner {
width:100%;
padding: 5px;
font-size: 16px;
font-family:Arial, Helvetica, sans-serif;
text-align: center;
align-content: center;
color: #4793d1;
background-color: white;
position: fixed;
top: 0px;
z-index: 1001;
font-weight: 600;
}


70 changes: 68 additions & 2 deletions src/app/core/base/base.component.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { Component, OnInit, ViewEncapsulation, HostListener, OnDestroy } from '@angular/core';
import { Component, OnInit, ViewEncapsulation, HostListener, OnDestroy, AfterViewInit } from '@angular/core';
import { Router, RouterEvent, NavigationExtras, ActivatedRoute, NavigationStart, ResolveEnd, ParamMap } from '@angular/router';
import { Environment } from '../../../environments/environment.model';
import { AuthService } from '../auth/auth.service';
Expand Down Expand Up @@ -30,7 +30,7 @@ import { UserQueryListDialogComponent } from '@gsrs-core/bulk-search/user-query-
styleUrls: ['./base.component.scss'],
encapsulation: ViewEncapsulation.None
})
export class BaseComponent implements OnInit, OnDestroy {
export class BaseComponent implements OnInit, AfterViewInit, OnDestroy {
mainPathSegment = '';
logoSrcPath: string;
auth?: Auth;
Expand All @@ -41,6 +41,7 @@ export class BaseComponent implements OnInit, OnDestroy {
classicLinkQueryParamsString: string;
isAdmin = false;
contactEmail: string;
contactEmailAlt: string;
version?: string;
versionTooltipMessage = '';
appId: string;
Expand All @@ -61,6 +62,11 @@ export class BaseComponent implements OnInit, OnDestroy {
private wildCardText: string;
private classicLinkQueryParams = {};
showHeaderBar = 'true';
bannerText: string = "This repository is under review for potential modification in compliance with Administration directives.";
showTopBanner: boolean;
showFooter: boolean;
showLogin: boolean;
showLoginButton: boolean;

constructor(
private router: Router,
Expand Down Expand Up @@ -139,14 +145,20 @@ export class BaseComponent implements OnInit, OnDestroy {
}
}




ngOnInit() {
this.showHeaderBar = this.activatedRoute.snapshot.queryParams['header'] || 'true';
this.loadedComponents = this.configService.configData.loadedComponents || null;


this.classicLinkPath = this.configService.environment.clasicBaseHref;
this.clasicBaseHref = this.configService.environment.clasicBaseHref;
this.classicLinkQueryParamsString = '';
this.contactEmail = this.configService.configData.contactEmail || null;
this.contactEmailAlt = this.configService.configData.contactEmailAlt || null;

this.navItems = this.configService.configData.navItems || null;

let notempty = false;
Expand Down Expand Up @@ -299,6 +311,56 @@ export class BaseComponent implements OnInit, OnDestroy {
this.router.navigate(['/login'], navigationExtras);
}

ngAfterViewInit() {

if(this.configService.configData.bannerText) {
this.bannerText = this.configService.configData.bannerText;
}

if(this.configService.configData.showTopBanner === undefined) {
this.showTopBanner = false;
} else {
if(this.configService.configData.showTopBanner === false) {
this.showTopBanner = false;
} else {
this.showTopBanner = true;
}
}

if(this.configService.configData.showLoginButton === undefined) {
this.showLoginButton = true;
} else {
if(this.configService.configData.showLoginButton === false) {
this.showLoginButton = false;
} else {
this.showLoginButton = true;
}
}

if(this.configService.configData.showLogin === undefined) {
this.showLogin = true;
} else {
if(this.configService.configData.showLogin === false) {
this.showLogin = false;
} else {
this.showLogin = true;
}
}

if(this.configService.configData.showFooter === undefined) {
this.showFooter = false;
} else {
if(this.configService.configData.showFooter === false) {
this.showFooter = false;
} else {
this.showFooter = true;
}
}


}


processSubstanceSearch(searchValue: string) {
this.wildCardService.getTopSearchBoxText(searchValue);
this.navigateToSearchResults(searchValue);
Expand Down Expand Up @@ -370,6 +432,10 @@ export class BaseComponent implements OnInit, OnDestroy {
if(item.kind==='contact-us') {
email = this.contactEmail;
}
if(item.kind==='contact-us-alt') {
email = this.contactEmailAlt;
}

if(item?.queryParams) {
if(item?.queryParams?.subject) {
subject = item.queryParams.subject;
Expand Down
1 change: 1 addition & 0 deletions src/app/core/bulk-search/bulk-query.component.scss
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
align-items: center;
justify-content: center;
padding: 65px 5px 0 5px;
margin-bottom: 400px;
}

.mat-card {
Expand Down
6 changes: 6 additions & 0 deletions src/app/core/config/config.model.ts
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@ export interface Config {
homeHeader?: string;
homeContents?: string;
contactEmail?: string;
contactEmailAlt?: string;
defaultCodeSystem?: string;
primaryCode?: string;
typeaheadFields?: Array<string>;
Expand Down Expand Up @@ -89,6 +90,11 @@ export interface Config {
enableStructureFeatures?: boolean;
StructureFeaturePriority?: Array<string>;
structureEditSearch?: boolean;
bannerText?: string;
showTopBanner?: boolean;
showLogin?: boolean;
showLoginButton?: boolean;
showFooter?: boolean;
editPagingOptionSettings?: PagingOptionSettings;
expandedComponents?: Array<string>;
enablePDFDownload ?: DownloadAsPDF;
Expand Down
39 changes: 39 additions & 0 deletions src/app/core/footer/footer.component.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
<div class="content-container">
<div class="footer-row">
<a href="http://www.hhs.gov" target="_blank" rel="noopener noreferrer">U.S. Department of Health &amp; Human Services</a>
</div>

<div class="footer-row">

<a href="http://www.nih.gov" target="_blank" rel="noopener noreferrer">National Institutes of Health</a>
</div>
<div class="footer-row">
<div class="parent-nf">
<span class="link"><a href="https://www.hhs.gov/vulnerability-disclosure-policy/index.html" target="_blank" rel="noopener noreferrer">HHS Vulnerability Disclosure</a></span>
<span class="separator"> | </span>
<span class="link"><a href="http://www.ncats.nih.gov/">NCATS Home</a></span>
<span class="separator"> | </span>
<span class="link"><a href="http://www.nih.gov/about/access.htm" target="_blank" rel="noopener noreferrer">Accessibility</a></span>
<span class="separator"> | </span>
<span class="link"><a href="/privacy">Privacy Notice</a></span>
<span class="separator"> | </span>
<span class="link"><a href="/licensing">Licensing</a></span>
<span class="separator"> | </span>
<span class="link"><a href="http://www.ncats.nih.gov/about/foia.html">FOIA</a></span>
<span class="separator"> | </span>
<span class="link"><a href="http://oig.hhs.gov/" target="_blank" rel="noopener noreferrer">OIG</a></span>
</div>
</div>

<div class="footer-row">
<div class="parent-nf">
<span class="fragment">National Center for Advancing Translational Sciences (NCATS)</span>
<span class="separator">, </span>
<span class="fragment">6701 Democracy Boulevard</span>
<span class="separator">, </span>
<span class="fragment">Bethesda MD 20892-4874</span>
<span class="separator"> | </span>
<span class="fragment">301-435-0888</span>
</div>
</div>
</div>
Loading