style: format HTML and TypeScript code for consistency

This commit is contained in:
Jan Gleytenhoover 2025-01-21 15:32:49 +01:00
parent ba520eea10
commit 739475ffcf
Signed by: jank
GPG key ID: 50620ADD22CD330B
7 changed files with 40 additions and 18 deletions

View file

@ -2,7 +2,12 @@
<app-navbar></app-navbar>
<div class="">
<div class="flex flex-row">
<button mat-flat-button color="secondary" class="my-3" (click)="createLink()">
<button
mat-flat-button
color="secondary"
class="my-3"
(click)="createLink()"
>
Create new Link
</button>
@ -43,7 +48,11 @@
<ng-container matColumnDef="shortLink">
<th mat-header-cell *matHeaderCellDef>Short link</th>
<td mat-cell *matCellDef="let element">
<button mat-flat-button class="my-3" (click)="copyLink(element.id)">
<button
mat-flat-button
class="my-3"
(click)="copyLink(element.id)"
>
Copy short link
</button>
</td>
@ -52,7 +61,11 @@
<ng-container matColumnDef="actions">
<th mat-header-cell *matHeaderCellDef>Actions</th>
<td mat-cell *matCellDef="let element">
<button mat-flat-button color="warn" (click)="deleteLink(element)">
<button
mat-flat-button
color="warn"
(click)="deleteLink(element)"
>
Delete
</button>
</td>

View file

@ -15,7 +15,13 @@ import { LogoutService } from '../service/logout.service';
@Component({
selector: 'app-dashboard',
imports: [NavbarComponent, MatTableModule, MatCardModule, MatButtonModule, OptionsMenuComponent],
imports: [
NavbarComponent,
MatTableModule,
MatCardModule,
MatButtonModule,
OptionsMenuComponent,
],
templateUrl: './dashboard.component.html',
styleUrl: './dashboard.component.css',
})

View file

@ -38,7 +38,7 @@ export class LoginComponent {
constructor(
private router: Router,
private snackBar: MatSnackBar,
) {}
) { }
private validationErrorMessages: Record<string, string> = {
required: 'This field is required',
@ -80,7 +80,7 @@ export class LoginComponent {
loginWithAuthentik() {
this.pb
.collection('users')
.authWithOAuth2({ provider: 'oidc' })
.authWithOAuth2({ provider: 'oidc', scopes: ['openid', 'email', 'profile', 'avatar'] })
.then(() => {
this.router.navigate(['dashboard']);
})

View file

@ -1,4 +1,8 @@
<button mat-icon-button [matMenuTriggerFor]="menu" aria-label="Example icon-button with a menu">
<button
mat-icon-button
[matMenuTriggerFor]="menu"
aria-label="Example icon-button with a menu"
>
<mat-icon>more_vert</mat-icon>
</button>
<mat-menu #menu="matMenu">

View file

@ -8,9 +8,8 @@ describe('OptionsMenuComponent', () => {
beforeEach(async () => {
await TestBed.configureTestingModule({
imports: [OptionsMenuComponent]
})
.compileComponents();
imports: [OptionsMenuComponent],
}).compileComponents();
fixture = TestBed.createComponent(OptionsMenuComponent);
component = fixture.componentInstance;

View file

@ -1,14 +1,14 @@
import { Component } from '@angular/core';
import {MatIconModule} from '@angular/material/icon';
import {MatMenuModule} from '@angular/material/menu';
import {MatButtonModule} from '@angular/material/button';
import { MatIconModule } from '@angular/material/icon';
import { MatMenuModule } from '@angular/material/menu';
import { MatButtonModule } from '@angular/material/button';
import { LogoutService } from '../service/logout.service';
@Component({
selector: 'app-options-menu',
imports: [MatIconModule, MatMenuModule, MatButtonModule],
templateUrl: './options-menu.component.html',
styleUrl: './options-menu.component.css'
styleUrl: './options-menu.component.css',
})
export class OptionsMenuComponent {
constructor(private logoutService: LogoutService) {}

View file

@ -1,7 +1,7 @@
import { Injectable } from "@angular/core";
import { Injectable } from '@angular/core';
import PocketBase from 'pocketbase';
import { environment } from "../../environments/environment";
import { Router } from "@angular/router";
import { environment } from '../../environments/environment';
import { Router } from '@angular/router';
@Injectable({
providedIn: 'root',
@ -9,7 +9,7 @@ import { Router } from "@angular/router";
export class LogoutService {
private pb = new PocketBase(environment.POCKETBASE);
constructor(private router: Router) { }
constructor(private router: Router) {}
logout() {
this.pb.authStore.clear();