New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
refactor!: set up the login page as a starting page (DSP-1292) #370
Changes from 3 commits
0d3c2f6
72b09fe
346cb8b
27bc05c
34e4acf
89da3e0
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,4 @@ | ||
<div class="login-page"> | ||
<dsp-login-form (loginSuccess)="refresh($event)"></dsp-login-form> | ||
<dsp-login-form (loginSuccess)="refresh()"></dsp-login-form> | ||
<!-- will be reactivated: <dsp-login-form (loginSuccess)="refresh($event)"></dsp-login-form> --> | ||
</div> |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,7 @@ | ||
import { Component, OnInit } from '@angular/core'; | ||
import { Title } from '@angular/platform-browser'; | ||
import { ActivatedRoute, Router } from '@angular/router'; | ||
import { SessionService } from '@dasch-swiss/dsp-ui'; | ||
import { ComponentCommunicationEventService, EmitEvent, Events } from 'src/app/main/services/component-communication-event.service'; | ||
|
||
@Component({ | ||
|
@@ -15,6 +16,7 @@ export class LoginComponent implements OnInit { | |
constructor (private _titleService: Title, | ||
private _route: ActivatedRoute, | ||
private _router: Router, | ||
private _session: SessionService, | ||
private _componentCommsService: ComponentCommunicationEventService) { | ||
|
||
// set the page title | ||
|
@@ -26,13 +28,21 @@ export class LoginComponent implements OnInit { | |
ngOnInit() { | ||
} | ||
|
||
refresh(status: boolean) { | ||
refresh() { | ||
// check if a session is active | ||
if (this._session.getSession()) { | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. could be There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. refactored in 34e4acf |
||
this._router.navigate(['dashboard']); | ||
} | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. After successful login the user will always be redirected to the dashboard page, right? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. haha...yes true. The root path |
||
} | ||
|
||
// TO REPLACE THE METHOD ABOVE ONCE WE WILL USE DSP-APP AS A RESEARCH PLATFORM AGAIN | ||
/* refresh(status: boolean) { | ||
|
||
// go to previous route: | ||
if (status) { | ||
this._router.navigate([this.returnUrl]); | ||
this._componentCommsService.emit(new EmitEvent(Events.LoginSuccess, true)); | ||
} | ||
} | ||
} */ | ||
|
||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The
LoginComponent
emits a boolean value inloginSuccess
. I do not understand why you removed it?There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
reversed in 27bc05c