Commit a87cfb8b authored by Vitali Stupin's avatar Vitali Stupin
Browse files

Changing intro text and adding error messages

parent 90e309dd
<div class="container"> <div class="container">
<h1>All subsystems with methods and WSDL descriptions for instance "EE"</h1>
<h3>How is this report generated?</h3>
<br>
<p>This report is generated by making getWsdl requests from RIA's Monitoring Security Server to all X-Road subsystems in the X-Road instance.</p>
<p>Subsystems with the <span class="badge badge-secondary">Empty</span> icon have no X-Road services available.</p>
<p>Subsystems with the <span class="badge badge-danger">Error</span> icon either could not be reached by RIA's Monitoring Security Server or there was some other error during the request.</p>
<p>Support: <a href="mailto:help@ria.ee">help@ria.ee</a></p>
<router-outlet></router-outlet> <router-outlet></router-outlet>
<!--<app-search></app-search>
<app-subsystem-list></app-subsystem-list>-->
</div> </div>
\ No newline at end of file
...@@ -10,6 +10,7 @@ import { SearchComponent } from './search/search.component'; ...@@ -10,6 +10,7 @@ import { SearchComponent } from './search/search.component';
import { SubsystemItemComponent } from './subsystem-list/subsystem-item/subsystem-item.component'; import { SubsystemItemComponent } from './subsystem-list/subsystem-item/subsystem-item.component';
import { AppRoutingModule } from './app-routing.module'; import { AppRoutingModule } from './app-routing.module';
import { SubsystemComponent } from './subsystem/subsystem.component'; import { SubsystemComponent } from './subsystem/subsystem.component';
import { MessageComponent } from './message/message.component';
@NgModule({ @NgModule({
declarations: [ declarations: [
...@@ -17,7 +18,8 @@ import { SubsystemComponent } from './subsystem/subsystem.component'; ...@@ -17,7 +18,8 @@ import { SubsystemComponent } from './subsystem/subsystem.component';
SubsystemListComponent, SubsystemListComponent,
SearchComponent, SearchComponent,
SubsystemItemComponent, SubsystemItemComponent,
SubsystemComponent SubsystemComponent,
MessageComponent
], ],
imports: [ imports: [
BrowserModule, BrowserModule,
......
<div class="alert alert-warning" role="alert" *ngIf="message">
{{message}}
</div>
\ No newline at end of file
import { async, ComponentFixture, TestBed } from '@angular/core/testing';
import { MessageComponent } from './message.component';
describe('MessageComponent', () => {
let component: MessageComponent;
let fixture: ComponentFixture<MessageComponent>;
beforeEach(async(() => {
TestBed.configureTestingModule({
declarations: [ MessageComponent ]
})
.compileComponents();
}));
beforeEach(() => {
fixture = TestBed.createComponent(MessageComponent);
component = fixture.componentInstance;
fixture.detectChanges();
});
it('should create', () => {
expect(component).toBeTruthy();
});
});
import { Component, OnInit } from '@angular/core';
import { MethodsService } from '../methods.service';
@Component({
selector: 'app-message',
templateUrl: './message.component.html',
styleUrls: ['./message.component.css']
})
export class MessageComponent implements OnInit {
message: string = ''
constructor(private methodsService: MethodsService) { }
ngOnInit() {
this.message = this.methodsService.getMessage();
// Service will tell when updated data is available!
this.methodsService.newMessage.subscribe(signal => {
this.message = signal;
});
}
}
...@@ -22,9 +22,11 @@ export class MethodsService { ...@@ -22,9 +22,11 @@ export class MethodsService {
private apiUrl = this.apiUrlBase + this.apiService; private apiUrl = this.apiUrlBase + this.apiService;
private subsystems: Subsystem[] = []; private subsystems: Subsystem[] = [];
private loadingDone: boolean = false; private loadingDone: boolean = false;
private lastMessage: string = '';
@Output() subsystemsUpdated: EventEmitter<any> = new EventEmitter(); @Output() subsystemsUpdated: EventEmitter<any> = new EventEmitter();
@Output() hideDetails: EventEmitter<boolean> = new EventEmitter(); @Output() hideDetails: EventEmitter<boolean> = new EventEmitter();
@Output() newMessage: EventEmitter<string> = new EventEmitter();
constructor(private http: HttpClient) { constructor(private http: HttpClient) {
this.http.get<Subsystem[]>(this.apiUrl) this.http.get<Subsystem[]>(this.apiUrl)
...@@ -176,6 +178,10 @@ export class MethodsService { ...@@ -176,6 +178,10 @@ export class MethodsService {
} }
} }
getMessage(): string {
return this.lastMessage
}
/** /**
* Handle Http operation that failed. * Handle Http operation that failed.
* Let the app continue. * Let the app continue.
...@@ -185,8 +191,9 @@ export class MethodsService { ...@@ -185,8 +191,9 @@ export class MethodsService {
private handleError<T> (operation = 'operation', result?: T) { private handleError<T> (operation = 'operation', result?: T) {
return (error: any): Observable<T> => { return (error: any): Observable<T> => {
// TODO: send the error to remote logging infrastructure //console.error(error); // log to console for debuging
console.error(error); // log to console instead this.lastMessage = 'Error loading data!'
this.newMessage.emit(this.lastMessage);
// Let the app keep running by returning an empty result. // Let the app keep running by returning an empty result.
return of(result as T); return of(result as T);
......
<h3>All subsystems with methods and WSDL descriptions for X-tee instance "EE"</h3>
<p>This report is generated by making getWsdl requests from RIA's Monitoring Security Server
to all X-tee subsystems in the "EE" instance.</p>
<p>Subsystems with the <span class="badge badge-secondary">Empty</span> icon have no X-Tee
services available.</p>
<p>Subsystems with the <span class="badge badge-danger">Error</span> icon either could not be
reached by RIA's Monitoring Security Server or there was some other error during the request.</p>
<p>Support: <a href="mailto:help@ria.ee">help@ria.ee</a></p>
<app-message></app-message>
<app-search></app-search> <app-search></app-search>
<div *ngFor="let subsystem of subsystems"> <div *ngFor="let subsystem of subsystems">
......
<h3>Subsystem {{subsystemId}} with methods and WSDL descriptions for
X-tee instance "EE"</h3>
<p>Support: <a href="mailto:help@ria.ee">help@ria.ee</a></p>
<app-message></app-message>
<div *ngIf="loadingDone() && subsystem"> <div *ngIf="loadingDone() && subsystem">
<div class="card"> <div class="card">
<div class="card-header"> <div class="card-header">
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment