Merge pull request 'release' (#14) from main into prod
	
		
			
	
		
	
	
		
	
		
			All checks were successful
		
		
	
	
		
			
				
	
				Release / Release (push) Successful in 2m7s
				
			
		
		
	
	
		
	
		
			All checks were successful
		
		
	
	Release / Release (push) Successful in 2m7s
				
			Reviewed-on: #14
This commit is contained in:
		
				commit
				
					
						1459290fed
					
				
			
		
					 6 changed files with 24 additions and 5 deletions
				
			
		| 
						 | 
					@ -1,6 +1,6 @@
 | 
				
			||||||
<h2 mat-dialog-title>{{ data.title }}</h2>
 | 
					<h2 mat-dialog-title>{{ data.title }}</h2>
 | 
				
			||||||
<mat-dialog-content>{{ data.description }}</mat-dialog-content>
 | 
					<mat-dialog-content>{{ data.description }}</mat-dialog-content>
 | 
				
			||||||
<mat-dialog-actions>
 | 
					<mat-dialog-actions>
 | 
				
			||||||
 | 
					  <button [style.backgroundColor]="'#FFFFFF'" [style.color]="'#000000'" mat-stroked-button color="warn" (click)="accept()">Yes</button>
 | 
				
			||||||
  <button mat-flat-button (click)="close()">No</button>
 | 
					  <button mat-flat-button (click)="close()">No</button>
 | 
				
			||||||
  <button mat-flat-button color="warn" (click)="accept()">Yes</button>
 | 
					 | 
				
			||||||
</mat-dialog-actions>
 | 
					</mat-dialog-actions>
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
| 
						 | 
					@ -1,6 +1,6 @@
 | 
				
			||||||
<div class="mx-auto container">
 | 
					<div class="mx-auto container">
 | 
				
			||||||
  <app-navbar></app-navbar>
 | 
					  <app-navbar></app-navbar>
 | 
				
			||||||
  <button mat-flat-button class="mt-3" color="warn" (click)="back()">
 | 
					  <button [style.backgroundColor]="'#FFFFFF'" [style.color]="'#000000'" mat-stroked-button class="mt-3" color="warn" (click)="back()">
 | 
				
			||||||
    Back
 | 
					    Back
 | 
				
			||||||
  </button>
 | 
					  </button>
 | 
				
			||||||
  <mat-card class="mt-3 p-3" appearance="outlined">
 | 
					  <mat-card class="mt-3 p-3" appearance="outlined">
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
| 
						 | 
					@ -1,5 +1,6 @@
 | 
				
			||||||
<div class="mx-auto container">
 | 
					<div class="mx-auto container">
 | 
				
			||||||
  <app-navbar></app-navbar>
 | 
					  <app-navbar></app-navbar>
 | 
				
			||||||
 | 
					  <h1>Hello {{user?.['name']}}!</h1>
 | 
				
			||||||
  <div class="">
 | 
					  <div class="">
 | 
				
			||||||
    <div class="flex flex-row">
 | 
					    <div class="flex flex-row">
 | 
				
			||||||
      <button
 | 
					      <button
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
| 
						 | 
					@ -1,6 +1,5 @@
 | 
				
			||||||
import { Component } from '@angular/core';
 | 
					import { Component } from '@angular/core';
 | 
				
			||||||
import { LinkService } from '../service/link.service';
 | 
					import { LinkService } from '../service/link.service';
 | 
				
			||||||
import { RecordModel } from 'pocketbase';
 | 
					 | 
				
			||||||
import { NavbarComponent } from '../navbar/navbar.component';
 | 
					import { NavbarComponent } from '../navbar/navbar.component';
 | 
				
			||||||
import { Router, RouterLink } from '@angular/router';
 | 
					import { Router, RouterLink } from '@angular/router';
 | 
				
			||||||
import { MatRow, MatTableModule } from '@angular/material/table';
 | 
					import { MatRow, MatTableModule } from '@angular/material/table';
 | 
				
			||||||
| 
						 | 
					@ -11,7 +10,8 @@ import { MatDialog, MatDialogModule } from '@angular/material/dialog';
 | 
				
			||||||
import { ConfirmationModalComponent } from '../confirmation-modal/confirmation-modal.component';
 | 
					import { ConfirmationModalComponent } from '../confirmation-modal/confirmation-modal.component';
 | 
				
			||||||
import { MatSnackBar } from '@angular/material/snack-bar';
 | 
					import { MatSnackBar } from '@angular/material/snack-bar';
 | 
				
			||||||
import { OptionsMenuComponent } from '../options-menu/options-menu.component';
 | 
					import { OptionsMenuComponent } from '../options-menu/options-menu.component';
 | 
				
			||||||
import { LogoutService } from '../service/logout.service';
 | 
					import { UserService } from '../service/user.service';
 | 
				
			||||||
 | 
					import { AuthRecord } from 'pocketbase';
 | 
				
			||||||
 | 
					
 | 
				
			||||||
@Component({
 | 
					@Component({
 | 
				
			||||||
  selector: 'app-dashboard',
 | 
					  selector: 'app-dashboard',
 | 
				
			||||||
| 
						 | 
					@ -28,12 +28,14 @@ import { LogoutService } from '../service/logout.service';
 | 
				
			||||||
export class DashboardComponent {
 | 
					export class DashboardComponent {
 | 
				
			||||||
  public links: Link[] = [];
 | 
					  public links: Link[] = [];
 | 
				
			||||||
  displayedColumns: string[] = ['id', 'name', 'link', 'shortLink', 'actions'];
 | 
					  displayedColumns: string[] = ['id', 'name', 'link', 'shortLink', 'actions'];
 | 
				
			||||||
 | 
					  public user!: AuthRecord;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
  constructor(
 | 
					  constructor(
 | 
				
			||||||
    private linkService: LinkService,
 | 
					    private linkService: LinkService,
 | 
				
			||||||
    private router: Router,
 | 
					    private router: Router,
 | 
				
			||||||
    private dialog: MatDialog,
 | 
					    private dialog: MatDialog,
 | 
				
			||||||
    private snackBar: MatSnackBar,
 | 
					    private snackBar: MatSnackBar,
 | 
				
			||||||
 | 
					    private userService: UserService,
 | 
				
			||||||
  ) {}
 | 
					  ) {}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
  copyLink(id: string) {
 | 
					  copyLink(id: string) {
 | 
				
			||||||
| 
						 | 
					@ -65,6 +67,8 @@ export class DashboardComponent {
 | 
				
			||||||
    this.linkService.getLinks().then((links) => {
 | 
					    this.linkService.getLinks().then((links) => {
 | 
				
			||||||
      this.links = links;
 | 
					      this.links = links;
 | 
				
			||||||
    });
 | 
					    });
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					    this.user = this.userService.getUser();
 | 
				
			||||||
  }
 | 
					  }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
  createLink() {
 | 
					  createLink() {
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
| 
						 | 
					@ -5,7 +5,7 @@
 | 
				
			||||||
>
 | 
					>
 | 
				
			||||||
  <mat-icon>more_vert</mat-icon>
 | 
					  <mat-icon>more_vert</mat-icon>
 | 
				
			||||||
</button>
 | 
					</button>
 | 
				
			||||||
<mat-menu #menu="matMenu">
 | 
					<mat-menu #menu="matMenu" xPosition="before">
 | 
				
			||||||
  <button (click)="logout()" mat-menu-item>
 | 
					  <button (click)="logout()" mat-menu-item>
 | 
				
			||||||
    <mat-icon>logout</mat-icon>
 | 
					    <mat-icon>logout</mat-icon>
 | 
				
			||||||
    <span>Logout</span>
 | 
					    <span>Logout</span>
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
							
								
								
									
										14
									
								
								src/app/service/user.service.ts
									
										
									
									
									
										Normal file
									
								
							
							
						
						
									
										14
									
								
								src/app/service/user.service.ts
									
										
									
									
									
										Normal file
									
								
							| 
						 | 
					@ -0,0 +1,14 @@
 | 
				
			||||||
 | 
					import { Injectable } from "@angular/core";
 | 
				
			||||||
 | 
					import PocketBase, { AuthRecord } from 'pocketbase';
 | 
				
			||||||
 | 
					import { environment } from "../../environments/environment";
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					@Injectable({
 | 
				
			||||||
 | 
					  providedIn: 'root',
 | 
				
			||||||
 | 
					})
 | 
				
			||||||
 | 
					export class UserService {
 | 
				
			||||||
 | 
					  private pb = new PocketBase(environment.POCKETBASE);
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					  getUser(): AuthRecord {
 | 
				
			||||||
 | 
					    return this.pb.authStore.record;
 | 
				
			||||||
 | 
					  }
 | 
				
			||||||
 | 
					}
 | 
				
			||||||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue