diff --git a/src/app/components/main-login/main-login.component.ts b/src/app/components/main-login/main-login.component.ts index 5da3630..709507a 100644 --- a/src/app/components/main-login/main-login.component.ts +++ b/src/app/components/main-login/main-login.component.ts @@ -1,20 +1,25 @@ import { Component } from '@angular/core'; -import { RegisterComponent } from "./register/register.component"; -import { ChooseAvatarComponent } from "./choose-avatar/choose-avatar.component"; -import { LoginComponent } from "./login/login.component"; -import { PasswordForgetComponent } from "./password-forget/password-forget.component"; -import { PasswordResetComponent } from "./password-reset/password-reset.component"; -import { loginService } from '../../service/login.service'; +import { RegisterComponent } from './register/register.component'; +import { ChooseAvatarComponent } from './choose-avatar/choose-avatar.component'; +import { LoginComponent } from './login/login.component'; +import { PasswordForgetComponent } from './password-forget/password-forget.component'; +import { PasswordResetComponent } from './password-reset/password-reset.component'; import { CommonModule } from '@angular/common'; import { RouterLink } from '@angular/router'; @Component({ - selector: 'app-main-login', - standalone: true, - templateUrl: './main-login.component.html', - styleUrl: './main-login.component.scss', - imports: [CommonModule,RegisterComponent, ChooseAvatarComponent, LoginComponent, PasswordForgetComponent, PasswordResetComponent,RouterLink] + selector: 'app-main-login', + standalone: true, + templateUrl: './main-login.component.html', + styleUrl: './main-login.component.scss', + imports: [ + CommonModule, + RegisterComponent, + ChooseAvatarComponent, + LoginComponent, + PasswordForgetComponent, + PasswordResetComponent, + RouterLink, + ], }) -export class MainLoginComponent { - -} +export class MainLoginComponent {} diff --git a/src/app/components/main-login/password-forget/password-forget.component.ts b/src/app/components/main-login/password-forget/password-forget.component.ts index d218350..51affdc 100644 --- a/src/app/components/main-login/password-forget/password-forget.component.ts +++ b/src/app/components/main-login/password-forget/password-forget.component.ts @@ -8,7 +8,7 @@ import { getAuth, sendPasswordResetEmail } from 'firebase/auth'; import { Firestore } from '@angular/fire/firestore'; import { Router } from '@angular/router'; import { StartHeaderComponent } from '../../../shared/components/login/start-header/start-header.component'; -import { TranslateModule} from '@ngx-translate/core'; +import { TranslateModule } from '@ngx-translate/core'; @Component({ selector: 'app-password-forget', @@ -22,21 +22,19 @@ import { TranslateModule} from '@ngx-translate/core'; RouterModule, SmallBtnComponent, StartHeaderComponent, - TranslateModule + TranslateModule, ], }) - export class PasswordForgetComponent { email: string = ''; emailSentBtn = false; firestore: Firestore = inject(Firestore); constructor(private router: Router) {} - - /** + /** * Initiates a password reset process for the user. * Sends a password reset email to the user's registered email address. - * + * * @param ngForm The form data from the Angular form, used to manage form state. */ passwordReset(ngForm: NgForm) { @@ -44,7 +42,7 @@ export class PasswordForgetComponent { sendPasswordResetEmail(auth, this.email) .then(() => { ngForm.resetForm(ngForm); - this.router.navigate(['/login']); + this.router.navigate(['/login']); }) .catch((error) => { const errorCode = error.code; @@ -52,10 +50,9 @@ export class PasswordForgetComponent { }); } - - /** + /** * Handles the form submission, invoking the password reset function and then sending a notification email. - * + * * @param ngForm The form instance containing user input. */ onSubmit(ngForm: NgForm) { @@ -63,7 +60,6 @@ export class PasswordForgetComponent { this.sendEmail(); } - /** * Simulates sending an email by toggling a button state to show feedback to the user. * After a set timeout, resets the button state. diff --git a/src/app/components/main-login/password-reset/password-reset.component.ts b/src/app/components/main-login/password-reset/password-reset.component.ts index 71b0999..c3e66b6 100644 --- a/src/app/components/main-login/password-reset/password-reset.component.ts +++ b/src/app/components/main-login/password-reset/password-reset.component.ts @@ -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 { FormsModule, NgForm } from '@angular/forms'; import { CommonModule } from '@angular/common'; @@ -21,7 +21,7 @@ import { TranslateModule } from '@ngx-translate/core'; FooterComponent, RouterModule, SmallBtnComponent, - TranslateModule + TranslateModule, ], templateUrl: './password-reset.component.html', styleUrl: './password-reset.component.scss', @@ -32,15 +32,11 @@ export class PasswordResetComponent { oobCode: string = ''; private queryParamsSubscription: Subscription = new Subscription(); - constructor( - private route: ActivatedRoute, - private router: Router, - ) {} + constructor(private route: ActivatedRoute, private router: Router) {} - -/** - * Initializes the component by subscribing to query parameters. - */ + /** + * Initializes the component by subscribing to query parameters. + */ ngOnInit(): void { this.queryParamsSubscription = this.route.queryParams.subscribe( (params) => { @@ -49,20 +45,18 @@ export class PasswordResetComponent { ); } - -/** - * Handles the submission of the password reset form. - * @param ngForm The form data of the password reset form. - */ + /** + * Handles the submission of the password reset form. + * @param ngForm The form data of the password reset form. + */ onSubmit(ngForm: NgForm): void { this.resetPassword(ngForm); } - -/** - * Performs the password reset operation using Firebase Authentication. - * @param ngForm The form data of the password reset form. - */ + /** + * Performs the password reset operation using Firebase Authentication. + * @param ngForm The form data of the password reset form. + */ resetPassword(ngForm: NgForm): void { const auth = getAuth(); const newPassword = this.passwordRepeat; @@ -76,19 +70,17 @@ 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. + */ ngOnDestroy(): void { this.queryParamsSubscription.unsubscribe(); } - /** - * Checks if the entered passwords match. - * @returns true if the password and repeated password are the same. - */ + * Checks if the entered passwords match. + * @returns true if the password and repeated password are the same. + */ passwordsMatch(): boolean { return this.password === this.passwordRepeat; } diff --git a/src/app/components/secondary-chat/secondary-chat.component.ts b/src/app/components/secondary-chat/secondary-chat.component.ts index d22f08e..f9646cf 100644 --- a/src/app/components/secondary-chat/secondary-chat.component.ts +++ b/src/app/components/secondary-chat/secondary-chat.component.ts @@ -1,6 +1,5 @@ import { AfterViewChecked, - AfterViewInit, Component, ElementRef, Input, @@ -10,12 +9,10 @@ import { import { UserService } from '../../service/user.service'; import { ChannleService } from '../../service/channle.service'; import { ChatService } from '../../service/chat.service'; -import { Channel } from '../../interface/channel.interface'; import { MainComponent } from '../main/main.component'; import { SingleChatComponent } from '../main-chat/single-chat/single-chat.component'; import { Chat, ChatAnswers } from '../../interface/chat.interface'; import { CommonModule } from '@angular/common'; -import { User } from '../../interface/user.interface'; import { ChatMsgBoxComponent } from '../main-chat/chat-msg-box/chat-msg-box.component'; import { TranslateModule } from '@ngx-translate/core'; diff --git a/src/app/components/sidebar/sidebar.component.ts b/src/app/components/sidebar/sidebar.component.ts index d8c0046..f91377e 100644 --- a/src/app/components/sidebar/sidebar.component.ts +++ b/src/app/components/sidebar/sidebar.component.ts @@ -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 { SidebarChannelsComponent } from './sidebar-channels/sidebar-channels.component'; import { SidebarDirectMessagesComponent } from './sidebar-direct-messages/sidebar-direct-messages.component'; diff --git a/src/app/service/download-files.service.ts b/src/app/service/download-files.service.ts index 016c791..154edfc 100644 --- a/src/app/service/download-files.service.ts +++ b/src/app/service/download-files.service.ts @@ -1,4 +1,4 @@ -import { Injectable, Input, OnInit } from '@angular/core'; +import { Injectable } from '@angular/core'; import { getDownloadURL, getStorage, @@ -23,7 +23,6 @@ export class DownloadFilesService { } loadAllFiles(docID: string) { - // lädt die fails in den firebase storage const storage = getStorage(); for (const file of this.uploadFiles) { const storageRef = ref(storage, `chatFiles/${docID}/${file.name}`); @@ -54,7 +53,6 @@ export class DownloadFilesService { downloadedFilesData.push({ id: folderID, files: folderFiles }); } - // Emit the updated value this.downloadedFiles.next(downloadedFilesData); }) diff --git a/src/app/service/language.service.ts b/src/app/service/language.service.ts index e491b1d..53df1f2 100644 --- a/src/app/service/language.service.ts +++ b/src/app/service/language.service.ts @@ -11,14 +11,11 @@ export class LanguageService { this.translate.setDefaultLang(this.currentLang); } - /** - * 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. - * - * @param lang The language code to switch to. Supported values are 'en' for English and 'de' for German. - */ + * 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. + * @param lang The language code to switch to. Supported values are 'en' for English and 'de' for German. + */ switchLanguage() { this.currentLang = this.currentLang === 'en' ? 'de' : 'en'; this.translate.use(this.currentLang); diff --git a/src/app/service/toggle-boolean.service.ts b/src/app/service/toggle-boolean.service.ts index a3f1823..ad90dc5 100644 --- a/src/app/service/toggle-boolean.service.ts +++ b/src/app/service/toggle-boolean.service.ts @@ -1,25 +1,23 @@ import { Injectable } from '@angular/core'; - @Injectable({ - providedIn: 'root' + providedIn: 'root', }) export class ToggleBooleanService { - - constructor() { } + constructor() {} openSearchWindow: boolean = false; openChannelMemberWindow: boolean = false; closeChannelMemberWindow: boolean = false; openSearchWindowHead: boolean = false; - selectUserInMsgBox:boolean = false; + selectUserInMsgBox: boolean = false; isSidebarOpen: boolean = true; - + /** * Opens or closes the add member window based on the provided boolean value. * @param boolean A boolean value to determine whether to open or close the add member window. */ - openAddMemberWindow(boolean : boolean){ + openAddMemberWindow(boolean: boolean) { this.closeChannelMemberWindow = boolean; } }