-
Notifications
You must be signed in to change notification settings - Fork 5
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 #490 from NUM-Forschungsdatenplattform/release/v1.…
…15.0 Release/v1.15.0
- Loading branch information
Showing
43 changed files
with
556 additions
and
78 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,2 @@ | ||
{ | ||
} |
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
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
export enum Environment { | ||
DEV = 'DEV', | ||
TEST = 'TEST', | ||
PREPROD = 'PREPROD', | ||
STAGING = 'STAGING', | ||
} |
8 changes: 8 additions & 0 deletions
8
src/app/core/services/system-status/system-status.interface.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,8 @@ | ||
export interface SystemStatus { | ||
EHRBASE: string | ||
FE: string | ||
FHIR_BRIDGE: string | ||
KEYCLOAK: string | ||
NUM: string | ||
CHECK_FOR_ANNOUNCEMENTS: string | ||
} |
58 changes: 58 additions & 0 deletions
58
src/app/core/services/system-status/system-status.service.spec.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,58 @@ | ||
import { TestBed } from '@angular/core/testing' | ||
|
||
import { SystemStatusService } from './system-status.service' | ||
import { HttpClientTestingModule } from '@angular/common/http/testing' | ||
import { AppConfigService } from 'src/app/config/app-config.service' | ||
import { HttpClient } from '@angular/common/http' | ||
|
||
describe('SystemStatusService', () => { | ||
let service: SystemStatusService | ||
|
||
const appConfig = { | ||
config: { api: { baseUrl: 'foo.bar' } }, | ||
} as unknown as AppConfigService | ||
|
||
const httpService = { | ||
get: { | ||
EHRBASE: 'string', | ||
FE: 'string', | ||
FHIR_BRIDGE: 'string', | ||
KEYCLOAK: 'string', | ||
NUM: 'string', | ||
}, | ||
} as unknown as HttpClient | ||
|
||
beforeEach(() => { | ||
TestBed.configureTestingModule({ | ||
imports: [HttpClientTestingModule], | ||
providers: [ | ||
{ | ||
provide: AppConfigService, | ||
useValue: appConfig, | ||
}, | ||
{ | ||
provide: HttpClient, | ||
useValue: httpService, | ||
}, | ||
], | ||
}) | ||
service = TestBed.inject(SystemStatusService) | ||
}) | ||
|
||
it('should be created', () => { | ||
expect(service).toBeTruthy() | ||
}) | ||
it('should check system status', () => { | ||
service.getSystemStatusOberservable() | ||
}) | ||
it('should check for errors', () => { | ||
service.hasError({ | ||
EHRBASE: '', | ||
KEYCLOAK: '', | ||
NUM: '', | ||
CHECK_FOR_ANNOUNCEMENTS: '', | ||
FE: '', | ||
FHIR_BRIDGE: '', | ||
}) | ||
}) | ||
}) |
55 changes: 55 additions & 0 deletions
55
src/app/core/services/system-status/system-status.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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,55 @@ | ||
import { Injectable } from '@angular/core' | ||
import { Environment } from './envs' | ||
import { HttpClient } from '@angular/common/http' | ||
import { AppConfigService } from 'src/app/config/app-config.service' | ||
import { SystemStatus } from './system-status.interface' | ||
import { Observable } from 'rxjs' | ||
|
||
@Injectable({ | ||
providedIn: 'root', | ||
}) | ||
export class SystemStatusService { | ||
baseUrl: string | ||
constructor(private httpClient: HttpClient, public appConfig: AppConfigService) { | ||
this.baseUrl = `${appConfig.config.api.baseUrl}/admin/services-status` | ||
} | ||
|
||
private getEnv(): Environment { | ||
const hostedEnv = window.location.host.split('.')[0] | ||
let env: Environment | ||
if (hostedEnv.includes('dev') || hostedEnv.includes('localhost')) { | ||
env = Environment.DEV | ||
} else if (hostedEnv.includes('test')) { | ||
env = Environment.TEST | ||
} else if (hostedEnv.includes('preprod')) { | ||
env = Environment.PREPROD | ||
} else { | ||
env = Environment.STAGING | ||
} | ||
return env | ||
} | ||
/* getSystemStatus(): Promise<SystemStatus> { | ||
return new Promise((resolve, reject) => { | ||
this.httpClient.get(`${this.baseUrl}?setup=${this.getEnv()}`).subscribe((systemStatus) => { | ||
resolve(systemStatus as SystemStatus) | ||
}) | ||
}) | ||
} */ | ||
getSystemStatusOberservable(): Observable<SystemStatus> { | ||
return new Observable((subscriber) => { | ||
this.httpClient.get(`${this.baseUrl}?setup=${this.getEnv()}`).subscribe((systemStatus) => { | ||
subscriber.next(systemStatus as SystemStatus) | ||
}) | ||
}) | ||
} | ||
hasError(status: SystemStatus): boolean { | ||
return ( | ||
status.EHRBASE !== '' || | ||
status.FE !== '' || | ||
status.FHIR_BRIDGE !== '' || | ||
status.KEYCLOAK !== '' || | ||
status.NUM !== '' || | ||
status.CHECK_FOR_ANNOUNCEMENTS !== '' | ||
) | ||
} | ||
} |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -23,3 +23,6 @@ fa-icon { | |
justify-content: center; | ||
align-items: center; | ||
} | ||
.num-mat-list-item.highlighted { | ||
color: #eb586a; | ||
} |
Oops, something went wrong.