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> <app-navbar></app-navbar>
<div class=""> <div class="">
<div class="flex flex-row"> <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 Create new Link
</button> </button>
@ -43,7 +48,11 @@
<ng-container matColumnDef="shortLink"> <ng-container matColumnDef="shortLink">
<th mat-header-cell *matHeaderCellDef>Short link</th> <th mat-header-cell *matHeaderCellDef>Short link</th>
<td mat-cell *matCellDef="let element"> <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 Copy short link
</button> </button>
</td> </td>
@ -52,7 +61,11 @@
<ng-container matColumnDef="actions"> <ng-container matColumnDef="actions">
<th mat-header-cell *matHeaderCellDef>Actions</th> <th mat-header-cell *matHeaderCellDef>Actions</th>
<td mat-cell *matCellDef="let element"> <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 Delete
</button> </button>
</td> </td>

View file

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

View file

@ -80,7 +80,7 @@ export class LoginComponent {
loginWithAuthentik() { loginWithAuthentik() {
this.pb this.pb
.collection('users') .collection('users')
.authWithOAuth2({ provider: 'oidc' }) .authWithOAuth2({ provider: 'oidc', scopes: ['openid', 'email', 'profile', 'avatar'] })
.then(() => { .then(() => {
this.router.navigate(['dashboard']); 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> <mat-icon>more_vert</mat-icon>
</button> </button>
<mat-menu #menu="matMenu"> <mat-menu #menu="matMenu">

View file

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

View file

@ -8,7 +8,7 @@ import { LogoutService } from '../service/logout.service';
selector: 'app-options-menu', selector: 'app-options-menu',
imports: [MatIconModule, MatMenuModule, MatButtonModule], imports: [MatIconModule, MatMenuModule, MatButtonModule],
templateUrl: './options-menu.component.html', templateUrl: './options-menu.component.html',
styleUrl: './options-menu.component.css' styleUrl: './options-menu.component.css',
}) })
export class OptionsMenuComponent { export class OptionsMenuComponent {
constructor(private logoutService: LogoutService) {} 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 PocketBase from 'pocketbase';
import { environment } from "../../environments/environment"; import { environment } from '../../environments/environment';
import { Router } from "@angular/router"; import { Router } from '@angular/router';
@Injectable({ @Injectable({
providedIn: 'root', providedIn: 'root',