style: format HTML and TypeScript code for consistency
This commit is contained in:
parent
ba520eea10
commit
739475ffcf
7 changed files with 40 additions and 18 deletions
|
@ -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>
|
||||
|
|
|
@ -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',
|
||||
})
|
||||
|
|
|
@ -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']);
|
||||
})
|
||||
|
|
|
@ -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">
|
||||
|
|
|
@ -8,9 +8,8 @@ describe('OptionsMenuComponent', () => {
|
|||
|
||||
beforeEach(async () => {
|
||||
await TestBed.configureTestingModule({
|
||||
imports: [OptionsMenuComponent]
|
||||
})
|
||||
.compileComponents();
|
||||
imports: [OptionsMenuComponent],
|
||||
}).compileComponents();
|
||||
|
||||
fixture = TestBed.createComponent(OptionsMenuComponent);
|
||||
component = fixture.componentInstance;
|
||||
|
|
|
@ -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) {}
|
||||
|
|
|
@ -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();
|
||||
|
|
Loading…
Add table
Reference in a new issue