clean code
This commit is contained in:
parent
c7e64d34c3
commit
e0677e9971
8 changed files with 56 additions and 73 deletions
|
|
@ -1,10 +1,9 @@
|
||||||
import { Component } from '@angular/core';
|
import { Component } from '@angular/core';
|
||||||
import { RegisterComponent } from "./register/register.component";
|
import { RegisterComponent } from './register/register.component';
|
||||||
import { ChooseAvatarComponent } from "./choose-avatar/choose-avatar.component";
|
import { ChooseAvatarComponent } from './choose-avatar/choose-avatar.component';
|
||||||
import { LoginComponent } from "./login/login.component";
|
import { LoginComponent } from './login/login.component';
|
||||||
import { PasswordForgetComponent } from "./password-forget/password-forget.component";
|
import { PasswordForgetComponent } from './password-forget/password-forget.component';
|
||||||
import { PasswordResetComponent } from "./password-reset/password-reset.component";
|
import { PasswordResetComponent } from './password-reset/password-reset.component';
|
||||||
import { loginService } from '../../service/login.service';
|
|
||||||
import { CommonModule } from '@angular/common';
|
import { CommonModule } from '@angular/common';
|
||||||
import { RouterLink } from '@angular/router';
|
import { RouterLink } from '@angular/router';
|
||||||
|
|
||||||
|
|
@ -13,8 +12,14 @@ import { RouterLink } from '@angular/router';
|
||||||
standalone: true,
|
standalone: true,
|
||||||
templateUrl: './main-login.component.html',
|
templateUrl: './main-login.component.html',
|
||||||
styleUrl: './main-login.component.scss',
|
styleUrl: './main-login.component.scss',
|
||||||
imports: [CommonModule,RegisterComponent, ChooseAvatarComponent, LoginComponent, PasswordForgetComponent, PasswordResetComponent,RouterLink]
|
imports: [
|
||||||
|
CommonModule,
|
||||||
|
RegisterComponent,
|
||||||
|
ChooseAvatarComponent,
|
||||||
|
LoginComponent,
|
||||||
|
PasswordForgetComponent,
|
||||||
|
PasswordResetComponent,
|
||||||
|
RouterLink,
|
||||||
|
],
|
||||||
})
|
})
|
||||||
export class MainLoginComponent {
|
export class MainLoginComponent {}
|
||||||
|
|
||||||
}
|
|
||||||
|
|
|
||||||
|
|
@ -22,17 +22,15 @@ import { TranslateModule} from '@ngx-translate/core';
|
||||||
RouterModule,
|
RouterModule,
|
||||||
SmallBtnComponent,
|
SmallBtnComponent,
|
||||||
StartHeaderComponent,
|
StartHeaderComponent,
|
||||||
TranslateModule
|
TranslateModule,
|
||||||
],
|
],
|
||||||
})
|
})
|
||||||
|
|
||||||
export class PasswordForgetComponent {
|
export class PasswordForgetComponent {
|
||||||
email: string = '';
|
email: string = '';
|
||||||
emailSentBtn = false;
|
emailSentBtn = false;
|
||||||
firestore: Firestore = inject(Firestore);
|
firestore: Firestore = inject(Firestore);
|
||||||
constructor(private router: Router) {}
|
constructor(private router: Router) {}
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Initiates a password reset process for the user.
|
* Initiates a password reset process for the user.
|
||||||
* Sends a password reset email to the user's registered email address.
|
* Sends a password reset email to the user's registered email address.
|
||||||
|
|
@ -52,7 +50,6 @@ export class PasswordForgetComponent {
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Handles the form submission, invoking the password reset function and then sending a notification email.
|
* Handles the form submission, invoking the password reset function and then sending a notification email.
|
||||||
*
|
*
|
||||||
|
|
@ -63,7 +60,6 @@ export class PasswordForgetComponent {
|
||||||
this.sendEmail();
|
this.sendEmail();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Simulates sending an email by toggling a button state to show feedback to the user.
|
* Simulates sending an email by toggling a button state to show feedback to the user.
|
||||||
* After a set timeout, resets the button state.
|
* After a set timeout, resets the button state.
|
||||||
|
|
|
||||||
|
|
@ -1,4 +1,4 @@
|
||||||
import { Component, inject } from '@angular/core';
|
import { Component } from '@angular/core';
|
||||||
import { FooterComponent } from '../../../shared/components/login/footer/footer.component';
|
import { FooterComponent } from '../../../shared/components/login/footer/footer.component';
|
||||||
import { FormsModule, NgForm } from '@angular/forms';
|
import { FormsModule, NgForm } from '@angular/forms';
|
||||||
import { CommonModule } from '@angular/common';
|
import { CommonModule } from '@angular/common';
|
||||||
|
|
@ -21,7 +21,7 @@ import { TranslateModule } from '@ngx-translate/core';
|
||||||
FooterComponent,
|
FooterComponent,
|
||||||
RouterModule,
|
RouterModule,
|
||||||
SmallBtnComponent,
|
SmallBtnComponent,
|
||||||
TranslateModule
|
TranslateModule,
|
||||||
],
|
],
|
||||||
templateUrl: './password-reset.component.html',
|
templateUrl: './password-reset.component.html',
|
||||||
styleUrl: './password-reset.component.scss',
|
styleUrl: './password-reset.component.scss',
|
||||||
|
|
@ -32,11 +32,7 @@ export class PasswordResetComponent {
|
||||||
oobCode: string = '';
|
oobCode: string = '';
|
||||||
private queryParamsSubscription: Subscription = new Subscription();
|
private queryParamsSubscription: Subscription = new Subscription();
|
||||||
|
|
||||||
constructor(
|
constructor(private route: ActivatedRoute, private router: Router) {}
|
||||||
private route: ActivatedRoute,
|
|
||||||
private router: Router,
|
|
||||||
) {}
|
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Initializes the component by subscribing to query parameters.
|
* Initializes the component by subscribing to query parameters.
|
||||||
|
|
@ -49,7 +45,6 @@ export class PasswordResetComponent {
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Handles the submission of the password reset form.
|
* Handles the submission of the password reset form.
|
||||||
* @param ngForm The form data of the password reset form.
|
* @param ngForm The form data of the password reset form.
|
||||||
|
|
@ -58,7 +53,6 @@ export class PasswordResetComponent {
|
||||||
this.resetPassword(ngForm);
|
this.resetPassword(ngForm);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Performs the password reset operation using Firebase Authentication.
|
* Performs the password reset operation using Firebase Authentication.
|
||||||
* @param ngForm The form data of the password reset form.
|
* @param ngForm The form data of the password reset form.
|
||||||
|
|
@ -76,7 +70,6 @@ export class PasswordResetComponent {
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Cleans up the component by unsubscribing from the query parameters subscription.
|
* Cleans up the component by unsubscribing from the query parameters subscription.
|
||||||
*/
|
*/
|
||||||
|
|
@ -84,7 +77,6 @@ export class PasswordResetComponent {
|
||||||
this.queryParamsSubscription.unsubscribe();
|
this.queryParamsSubscription.unsubscribe();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Checks if the entered passwords match.
|
* Checks if the entered passwords match.
|
||||||
* @returns true if the password and repeated password are the same.
|
* @returns true if the password and repeated password are the same.
|
||||||
|
|
|
||||||
|
|
@ -1,6 +1,5 @@
|
||||||
import {
|
import {
|
||||||
AfterViewChecked,
|
AfterViewChecked,
|
||||||
AfterViewInit,
|
|
||||||
Component,
|
Component,
|
||||||
ElementRef,
|
ElementRef,
|
||||||
Input,
|
Input,
|
||||||
|
|
@ -10,12 +9,10 @@ import {
|
||||||
import { UserService } from '../../service/user.service';
|
import { UserService } from '../../service/user.service';
|
||||||
import { ChannleService } from '../../service/channle.service';
|
import { ChannleService } from '../../service/channle.service';
|
||||||
import { ChatService } from '../../service/chat.service';
|
import { ChatService } from '../../service/chat.service';
|
||||||
import { Channel } from '../../interface/channel.interface';
|
|
||||||
import { MainComponent } from '../main/main.component';
|
import { MainComponent } from '../main/main.component';
|
||||||
import { SingleChatComponent } from '../main-chat/single-chat/single-chat.component';
|
import { SingleChatComponent } from '../main-chat/single-chat/single-chat.component';
|
||||||
import { Chat, ChatAnswers } from '../../interface/chat.interface';
|
import { Chat, ChatAnswers } from '../../interface/chat.interface';
|
||||||
import { CommonModule } from '@angular/common';
|
import { CommonModule } from '@angular/common';
|
||||||
import { User } from '../../interface/user.interface';
|
|
||||||
import { ChatMsgBoxComponent } from '../main-chat/chat-msg-box/chat-msg-box.component';
|
import { ChatMsgBoxComponent } from '../main-chat/chat-msg-box/chat-msg-box.component';
|
||||||
import { TranslateModule } from '@ngx-translate/core';
|
import { TranslateModule } from '@ngx-translate/core';
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -1,4 +1,4 @@
|
||||||
import { ChangeDetectorRef, Component, Input, OnInit } from '@angular/core';
|
import { Component, Input, OnInit } from '@angular/core';
|
||||||
import { ActivatedRoute, RouterModule } from '@angular/router';
|
import { ActivatedRoute, RouterModule } from '@angular/router';
|
||||||
import { SidebarChannelsComponent } from './sidebar-channels/sidebar-channels.component';
|
import { SidebarChannelsComponent } from './sidebar-channels/sidebar-channels.component';
|
||||||
import { SidebarDirectMessagesComponent } from './sidebar-direct-messages/sidebar-direct-messages.component';
|
import { SidebarDirectMessagesComponent } from './sidebar-direct-messages/sidebar-direct-messages.component';
|
||||||
|
|
|
||||||
|
|
@ -1,4 +1,4 @@
|
||||||
import { Injectable, Input, OnInit } from '@angular/core';
|
import { Injectable } from '@angular/core';
|
||||||
import {
|
import {
|
||||||
getDownloadURL,
|
getDownloadURL,
|
||||||
getStorage,
|
getStorage,
|
||||||
|
|
@ -23,7 +23,6 @@ export class DownloadFilesService {
|
||||||
}
|
}
|
||||||
|
|
||||||
loadAllFiles(docID: string) {
|
loadAllFiles(docID: string) {
|
||||||
// lädt die fails in den firebase storage
|
|
||||||
const storage = getStorage();
|
const storage = getStorage();
|
||||||
for (const file of this.uploadFiles) {
|
for (const file of this.uploadFiles) {
|
||||||
const storageRef = ref(storage, `chatFiles/${docID}/${file.name}`);
|
const storageRef = ref(storage, `chatFiles/${docID}/${file.name}`);
|
||||||
|
|
@ -54,7 +53,6 @@ export class DownloadFilesService {
|
||||||
|
|
||||||
downloadedFilesData.push({ id: folderID, files: folderFiles });
|
downloadedFilesData.push({ id: folderID, files: folderFiles });
|
||||||
}
|
}
|
||||||
|
|
||||||
// Emit the updated value
|
// Emit the updated value
|
||||||
this.downloadedFiles.next(downloadedFilesData);
|
this.downloadedFiles.next(downloadedFilesData);
|
||||||
})
|
})
|
||||||
|
|
|
||||||
|
|
@ -11,12 +11,9 @@ export class LanguageService {
|
||||||
this.translate.setDefaultLang(this.currentLang);
|
this.translate.setDefaultLang(this.currentLang);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Switches the application's current language.
|
* Switches the application's current language.
|
||||||
*
|
|
||||||
* This method sets the current language based on the specified `lang` parameter and updates the translation service to use the new language. This is useful for enabling runtime language switching in a multi-lingual application.
|
* This method sets the current language based on the specified `lang` parameter and updates the translation service to use the new language. This is useful for enabling runtime language switching in a multi-lingual application.
|
||||||
*
|
|
||||||
* @param lang The language code to switch to. Supported values are 'en' for English and 'de' for German.
|
* @param lang The language code to switch to. Supported values are 'en' for English and 'de' for German.
|
||||||
*/
|
*/
|
||||||
switchLanguage() {
|
switchLanguage() {
|
||||||
|
|
|
||||||
|
|
@ -1,11 +1,9 @@
|
||||||
import { Injectable } from '@angular/core';
|
import { Injectable } from '@angular/core';
|
||||||
|
|
||||||
|
|
||||||
@Injectable({
|
@Injectable({
|
||||||
providedIn: 'root'
|
providedIn: 'root',
|
||||||
})
|
})
|
||||||
export class ToggleBooleanService {
|
export class ToggleBooleanService {
|
||||||
|
|
||||||
constructor() {}
|
constructor() {}
|
||||||
|
|
||||||
openSearchWindow: boolean = false;
|
openSearchWindow: boolean = false;
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue