diff --git a/src/app/core/admin/cv-management/cv-term-dialog/cv-term-dialog.component.scss b/src/app/core/admin/cv-management/cv-term-dialog/cv-term-dialog.component.scss index bf87def14..ce82964be 100644 --- a/src/app/core/admin/cv-management/cv-term-dialog/cv-term-dialog.component.scss +++ b/src/app/core/admin/cv-management/cv-term-dialog/cv-term-dialog.component.scss @@ -54,7 +54,7 @@ margin-bottom:5px; .content-fix { min-height: 250px; padding: 15px 20px; - + overflow: scroll; } .src-column { diff --git a/src/app/core/app.module.ts b/src/app/core/app.module.ts index 2e463de0c..a7c271fd0 100644 --- a/src/app/core/app.module.ts +++ b/src/app/core/app.module.ts @@ -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'; @@ -162,8 +164,8 @@ import { NitrosamineStandaloneModule } from './nitrosamine-standalone/nitrosamin MergeActionDialogComponent, UserQueryListDialogComponent, ListCreateDialogComponent, - ImportScrubberComponent - + ImportScrubberComponent, + FooterComponent ], imports: [ BrowserModule.withServerTransition({ appId: 'gsrs' }), @@ -281,4 +283,4 @@ import { NitrosamineStandaloneModule } from './nitrosamine-standalone/nitrosamin SubstanceStatusPipe ] }) -export class AppModule {} +export class AppModule {} \ No newline at end of file diff --git a/src/app/core/auth/login/login.component.html b/src/app/core/auth/login/login.component.html index 0e227889c..d5dbfb54c 100644 --- a/src/app/core/auth/login/login.component.html +++ b/src/app/core/auth/login/login.component.html @@ -1,5 +1,5 @@
- + Login diff --git a/src/app/core/auth/login/login.component.ts b/src/app/core/auth/login/login.component.ts index 4ab7eae16..1854bd4f7 100644 --- a/src/app/core/auth/login/login.component.ts +++ b/src/app/core/auth/login/login.component.ts @@ -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, @@ -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 = diff --git a/src/app/core/base/base.component.html b/src/app/core/base/base.component.html index 25a8e951c..94f28b96f 100644 --- a/src/app/core/base/base.component.html +++ b/src/app/core/base/base.component.html @@ -1,4 +1,10 @@ +
+
+
{{bannerText}}
+
+
+ + + diff --git a/src/app/core/base/base.component.scss b/src/app/core/base/base.component.scss index 8dca2150c..eed216405 100644 --- a/src/app/core/base/base.component.scss +++ b/src/app/core/base/base.component.scss @@ -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; @@ -110,7 +149,6 @@ .mat-toolbar { position: fixed; - top: 0; z-index: 1001; } @@ -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; + } + diff --git a/src/app/core/base/base.component.ts b/src/app/core/base/base.component.ts index 1d12fe9bb..2bf9b5a3d 100644 --- a/src/app/core/base/base.component.ts +++ b/src/app/core/base/base.component.ts @@ -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'; @@ -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; @@ -41,6 +41,7 @@ export class BaseComponent implements OnInit, OnDestroy { classicLinkQueryParamsString: string; isAdmin = false; contactEmail: string; + contactEmailAlt: string; version?: string; versionTooltipMessage = ''; appId: string; @@ -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, @@ -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; @@ -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); @@ -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; diff --git a/src/app/core/bulk-search/bulk-query.component.scss b/src/app/core/bulk-search/bulk-query.component.scss index 13cb95c5d..63d56e1bb 100644 --- a/src/app/core/bulk-search/bulk-query.component.scss +++ b/src/app/core/bulk-search/bulk-query.component.scss @@ -5,6 +5,7 @@ align-items: center; justify-content: center; padding: 65px 5px 0 5px; + margin-bottom: 400px; } .mat-card { diff --git a/src/app/core/config/config.model.ts b/src/app/core/config/config.model.ts index d72c868cf..3534d2f6b 100644 --- a/src/app/core/config/config.model.ts +++ b/src/app/core/config/config.model.ts @@ -20,6 +20,7 @@ export interface Config { homeHeader?: string; homeContents?: string; contactEmail?: string; + contactEmailAlt?: string; defaultCodeSystem?: string; primaryCode?: string; typeaheadFields?: Array; @@ -89,6 +90,11 @@ export interface Config { enableStructureFeatures?: boolean; StructureFeaturePriority?: Array; structureEditSearch?: boolean; + bannerText?: string; + showTopBanner?: boolean; + showLogin?: boolean; + showLoginButton?: boolean; + showFooter?: boolean; editPagingOptionSettings?: PagingOptionSettings; expandedComponents?: Array; enablePDFDownload ?: DownloadAsPDF; diff --git a/src/app/core/footer/footer.component.html b/src/app/core/footer/footer.component.html new file mode 100644 index 000000000..00a83f795 --- /dev/null +++ b/src/app/core/footer/footer.component.html @@ -0,0 +1,39 @@ +
+ + + + + + +
\ No newline at end of file diff --git a/src/app/core/footer/footer.component.scss b/src/app/core/footer/footer.component.scss new file mode 100644 index 000000000..8d2ee6df0 --- /dev/null +++ b/src/app/core/footer/footer.component.scss @@ -0,0 +1,48 @@ +.content-container { + width: 100%; + bottom: 0px; + position: fixed; + height: 100px; + background: #4793d1; + color: #fff; + padding: 10px; + overflow: scroll; +} + +.footer-row { + margin-top: 3px; + display: flex; + width: 100%; + color: WhiteSmoke; + justify-content: center; +} + + +.footer-row a { + color: WhiteSmoke; + text-decoration: none; +} + +@media (max-width:800px) { +.parent-nf { + flex: none; + display: block; + width: 100%; +} +.separator { + display: none; +} +.link { + flex: none; + display: block; + width: 100%; + text-align: center; +} +.fragment { + flex: none; + display: block; + width: 100%; + text-align: center; +} + +} diff --git a/src/app/core/footer/footer.component.ts b/src/app/core/footer/footer.component.ts new file mode 100644 index 000000000..5e8f4de93 --- /dev/null +++ b/src/app/core/footer/footer.component.ts @@ -0,0 +1,43 @@ +import { HttpClient } from '@angular/common/http'; +import { Component, OnInit } from '@angular/core'; +import { DomSanitizer } from '@angular/platform-browser'; +import { ConfigService } from '@gsrs-core/config'; +import { fromEvent, throttleTime } from 'rxjs'; +import { filter, first, map, tap } from 'rxjs/operators'; + +@Component({ + selector: 'app-footer', + templateUrl: './footer.component.html', + styleUrls: ['./footer.component.scss'] +}) +export class FooterComponent implements OnInit { + bottom : number = 0; + htmlText; + constructor( + private http:HttpClient, + private sanitizer:DomSanitizer, + private configService: ConfigService + ){ } + ngOnInit(){ + // const privacyStatement = this.configService.configData.privacyStatement; + // if(privacyStatement) { + // // if used, privacyStatement should be a json encoded string in config.json + // this.htmlText = this.sanitizer.bypassSecurityTrustHtml(privacyStatement); + // } else { + // // if used overwrite this file with a simple html version of your privacy statement. + // this.http.get('assets/html/privacy-statement.html',{responseType:'text'}).subscribe(result=>{ + // this.htmlText = this.sanitizer.bypassSecurityTrustHtml(result); + // }, error => { + // this.htmlText = "Error fetching page content"; + // }); + // } + + + + } + + + + + +} \ No newline at end of file diff --git a/src/app/core/home/home.component.html b/src/app/core/home/home.component.html index 6d4ee218d..f922b122b 100644 --- a/src/app/core/home/home.component.html +++ b/src/app/core/home/home.component.html @@ -393,4 +393,4 @@
- \ No newline at end of file + diff --git a/src/app/core/main-notification/main-notification/main-notification.component.html b/src/app/core/main-notification/main-notification/main-notification.component.html index db47d4519..842271593 100644 --- a/src/app/core/main-notification/main-notification/main-notification.component.html +++ b/src/app/core/main-notification/main-notification/main-notification.component.html @@ -1,3 +1,4 @@ -
-
+
--> -
+
+
+ +
+ + + + +
@@ -11,7 +19,7 @@ -
@@ -100,7 +108,7 @@
-
+