BAEL-797 adding some basic UI stuff to show the different login states
This commit is contained in:
@@ -100,7 +100,7 @@
|
||||
<artifactId>maven-antrun-plugin</artifactId>
|
||||
<executions>
|
||||
<execution>
|
||||
<phase>compile</phase>
|
||||
<phase>generate-resources</phase>
|
||||
<configuration>
|
||||
<tasks>
|
||||
<exec executable="cmd" osfamily="windows" dir="${project.basedir}/src/main/angular/ui">
|
||||
|
||||
+3
-2
@@ -20,14 +20,15 @@
|
||||
<div *ngIf="loginFailed">
|
||||
<div class="alert alert-warning">Login Failed</div>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
</nav>
|
||||
|
||||
<div class="jumbotron">
|
||||
<div class="container">
|
||||
<h1>Book Rater App</h1>
|
||||
<p class="lead">Keep track of all the latest books and their ratings.</p>
|
||||
<p *ngIf="!principal.authenticated" class="lead">Anyone can view the books.</p>
|
||||
<p *ngIf="principal.authenticated && !principal.isAdmin()" class="lead">Users can view and create ratings</p>
|
||||
<p *ngIf="principal.isAdmin()" class="lead">Admins can do anything!</p>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
|
||||
-31
@@ -1,31 +0,0 @@
|
||||
import {TestBed, async} from "@angular/core/testing";
|
||||
import {AppComponent} from "./app.component";
|
||||
|
||||
describe('AppComponent', () => {
|
||||
beforeEach(async(() => {
|
||||
TestBed.configureTestingModule({
|
||||
declarations: [
|
||||
AppComponent
|
||||
],
|
||||
}).compileComponents();
|
||||
}));
|
||||
|
||||
it('should create the app', async(() => {
|
||||
const fixture = TestBed.createComponent(AppComponent);
|
||||
const app = fixture.debugElement.componentInstance;
|
||||
expect(app).toBeTruthy();
|
||||
}));
|
||||
|
||||
it(`should have as title 'app works!'`, async(() => {
|
||||
const fixture = TestBed.createComponent(AppComponent);
|
||||
const app = fixture.debugElement.componentInstance;
|
||||
expect(app.title).toEqual('app works!');
|
||||
}));
|
||||
|
||||
it('should render title in a h1 tag', async(() => {
|
||||
const fixture = TestBed.createComponent(AppComponent);
|
||||
fixture.detectChanges();
|
||||
const compiled = fixture.debugElement.nativeElement;
|
||||
expect(compiled.querySelector('h1').textContent).toContain('app works!');
|
||||
}));
|
||||
});
|
||||
+1
-11
@@ -15,23 +15,13 @@ export class AppComponent {
|
||||
username: '',
|
||||
password: ''
|
||||
};
|
||||
|
||||
selectedBook: Book = null;
|
||||
|
||||
private username: String = '';
|
||||
private password: String = '';
|
||||
|
||||
|
||||
principal: Principal = new Principal(false, [], null);
|
||||
// principal: Principal = new Principal(true, [new Authority("ROLE_USER")], {username: 'user', password: 'password'});
|
||||
|
||||
loginFailed: boolean = false;
|
||||
|
||||
constructor(private httpService: HttpService){}
|
||||
|
||||
ngOnInit(): void {
|
||||
|
||||
}
|
||||
ngOnInit(): void {}
|
||||
|
||||
onLogin(form: NgForm) {
|
||||
this.loginFailed = false;
|
||||
|
||||
+1
-1
File diff suppressed because one or more lines are too long
+2
-6
File diff suppressed because one or more lines are too long
+1
-1
File diff suppressed because one or more lines are too long
Reference in New Issue
Block a user