Skip to content

Commit

Permalink
Revert "Merge branch 'main' into wip/DSP-741-edit-list-item-attempt-2"
Browse files Browse the repository at this point in the history
This reverts commit 4ebb4e2, reversing
changes made to 9b86847.
  • Loading branch information
mdelez committed Jan 28, 2021
1 parent 4ebb4e2 commit 2f66840
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 11 deletions.
3 changes: 1 addition & 2 deletions src/app/app-routing.module.ts
Expand Up @@ -32,8 +32,7 @@ import { UsersComponent } from './system/users/users.component';
const routes: Routes = [
{
path: '',
component: LoginComponent
// component: MainComponent
component: MainComponent
},
{
path: 'help',
Expand Down
18 changes: 9 additions & 9 deletions src/app/main/login/login.component.ts
@@ -1,36 +1,36 @@
import { Component } from '@angular/core';
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({
selector: 'app-login',
templateUrl: './login.component.html',
styleUrls: ['./login.component.scss']
})
export class LoginComponent {
export class LoginComponent implements OnInit {

returnUrl: string;

constructor (private _titleService: Title,
private _route: ActivatedRoute,
private _router: Router,
private _session: SessionService,
private _componentCommsService: ComponentCommunicationEventService) {

// set the page title
this._titleService.setTitle('Login');

// this.returnUrl = this._route.snapshot.queryParams['returnUrl'] || '/';
this.returnUrl = this._route.snapshot.queryParams['returnUrl'] || '/';
}

ngOnInit() {
}

refresh(status: boolean) {

// go to the dashboard:
if (status && this._session.getSession()) {
this._router.navigate(['dashboard']);
// go to the previous route: this._router.navigate([this.returnUrl]);
// go to previous route:
if (status) {
this._router.navigate([this.returnUrl]);
this._componentCommsService.emit(new EmitEvent(Events.LoginSuccess, true));
}
}
Expand Down

0 comments on commit 2f66840

Please sign in to comment.