added notice dialog
This commit is contained in:
parent
d046718c30
commit
35d815d5e6
12 changed files with 147 additions and 4 deletions
|
|
@ -1,5 +1,6 @@
|
||||||
@if (this.isLoggedIn === undefined) {
|
@if (this.isLoggedIn === undefined) {
|
||||||
<router-outlet></router-outlet>
|
<router-outlet></router-outlet>
|
||||||
|
<app-overlay></app-overlay>
|
||||||
} @else {
|
} @else {
|
||||||
<div
|
<div
|
||||||
[ngClass]="{
|
[ngClass]="{
|
||||||
|
|
|
||||||
|
|
@ -16,6 +16,7 @@ import { PwResetComponent } from './components/login/forgot-pw/pw-reset/pw-reset
|
||||||
export const routes: Routes = [
|
export const routes: Routes = [
|
||||||
{ path: '', component: SummaryComponent },
|
{ path: '', component: SummaryComponent },
|
||||||
{ path: 'login', component: LoginComponent },
|
{ path: 'login', component: LoginComponent },
|
||||||
|
{ path: 'login/:id', component: LoginComponent },
|
||||||
{ path: 'login/imprint', component: ImprintComponent },
|
{ path: 'login/imprint', component: ImprintComponent },
|
||||||
{ path: 'login/privacy-policy', component: PrivacyPolicyComponent },
|
{ path: 'login/privacy-policy', component: PrivacyPolicyComponent },
|
||||||
{ path: 'register', component: RegisterComponent },
|
{ path: 'register', component: RegisterComponent },
|
||||||
|
|
|
||||||
|
|
@ -3,13 +3,14 @@ import { Component } from '@angular/core';
|
||||||
import { FormsModule, NgForm } from '@angular/forms';
|
import { FormsModule, NgForm } from '@angular/forms';
|
||||||
import { FormBtnComponent } from '../../shared/components/buttons/form-btn/form-btn.component';
|
import { FormBtnComponent } from '../../shared/components/buttons/form-btn/form-btn.component';
|
||||||
import { FirebaseService } from '../../services/firebase.service';
|
import { FirebaseService } from '../../services/firebase.service';
|
||||||
import { Router, RouterLink } from '@angular/router';
|
import { ActivatedRoute, Router, RouterLink } from '@angular/router';
|
||||||
import { LoginService } from '../../services/login.service';
|
import { LoginService } from '../../services/login.service';
|
||||||
import { SharedService } from '../../services/shared.service';
|
import { SharedService } from '../../services/shared.service';
|
||||||
import { FooterComponent } from './footer/footer.component';
|
import { FooterComponent } from './footer/footer.component';
|
||||||
import { HeaderComponent } from './header/header.component';
|
import { HeaderComponent } from './header/header.component';
|
||||||
import { TranslateModule } from '@ngx-translate/core';
|
import { TranslateModule } from '@ngx-translate/core';
|
||||||
import { LoadingDialogComponent } from './loading-dialog/loading-dialog.component';
|
import { LoadingDialogComponent } from './loading-dialog/loading-dialog.component';
|
||||||
|
import { OverlayService } from '../../services/overlay.service';
|
||||||
|
|
||||||
@Component({
|
@Component({
|
||||||
selector: 'app-login',
|
selector: 'app-login',
|
||||||
|
|
@ -39,9 +40,26 @@ export class LoginComponent {
|
||||||
private firebaseService: FirebaseService,
|
private firebaseService: FirebaseService,
|
||||||
public loginSerivce: LoginService,
|
public loginSerivce: LoginService,
|
||||||
public sharedService: SharedService,
|
public sharedService: SharedService,
|
||||||
|
private overlayService: OverlayService,
|
||||||
|
private route: ActivatedRoute,
|
||||||
private router: Router
|
private router: Router
|
||||||
) {}
|
) {}
|
||||||
|
|
||||||
|
ngOnInit() {
|
||||||
|
this.routeParams();
|
||||||
|
}
|
||||||
|
|
||||||
|
routeParams() {
|
||||||
|
this.route.params.subscribe((params) => {
|
||||||
|
if (params['id'] && params['id'] === 'pw-send') {
|
||||||
|
this.overlayService.setOverlayData('dialog', 'pw-send');
|
||||||
|
}
|
||||||
|
if (params['id'] && params['id'] === 'pw-change') {
|
||||||
|
this.overlayService.setOverlayData('dialog', 'pw-change');
|
||||||
|
}
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
onSubmit(ngForm: NgForm) {
|
onSubmit(ngForm: NgForm) {
|
||||||
this.sharedService.isBtnDisabled = true;
|
this.sharedService.isBtnDisabled = true;
|
||||||
if (ngForm.submitted && ngForm.form.valid) {
|
if (ngForm.submitted && ngForm.form.valid) {
|
||||||
|
|
|
||||||
|
|
@ -212,7 +212,7 @@ export class LoginService {
|
||||||
const auth = getAuth();
|
const auth = getAuth();
|
||||||
sendPasswordResetEmail(auth, email)
|
sendPasswordResetEmail(auth, email)
|
||||||
.then(() => {
|
.then(() => {
|
||||||
this.router.navigate(['/login']);
|
this.router.navigate(['/login/pw-send']);
|
||||||
this.sharedService.isBtnDisabled = false;
|
this.sharedService.isBtnDisabled = false;
|
||||||
})
|
})
|
||||||
.catch((error) => {
|
.catch((error) => {
|
||||||
|
|
|
||||||
|
|
@ -0,0 +1,12 @@
|
||||||
|
<section>
|
||||||
|
<div class="header">
|
||||||
|
<div class="headline">{{ "msgDialog.noticeHeadline" | translate }}</div>
|
||||||
|
<app-btn-close (click)="closeOverlay()"></app-btn-close>
|
||||||
|
</div>
|
||||||
|
<p>
|
||||||
|
@if (overlayData === "pw-send") { {{ "msgDialog.pwSend" | translate }} }
|
||||||
|
</p>
|
||||||
|
<p>
|
||||||
|
@if (overlayData === "pw-change") { {{ "msgDialog.pwChange" | translate }} }
|
||||||
|
</p>
|
||||||
|
</section>
|
||||||
|
|
@ -0,0 +1,41 @@
|
||||||
|
section {
|
||||||
|
width: 500px;
|
||||||
|
height: fit-content;
|
||||||
|
padding: 24px;
|
||||||
|
border-radius: 24px;
|
||||||
|
background-color: var(--white);
|
||||||
|
box-shadow: 4px 4px 4px 0px rgba(0, 0, 0, 0.1);
|
||||||
|
p {
|
||||||
|
text-align: center;
|
||||||
|
font-size: 21px;
|
||||||
|
font-weight: 500;
|
||||||
|
padding-bottom: 12px;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
.header {
|
||||||
|
display: flex;
|
||||||
|
justify-content: space-between;
|
||||||
|
align-items: center;
|
||||||
|
padding-bottom: 18px;
|
||||||
|
.headline {
|
||||||
|
font-size: 24px;
|
||||||
|
font-weight: 700;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
/*------------- RESPONSIVE -------------*/
|
||||||
|
|
||||||
|
@media screen and (max-width: 600px) {
|
||||||
|
section {
|
||||||
|
width: calc(100vw - 96px);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
@media screen and (max-width: 450px) {
|
||||||
|
section {
|
||||||
|
p {
|
||||||
|
font-size: 18px;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
@ -0,0 +1,23 @@
|
||||||
|
import { ComponentFixture, TestBed } from '@angular/core/testing';
|
||||||
|
|
||||||
|
import { DialogOverlayComponent } from './dialog-overlay.component';
|
||||||
|
|
||||||
|
describe('DialogOverlayComponent', () => {
|
||||||
|
let component: DialogOverlayComponent;
|
||||||
|
let fixture: ComponentFixture<DialogOverlayComponent>;
|
||||||
|
|
||||||
|
beforeEach(async () => {
|
||||||
|
await TestBed.configureTestingModule({
|
||||||
|
imports: [DialogOverlayComponent]
|
||||||
|
})
|
||||||
|
.compileComponents();
|
||||||
|
|
||||||
|
fixture = TestBed.createComponent(DialogOverlayComponent);
|
||||||
|
component = fixture.componentInstance;
|
||||||
|
fixture.detectChanges();
|
||||||
|
});
|
||||||
|
|
||||||
|
it('should create', () => {
|
||||||
|
expect(component).toBeTruthy();
|
||||||
|
});
|
||||||
|
});
|
||||||
|
|
@ -0,0 +1,25 @@
|
||||||
|
import { Component, EventEmitter, Input, Output } from '@angular/core';
|
||||||
|
import { SharedService } from '../../../../services/shared.service';
|
||||||
|
import { BtnCloseComponent } from '../../buttons/btn-close/btn-close.component';
|
||||||
|
import { Router } from '@angular/router';
|
||||||
|
import { TranslateModule } from '@ngx-translate/core';
|
||||||
|
|
||||||
|
@Component({
|
||||||
|
selector: 'app-dialog-overlay',
|
||||||
|
standalone: true,
|
||||||
|
imports: [BtnCloseComponent, TranslateModule],
|
||||||
|
templateUrl: './dialog-overlay.component.html',
|
||||||
|
styleUrl: './dialog-overlay.component.scss',
|
||||||
|
})
|
||||||
|
export class DialogOverlayComponent {
|
||||||
|
@Input() overlayData: string = '';
|
||||||
|
@Input() overlayType: string = '';
|
||||||
|
@Output() closeDialogEmitter = new EventEmitter<string>();
|
||||||
|
|
||||||
|
constructor(public sharedService: SharedService, private router: Router) {}
|
||||||
|
|
||||||
|
closeOverlay() {
|
||||||
|
this.router.navigate(['/login']);
|
||||||
|
this.closeDialogEmitter.emit('');
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
@ -18,6 +18,12 @@
|
||||||
[overlayType]="overlayType"
|
[overlayType]="overlayType"
|
||||||
(closeDialogEmitter)="onCloseOverlay($event)"
|
(closeDialogEmitter)="onCloseOverlay($event)"
|
||||||
></app-task-edit-overlay>
|
></app-task-edit-overlay>
|
||||||
|
}@if (overlayType === "dialog") {
|
||||||
|
<app-dialog-overlay
|
||||||
|
[overlayData]="overlayData"
|
||||||
|
[overlayType]="overlayType"
|
||||||
|
(closeDialogEmitter)="onCloseOverlay($event)"
|
||||||
|
></app-dialog-overlay>
|
||||||
}
|
}
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
|
||||||
|
|
@ -13,8 +13,10 @@ import { CommonModule } from '@angular/common';
|
||||||
import { TaskOverlayComponent } from './task-overlay/task-overlay.component';
|
import { TaskOverlayComponent } from './task-overlay/task-overlay.component';
|
||||||
import { FirebaseService } from '../../../services/firebase.service';
|
import { FirebaseService } from '../../../services/firebase.service';
|
||||||
import { TaskEditOverlayComponent } from './task-edit-overlay/task-edit-overlay.component';
|
import { TaskEditOverlayComponent } from './task-edit-overlay/task-edit-overlay.component';
|
||||||
import { ActivatedRoute } from '@angular/router';
|
import { ActivatedRoute, Router } from '@angular/router';
|
||||||
import { AddTaskComponent } from '../../../components/add-task/add-task.component';
|
import { AddTaskComponent } from '../../../components/add-task/add-task.component';
|
||||||
|
import { DialogOverlayComponent } from './dialog-overlay/dialog-overlay.component';
|
||||||
|
import { SharedService } from '../../../services/shared.service';
|
||||||
|
|
||||||
@Component({
|
@Component({
|
||||||
selector: 'app-overlay',
|
selector: 'app-overlay',
|
||||||
|
|
@ -23,6 +25,7 @@ import { AddTaskComponent } from '../../../components/add-task/add-task.componen
|
||||||
CommonModule,
|
CommonModule,
|
||||||
TaskOverlayComponent,
|
TaskOverlayComponent,
|
||||||
TaskEditOverlayComponent,
|
TaskEditOverlayComponent,
|
||||||
|
DialogOverlayComponent,
|
||||||
AddTaskComponent,
|
AddTaskComponent,
|
||||||
],
|
],
|
||||||
templateUrl: './overlay.component.html',
|
templateUrl: './overlay.component.html',
|
||||||
|
|
@ -34,7 +37,9 @@ export class OverlayComponent implements OnInit {
|
||||||
|
|
||||||
constructor(
|
constructor(
|
||||||
private overlayService: OverlayService,
|
private overlayService: OverlayService,
|
||||||
private route: ActivatedRoute
|
private sharedService: SharedService,
|
||||||
|
private route: ActivatedRoute,
|
||||||
|
private router: Router
|
||||||
) {}
|
) {}
|
||||||
|
|
||||||
ngOnInit(): void {
|
ngOnInit(): void {
|
||||||
|
|
@ -51,6 +56,7 @@ export class OverlayComponent implements OnInit {
|
||||||
}
|
}
|
||||||
|
|
||||||
onCloseOverlay(emitter: string) {
|
onCloseOverlay(emitter: string) {
|
||||||
|
this.overlayType === 'dialog' && this.router.navigate(['/login']);
|
||||||
this.overlayData = emitter;
|
this.overlayData = emitter;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -20,6 +20,11 @@
|
||||||
"pwChange": "Passwort ändern",
|
"pwChange": "Passwort ändern",
|
||||||
"notice": "Wir senden Ihnen eine E-Mail, über die Sie Ihr Passwort ändern können"
|
"notice": "Wir senden Ihnen eine E-Mail, über die Sie Ihr Passwort ändern können"
|
||||||
},
|
},
|
||||||
|
"msgDialog": {
|
||||||
|
"noticeHeadline": "Hinweis",
|
||||||
|
"pwSend": "Eine E-Mail mit Anweisungen zum Zurücksetzen Ihres Passworts wurde an Sie gesendet.",
|
||||||
|
"pwChange": "Ihr Passwort wurde erfolgreich geändert. Sie können sich jetzt einloggen."
|
||||||
|
},
|
||||||
"register": {
|
"register": {
|
||||||
"signup": "Registrieren",
|
"signup": "Registrieren",
|
||||||
"name": "Name",
|
"name": "Name",
|
||||||
|
|
|
||||||
|
|
@ -20,6 +20,11 @@
|
||||||
"pwChange": "Change Password",
|
"pwChange": "Change Password",
|
||||||
"notice": "We will send you an email to change your password."
|
"notice": "We will send you an email to change your password."
|
||||||
},
|
},
|
||||||
|
"msgDialog": {
|
||||||
|
"noticeHeadline": "Notice",
|
||||||
|
"pwSend": "An email with instructions on how to reset your password has been sent to you.",
|
||||||
|
"pwChange": "Your password has been successfully changed. You can now log in."
|
||||||
|
},
|
||||||
"register": {
|
"register": {
|
||||||
"signup": "Sign up",
|
"signup": "Sign up",
|
||||||
"name": "Name",
|
"name": "Name",
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue