diff --git a/.gitea/workflows/release.yml b/.gitea/workflows/release.yml
index f717de7..66c451e 100644
--- a/.gitea/workflows/release.yml
+++ b/.gitea/workflows/release.yml
@@ -11,7 +11,7 @@ permissions:
contents: read # for checkout
concurrency:
- group: ${{ github.ref }} # Ensure each branch has its own group
+ group: ${{ github.ref }} # Ensure each branch has its own group
cancel-in-progress: false # Prevent new runs from canceling in-progress runs
jobs:
@@ -29,4 +29,3 @@ jobs:
with:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
GITEA_TOKEN: ${{ secrets.GITEA_TOKEN }}
-
diff --git a/.prettierignore b/.prettierignore
new file mode 100644
index 0000000..1b8ac88
--- /dev/null
+++ b/.prettierignore
@@ -0,0 +1,3 @@
+# Ignore artifacts:
+build
+coverage
diff --git a/.prettierrc b/.prettierrc
new file mode 100644
index 0000000..0967ef4
--- /dev/null
+++ b/.prettierrc
@@ -0,0 +1 @@
+{}
diff --git a/angular.json b/angular.json
index 3f41ec4..3736cdb 100644
--- a/angular.json
+++ b/angular.json
@@ -16,9 +16,7 @@
"outputPath": "dist/jklink",
"index": "src/index.html",
"browser": "src/main.ts",
- "polyfills": [
- "zone.js"
- ],
+ "polyfills": ["zone.js"],
"tsConfig": "tsconfig.app.json",
"assets": [
{
@@ -86,10 +84,7 @@
"test": {
"builder": "@angular-devkit/build-angular:karma",
"options": {
- "polyfills": [
- "zone.js",
- "zone.js/testing"
- ],
+ "polyfills": ["zone.js", "zone.js/testing"],
"tsConfig": "tsconfig.spec.json",
"assets": [
{
diff --git a/package-lock.json b/package-lock.json
index 6a63114..d092d7a 100644
--- a/package-lock.json
+++ b/package-lock.json
@@ -38,6 +38,7 @@
"karma-jasmine": "~5.1.0",
"karma-jasmine-html-reporter": "~2.1.0",
"postcss": "^8.5.1",
+ "prettier": "3.4.2",
"tailwindcss": "^3.4.17",
"typescript": "~5.6.2"
}
@@ -10845,6 +10846,22 @@
"resolved": "https://registry.npmjs.org/postcss-value-parser/-/postcss-value-parser-4.2.0.tgz",
"integrity": "sha512-1NNCs6uurfkVbeXG4S8JFT9t19m45ICnif8zWLd5oPSZ50QnwMfK+H3jv408d4jw/7Bttv5axS5IiHoLaVNHeQ=="
},
+ "node_modules/prettier": {
+ "version": "3.4.2",
+ "resolved": "https://registry.npmjs.org/prettier/-/prettier-3.4.2.tgz",
+ "integrity": "sha512-e9MewbtFo+Fevyuxn/4rrcDAaq0IYxPGLvObpQjiZBMAzB9IGmzlnG9RZy3FFas+eBMu2vA0CszMeduow5dIuQ==",
+ "dev": true,
+ "license": "MIT",
+ "bin": {
+ "prettier": "bin/prettier.cjs"
+ },
+ "engines": {
+ "node": ">=14"
+ },
+ "funding": {
+ "url": "https://github.com/prettier/prettier?sponsor=1"
+ }
+ },
"node_modules/proc-log": {
"version": "5.0.0",
"resolved": "https://registry.npmjs.org/proc-log/-/proc-log-5.0.0.tgz",
diff --git a/package.json b/package.json
index 86546d4..54ec5b8 100644
--- a/package.json
+++ b/package.json
@@ -40,7 +40,8 @@
"karma-jasmine": "~5.1.0",
"karma-jasmine-html-reporter": "~2.1.0",
"postcss": "^8.5.1",
+ "prettier": "3.4.2",
"tailwindcss": "^3.4.17",
"typescript": "~5.6.2"
}
-}
\ No newline at end of file
+}
diff --git a/release.config.cjs b/release.config.cjs
index 80e07d0..b6ba127 100644
--- a/release.config.cjs
+++ b/release.config.cjs
@@ -1,11 +1,14 @@
module.exports = {
- branches: ['prod'],
+ branches: ["prod"],
plugins: [
- '@semantic-release/commit-analyzer',
- '@semantic-release/release-notes-generator',
- '@semantic-release/changelog',
- ["@saithodev/semantic-release-gitea", {
- "giteaUrl": "https://git.kjan.de"
- }],
+ "@semantic-release/commit-analyzer",
+ "@semantic-release/release-notes-generator",
+ "@semantic-release/changelog",
+ [
+ "@saithodev/semantic-release-gitea",
+ {
+ giteaUrl: "https://git.kjan.de",
+ },
+ ],
],
};
diff --git a/src/app/app.component.spec.ts b/src/app/app.component.spec.ts
index 73f7900..3fb9e53 100644
--- a/src/app/app.component.spec.ts
+++ b/src/app/app.component.spec.ts
@@ -24,6 +24,8 @@ describe('AppComponent', () => {
const fixture = TestBed.createComponent(AppComponent);
fixture.detectChanges();
const compiled = fixture.nativeElement as HTMLElement;
- expect(compiled.querySelector('h1')?.textContent).toContain('Hello, jklink');
+ expect(compiled.querySelector('h1')?.textContent).toContain(
+ 'Hello, jklink',
+ );
});
});
diff --git a/src/app/app.component.ts b/src/app/app.component.ts
index eebc95d..75211fc 100644
--- a/src/app/app.component.ts
+++ b/src/app/app.component.ts
@@ -5,7 +5,6 @@ import { RouterOutlet } from '@angular/router';
selector: 'app-root',
imports: [RouterOutlet],
templateUrl: './app.component.html',
- styleUrl: './app.component.css'
+ styleUrl: './app.component.css',
})
-export class AppComponent {
-}
+export class AppComponent {}
diff --git a/src/app/app.config.ts b/src/app/app.config.ts
index 96116fd..ec69408 100644
--- a/src/app/app.config.ts
+++ b/src/app/app.config.ts
@@ -5,5 +5,9 @@ import { routes } from './app.routes';
import { provideAnimationsAsync } from '@angular/platform-browser/animations/async';
export const appConfig: ApplicationConfig = {
- providers: [provideZoneChangeDetection({ eventCoalescing: true }), provideRouter(routes), provideAnimationsAsync()]
+ providers: [
+ provideZoneChangeDetection({ eventCoalescing: true }),
+ provideRouter(routes),
+ provideAnimationsAsync(),
+ ],
};
diff --git a/src/app/app.routes.ts b/src/app/app.routes.ts
index 4c2ca33..c9976fa 100644
--- a/src/app/app.routes.ts
+++ b/src/app/app.routes.ts
@@ -25,7 +25,7 @@ export const routes: Routes = [
component: ViewLinkComponent,
},
{
- path: "**",
- redirectTo: "",
+ path: '**',
+ redirectTo: '',
},
];
diff --git a/src/app/confirmation-modal/confirmation-modal.component.html b/src/app/confirmation-modal/confirmation-modal.component.html
index 2bc7aed..419add9 100644
--- a/src/app/confirmation-modal/confirmation-modal.component.html
+++ b/src/app/confirmation-modal/confirmation-modal.component.html
@@ -1,5 +1,5 @@
-
{{data.title}}
-{{data.description}}
+{{ data.title }}
+{{ data.description }}
diff --git a/src/app/confirmation-modal/confirmation-modal.component.spec.ts b/src/app/confirmation-modal/confirmation-modal.component.spec.ts
index 709b427..8c09367 100644
--- a/src/app/confirmation-modal/confirmation-modal.component.spec.ts
+++ b/src/app/confirmation-modal/confirmation-modal.component.spec.ts
@@ -8,9 +8,8 @@ describe('VisitLinkConfirmationComponent', () => {
beforeEach(async () => {
await TestBed.configureTestingModule({
- imports: [ConfirmationModalComponent]
- })
- .compileComponents();
+ imports: [ConfirmationModalComponent],
+ }).compileComponents();
fixture = TestBed.createComponent(ConfirmationModalComponent);
component = fixture.componentInstance;
diff --git a/src/app/confirmation-modal/confirmation-modal.component.ts b/src/app/confirmation-modal/confirmation-modal.component.ts
index d442365..2524a4a 100644
--- a/src/app/confirmation-modal/confirmation-modal.component.ts
+++ b/src/app/confirmation-modal/confirmation-modal.component.ts
@@ -12,9 +12,14 @@ import { ConfirmationModalDto } from '../models/confirmation-modal';
@Component({
selector: 'app-confirmation-modal',
- imports: [MatDialogTitle, MatDialogContent, MatDialogActions, MatButtonModule],
+ imports: [
+ MatDialogTitle,
+ MatDialogContent,
+ MatDialogActions,
+ MatButtonModule,
+ ],
templateUrl: './confirmation-modal.component.html',
- styleUrl: './confirmation-modal.component.css'
+ styleUrl: './confirmation-modal.component.css',
})
export class ConfirmationModalComponent {
public data: ConfirmationModalDto = inject(MAT_DIALOG_DATA);
diff --git a/src/app/create-link/create-link.component.html b/src/app/create-link/create-link.component.html
index 6bc479c..7ac87ea 100644
--- a/src/app/create-link/create-link.component.html
+++ b/src/app/create-link/create-link.component.html
@@ -1,17 +1,24 @@
-
+
diff --git a/src/app/create-link/create-link.component.spec.ts b/src/app/create-link/create-link.component.spec.ts
index b706423..9eb01ea 100644
--- a/src/app/create-link/create-link.component.spec.ts
+++ b/src/app/create-link/create-link.component.spec.ts
@@ -8,9 +8,8 @@ describe('CreateLinkComponent', () => {
beforeEach(async () => {
await TestBed.configureTestingModule({
- imports: [CreateLinkComponent]
- })
- .compileComponents();
+ imports: [CreateLinkComponent],
+ }).compileComponents();
fixture = TestBed.createComponent(CreateLinkComponent);
component = fixture.componentInstance;
diff --git a/src/app/create-link/create-link.component.ts b/src/app/create-link/create-link.component.ts
index 76c3dcf..ebf9788 100644
--- a/src/app/create-link/create-link.component.ts
+++ b/src/app/create-link/create-link.component.ts
@@ -1,6 +1,11 @@
import { Component } from '@angular/core';
import { NavbarComponent } from '../navbar/navbar.component';
-import { FormControl, FormGroup, ReactiveFormsModule, Validators } from '@angular/forms';
+import {
+ FormControl,
+ FormGroup,
+ ReactiveFormsModule,
+ Validators,
+} from '@angular/forms';
import { LinkService } from '../service/link.service';
import { Router } from '@angular/router';
import { MatCardModule } from '@angular/material/card';
@@ -11,31 +16,45 @@ import { debounceTime } from 'rxjs';
@Component({
selector: 'app-create-link',
- imports: [NavbarComponent, ReactiveFormsModule, MatCardModule, MatFormFieldModule, MatInputModule, MatButtonModule],
+ imports: [
+ NavbarComponent,
+ ReactiveFormsModule,
+ MatCardModule,
+ MatFormFieldModule,
+ MatInputModule,
+ MatButtonModule,
+ ],
templateUrl: './create-link.component.html',
- styleUrl: './create-link.component.css'
+ styleUrl: './create-link.component.css',
})
export class CreateLinkComponent {
public createLinkForm!: FormGroup;
public requestFailed: boolean = false;
public errorMessages: Record = {};
- constructor(private linkService: LinkService, private router: Router) { }
+ constructor(
+ private linkService: LinkService,
+ private router: Router,
+ ) {}
private validationErrorMessages: Record = {
- required: "This field is required",
- pattern: "This must be a valid url",
+ required: 'This field is required',
+ pattern: 'This must be a valid url',
};
updateErrorMessages(): void {
this.errorMessages = {};
- Object.keys(this.createLinkForm.controls).forEach(field => {
+ Object.keys(this.createLinkForm.controls).forEach((field) => {
const control = this.createLinkForm.get(field);
if (control && control.errors) {
this.errorMessages[field] = Object.keys(control.errors)
- .map(errorKey => this.validationErrorMessages[errorKey] || `Unknown error: ${errorKey}`)
+ .map(
+ (errorKey) =>
+ this.validationErrorMessages[errorKey] ||
+ `Unknown error: ${errorKey}`,
+ )
.join(' ');
}
});
@@ -48,7 +67,12 @@ export class CreateLinkComponent {
ngOnInit(): void {
this.createLinkForm = new FormGroup({
name: new FormControl('', Validators.required),
- link: new FormControl('', [Validators.required, Validators.pattern(/((([A-Za-z]{3,9}:(?:\/\/)?)(?:[-;:&=\+\$,\w]+@)?[A-Za-z0-9.-]+|(?:www.|[-;:&=\+\$,\w]+@)[A-Za-z0-9.-]+)((?:\/[\+~%\/.\w-_]*)?\??(?:[-\+=&;%@.\w_]*)#?(?:[\w]*))?)/)]),
+ link: new FormControl('', [
+ Validators.required,
+ Validators.pattern(
+ /((([A-Za-z]{3,9}:(?:\/\/)?)(?:[-;:&=\+\$,\w]+@)?[A-Za-z0-9.-]+|(?:www.|[-;:&=\+\$,\w]+@)[A-Za-z0-9.-]+)((?:\/[\+~%\/.\w-_]*)?\??(?:[-\+=&;%@.\w_]*)#?(?:[\w]*))?)/,
+ ),
+ ]),
});
this.createLinkForm.valueChanges.subscribe(() => {
this.updateErrorMessages();
@@ -56,19 +80,21 @@ export class CreateLinkComponent {
}
submit() {
-
if (!this.createLinkForm.valid) {
return;
}
this.requestFailed = false;
- this.linkService.createLink({
- name: this.createLinkForm.get('name')?.value,
- link: this.createLinkForm.get('link')?.value,
- }).catch(() => this.requestFailed = true).finally(() => {
- if (!this.requestFailed) {
- this.router.navigate(['dashboard']);
- }
- });
+ this.linkService
+ .createLink({
+ name: this.createLinkForm.get('name')?.value,
+ link: this.createLinkForm.get('link')?.value,
+ })
+ .catch(() => (this.requestFailed = true))
+ .finally(() => {
+ if (!this.requestFailed) {
+ this.router.navigate(['dashboard']);
+ }
+ });
}
}
diff --git a/src/app/dashboard/dashboard.component.html b/src/app/dashboard/dashboard.component.html
index 4c363ef..4041018 100644
--- a/src/app/dashboard/dashboard.component.html
+++ b/src/app/dashboard/dashboard.component.html
@@ -1,54 +1,72 @@
-
+
-
- ID |
+ ID |
- {{element.id}}
+ {{ element.id }}
|
- Name |
- {{element.name}} |
+ Name |
+ {{ element.name }} |
- Link |
- {{element.link}} |
+ Link |
+ {{ element.link }} |
- Short link |
+ Short link |
-
+
|
- Actions |
+ Actions |
-
+
|
-
+
diff --git a/src/app/dashboard/dashboard.component.spec.ts b/src/app/dashboard/dashboard.component.spec.ts
index 30e39a2..e4d9df5 100644
--- a/src/app/dashboard/dashboard.component.spec.ts
+++ b/src/app/dashboard/dashboard.component.spec.ts
@@ -8,9 +8,8 @@ describe('DashboardComponent', () => {
beforeEach(async () => {
await TestBed.configureTestingModule({
- imports: [DashboardComponent]
- })
- .compileComponents();
+ imports: [DashboardComponent],
+ }).compileComponents();
fixture = TestBed.createComponent(DashboardComponent);
component = fixture.componentInstance;
diff --git a/src/app/dashboard/dashboard.component.ts b/src/app/dashboard/dashboard.component.ts
index a2727b6..8644256 100644
--- a/src/app/dashboard/dashboard.component.ts
+++ b/src/app/dashboard/dashboard.component.ts
@@ -15,40 +15,48 @@ import { MatSnackBar } from '@angular/material/snack-bar';
selector: 'app-dashboard',
imports: [NavbarComponent, MatTableModule, MatCardModule, MatButtonModule],
templateUrl: './dashboard.component.html',
- styleUrl: './dashboard.component.css'
+ styleUrl: './dashboard.component.css',
})
export class DashboardComponent {
public links: Link[] = [];
displayedColumns: string[] = ['id', 'name', 'link', 'shortLink', 'actions'];
- constructor(private linkService: LinkService, private router: Router, private dialog: MatDialog, private snackBar: MatSnackBar) { };
+ constructor(
+ private linkService: LinkService,
+ private router: Router,
+ private dialog: MatDialog,
+ private snackBar: MatSnackBar,
+ ) {}
copyLink(id: string) {
navigator.clipboard.writeText(this.getShortLink(id));
}
getShortLink(id: string): string {
- return "https://" + window.location.hostname + '/' + id;
+ return 'https://' + window.location.hostname + '/' + id;
}
goToLink(link: Link) {
- this.dialog.open(ConfirmationModalComponent, {
- data: {
- title: "Are you sure?",
- description: "Are you sure that you want to open " + link.link + " now?",
- },
- }).afterClosed().subscribe((accepted: Boolean) => {
- if (accepted) {
- this.router.navigate([link.id]);
- }
- });
+ this.dialog
+ .open(ConfirmationModalComponent, {
+ data: {
+ title: 'Are you sure?',
+ description:
+ 'Are you sure that you want to open ' + link.link + ' now?',
+ },
+ })
+ .afterClosed()
+ .subscribe((accepted: Boolean) => {
+ if (accepted) {
+ this.router.navigate([link.id]);
+ }
+ });
}
ngOnInit(): void {
- this.linkService.getLinks().then(links => {
+ this.linkService.getLinks().then((links) => {
this.links = links;
});
-
}
createLink() {
@@ -56,29 +64,35 @@ export class DashboardComponent {
}
deleteLink(link: Link) {
- this.dialog.open(ConfirmationModalComponent, {
- data: {
- title: "Are you sure?",
- description: "Are you sure that you want to delete " + link.name + "?",
- }
- }).afterClosed().subscribe((accepted: boolean) => {
- if (accepted) {
- this.linkService.deleteLink(link.id).catch(() => {
- const errorNotification = this.snackBar.open("Something went wrong.");
+ this.dialog
+ .open(ConfirmationModalComponent, {
+ data: {
+ title: 'Are you sure?',
+ description:
+ 'Are you sure that you want to delete ' + link.name + '?',
+ },
+ })
+ .afterClosed()
+ .subscribe((accepted: boolean) => {
+ if (accepted) {
+ this.linkService.deleteLink(link.id).catch(() => {
+ const errorNotification = this.snackBar.open(
+ 'Something went wrong.',
+ );
+ setTimeout(() => {
+ errorNotification.dismiss();
+ }, 5000);
+ });
+
+ this.links = this.links.filter((givenLink) => {
+ return givenLink.id != link.id;
+ });
+
+ const notification = this.snackBar.open(link.name + ' was deleted.');
setTimeout(() => {
- errorNotification.dismiss();
- }, 5000);
- });
-
- this.links = this.links.filter(givenLink => {
- return givenLink.id != link.id;
- });
-
- const notification = this.snackBar.open(link.name + " was deleted.");
- setTimeout(() => {
- notification.dismiss();
- }, 2000);
- }
- });
+ notification.dismiss();
+ }, 2000);
+ }
+ });
}
}
diff --git a/src/app/login/login.component.html b/src/app/login/login.component.html
index 9f038c7..ef35d97 100644
--- a/src/app/login/login.component.html
+++ b/src/app/login/login.component.html
@@ -1,42 +1,74 @@
-

-
Sign in to your account
+

+
+ Sign in to your account
+
diff --git a/src/app/login/login.component.spec.ts b/src/app/login/login.component.spec.ts
index 18f3685..251a67f 100644
--- a/src/app/login/login.component.spec.ts
+++ b/src/app/login/login.component.spec.ts
@@ -8,9 +8,8 @@ describe('LoginComponent', () => {
beforeEach(async () => {
await TestBed.configureTestingModule({
- imports: [LoginComponent]
- })
- .compileComponents();
+ imports: [LoginComponent],
+ }).compileComponents();
fixture = TestBed.createComponent(LoginComponent);
component = fixture.componentInstance;
diff --git a/src/app/login/login.component.ts b/src/app/login/login.component.ts
index b933ddb..5faad83 100644
--- a/src/app/login/login.component.ts
+++ b/src/app/login/login.component.ts
@@ -8,14 +8,14 @@ import { Router } from '@angular/router';
selector: 'app-login',
imports: [ReactiveFormsModule],
templateUrl: './login.component.html',
- styleUrl: './login.component.css'
+ styleUrl: './login.component.css',
})
export class LoginComponent {
public loginForm!: FormGroup;
public invalidCredentials = false;
private pb = new PocketBase(environment.POCKETBASE);
- constructor(private router: Router) { };
+ constructor(private router: Router) {}
ngOnInit(): void {
this.loginForm = new FormGroup({
@@ -29,13 +29,17 @@ export class LoginComponent {
}
submit() {
- this.pb.collection("users").authWithPassword(
- this.loginForm.get('email')?.value,
- this.loginForm.get('password')?.value
- ).then(() => {
+ this.pb
+ .collection('users')
+ .authWithPassword(
+ this.loginForm.get('email')?.value,
+ this.loginForm.get('password')?.value,
+ )
+ .then(() => {
this.router.navigate(['dashboard']);
- }).catch(() => {
- this.invalidCredentials = true;
- });
+ })
+ .catch(() => {
+ this.invalidCredentials = true;
+ });
}
}
diff --git a/src/app/models/confirmation-modal.ts b/src/app/models/confirmation-modal.ts
index 790e236..0b65bef 100644
--- a/src/app/models/confirmation-modal.ts
+++ b/src/app/models/confirmation-modal.ts
@@ -1,4 +1,4 @@
export interface ConfirmationModalDto {
- title: string,
- description: string,
+ title: string;
+ description: string;
}
diff --git a/src/app/navbar/navbar.component.spec.ts b/src/app/navbar/navbar.component.spec.ts
index cfedf9e..c8eb826 100644
--- a/src/app/navbar/navbar.component.spec.ts
+++ b/src/app/navbar/navbar.component.spec.ts
@@ -8,9 +8,8 @@ describe('NavbarComponent', () => {
beforeEach(async () => {
await TestBed.configureTestingModule({
- imports: [NavbarComponent]
- })
- .compileComponents();
+ imports: [NavbarComponent],
+ }).compileComponents();
fixture = TestBed.createComponent(NavbarComponent);
component = fixture.componentInstance;
diff --git a/src/app/navbar/navbar.component.ts b/src/app/navbar/navbar.component.ts
index 90f79f9..caab756 100644
--- a/src/app/navbar/navbar.component.ts
+++ b/src/app/navbar/navbar.component.ts
@@ -7,6 +7,4 @@ import { Component, ViewEncapsulation } from '@angular/core';
styleUrl: './navbar.component.css',
encapsulation: ViewEncapsulation.None,
})
-export class NavbarComponent {
-
-}
+export class NavbarComponent {}
diff --git a/src/app/service/auth.service.ts b/src/app/service/auth.service.ts
index 6c926df..4290efa 100644
--- a/src/app/service/auth.service.ts
+++ b/src/app/service/auth.service.ts
@@ -5,20 +5,26 @@ import {
GuardResult,
MaybeAsync,
Router,
- RouterStateSnapshot
+ RouterStateSnapshot,
} from '@angular/router';
import PocketBase from 'pocketbase';
import { environment } from '../../environments/environment';
@Injectable({
- providedIn: 'root'
+ providedIn: 'root',
})
export class AuthGuard implements CanActivate {
- constructor(private router: Router) { };
+ constructor(private router: Router) {}
- async canActivate(route: ActivatedRouteSnapshot, state: RouterStateSnapshot): Promise
{
+ async canActivate(
+ route: ActivatedRouteSnapshot,
+ state: RouterStateSnapshot,
+ ): Promise {
const pb = new PocketBase(environment.POCKETBASE);
- await pb.collection('users').authRefresh().catch(() => this.router.navigate(['']));
+ await pb
+ .collection('users')
+ .authRefresh()
+ .catch(() => this.router.navigate(['']));
if (pb.authStore.isValid) {
return true;
diff --git a/src/app/service/link.service.ts b/src/app/service/link.service.ts
index 09d5dec..77c01ee 100644
--- a/src/app/service/link.service.ts
+++ b/src/app/service/link.service.ts
@@ -1,11 +1,10 @@
-import { Injectable } from "@angular/core";
-import { environment } from "../../environments/environment";
+import { Injectable } from '@angular/core';
+import { environment } from '../../environments/environment';
import PocketBase, { RecordModel } from 'pocketbase';
-import { Link } from "../models/link";
-
+import { Link } from '../models/link';
@Injectable({
- providedIn: 'root'
+ providedIn: 'root',
})
export class LinkService {
private pb = new PocketBase(environment.POCKETBASE);
@@ -24,9 +23,9 @@ export class LinkService {
createLink(link: any): Promise {
return this.pb.collection('links').create({
- 'name': link.name,
- 'link': link.link,
- 'owner': this.pb.authStore.record?.id,
+ name: link.name,
+ link: link.link,
+ owner: this.pb.authStore.record?.id,
});
}
}
diff --git a/src/app/view-link/view-link.component.html b/src/app/view-link/view-link.component.html
index a80c841..2af80ff 100644
--- a/src/app/view-link/view-link.component.html
+++ b/src/app/view-link/view-link.component.html
@@ -1,3 +1,6 @@
Your are being redirected.
-
+
diff --git a/src/app/view-link/view-link.component.spec.ts b/src/app/view-link/view-link.component.spec.ts
index 1d509b7..91f9dd4 100644
--- a/src/app/view-link/view-link.component.spec.ts
+++ b/src/app/view-link/view-link.component.spec.ts
@@ -8,9 +8,8 @@ describe('ViewLinkComponent', () => {
beforeEach(async () => {
await TestBed.configureTestingModule({
- imports: [ViewLinkComponent]
- })
- .compileComponents();
+ imports: [ViewLinkComponent],
+ }).compileComponents();
fixture = TestBed.createComponent(ViewLinkComponent);
component = fixture.componentInstance;
diff --git a/src/app/view-link/view-link.component.ts b/src/app/view-link/view-link.component.ts
index 21951c3..635e560 100644
--- a/src/app/view-link/view-link.component.ts
+++ b/src/app/view-link/view-link.component.ts
@@ -6,14 +6,20 @@ import { ActivatedRoute, Router } from '@angular/router';
selector: 'app-view-link',
imports: [],
templateUrl: './view-link.component.html',
- styleUrl: './view-link.component.css'
+ styleUrl: './view-link.component.css',
})
export class ViewLinkComponent {
- constructor(private linkService: LinkService, private route: ActivatedRoute, private router: Router) { }
+ constructor(
+ private linkService: LinkService,
+ private route: ActivatedRoute,
+ private router: Router,
+ ) {}
ngOnInit(): void {
- this.linkService.getLink(this.route.snapshot.params['link']).then(link => {
- window.location.href = link.link;
- });
+ this.linkService
+ .getLink(this.route.snapshot.params['link'])
+ .then((link) => {
+ window.location.href = link.link;
+ });
}
}
diff --git a/src/environments/environment.development.ts b/src/environments/environment.development.ts
index 4dd998c..a02e204 100644
--- a/src/environments/environment.development.ts
+++ b/src/environments/environment.development.ts
@@ -1,3 +1,3 @@
export const environment = {
- POCKETBASE: 'https://jklink-pocketbase-test.intern.kjan.de'
+ POCKETBASE: 'https://jklink-pocketbase-test.intern.kjan.de',
};
diff --git a/src/environments/environment.ts b/src/environments/environment.ts
index 4dd998c..a02e204 100644
--- a/src/environments/environment.ts
+++ b/src/environments/environment.ts
@@ -1,3 +1,3 @@
export const environment = {
- POCKETBASE: 'https://jklink-pocketbase-test.intern.kjan.de'
+ POCKETBASE: 'https://jklink-pocketbase-test.intern.kjan.de',
};
diff --git a/src/index.html b/src/index.html
index 5ab9cdc..9d15f1b 100644
--- a/src/index.html
+++ b/src/index.html
@@ -1,15 +1,21 @@
-
-
- Jklink
-
-
-
-
-
-
-
-
-
+
+
+ Jklink
+
+
+
+
+
+
+
+
+
diff --git a/src/main.ts b/src/main.ts
index 35b00f3..8882c45 100644
--- a/src/main.ts
+++ b/src/main.ts
@@ -2,5 +2,6 @@ import { bootstrapApplication } from '@angular/platform-browser';
import { appConfig } from './app/app.config';
import { AppComponent } from './app/app.component';
-bootstrapApplication(AppComponent, appConfig)
- .catch((err) => console.error(err));
+bootstrapApplication(AppComponent, appConfig).catch((err) =>
+ console.error(err),
+);
diff --git a/src/styles.scss b/src/styles.scss
index c0e74c5..5ef6f19 100644
--- a/src/styles.scss
+++ b/src/styles.scss
@@ -1,4 +1,4 @@
-@use '@angular/material' as mat;
+@use "@angular/material" as mat;
@tailwind base;
@tailwind components;
@tailwind utilities;
diff --git a/tailwind.config.js b/tailwind.config.js
index f24e856..cb1350d 100644
--- a/tailwind.config.js
+++ b/tailwind.config.js
@@ -1,8 +1,6 @@
/** @type {import('tailwindcss').Config} */
module.exports = {
- content: [
- "./src/**/*.{html,ts}",
- ],
+ content: ["./src/**/*.{html,ts}"],
theme: {
extend: {},
},
@@ -10,5 +8,4 @@ module.exports = {
preflight: false,
},
plugins: [],
-}
-
+};
diff --git a/tsconfig.app.json b/tsconfig.app.json
index 3775b37..8886e90 100644
--- a/tsconfig.app.json
+++ b/tsconfig.app.json
@@ -6,10 +6,6 @@
"outDir": "./out-tsc/app",
"types": []
},
- "files": [
- "src/main.ts"
- ],
- "include": [
- "src/**/*.d.ts"
- ]
+ "files": ["src/main.ts"],
+ "include": ["src/**/*.d.ts"]
}
diff --git a/tsconfig.spec.json b/tsconfig.spec.json
index 5fb748d..e00e30e 100644
--- a/tsconfig.spec.json
+++ b/tsconfig.spec.json
@@ -4,12 +4,7 @@
"extends": "./tsconfig.json",
"compilerOptions": {
"outDir": "./out-tsc/spec",
- "types": [
- "jasmine"
- ]
+ "types": ["jasmine"]
},
- "include": [
- "src/**/*.spec.ts",
- "src/**/*.d.ts"
- ]
+ "include": ["src/**/*.spec.ts", "src/**/*.d.ts"]
}