From f141b5668ec9e8f77c25f628752cdaad0e1d83e7 Mon Sep 17 00:00:00 2001 From: auumgn Date: Thu, 26 Oct 2023 09:26:47 +0000 Subject: [PATCH] =?UTF-8?q?=F0=9F=A4=96=20GITHUB=20ACTIONS=20format=5Fpret?= =?UTF-8?q?tier?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- ui/src/app/account/login/login.component.ts | 135 +++++++++--------- ui/src/app/home/home.component.spec.ts | 26 ++-- ui/src/app/home/home.component.ts | 8 +- ui/src/app/home/home.module.ts | 17 +-- ui/src/app/home/home.route.ts | 29 ++-- ui/src/app/member/model/member.model.ts | 40 +++--- .../member/model/salesforce-address.model.ts | 14 +- .../model/salesforce-country.model copy.ts | 9 +- .../member/model/salesforce-country.model.ts | 14 +- .../model/salesforce-member-contact.model.ts | 50 +++---- .../model/salesforce-member-data.model.ts | 103 ++++++------- .../model/salesforce-member-org-id.model.ts | 25 ++-- .../model/salesforce-member-update.model.ts | 16 +-- .../salesforce-new-consortium-member.model.ts | 30 ++-- .../directive/has-any-authority.directive.ts | 30 ++-- ui/src/content/scss/noto-sans.scss | 3 +- ui/src/environments/environment.prod.ts | 4 +- ui/src/environments/environment.ts | 4 +- 18 files changed, 290 insertions(+), 267 deletions(-) diff --git a/ui/src/app/account/login/login.component.ts b/ui/src/app/account/login/login.component.ts index 54f7e7630..3f61604c0 100644 --- a/ui/src/app/account/login/login.component.ts +++ b/ui/src/app/account/login/login.component.ts @@ -1,32 +1,31 @@ -import { AfterViewInit, Component, OnDestroy, Renderer2 } from '@angular/core'; -import { FormBuilder } from '@angular/forms'; -import { Router } from '@angular/router'; -import { AccountService } from '../service/account.service'; -import { LoginService } from '../service/login.service'; -import { StateStorageService } from '../service/state-storage.service'; -import { Subscription, filter, take } from 'rxjs'; -import { EventService } from 'src/app/shared/service/event.service'; -import { EventType } from 'src/app/app.constants'; -import { Event } from 'src/app/shared/model/event.model'; - +import { AfterViewInit, Component, OnDestroy, Renderer2 } from '@angular/core' +import { FormBuilder } from '@angular/forms' +import { Router } from '@angular/router' +import { AccountService } from '../service/account.service' +import { LoginService } from '../service/login.service' +import { StateStorageService } from '../service/state-storage.service' +import { Subscription, filter, take } from 'rxjs' +import { EventService } from 'src/app/shared/service/event.service' +import { EventType } from 'src/app/app.constants' +import { Event } from 'src/app/shared/model/event.model' @Component({ selector: 'app-login', templateUrl: './login.component.html', - styleUrls: ['./login.component.scss'] + styleUrls: ['./login.component.scss'], }) export class LoginComponent implements AfterViewInit, OnDestroy { - authenticationError = false; - showMfa = false; - mfaSent = false; - mfaError = false; - sub: Subscription | undefined; + authenticationError = false + showMfa = false + mfaSent = false + mfaError = false + sub: Subscription | undefined loginForm = this.fb.group({ username: [''], password: [''], - mfaCode: [''] - }); + mfaCode: [''], + }) constructor( private loginService: LoginService, @@ -37,76 +36,84 @@ export class LoginComponent implements AfterViewInit, OnDestroy { private fb: FormBuilder, private eventService: EventService ) { - this.sub = this.eventService.on(EventType.LOG_IN_SUCCESS).subscribe(e => { - console.log(e.payload); + this.sub = this.eventService.on(EventType.LOG_IN_SUCCESS).subscribe((e) => { + console.log(e.payload) }) - } + } - ngOnDestroy(): void { - this.sub?.unsubscribe(); - console.log('test') - } + ngOnDestroy(): void { + this.sub?.unsubscribe() + console.log('test') + } ngAfterViewInit() { - setTimeout(() => this.renderer.selectRootElement('#username').scrollIntoView()); + setTimeout(() => + this.renderer.selectRootElement('#username').scrollIntoView() + ) } cancel() { - this.authenticationError = false; + this.authenticationError = false this.loginForm.patchValue({ username: '', password: '', - mfaCode: '' - }); + mfaCode: '', + }) } login() { - this.mfaError = false; - const mfaCode = this.loginForm.get('mfaCode')?.value; + this.mfaError = false + const mfaCode = this.loginForm.get('mfaCode')?.value if (this.showMfa && !mfaCode) { - this.mfaError = true; + this.mfaError = true } else { if (mfaCode) { - this.mfaSent = true; + this.mfaSent = true } this.loginService .login({ username: this.loginForm.get('username')?.value!, password: this.loginForm.get('password')?.value!, - mfaCode: this.loginForm.get('mfaCode')?.value + mfaCode: this.loginForm.get('mfaCode')?.value, }) - .subscribe( - { - next: (data) => { - if (!data.mfaRequired) { - this.showMfa = false; - this.accountService.getAccountData().pipe(filter((account) => !!account), take(1)).subscribe((account) => { + .subscribe({ + next: (data) => { + if (!data.mfaRequired) { + this.showMfa = false + this.accountService + .getAccountData() + .pipe( + filter((account) => !!account), + take(1) + ) + .subscribe((account) => { // TODO: remove after sprint review - console.log("Login successful, account data:", account); - this.loginSuccess(); - }); - } else { - this.showMfa = true; - this.mfaError = this.mfaSent; - } - this.mfaSent = false; - }, - // TODO: review any type - error: err => { - this.loginService.logout(); - this.authenticationError = true; + console.log('Login successful, account data:', account) + this.loginSuccess() + }) + } else { + this.showMfa = true + this.mfaError = this.mfaSent } - } - ); + this.mfaSent = false + }, + // TODO: review any type + error: (err) => { + this.loginService.logout() + this.authenticationError = true + }, + }) } } loginSuccess(): void { - this.router.navigate(['']); + this.router.navigate(['']) - this.eventService.broadcast(new Event(EventType.LOG_IN_SUCCESS, "logged in")) + this.eventService.broadcast( + new Event(EventType.LOG_IN_SUCCESS, 'logged in') + ) // TODO: Event manager /* this.eventManager.broadcast({ name: 'authenticationSuccess', @@ -115,20 +122,18 @@ export class LoginComponent implements AfterViewInit, OnDestroy { // previousState was set in the authExpiredInterceptor before being redirected to login modal. // since login is successful, go to stored previousState and clear previousState - const redirect = this.stateStorageService.getUrl(); + const redirect = this.stateStorageService.getUrl() if (redirect) { - this.stateStorageService.storeUrl(null); - this.router.navigateByUrl(redirect); + this.stateStorageService.storeUrl(null) + this.router.navigateByUrl(redirect) } } register() { - this.router.navigate(['/register']); + this.router.navigate(['/register']) } requestResetPassword() { - this.router.navigate(['/reset', 'request']); + this.router.navigate(['/reset', 'request']) } - } - diff --git a/ui/src/app/home/home.component.spec.ts b/ui/src/app/home/home.component.spec.ts index ba1b4a35a..55d817b9d 100644 --- a/ui/src/app/home/home.component.spec.ts +++ b/ui/src/app/home/home.component.spec.ts @@ -1,21 +1,21 @@ -import { ComponentFixture, TestBed } from '@angular/core/testing'; +import { ComponentFixture, TestBed } from '@angular/core/testing' -import { HomeComponent } from './home.component'; +import { HomeComponent } from './home.component' describe('HomeComponent', () => { - let component: HomeComponent; - let fixture: ComponentFixture; + let component: HomeComponent + let fixture: ComponentFixture beforeEach(() => { TestBed.configureTestingModule({ - declarations: [HomeComponent] - }); - fixture = TestBed.createComponent(HomeComponent); - component = fixture.componentInstance; - fixture.detectChanges(); - }); + declarations: [HomeComponent], + }) + fixture = TestBed.createComponent(HomeComponent) + component = fixture.componentInstance + fixture.detectChanges() + }) it('should create', () => { - expect(component).toBeTruthy(); - }); -}); + expect(component).toBeTruthy() + }) +}) diff --git a/ui/src/app/home/home.component.ts b/ui/src/app/home/home.component.ts index 820d900fa..68fb47086 100644 --- a/ui/src/app/home/home.component.ts +++ b/ui/src/app/home/home.component.ts @@ -1,10 +1,8 @@ -import { Component } from '@angular/core'; +import { Component } from '@angular/core' @Component({ selector: 'app-home', templateUrl: './home.component.html', - styleUrls: ['./home.component.scss'] + styleUrls: ['./home.component.scss'], }) -export class HomeComponent { - -} +export class HomeComponent {} diff --git a/ui/src/app/home/home.module.ts b/ui/src/app/home/home.module.ts index 1ab09a780..fdf6e1f58 100644 --- a/ui/src/app/home/home.module.ts +++ b/ui/src/app/home/home.module.ts @@ -1,14 +1,11 @@ -import { NgModule } from '@angular/core'; -import { CommonModule } from '@angular/common'; -import { RouterModule } from '@angular/router'; -import { routes } from './home.route'; -import { HomeComponent } from './home.component'; +import { NgModule } from '@angular/core' +import { CommonModule } from '@angular/common' +import { RouterModule } from '@angular/router' +import { routes } from './home.route' +import { HomeComponent } from './home.component' @NgModule({ declarations: [HomeComponent], - imports: [ - CommonModule, - RouterModule.forChild(routes) - ] + imports: [CommonModule, RouterModule.forChild(routes)], }) -export class HomeModule { } +export class HomeModule {} diff --git a/ui/src/app/home/home.route.ts b/ui/src/app/home/home.route.ts index 3bb148195..811895f76 100644 --- a/ui/src/app/home/home.route.ts +++ b/ui/src/app/home/home.route.ts @@ -1,18 +1,15 @@ -import { Routes } from "@angular/router"; -import { HomeComponent } from "../home/home.component"; -import { AuthGuard } from "../account/auth.guard"; +import { Routes } from '@angular/router' +import { HomeComponent } from '../home/home.component' +import { AuthGuard } from '../account/auth.guard' export const routes: Routes = [ - { - - path: '', - component: HomeComponent, - data: { - authorities: ['ROLE_USER'], - pageTitle: 'home.title.string' - }, - canActivate: [AuthGuard] - - } - ]; - \ No newline at end of file + { + path: '', + component: HomeComponent, + data: { + authorities: ['ROLE_USER'], + pageTitle: 'home.title.string', + }, + canActivate: [AuthGuard], + }, +] diff --git a/ui/src/app/member/model/member.model.ts b/ui/src/app/member/model/member.model.ts index a1e03049b..558306881 100644 --- a/ui/src/app/member/model/member.model.ts +++ b/ui/src/app/member/model/member.model.ts @@ -1,22 +1,22 @@ -import { Moment } from 'moment'; +import { Moment } from 'moment' export interface IMember { - id?: string; - clientId?: string; - clientName?: string; - clientSecret?: string; - salesforceId?: string; - parentSalesforceId?: string; - isConsortiumLead?: boolean; - superadminEnabled?: boolean; - assertionServiceEnabled?: boolean; - createdBy?: string; - createdDate?: Moment; - lastModifiedBy?: string; - lastModifiedDate?: Moment; - type?: string; - status?: string; - defaultLanguage?: string; + id?: string + clientId?: string + clientName?: string + clientSecret?: string + salesforceId?: string + parentSalesforceId?: string + isConsortiumLead?: boolean + superadminEnabled?: boolean + assertionServiceEnabled?: boolean + createdBy?: string + createdDate?: Moment + lastModifiedBy?: string + lastModifiedDate?: Moment + type?: string + status?: string + defaultLanguage?: string } export class Member implements IMember { @@ -38,8 +38,8 @@ export class Member implements IMember { public status?: string, public defaultLaungage?: string ) { - this.isConsortiumLead = this.isConsortiumLead || false; - this.superadminEnabled = this.superadminEnabled || false; - this.assertionServiceEnabled = this.assertionServiceEnabled || false; + this.isConsortiumLead = this.isConsortiumLead || false + this.superadminEnabled = this.superadminEnabled || false + this.assertionServiceEnabled = this.assertionServiceEnabled || false } } diff --git a/ui/src/app/member/model/salesforce-address.model.ts b/ui/src/app/member/model/salesforce-address.model.ts index 4ef5c4ffb..82e181f7a 100644 --- a/ui/src/app/member/model/salesforce-address.model.ts +++ b/ui/src/app/member/model/salesforce-address.model.ts @@ -1,11 +1,11 @@ export interface ISFAddress { - city?: string; - country?: string; - countryCode?: string; - postalCode?: string; - state?: string; - stateCode?: string; - street?: string; + city?: string + country?: string + countryCode?: string + postalCode?: string + state?: string + stateCode?: string + street?: string } export class SFAddress implements ISFAddress { diff --git a/ui/src/app/member/model/salesforce-country.model copy.ts b/ui/src/app/member/model/salesforce-country.model copy.ts index 0f0ab25c8..d0d49afd3 100644 --- a/ui/src/app/member/model/salesforce-country.model copy.ts +++ b/ui/src/app/member/model/salesforce-country.model copy.ts @@ -1,8 +1,11 @@ export interface ISFState { - code: string; - name: string; + code: string + name: string } export class SFState implements ISFState { - constructor(public code: string, public name: string) {} + constructor( + public code: string, + public name: string + ) {} } diff --git a/ui/src/app/member/model/salesforce-country.model.ts b/ui/src/app/member/model/salesforce-country.model.ts index 46ddee0fb..bd4085f45 100644 --- a/ui/src/app/member/model/salesforce-country.model.ts +++ b/ui/src/app/member/model/salesforce-country.model.ts @@ -1,11 +1,15 @@ -import { ISFState } from './salesforce-country.model copy'; +import { ISFState } from './salesforce-country.model copy' export interface ISFCountry { - code: string; - name: string; - states?: ISFState[]; + code: string + name: string + states?: ISFState[] } export class SFCountry implements ISFCountry { - constructor(public code: string, public name: string, public states?: ISFState[]) {} + constructor( + public code: string, + public name: string, + public states?: ISFState[] + ) {} } diff --git a/ui/src/app/member/model/salesforce-member-contact.model.ts b/ui/src/app/member/model/salesforce-member-contact.model.ts index 7b8bde6eb..1bf2a10a6 100644 --- a/ui/src/app/member/model/salesforce-member-contact.model.ts +++ b/ui/src/app/member/model/salesforce-member-contact.model.ts @@ -1,26 +1,26 @@ export interface ISFMemberContact { - memberId?: string; - votingContant?: boolean; - memberOrgRole?: string[]; - name?: string; - contactEmail?: string; - title?: string; - phone?: string; + memberId?: string + votingContant?: boolean + memberOrgRole?: string[] + name?: string + contactEmail?: string + title?: string + phone?: string } export interface ISFRawMemberContact { - Organization__c?: string; - Voting_Contact__c?: boolean; - Contact_Curr_Email__c?: string; - Member_Org_Role__c?: string; - Name?: string; - Title?: string; - Phone?: string; + Organization__c?: string + Voting_Contact__c?: boolean + Contact_Curr_Email__c?: string + Member_Org_Role__c?: string + Name?: string + Title?: string + Phone?: string } export interface ISFRawMemberContacts { - size?: number; - records?: ISFRawMemberContact[]; + size?: number + records?: ISFRawMemberContact[] } export class SFMemberContact implements ISFMemberContact { @@ -33,19 +33,19 @@ export class SFMemberContact implements ISFMemberContact { public title?: string, public phone?: string ) { - this.memberOrgRole = []; + this.memberOrgRole = [] } } export class ISFMemberContactUpdate { - contactName?: string; - contactEmail?: string; - contactMember?: string; - contactNewName?: string; - contactNewEmail?: string; - contactNewJobTitle?: string; - contactNewPhone?: string; - contactNewRoles?: string[]; + contactName?: string + contactEmail?: string + contactMember?: string + contactNewName?: string + contactNewEmail?: string + contactNewJobTitle?: string + contactNewPhone?: string + contactNewRoles?: string[] } export class SFMemberContactUpdate implements ISFMemberContactUpdate { diff --git a/ui/src/app/member/model/salesforce-member-data.model.ts b/ui/src/app/member/model/salesforce-member-data.model.ts index 81be087bb..e4ae9ca17 100644 --- a/ui/src/app/member/model/salesforce-member-data.model.ts +++ b/ui/src/app/member/model/salesforce-member-data.model.ts @@ -1,68 +1,68 @@ -import { ISFAddress } from './salesforce-address.model'; -import { ISFMemberContact } from './salesforce-member-contact.model'; -import { ISFMemberOrgIds } from './salesforce-member-org-id.model'; +import { ISFAddress } from './salesforce-address.model' +import { ISFMemberContact } from './salesforce-member-contact.model' +import { ISFMemberOrgIds } from './salesforce-member-org-id.model' export interface ISFMemberData { - id?: string; - consortiaMember?: boolean; - consortiaLeadId?: string; - isConsortiumLead?: boolean; - name?: string; - publicDisplayName?: string; - website?: string; - billingCountry?: string; - memberType?: string; - publicDisplayDescriptionHtml?: string; - logoUrl?: string; - publicDisplayEmail?: string; - membershipStartDateString?: string; - membershipEndDateString?: string; - consortiumLeadName?: string; - consortiumMembers?: ISFConsortiumMemberData[]; - contacts?: ISFMemberContact[]; - orgIds?: ISFMemberOrgIds; - billingAddress?: ISFAddress; - trademarkLicense?: string; + id?: string + consortiaMember?: boolean + consortiaLeadId?: string + isConsortiumLead?: boolean + name?: string + publicDisplayName?: string + website?: string + billingCountry?: string + memberType?: string + publicDisplayDescriptionHtml?: string + logoUrl?: string + publicDisplayEmail?: string + membershipStartDateString?: string + membershipEndDateString?: string + consortiumLeadName?: string + consortiumMembers?: ISFConsortiumMemberData[] + contacts?: ISFMemberContact[] + orgIds?: ISFMemberOrgIds + billingAddress?: ISFAddress + trademarkLicense?: string } export interface ISFConsortiumMemberData { - orgName?: string; - salesforceId?: string; - metadata?: ISFConsortiumMemberMetadata; - terminationMonth?: string; - terminationYear?: string; + orgName?: string + salesforceId?: string + metadata?: ISFConsortiumMemberMetadata + terminationMonth?: string + terminationYear?: string } export interface ISFConsortiumMemberMetadata { - name?: string; + name?: string } export interface ISFRawMemberData { - Id?: string; - Consortia_Member__c?: boolean; - Consortium_Lead__c?: string; - Name?: string; - Public_Display_Name__c?: string; - Website?: string; - BillingCountry?: string; - Research_Community__c?: string; - Public_Display_Description__c?: string; - Logo_Description__c?: string; - Public_Display_Email__c?: string; - Last_membership_start_date__c?: string; - Last_membership_end_date__c?: string; - consortiumOpportunities: [ISFRawConsortiumMemberData]; - BillingAddress: ISFAddress; - Trademark_License__c: string; + Id?: string + Consortia_Member__c?: boolean + Consortium_Lead__c?: string + Name?: string + Public_Display_Name__c?: string + Website?: string + BillingCountry?: string + Research_Community__c?: string + Public_Display_Description__c?: string + Logo_Description__c?: string + Public_Display_Email__c?: string + Last_membership_start_date__c?: string + Last_membership_end_date__c?: string + consortiumOpportunities: [ISFRawConsortiumMemberData] + BillingAddress: ISFAddress + Trademark_License__c: string } export interface ISFRawConsortiumMemberData { - AccountId?: string; - Account?: ISFRawConsortiumMemberMetadata; + AccountId?: string + Account?: ISFRawConsortiumMemberMetadata } export interface ISFRawConsortiumMemberMetadata { - Public_Display_Name__c?: string; + Public_Display_Name__c?: string } export class SFMemberData implements ISFMemberData { @@ -91,5 +91,10 @@ export class SFMemberData implements ISFMemberData { } export class SFConsortiumMemberData implements ISFConsortiumMemberData { - constructor(public salesforceId?: string, public orgName?: string, public terminationMonth?: string, public terminationYear?: string) {} + constructor( + public salesforceId?: string, + public orgName?: string, + public terminationMonth?: string, + public terminationYear?: string + ) {} } diff --git a/ui/src/app/member/model/salesforce-member-org-id.model.ts b/ui/src/app/member/model/salesforce-member-org-id.model.ts index a5febf9fe..71130c134 100644 --- a/ui/src/app/member/model/salesforce-member-org-id.model.ts +++ b/ui/src/app/member/model/salesforce-member-org-id.model.ts @@ -1,20 +1,25 @@ export interface ISFMemberOrgIds { - ROR?: string[]; - GRID?: string[]; - Ringgold?: string[]; - Fundref?: string[]; + ROR?: string[] + GRID?: string[] + Ringgold?: string[] + Fundref?: string[] } export interface ISFRawMemberOrgId { - Identifier_Type__c: string; - Name: string; + Identifier_Type__c: string + Name: string } export interface ISFRawMemberOrgIds { - records?: ISFRawMemberOrgId[]; - size?: number; - done?: boolean; + records?: ISFRawMemberOrgId[] + size?: number + done?: boolean } export class SFMemberOrgIds implements ISFMemberOrgIds { - constructor(public ROR?: string[], public GRID?: string[], public Ringgold?: string[], public Fundref?: string[]) {} + constructor( + public ROR?: string[], + public GRID?: string[], + public Ringgold?: string[], + public Fundref?: string[] + ) {} } diff --git a/ui/src/app/member/model/salesforce-member-update.model.ts b/ui/src/app/member/model/salesforce-member-update.model.ts index dc35ce3c7..e73c3c5b7 100644 --- a/ui/src/app/member/model/salesforce-member-update.model.ts +++ b/ui/src/app/member/model/salesforce-member-update.model.ts @@ -1,13 +1,13 @@ -import { ISFAddress } from './salesforce-address.model'; +import { ISFAddress } from './salesforce-address.model' export interface ISFMemberUpdate { - orgName?: string; - billingAddress?: ISFAddress; - trademarkLicense?: string; - publicName?: string; - description?: string; - website?: string; - email?: string; + orgName?: string + billingAddress?: ISFAddress + trademarkLicense?: string + publicName?: string + description?: string + website?: string + email?: string } export class SFMemberUpdate implements ISFMemberUpdate { diff --git a/ui/src/app/member/model/salesforce-new-consortium-member.model.ts b/ui/src/app/member/model/salesforce-new-consortium-member.model.ts index d72f766ca..23e99620f 100644 --- a/ui/src/app/member/model/salesforce-new-consortium-member.model.ts +++ b/ui/src/app/member/model/salesforce-new-consortium-member.model.ts @@ -1,19 +1,19 @@ export interface ISFNewConsortiumMember { - orgName: string; - trademarkLicense: string; - startMonth: string; - startYear: string; - emailDomain?: string; - street?: string; - city?: string; - state?: string; - country?: string; - postcode?: string; - contactGivenName?: string; - contactFamilyName?: string; - contactJobTitle?: string; - contactEmail?: string; - contactPhone?: string; + orgName: string + trademarkLicense: string + startMonth: string + startYear: string + emailDomain?: string + street?: string + city?: string + state?: string + country?: string + postcode?: string + contactGivenName?: string + contactFamilyName?: string + contactJobTitle?: string + contactEmail?: string + contactPhone?: string } export class SFNewConsortiumMember implements ISFNewConsortiumMember { diff --git a/ui/src/app/shared/directive/has-any-authority.directive.ts b/ui/src/app/shared/directive/has-any-authority.directive.ts index 66b2188a0..cd4e1c7a6 100644 --- a/ui/src/app/shared/directive/has-any-authority.directive.ts +++ b/ui/src/app/shared/directive/has-any-authority.directive.ts @@ -1,5 +1,5 @@ -import { Directive, Input, TemplateRef, ViewContainerRef } from '@angular/core'; -import { AccountService } from 'src/app/account/service/account.service'; +import { Directive, Input, TemplateRef, ViewContainerRef } from '@angular/core' +import { AccountService } from 'src/app/account/service/account.service' /** * @whatItDoes Conditionally includes an HTML element if current user has any @@ -13,26 +13,34 @@ import { AccountService } from 'src/app/account/service/account.service'; * ``` */ @Directive({ - selector: '[hasAnyAuthority]' + selector: '[hasAnyAuthority]', }) export class HasAnyAuthorityDirective { - private authorities: string[] = []; + private authorities: string[] = [] - constructor(private accountService: AccountService, private templateRef: TemplateRef, private viewContainerRef: ViewContainerRef) {} + constructor( + private accountService: AccountService, + private templateRef: TemplateRef, + private viewContainerRef: ViewContainerRef + ) {} @Input() set hasAnyAuthority(value: string | string[]) { - this.authorities = typeof value === 'string' ? [value] : value; - this.updateView(); + this.authorities = typeof value === 'string' ? [value] : value + this.updateView() // Get notified each time authentication state changes. - this.accountService.getAuthenticationState().subscribe(identity => this.updateView()); + this.accountService + .getAuthenticationState() + .subscribe((identity) => this.updateView()) } private updateView(): void { - const hasAnyAuthority = this.accountService.hasAnyAuthority(this.authorities); - this.viewContainerRef.clear(); + const hasAnyAuthority = this.accountService.hasAnyAuthority( + this.authorities + ) + this.viewContainerRef.clear() if (hasAnyAuthority) { - this.viewContainerRef.createEmbeddedView(this.templateRef); + this.viewContainerRef.createEmbeddedView(this.templateRef) } } } diff --git a/ui/src/content/scss/noto-sans.scss b/ui/src/content/scss/noto-sans.scss index c31dd9175..e45c598ed 100644 --- a/ui/src/content/scss/noto-sans.scss +++ b/ui/src/content/scss/noto-sans.scss @@ -5,7 +5,8 @@ $notosans-fontface-path: 'content/fonts/noto-sans' !default; @mixin notosans-fontface($type, $weight, $style) { @font-face { font-family: 'Noto Sans'; - src: url ('#{$notosans-fontface-path}/NotoSans-#{$type}.woff2') format('woff'), + src: + url ('#{$notosans-fontface-path}/NotoSans-#{$type}.woff2') format('woff'), url ('#{$notosans-fontface-path}/NotoSans-#{$type}.woff') format('woff'); font-weight: $weight; font-style: $style; diff --git a/ui/src/environments/environment.prod.ts b/ui/src/environments/environment.prod.ts index 3612073bc..970e25bd7 100644 --- a/ui/src/environments/environment.prod.ts +++ b/ui/src/environments/environment.prod.ts @@ -1,3 +1,3 @@ export const environment = { - production: true -}; + production: true, +} diff --git a/ui/src/environments/environment.ts b/ui/src/environments/environment.ts index f56ff4702..372505677 100644 --- a/ui/src/environments/environment.ts +++ b/ui/src/environments/environment.ts @@ -3,8 +3,8 @@ // The list of file replacements can be found in `angular.json`. export const environment = { - production: false -}; + production: false, +} /* * For easier debugging in development mode, you can import the following file