-
Notifications
You must be signed in to change notification settings - Fork 16
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* Renamed refreshing observable, added refreshMessage$ observable, refresh-alert component * Remove refreshing$ observable, use refreshMessage$ for checks * Refresh indicator, disable buttons when refreshing * Fix errorObj grammar * Fix merge conflicts, moved error service, renamed refresh-alert to alert
- Loading branch information
Showing
39 changed files
with
213 additions
and
117 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
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
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
Empty file.
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,15 @@ | ||
<div class="alert alert-info" role="alert" *ngIf="refreshMessage"> | ||
<span class="glyphicon glyphicon-refresh glyphicon-refresh-animate"> | ||
</span> | ||
{{ refreshMessage }} | ||
</div> | ||
<div class="alert alert-danger alert-dismissable" ng-class="!editMode ? 'push-top' : ''" role="alert" *ngIf="errorObj"> | ||
<button type="button" class="close" data-dismiss="alert" ng-click="setError(null)"> | ||
× | ||
</button> | ||
<p> | ||
<span class="glyphicon glyphicon-warning-sign"></span> | ||
{{errorObj.message}} | ||
</p> | ||
<p class="error-output">{{errorObj.errorDetails}}</p> | ||
</div> |
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,34 @@ | ||
import { ErrorStubService } from './../../test/service-stubs'; | ||
import { ErrorService } from './../../shared/error.service'; | ||
import { StateStubService } from '../../test/service-stubs'; | ||
import { StateService } from '../state.service'; | ||
/* tslint:disable:no-unused-variable */ | ||
import { async, ComponentFixture, TestBed } from '@angular/core/testing'; | ||
import { By } from '@angular/platform-browser'; | ||
import { DebugElement } from '@angular/core'; | ||
|
||
import { AlertComponent } from './alert.component'; | ||
|
||
describe('RefreshAlertComponent', () => { | ||
let component: AlertComponent; | ||
let fixture: ComponentFixture<AlertComponent>; | ||
|
||
beforeEach(async(() => { | ||
TestBed.configureTestingModule({ | ||
declarations: [ AlertComponent ], | ||
providers: [ {provide: StateService, useClass: StateStubService}, | ||
{ provide: ErrorService, useClass: ErrorStubService}] | ||
}) | ||
.compileComponents(); | ||
})); | ||
|
||
beforeEach(() => { | ||
fixture = TestBed.createComponent(AlertComponent); | ||
component = fixture.componentInstance; | ||
fixture.detectChanges(); | ||
}); | ||
|
||
it('should create', () => { | ||
expect(component).toBeTruthy(); | ||
}); | ||
}); |
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,22 @@ | ||
import { ErrorService } from '../../shared/error.service'; | ||
import { StateService } from '../state.service'; | ||
import { Component, OnInit } from '@angular/core'; | ||
|
||
// TODO: Rename this component to something like 'alert' since it contains both error and refresh alerts | ||
|
||
@Component({ | ||
selector: 'app-alert', | ||
templateUrl: './alert.component.html', | ||
styleUrls: ['./alert.component.css'] | ||
}) | ||
export class AlertComponent implements OnInit { | ||
public refreshMessage: string; | ||
public errorObj: any; | ||
constructor(private stateService: StateService, private errorService: ErrorService) { } | ||
|
||
ngOnInit() { | ||
this.stateService.refreshMessage$.subscribe(refreshMessage => this.refreshMessage = refreshMessage); | ||
this.errorService.errorObj$.subscribe(errorObj => this.errorObj = errorObj); | ||
} | ||
|
||
} |
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,20 @@ | ||
import { CommonModule } from '@angular/common'; | ||
import { FormsModule } from '@angular/forms'; | ||
import { StateService } from '../state.service'; | ||
import { AlertComponent } from './alert.component'; | ||
import { NgModule } from '@angular/core'; | ||
|
||
@NgModule({ | ||
declarations: [ | ||
AlertComponent | ||
], | ||
imports: [ | ||
CommonModule, | ||
FormsModule | ||
], | ||
providers: [ | ||
StateService | ||
], | ||
exports: [AlertComponent] | ||
}) | ||
export class RefreshAlertModule {} |
Oops, something went wrong.