From 03ddce0290d62cdd12add486cd9ab832a51bfbf5 Mon Sep 17 00:00:00 2001 From: jank Date: Wed, 20 Aug 2025 08:29:13 +0200 Subject: [PATCH] prettier --- angular.json | 9 +- src/app/app.component.ts | 9 +- src/app/app.config.ts | 8 +- src/app/app.routes.ts | 10 +- .../component/auth/login/login.component.html | 20 +++- .../component/auth/login/login.component.ts | 23 +++-- .../auth/register/register.component.html | 91 ++++++++++++++++--- .../auth/register/register.component.ts | 17 ++-- .../dashboard/dashboard.component.html | 4 +- .../dashboard/dashboard.component.ts | 14 +-- .../component/header/header.component.html | 10 +- src/app/component/header/header.component.ts | 14 +-- .../random-ahh/random-ahh.component.ts | 16 +--- src/app/component/side/side.component.html | 7 +- src/app/component/side/side.component.ts | 6 +- src/app/component/users/users.component.ts | 4 +- src/app/service/auth.guard.ts | 36 +++++--- src/app/service/auth.service.ts | 18 ++-- src/app/service/custom.validators.ts | 19 ++-- src/app/service/http.interceptor.ts | 23 +++-- src/index.html | 20 ++-- src/main.ts | 5 +- tsconfig.app.json | 8 +- tsconfig.json | 5 +- tsconfig.spec.json | 9 +- 25 files changed, 240 insertions(+), 165 deletions(-) diff --git a/angular.json b/angular.json index edf89fd..e8c9f44 100644 --- a/angular.json +++ b/angular.json @@ -16,9 +16,7 @@ "outputPath": "dist/auth", "index": "src/index.html", "browser": "src/main.ts", - "polyfills": [ - "zone.js" - ], + "polyfills": ["zone.js"], "tsConfig": "tsconfig.app.json", "assets": [ { @@ -74,10 +72,7 @@ "test": { "builder": "@angular/build:karma", "options": { - "polyfills": [ - "zone.js", - "zone.js/testing" - ], + "polyfills": ["zone.js", "zone.js/testing"], "tsConfig": "tsconfig.spec.json", "assets": [ { diff --git a/src/app/app.component.ts b/src/app/app.component.ts index c9770ba..9336879 100644 --- a/src/app/app.component.ts +++ b/src/app/app.component.ts @@ -2,9 +2,8 @@ import { Component } from '@angular/core'; import { RouterOutlet } from '@angular/router'; @Component({ - selector: 'app-root', - imports: [RouterOutlet], - templateUrl: './app.component.html', + selector: 'app-root', + imports: [RouterOutlet], + templateUrl: './app.component.html', }) -export class AppComponent { -} +export class AppComponent {} diff --git a/src/app/app.config.ts b/src/app/app.config.ts index 4973533..1ccabc6 100644 --- a/src/app/app.config.ts +++ b/src/app/app.config.ts @@ -1,14 +1,14 @@ import { ApplicationConfig, provideZoneChangeDetection } from '@angular/core'; -import {provideRouter, withDebugTracing} from '@angular/router'; +import { provideRouter, withDebugTracing } from '@angular/router'; import { routes } from './app.routes'; -import {provideHttpClient, withInterceptors} from "@angular/common/http"; -import {httpInterceptor} from "./service/http.interceptor"; +import { provideHttpClient, withInterceptors } from '@angular/common/http'; +import { httpInterceptor } from './service/http.interceptor'; export const appConfig: ApplicationConfig = { providers: [ provideZoneChangeDetection({ eventCoalescing: true }), provideRouter(routes, withDebugTracing()), provideHttpClient(withInterceptors([httpInterceptor])), - ] + ], }; diff --git a/src/app/app.routes.ts b/src/app/app.routes.ts index 161940d..dc084f2 100644 --- a/src/app/app.routes.ts +++ b/src/app/app.routes.ts @@ -1,5 +1,5 @@ import { Routes } from '@angular/router'; -import {authGuard} from "./service/auth.guard"; +import { authGuard } from './service/auth.guard'; export const routes: Routes = [ { @@ -7,7 +7,8 @@ export const routes: Routes = [ children: [ { path: 'register', - loadComponent: () => import('./component/auth/register/register.component'), + loadComponent: () => + import('./component/auth/register/register.component'), }, { path: 'login', @@ -21,7 +22,8 @@ export const routes: Routes = [ children: [ { path: 'dashboard', - loadComponent: () => import('./component/dashboard/dashboard.component'), + loadComponent: () => + import('./component/dashboard/dashboard.component'), }, { path: 'users', @@ -29,5 +31,5 @@ export const routes: Routes = [ }, ], canActivate: [authGuard], - } + }, ]; diff --git a/src/app/component/auth/login/login.component.html b/src/app/component/auth/login/login.component.html index fd14997..3a52ae5 100644 --- a/src/app/component/auth/login/login.component.html +++ b/src/app/component/auth/login/login.component.html @@ -8,15 +8,27 @@
- +
- +
- +
- \ No newline at end of file + diff --git a/src/app/component/auth/login/login.component.ts b/src/app/component/auth/login/login.component.ts index 4f19f4d..d6df24b 100644 --- a/src/app/component/auth/login/login.component.ts +++ b/src/app/component/auth/login/login.component.ts @@ -1,14 +1,17 @@ -import {Component, inject} from '@angular/core'; -import {FormBuilder, FormGroup, ReactiveFormsModule, Validators} from "@angular/forms"; -import AuthService from "../../../service/auth.service"; -import {AuthResponse, Token} from "../../../models"; -import {Router} from "@angular/router"; +import { Component, inject } from '@angular/core'; +import { + FormBuilder, + FormGroup, + ReactiveFormsModule, + Validators, +} from '@angular/forms'; +import AuthService from '../../../service/auth.service'; +import { AuthResponse, Token } from '../../../models'; +import { Router } from '@angular/router'; @Component({ selector: 'app-login', - imports: [ - ReactiveFormsModule - ], + imports: [ReactiveFormsModule], templateUrl: './login.component.html', }) export default class LoginComponent { @@ -23,7 +26,7 @@ export default class LoginComponent { login() { if (this.form.invalid) { - console.log(this.form.errors) + console.log(this.form.errors); return; } @@ -31,7 +34,7 @@ export default class LoginComponent { localStorage.setItem('access_token', r.accessToken); localStorage.setItem('refresh_token', r.refreshToken); - this.router.navigate(['dashboard']) + this.router.navigate(['dashboard']); }); } } diff --git a/src/app/component/auth/register/register.component.html b/src/app/component/auth/register/register.component.html index d65181c..2fb9eaf 100644 --- a/src/app/component/auth/register/register.component.html +++ b/src/app/component/auth/register/register.component.html @@ -9,11 +9,21 @@
- +
- +
@@ -22,25 +32,50 @@
- +
- +
- +
- +
- +
@@ -50,11 +85,23 @@
- +
- - + +
@@ -64,18 +111,32 @@
- +
- - + +
- + - \ No newline at end of file + diff --git a/src/app/component/auth/register/register.component.ts b/src/app/component/auth/register/register.component.ts index ee56e6f..05ebfa5 100644 --- a/src/app/component/auth/register/register.component.ts +++ b/src/app/component/auth/register/register.component.ts @@ -1,13 +1,16 @@ -import {Component, inject} from '@angular/core'; -import {FormBuilder, FormGroup, ReactiveFormsModule, Validators} from "@angular/forms"; -import AuthService from "../../../service/auth.service"; -import CustomValidators from "../../../service/custom.validators"; +import { Component, inject } from '@angular/core'; +import { + FormBuilder, + FormGroup, + ReactiveFormsModule, + Validators, +} from '@angular/forms'; +import AuthService from '../../../service/auth.service'; +import CustomValidators from '../../../service/custom.validators'; @Component({ selector: 'app-register', - imports: [ - ReactiveFormsModule - ], + imports: [ReactiveFormsModule], templateUrl: './register.component.html', }) export default class RegisterComponent { diff --git a/src/app/component/dashboard/dashboard.component.html b/src/app/component/dashboard/dashboard.component.html index e05f470..c530e9a 100644 --- a/src/app/component/dashboard/dashboard.component.html +++ b/src/app/component/dashboard/dashboard.component.html @@ -1,7 +1,9 @@
-
+

Dashboard

diff --git a/src/app/component/dashboard/dashboard.component.ts b/src/app/component/dashboard/dashboard.component.ts index d9c5ccb..c0d29d0 100644 --- a/src/app/component/dashboard/dashboard.component.ts +++ b/src/app/component/dashboard/dashboard.component.ts @@ -1,14 +1,10 @@ -import {Component} from '@angular/core'; -import "../side/side.component"; -import {RouterOutlet} from "@angular/router"; +import { Component } from '@angular/core'; +import '../side/side.component'; +import { RouterOutlet } from '@angular/router'; @Component({ selector: 'app-dashboard', - imports: [ - RouterOutlet - ], + imports: [RouterOutlet], templateUrl: './dashboard.component.html', }) -export default class DashboardComponent { - -} +export default class DashboardComponent {} diff --git a/src/app/component/header/header.component.html b/src/app/component/header/header.component.html index d52de61..8727126 100644 --- a/src/app/component/header/header.component.html +++ b/src/app/component/header/header.component.html @@ -1,7 +1,15 @@