diff --git a/myteamwallet_frontend/.editorconfig b/myteamwallet_frontend/.editorconfig deleted file mode 100644 index 59d9a3a..0000000 --- a/myteamwallet_frontend/.editorconfig +++ /dev/null @@ -1,16 +0,0 @@ -# Editor configuration, see https://editorconfig.org -root = true - -[*] -charset = utf-8 -indent_style = space -indent_size = 2 -insert_final_newline = true -trim_trailing_whitespace = true - -[*.ts] -quote_type = single - -[*.md] -max_line_length = off -trim_trailing_whitespace = false diff --git a/myteamwallet_frontend/.gitignore b/myteamwallet_frontend/.gitignore deleted file mode 100644 index 6edc436..0000000 --- a/myteamwallet_frontend/.gitignore +++ /dev/null @@ -1,49 +0,0 @@ -# See http://help.github.com/ignore-files/ for more about ignoring files. - -# Compiled output -/dist -/tmp -/out-tsc -/bazel-out - -# Node -/node_modules -npm-debug.log -yarn-error.log - -# IDEs and editors -.idea/ -.project -.classpath -.c9/ -*.launch -.settings/ -*.sublime-workspace - -# Visual Studio Code -.vscode/* -!.vscode/settings.json -!.vscode/tasks.json -!.vscode/launch.json -!.vscode/extensions.json -.history/* - -# Miscellaneous -/.angular/cache -.sass-cache/ -/connect.lock -/coverage -/libpeerconnection.log -testem.log -/typings - -# System files -.DS_Store -Thumbs.db - -# Claude Code worktrees / plan tooling -/.claude -/.superpowers - -# git -package-lock.json diff --git a/myteamwallet_frontend/.vscode/extensions.json b/myteamwallet_frontend/.vscode/extensions.json deleted file mode 100644 index 77b3745..0000000 --- a/myteamwallet_frontend/.vscode/extensions.json +++ /dev/null @@ -1,4 +0,0 @@ -{ - // For more information, visit: https://go.microsoft.com/fwlink/?linkid=827846 - "recommendations": ["angular.ng-template"] -} diff --git a/myteamwallet_frontend/.vscode/launch.json b/myteamwallet_frontend/.vscode/launch.json deleted file mode 100644 index 740e35a..0000000 --- a/myteamwallet_frontend/.vscode/launch.json +++ /dev/null @@ -1,20 +0,0 @@ -{ - // For more information, visit: https://go.microsoft.com/fwlink/?linkid=830387 - "version": "0.2.0", - "configurations": [ - { - "name": "ng serve", - "type": "pwa-chrome", - "request": "launch", - "preLaunchTask": "npm: start", - "url": "http://localhost:4200/" - }, - { - "name": "ng test", - "type": "chrome", - "request": "launch", - "preLaunchTask": "npm: test", - "url": "http://localhost:9876/debug.html" - } - ] -} diff --git a/myteamwallet_frontend/.vscode/settings.json b/myteamwallet_frontend/.vscode/settings.json deleted file mode 100644 index 36c12fd..0000000 --- a/myteamwallet_frontend/.vscode/settings.json +++ /dev/null @@ -1,3 +0,0 @@ -{ - "CodeGPT.apiKey": "CodeGPT Plus Beta" -} \ No newline at end of file diff --git a/myteamwallet_frontend/.vscode/tasks.json b/myteamwallet_frontend/.vscode/tasks.json deleted file mode 100644 index a298b5b..0000000 --- a/myteamwallet_frontend/.vscode/tasks.json +++ /dev/null @@ -1,42 +0,0 @@ -{ - // For more information, visit: https://go.microsoft.com/fwlink/?LinkId=733558 - "version": "2.0.0", - "tasks": [ - { - "type": "npm", - "script": "start", - "isBackground": true, - "problemMatcher": { - "owner": "typescript", - "pattern": "$tsc", - "background": { - "activeOnStart": true, - "beginsPattern": { - "regexp": "(.*?)" - }, - "endsPattern": { - "regexp": "bundle generation complete" - } - } - } - }, - { - "type": "npm", - "script": "test", - "isBackground": true, - "problemMatcher": { - "owner": "typescript", - "pattern": "$tsc", - "background": { - "activeOnStart": true, - "beginsPattern": { - "regexp": "(.*?)" - }, - "endsPattern": { - "regexp": "bundle generation complete" - } - } - } - } - ] -} diff --git a/myteamwallet_frontend/README.md b/myteamwallet_frontend/README.md deleted file mode 100644 index 5d4bb95..0000000 --- a/myteamwallet_frontend/README.md +++ /dev/null @@ -1,27 +0,0 @@ -# MyteamwalletFrontend - -This project was generated with [Angular CLI](https://github.com/angular/angular-cli) version 15.0.1. - -## Development server - -Run `ng serve` for a dev server. Navigate to `http://localhost:4200/`. The application will automatically reload if you change any of the source files. - -## Code scaffolding - -Run `ng generate component component-name` to generate a new component. You can also use `ng generate directive|pipe|service|class|guard|interface|enum|module`. - -## Build - -Run `ng build` to build the project. The build artifacts will be stored in the `dist/` directory. - -## Running unit tests - -Run `ng test` to execute the unit tests via [Karma](https://karma-runner.github.io). - -## Running end-to-end tests - -Run `ng e2e` to execute the end-to-end tests via a platform of your choice. To use this command, you need to first add a package that implements end-to-end testing capabilities. - -## Further help - -To get more help on the Angular CLI use `ng help` or go check out the [Angular CLI Overview and Command Reference](https://angular.io/cli) page. diff --git a/myteamwallet_frontend/angular.json b/myteamwallet_frontend/angular.json deleted file mode 100644 index 944229f..0000000 --- a/myteamwallet_frontend/angular.json +++ /dev/null @@ -1,135 +0,0 @@ -{ - "$schema": "./node_modules/@angular/cli/lib/config/schema.json", - "version": 1, - "newProjectRoot": "projects", - "projects": { - "myteamwallet_frontend": { - "projectType": "application", - "schematics": { - "@schematics/angular:component": { - "style": "scss" - } - }, - "root": "", - "sourceRoot": "src", - "prefix": "app", - "architect": { - "build": { - "builder": "@angular-devkit/build-angular:browser", - "options": { - "outputPath": "dist", - "index": "src/index.html", - "main": "src/main.ts", - "polyfills": [ - "zone.js" - ], - "statsJson": true, - "tsConfig": "tsconfig.app.json", - "inlineStyleLanguage": "scss", - "assets": [ - "src/favicon.ico", - "src/assets", - "src/manifest.webmanifest" - ], - "styles": [ - "src/styles.scss" - ], - "scripts": [], - "serviceWorker": true, - "ngswConfigPath": "ngsw-config.json" - }, - "configurations": { - "production": { - "budgets": [ - { - "type": "initial", - "maximumWarning": "500kb", - "maximumError": "1mb" - }, - { - "type": "anyComponentStyle", - "maximumWarning": "2kb", - "maximumError": "4kb" - } - ], - "outputHashing": "all", - "fileReplacements": [ - { - "replace": "src/environments/environment.ts", - "with": "src/environments/environment.prod.ts" - } - ] - }, - "development": { - "buildOptimizer": false, - "optimization": false, - "vendorChunk": true, - "extractLicenses": false, - "sourceMap": true, - "namedChunks": true, - "fileReplacements": [ - { - "replace": "src/environments/environment.ts", - "with": "src/environments/environment.dev.ts" - } - ] - }, - "remote": { - "buildOptimizer": false, - "optimization": false, - "vendorChunk": true, - "extractLicenses": false, - "sourceMap": true, - "namedChunks": true, - "fileReplacements": [] - } - }, - "defaultConfiguration": "production" - }, - "serve": { - "builder": "@angular-devkit/build-angular:dev-server", - "configurations": { - "production": { - "buildTarget": "myteamwallet_frontend:build:production" - }, - "development": { - "buildTarget": "myteamwallet_frontend:build:development" - }, - "remote": { - "buildTarget": "myteamwallet_frontend:build:remote" - } - }, - "defaultConfiguration": "development" - }, - "extract-i18n": { - "builder": "@angular-devkit/build-angular:extract-i18n", - "options": { - "buildTarget": "myteamwallet_frontend:build" - } - }, - "test": { - "builder": "@angular-devkit/build-angular:karma", - "options": { - "polyfills": [ - "zone.js", - "zone.js/testing" - ], - "tsConfig": "tsconfig.spec.json", - "inlineStyleLanguage": "scss", - "assets": [ - "src/favicon.ico", - "src/assets" - ], - "styles": [ - "src/styles.scss" - ], - "scripts": [] - } - } - } - } - }, - "cli": { - "analytics": false - } -} diff --git a/myteamwallet_frontend/docs/superpowers/plans/2026-07-31-design-foundation.md b/myteamwallet_frontend/docs/superpowers/plans/2026-07-31-design-foundation.md deleted file mode 100644 index 2c0f415..0000000 --- a/myteamwallet_frontend/docs/superpowers/plans/2026-07-31-design-foundation.md +++ /dev/null @@ -1,374 +0,0 @@ -# Design-System-Fundament Implementation Plan - -> **For agentic workers:** REQUIRED SUB-SKILL: Use superpowers:subagent-driven-development (recommended) or superpowers:executing-plans to implement this plan task-by-task. Steps use checkbox (`- [ ]`) syntax for tracking. - -**Goal:** Legt die technische und visuelle Basis für das TeamWallet-Redesign: Design-Tokens, ein eigenes Material-3-Theme (fintech-modern, Indigo/Grün), ein konsistentes Icon-System und ein bereinigtes Notification-System — ohne die bestehenden Bildschirme inhaltlich umzubauen (das folgt in Folge-Plänen für Public-Übersicht, Dashboard/Team-Workspace, Auth-Flows). - -**Architecture:** Zwei neue SCSS-Partials (`src/styles/_tokens.scss`, `src/styles/_theme.scss`) werden aus `src/styles.scss` eingebunden. Die Angular-Material-Theming-API (`mat.define-theme`, installiert in `node_modules/@angular/material/core/theming/_definition.scss`) erzeugt das Theme aus vordefinierten M3-Paletten (`mat.$blue-palette` als Primary, `mat.$spring-green-palette` als Tertiary) statt des Stock-Themes `azure-blue`. Reine CSS-Custom-Properties (nicht Sass-Variablen) tragen Spacing/Radius/Elevation/Balance-Farben, damit sie direkt in Komponenten-Templates/-Styles nutzbar sind, auch außerhalb von Sass-Kontext. - -**Tech Stack:** Angular 18.1, Angular Material 18.1 (M3-Theming-API), SCSS, Angular CLI Builder (`@angular-devkit/build-angular:browser`), Karma/Jasmine. - -## Global Constraints - -- Kein Dark Mode in diesem Plan — Tokens müssen aber so benannt/strukturiert sein, dass ein späteres Dark-Theme sie überschreiben kann (semantische Namen, keine rohen Paletten-Referenzen in Komponenten). -- Keine neuen Abhängigkeiten hinzufügen; stattdessen wird die ungenutzte Abhängigkeit `@ngxpert/hot-toast` entfernt. -- Bestehende deutsche UI-Texte bleiben unverändert (i18n-Audit ist ein separater Folge-Plan). -- Nach jedem Task muss `npm run build` (aus `myteamwallet_frontend/`) fehlerfrei durchlaufen. -- Angular Material 18 M3-Theming bietet **keine** Funktion, aus einem beliebigen Hex-Wert eine Palette zu generieren (verifiziert: `_palettes.scss` enthält nur die zwölf vordefinierten Paletten `red/green/blue/yellow/cyan/magenta/orange/chartreuse/spring-green/azure/violet/rose`). Primary/Tertiary werden daher aus diesen vordefinierten Paletten gewählt, nicht aus Wunsch-Hexcodes. - ---- - -### Task 1: Design-Tokens (Spacing, Radius, Elevation, Balance-Farben) - -**Files:** -- Create: `myteamwallet_frontend/src/styles/_tokens.scss` -- Modify: `myteamwallet_frontend/src/styles.scss` - -**Interfaces:** -- Produces: CSS-Custom-Properties auf `:root` — `--tw-space-{1,2,3,4,6,8}`, `--tw-radius-{sm,md,lg}`, `--tw-elevation-{1,2}`, `--tw-balance-positive`, `--tw-balance-negative`, `--tw-balance-neutral`, `--tw-surface-bg`, `--tw-surface-card`. Alle Folge-Tasks/-Pläne referenzieren ausschließlich diese Namen, nie rohe Hex-Werte. - -- [ ] **Step 1: `_tokens.scss` anlegen** - -```scss -// myteamwallet_frontend/src/styles/_tokens.scss -:root { - // Spacing (8px-Grid) - --tw-space-1: 4px; - --tw-space-2: 8px; - --tw-space-3: 12px; - --tw-space-4: 16px; - --tw-space-6: 24px; - --tw-space-8: 32px; - - // Radius - --tw-radius-sm: 8px; - --tw-radius-md: 12px; - --tw-radius-lg: 16px; - - // Elevation (ersetzt die bisher wiederholte box-shadow-Deklaration) - --tw-elevation-1: 0 1px 2px rgba(15, 23, 42, 0.06), 0 1px 3px rgba(15, 23, 42, 0.1); - --tw-elevation-2: 0 2px 4px rgba(15, 23, 42, 0.06), 0 4px 8px rgba(15, 23, 42, 0.1); - - // Semantische Saldo-Farben (fintech-modern: gedämpftes Grün/Rot statt Signalfarben) - --tw-balance-positive: #1b8a5a; - --tw-balance-negative: #c4351c; - --tw-balance-neutral: #64748b; - - // Flächen - --tw-surface-bg: #f7f8fa; - --tw-surface-card: #ffffff; -} -``` - -- [ ] **Step 2: In `styles.scss` einbinden und bestehende Hardcodes ersetzen** - -In `myteamwallet_frontend/src/styles.scss` ganz oben ergänzen: - -```scss -@use './styles/tokens'; -``` - -Danach folgende bestehende Stellen in derselben Datei ersetzen: - -```scss -// vorher: body { margin: 0; font-family: Roboto, "Helvetica Neue", sans-serif; background-color: #fafafa;} -body { margin: 0; font-family: Roboto, "Helvetica Neue", sans-serif; background-color: var(--tw-surface-bg); } -``` - -```scss -// vorher in .card: -// box-shadow: 0 2px 1px -1px #0003, 0 1px 1px #00000024, 0 1px 3px #0000001f; -.card { - padding: var(--tw-space-3); - box-shadow: var(--tw-elevation-1); - margin: var(--tw-space-1); - background-color: var(--tw-surface-card); - border-radius: var(--tw-radius-md); - - &.flat { - background-color: transparent; - box-shadow: none; - outline: #ddd solid 1px; - } -} -``` - -```scss -// vorher: background-color: rgb(148, 16, 16) !important; -.snackbar_error > .mdc-snackbar__surface { - background-color: var(--tw-balance-negative) !important; - - .mat-mdc-snack-bar-label { - color: white !important; - } -} -``` - -- [ ] **Step 3: Build verifizieren** - -Run: `cd myteamwallet_frontend && npm run build` -Expected: Build erfolgreich, keine Sass-/Compile-Fehler. - -- [ ] **Step 4: Commit** - -```bash -git add myteamwallet_frontend/src/styles/_tokens.scss myteamwallet_frontend/src/styles.scss -git commit -m "feat(design): add design tokens and wire into global styles" -``` - ---- - -### Task 2: Eigenes Material-3-Theme statt Stock-Theme - -**Files:** -- Create: `myteamwallet_frontend/src/styles/_theme.scss` -- Modify: `myteamwallet_frontend/src/styles.scss` -- Modify: `myteamwallet_frontend/angular.json:35` (build-Styles), `myteamwallet_frontend/angular.json:125` (test-Styles) -- Modify: `myteamwallet_frontend/src/index.html` - -**Interfaces:** -- Consumes: nichts aus Task 1 direkt (unabhängiges Partial), wird aber in derselben `styles.scss` eingebunden. -- Produces: Sass-Variable `theme.$teamwallet-theme`, die alle Material-Komponentenstyles erzeugt. Spätere Pläne fügen hier bei Bedarf `mat.theme-overrides()` hinzu, ändern aber nicht den Namen `$teamwallet-theme`. - -- [ ] **Step 1: `_theme.scss` anlegen** - -```scss -// myteamwallet_frontend/src/styles/_theme.scss -@use '@angular/material' as mat; - -$teamwallet-theme: mat.define-theme(( - color: ( - theme-type: light, - primary: mat.$blue-palette, - tertiary: mat.$spring-green-palette, - ), - typography: ( - brand-family: 'Inter, Roboto, "Helvetica Neue", sans-serif', - plain-family: 'Inter, Roboto, "Helvetica Neue", sans-serif', - ), - density: ( - scale: 0, - ), -)); -``` - -- [ ] **Step 2: Theme in `styles.scss` einbinden (ersetzt Stock-Theme-Import)** - -Am Anfang von `myteamwallet_frontend/src/styles.scss` ergänzen (vor den bestehenden Regeln): - -```scss -@use '@angular/material' as mat; -@use './styles/theme'; - -@include mat.core(); -@include mat.all-component-themes(theme.$teamwallet-theme); -``` - -- [ ] **Step 3: Stock-Theme aus `angular.json` entfernen** - -In `myteamwallet_frontend/angular.json` im `build`-Target die Zeile entfernen: - -```json -"@angular/material/prebuilt-themes/azure-blue.css", -``` - -Im `test`-Target die Zeile entfernen: - -```json -"@angular/material/prebuilt-themes/cyan-orange.css", -``` - -In beiden Targets bleibt `"src/styles.scss"` als einziger globaler Stylesheet-Eintrag stehen. - -- [ ] **Step 4: Google-Font auf Inter umstellen** - -In `myteamwallet_frontend/src/index.html` die bestehende Roboto-Zeile ersetzen: - -```html - -``` - -- [ ] **Step 5: Build und Tests verifizieren** - -Run: `cd myteamwallet_frontend && npm run build` -Expected: Build erfolgreich, Material-Komponenten (Buttons, Toolbar, Cards) werden aus dem neuen Theme gestylt statt aus `azure-blue.css`. - -Run: `cd myteamwallet_frontend && npm test -- --watch=false` -Expected: Bestehende Karma-Suite läuft weiterhin durch (keine Test-Regression durch den Theme-Wechsel). - -- [ ] **Step 6: Commit** - -```bash -git add myteamwallet_frontend/src/styles/_theme.scss myteamwallet_frontend/src/styles.scss myteamwallet_frontend/angular.json myteamwallet_frontend/src/index.html -git commit -m "feat(design): replace stock Material azure-blue theme with custom M3 theme" -``` - ---- - -### Task 3: Icon-System auf Material Symbols umstellen, PNG-Icon-Klassen entfernen - -**Files:** -- Modify: `myteamwallet_frontend/src/index.html` -- Modify: `myteamwallet_frontend/src/app/app.component.ts` -- Modify: `myteamwallet_frontend/src/app/modules/home/dashboard/dashboard.component.ts` -- Modify: `myteamwallet_frontend/src/app/modules/home/dashboard/dashboard.component.html` -- Modify: `myteamwallet_frontend/src/styles.scss` -- Delete: `myteamwallet_frontend/src/assets/edit.png`, `myteamwallet_frontend/src/assets/dashboard.png`, `myteamwallet_frontend/src/assets/tacho.png` - -**Interfaces:** -- Consumes: nichts. -- Produces: ``-basierte Icons überall; keine PNG-Icon-Klassen (`icon`, `icon_edit`, `icon_dashboard`, `icon_tacho`) mehr im Code. Verifiziert: diese Klassen werden ausschließlich in `dashboard.component.html` verwendet (`icon_tacho`, `icon_edit`; `icon_dashboard` ist bereits toter Code). - -- [ ] **Step 1: Material Symbols statt Material Icons laden** - -In `myteamwallet_frontend/src/index.html` die Material-Icons-Zeile ersetzen: - -```html - -``` - -- [ ] **Step 2: Default-Fontset der App auf Material Symbols umstellen** - -In `myteamwallet_frontend/src/app/app.component.ts`: - -```ts -import { Component } from '@angular/core'; -import { TranslateService } from '@ngx-translate/core'; -import { environment } from './../environments/environment'; -import { SwUpdate } from '@angular/service-worker'; -import { MatIconRegistry } from '@angular/material/icon'; - -@Component({ - selector: 'app-root', - templateUrl: './app.component.html', - styleUrls: ['./app.component.scss'] -}) -export class AppComponent { - version = environment.appVersion; - - constructor(translate: TranslateService, updates: SwUpdate, iconRegistry: MatIconRegistry) { - iconRegistry.setDefaultFontSetClass('material-symbols-outlined'); - translate.setDefaultLang('de'); - translate.use('de'); - this.update(updates); - } - // ... rest unverändert -``` - -(Restlichen Methodenkörper `update()` unverändert lassen.) - -- [ ] **Step 3: Dashboard-Icons auf `mat-icon` umstellen** - -In `myteamwallet_frontend/src/app/modules/home/dashboard/dashboard.component.ts` `MatIconModule` importieren: - -```ts -import { MatIconModule } from '@angular/material/icon'; -// ... -@Component({ - selector: 'app-dashboard', - templateUrl: './dashboard.component.html', - styleUrls: ['./dashboard.component.scss'], - standalone: true, - imports: [ CommonModule, TranslateModule, MatButtonModule, MatIconModule ] -}) -``` - -In `myteamwallet_frontend/src/app/modules/home/dashboard/dashboard.component.html` ersetzen: - -```html - -
-
-
-
-``` - -```html - -
- - -
-``` - -- [ ] **Step 4: Tote Icon-Klassen aus `styles.scss` entfernen** - -In `myteamwallet_frontend/src/styles.scss` den gesamten Block entfernen: - -```scss -.icon { ... } -.icon_edit { ... } -.icon_dashboard { ... } -.icon_tacho { ... } -``` - -(Alle vier Regeln inkl. der `.icon:hover`-Verschachtelung löschen — keine andere Datei referenziert diese Klassen mehr.) - -- [ ] **Step 5: Ungenutzte PNG-Assets löschen** - -```bash -git rm myteamwallet_frontend/src/assets/edit.png myteamwallet_frontend/src/assets/dashboard.png myteamwallet_frontend/src/assets/tacho.png -``` - -- [ ] **Step 6: Build verifizieren und visuell prüfen** - -Run: `cd myteamwallet_frontend && npm run build` -Expected: Build erfolgreich, keine fehlenden Asset-Referenzen. - -Run: `cd myteamwallet_frontend && npm start`, Dashboard im Browser öffnen (`http://localhost:4200/dashboard`, eingeloggt). -Expected: Statt der beiden PNG-Icons erscheinen die Material-Symbols-Icons „speed“ und „edit“, klickbar wie zuvor. - -- [ ] **Step 7: Commit** - -```bash -git add myteamwallet_frontend/src/index.html myteamwallet_frontend/src/app/app.component.ts myteamwallet_frontend/src/app/modules/home/dashboard/dashboard.component.ts myteamwallet_frontend/src/app/modules/home/dashboard/dashboard.component.html myteamwallet_frontend/src/styles.scss -git commit -m "feat(design): migrate to Material Symbols, remove PNG icon classes" -``` - ---- - -### Task 4: Notification-System bereinigen - -**Files:** -- Modify: `myteamwallet_frontend/package.json` - -**Interfaces:** -- Consumes: `--tw-balance-negative`-Token aus Task 1 (bereits in `.snackbar_error` verdrahtet). -- Produces: keine neuen Symbole — reine Bereinigung. - -Verifiziert: `@ngxpert/hot-toast` ist in `package.json` als Abhängigkeit deklariert, wird aber im gesamten `src/`-Verzeichnis nirgends importiert (`HotToastService`/`@ngxpert/hot-toast` liefert null Treffer). Es gibt also kein zweites, konkurrierendes Toast-System im Code — nur eine tote Abhängigkeit. Die tatsächliche Benachrichtigung läuft ausschließlich über `MatSnackBar` (3 Aufrufstellen, alle in `team-details.component.ts`), deren Fehler-Variante bereits in Task 1 auf den neuen Token umgestellt wurde. - -- [ ] **Step 1: Ungenutzte Abhängigkeit entfernen** - -In `myteamwallet_frontend/package.json` die Zeile aus `dependencies` entfernen: - -```json -"@ngxpert/hot-toast": "3.0.0", -``` - -- [ ] **Step 2: Lockfile aktualisieren** - -Run: `cd myteamwallet_frontend && npm install` -Expected: `package-lock.json` aktualisiert sich, `@ngxpert/hot-toast` verschwindet aus dem Dependency-Baum, keine anderen Pakete werden unerwartet verändert. - -- [ ] **Step 3: Build verifizieren** - -Run: `cd myteamwallet_frontend && npm run build` -Expected: Build weiterhin erfolgreich (bestätigt, dass das Paket wirklich ungenutzt war). - -- [ ] **Step 4: Commit** - -```bash -git add myteamwallet_frontend/package.json myteamwallet_frontend/package-lock.json -git commit -m "chore(deps): remove unused @ngxpert/hot-toast dependency" -``` - ---- - -## Hinweis für Folge-Pläne - -Die Wrapper-Komponenten-Bibliothek (`BalanceDisplay`, `PageHeader`, `SectionCard`, `EmptyState`, `StatTile` aus dem Gesamtplan) wird bewusst **nicht** in diesem Fundament-Plan gebaut, sondern erst in dem Folge-Plan, der ihren ersten echten Verwendungsort umbaut (Public-Team-Übersicht bzw. Dashboard/Team-Workspace) — YAGNI: eine Komponenten-Bibliothek ohne Konsumenten lässt sich nicht sinnvoll gegen echte Anforderungen entwerfen. Dieser Fundament-Plan liefert die Basis (Tokens, Theme, Icons, saubere Notifications), auf der diese Komponenten aufbauen. diff --git a/myteamwallet_frontend/ngsw-config.json b/myteamwallet_frontend/ngsw-config.json deleted file mode 100644 index 6c8ccf4..0000000 --- a/myteamwallet_frontend/ngsw-config.json +++ /dev/null @@ -1,29 +0,0 @@ -{ - "$schema": "./node_modules/@angular/service-worker/config/schema.json", - "index": "/index.html", - "assetGroups": [ - { - "name": "app", - "installMode": "prefetch", - "resources": { - "files": [ - "/favicon.ico", - "/index.html", - "/manifest.webmanifest", - "/*.css", - "/*.js" - ] - } - }, - { - "name": "assets", - "installMode": "lazy", - "updateMode": "prefetch", - "resources": { - "files": [ - "/**/*.(svg|cur|jpg|jpeg|png|apng|webp|avif|gif|otf|ttf|woff|woff2)" - ] - } - } - ] -} diff --git a/myteamwallet_frontend/package.json b/myteamwallet_frontend/package.json deleted file mode 100644 index 19e58f8..0000000 --- a/myteamwallet_frontend/package.json +++ /dev/null @@ -1,51 +0,0 @@ -{ - "name": "myteamwallet-frontend", - "version": "1.0.49", - "scripts": { - "ng": "ng", - "start": "ng serve", - "start:remote": "ng serve --configuration=remote", - "build": "ng build", - "watch": "ng build --watch --configuration development", - "test": "ng test", - "patch": "npm --no-git-tag-version version patch", - "post_patch": "git add package.json" - }, - "pre-commit": [ - "patch", - "post_patch" - ], - "private": true, - "dependencies": { - "@angular/animations": "^18.1.4", - "@angular/cdk": "^18.1.4", - "@angular/common": "^18.1.4", - "@angular/compiler": "^18.1.4", - "@angular/core": "^18.1.4", - "@angular/forms": "^18.1.4", - "@angular/material": "^18.1.4", - "@angular/platform-browser": "^18.1.4", - "@angular/platform-browser-dynamic": "^18.1.4", - "@angular/router": "^18.1.4", - "@angular/service-worker": "^18.1.4", - "@ngx-translate/core": "^15.0.0", - "@ngx-translate/http-loader": "^8.0.0", - "rxjs": "~7.5.0", - "tslib": "^2.3.0", - "zone.js": "~0.14.8" - }, - "devDependencies": { - "@angular-devkit/build-angular": "^18.1.4", - "@angular/cli": "~18.1.4", - "@angular/compiler-cli": "^18.1.4", - "@types/jasmine": "~4.3.0", - "jasmine-core": "~4.5.0", - "karma": "~6.4.0", - "karma-chrome-launcher": "~3.1.0", - "karma-coverage": "~2.2.0", - "karma-jasmine": "~5.1.0", - "karma-jasmine-html-reporter": "~2.0.0", - "pre-commit": "^1.2.2", - "typescript": "~5.4.5" - } -} diff --git a/myteamwallet_frontend/public/icons/icon-128x128.png b/myteamwallet_frontend/public/icons/icon-128x128.png deleted file mode 100644 index 5a9a2cc..0000000 Binary files a/myteamwallet_frontend/public/icons/icon-128x128.png and /dev/null differ diff --git a/myteamwallet_frontend/public/icons/icon-144x144.png b/myteamwallet_frontend/public/icons/icon-144x144.png deleted file mode 100644 index 11702cd..0000000 Binary files a/myteamwallet_frontend/public/icons/icon-144x144.png and /dev/null differ diff --git a/myteamwallet_frontend/public/icons/icon-152x152.png b/myteamwallet_frontend/public/icons/icon-152x152.png deleted file mode 100644 index ff4e06b..0000000 Binary files a/myteamwallet_frontend/public/icons/icon-152x152.png and /dev/null differ diff --git a/myteamwallet_frontend/public/icons/icon-192x192.png b/myteamwallet_frontend/public/icons/icon-192x192.png deleted file mode 100644 index afd36a4..0000000 Binary files a/myteamwallet_frontend/public/icons/icon-192x192.png and /dev/null differ diff --git a/myteamwallet_frontend/public/icons/icon-384x384.png b/myteamwallet_frontend/public/icons/icon-384x384.png deleted file mode 100644 index 613ac79..0000000 Binary files a/myteamwallet_frontend/public/icons/icon-384x384.png and /dev/null differ diff --git a/myteamwallet_frontend/public/icons/icon-512x512.png b/myteamwallet_frontend/public/icons/icon-512x512.png deleted file mode 100644 index 7574990..0000000 Binary files a/myteamwallet_frontend/public/icons/icon-512x512.png and /dev/null differ diff --git a/myteamwallet_frontend/public/icons/icon-72x72.png b/myteamwallet_frontend/public/icons/icon-72x72.png deleted file mode 100644 index 033724e..0000000 Binary files a/myteamwallet_frontend/public/icons/icon-72x72.png and /dev/null differ diff --git a/myteamwallet_frontend/public/icons/icon-96x96.png b/myteamwallet_frontend/public/icons/icon-96x96.png deleted file mode 100644 index 3090dc2..0000000 Binary files a/myteamwallet_frontend/public/icons/icon-96x96.png and /dev/null differ diff --git a/myteamwallet_frontend/src/app/app.component.html b/myteamwallet_frontend/src/app/app.component.html deleted file mode 100644 index e2654dd..0000000 --- a/myteamwallet_frontend/src/app/app.component.html +++ /dev/null @@ -1,2 +0,0 @@ -
{{version}}
- \ No newline at end of file diff --git a/myteamwallet_frontend/src/app/app.component.scss b/myteamwallet_frontend/src/app/app.component.scss deleted file mode 100644 index 41cc31a..0000000 --- a/myteamwallet_frontend/src/app/app.component.scss +++ /dev/null @@ -1,9 +0,0 @@ -.app_version{ - position: absolute; - left: 0px; - bottom: 0px; - font-size: 0.6rem; - line-height: 0.6rem; - color: rgb(190, 190, 190); - pointer-events: none; -} \ No newline at end of file diff --git a/myteamwallet_frontend/src/app/app.component.spec.ts b/myteamwallet_frontend/src/app/app.component.spec.ts deleted file mode 100644 index a49cddf..0000000 --- a/myteamwallet_frontend/src/app/app.component.spec.ts +++ /dev/null @@ -1,29 +0,0 @@ -import { TestBed } from '@angular/core/testing'; -import { RouterTestingModule } from '@angular/router/testing'; -import { AppComponent } from './app.component'; - -describe('AppComponent', () => { - beforeEach(async () => { - await TestBed.configureTestingModule({ - imports: [ - RouterTestingModule - ], - declarations: [ - AppComponent - ], - }).compileComponents(); - }); - - it('should create the app', () => { - const fixture = TestBed.createComponent(AppComponent); - const app = fixture.componentInstance; - expect(app).toBeTruthy(); - }); - - it(`should have as title 'myteamwallet_frontend'`, () => { - const fixture = TestBed.createComponent(AppComponent); - const app = fixture.componentInstance; - expect(app.title).toEqual('myteamwallet_frontend'); - }); - -}); diff --git a/myteamwallet_frontend/src/app/app.component.ts b/myteamwallet_frontend/src/app/app.component.ts deleted file mode 100644 index 674426f..0000000 --- a/myteamwallet_frontend/src/app/app.component.ts +++ /dev/null @@ -1,46 +0,0 @@ -import { Component } from '@angular/core'; -import { TranslateService } from '@ngx-translate/core'; -import { environment } from './../environments/environment'; -import { SwUpdate } from '@angular/service-worker'; -import { MatIconRegistry } from '@angular/material/icon'; - -@Component({ - selector: 'app-root', - templateUrl: './app.component.html', - styleUrls: ['./app.component.scss'] -}) -export class AppComponent { - version = environment.appVersion; - - constructor(translate: TranslateService, updates: SwUpdate, iconRegistry: MatIconRegistry) { - iconRegistry.setDefaultFontSetClass('material-symbols-outlined'); - translate.setDefaultLang('de'); - translate.use('de'); - this.update(updates); - } - - update(updates: SwUpdate) { - console.log("Checking for updates: ", updates.isEnabled); - if (!updates.isEnabled) { return; } - - updates.versionUpdates.subscribe(evt => { - - switch (evt.type) { - case 'VERSION_DETECTED': - console.log(`Downloading new app version: ${evt.version.hash}`); - break; - case 'VERSION_READY': - console.log(`Current app version: ${evt.currentVersion.hash}`); - console.log(`New app version ready for use: ${evt.latestVersion.hash}`); - window.location.reload(); - break; - case 'VERSION_INSTALLATION_FAILED': - console.log(`Failed to install app version '${evt.version.hash}': ${evt.error}`); - break; - case 'NO_NEW_VERSION_DETECTED': - break; - default: - } - }); - } -} diff --git a/myteamwallet_frontend/src/app/app.module.ts b/myteamwallet_frontend/src/app/app.module.ts deleted file mode 100644 index 25d6efa..0000000 --- a/myteamwallet_frontend/src/app/app.module.ts +++ /dev/null @@ -1,55 +0,0 @@ -import { NgModule } from '@angular/core'; -import { BrowserModule } from '@angular/platform-browser'; - -import { AppComponent } from './app.component'; -import { BrowserAnimationsModule } from '@angular/platform-browser/animations'; - -import { LOCALE_ID, isDevMode} from '@angular/core'; -import localeDe from '@angular/common/locales/de'; -import localeDeExtra from '@angular/common/locales/extra/de'; -import { registerLocaleData } from '@angular/common'; -import { HttpClient, HttpClientModule, HTTP_INTERCEPTORS } from '@angular/common/http'; -import { AuthInterceptorService } from './core/interceptor/auth.interceptor'; -import { TranslateLoader, TranslateModule } from '@ngx-translate/core'; -import { CustomTranslateLoader } from './core/translate/translate-loader'; -import { provideRouter, RouterModule } from '@angular/router'; -import { routes } from './app.routes'; -import { ServiceWorkerModule } from '@angular/service-worker'; -registerLocaleData(localeDe, localeDeExtra); - -@NgModule({ - declarations: [ - AppComponent - ], - imports: [ - BrowserModule, - RouterModule, - BrowserAnimationsModule, - HttpClientModule, - TranslateModule.forRoot({ - loader: { - provide: TranslateLoader, - useClass: CustomTranslateLoader, - deps: [HttpClient], - }, - defaultLanguage: 'de', - }), - ServiceWorkerModule.register('ngsw-worker.js', { - enabled: !isDevMode(), - // Register the ServiceWorker as soon as the application is stable - // or after 30 seconds (whichever comes first). - registrationStrategy: 'registerWhenStable:30000' - }), - ], - providers: [ - { provide: LOCALE_ID, useValue: 'de' }, - { - provide: HTTP_INTERCEPTORS, - useClass: AuthInterceptorService, - multi: true - }, - provideRouter(routes) - ], - bootstrap: [AppComponent] -}) -export class AppModule { } diff --git a/myteamwallet_frontend/src/app/app.routes.ts b/myteamwallet_frontend/src/app/app.routes.ts deleted file mode 100644 index 7926ec3..0000000 --- a/myteamwallet_frontend/src/app/app.routes.ts +++ /dev/null @@ -1,18 +0,0 @@ -import { Routes } from '@angular/router'; -import { homeRoutes } from './modules/home/home.routes'; -import { authRoutes } from './modules/auth/auth.routes'; - -export const routes: Routes = [ - { - path: '', children: homeRoutes - }, - { - path: 'auth', children: authRoutes - }, - { - path: 'password-change/:hash', loadComponent: () => import('./modules/auth/password-change/password-change.component').then(m => m.PasswordChangeComponent) - }, - { - path: 'teams', loadChildren: () => import('./modules/teams/teams.module').then(m => m.TeamsModule) - } -]; diff --git a/myteamwallet_frontend/src/app/core/guards/auth.guard.ts b/myteamwallet_frontend/src/app/core/guards/auth.guard.ts deleted file mode 100644 index ffb61aa..0000000 --- a/myteamwallet_frontend/src/app/core/guards/auth.guard.ts +++ /dev/null @@ -1,38 +0,0 @@ -import { Injectable } from '@angular/core'; -import { ActivatedRoute, ActivatedRouteSnapshot, Route, Router, RouterStateSnapshot, UrlSegment, UrlTree } from '@angular/router'; -import { Observable } from 'rxjs'; -import { AuthService } from 'src/app/modules/auth.service'; - - -@Injectable({ - providedIn: 'root' -}) -export class AuthGuard { - constructor(private router: Router, private activatedRoute: ActivatedRoute, private authService: AuthService) {} - - private async check(): Promise { - console.log("checking") - if (this.authService.isLoggedIn()) { return true; } - const success = await this.authService.loginFromLocalStorage(); - if (success) { - return true; - } - - this.router.navigate(['/auth']).then(); - return false; - } - - canActivate( - route: ActivatedRouteSnapshot, - state: RouterStateSnapshot): Observable | Promise | boolean | UrlTree { - return this.check(); - } - canActivateChild( - childRoute: ActivatedRouteSnapshot, - state: RouterStateSnapshot): Observable | Promise | boolean | UrlTree { - return this.check(); - } - canLoad(): Observable | Promise | boolean | UrlTree { - return this.check(); - } -} \ No newline at end of file diff --git a/myteamwallet_frontend/src/app/core/interceptor/auth.interceptor.ts b/myteamwallet_frontend/src/app/core/interceptor/auth.interceptor.ts deleted file mode 100644 index a51f2f7..0000000 --- a/myteamwallet_frontend/src/app/core/interceptor/auth.interceptor.ts +++ /dev/null @@ -1,34 +0,0 @@ -import { HttpInterceptor, HttpRequest, HttpHandler, HttpEvent, HttpErrorResponse } from '@angular/common/http'; -import { Injectable } from '@angular/core'; -import { MatSnackBar } from '@angular/material/snack-bar'; -import { Observable, catchError, throwError } from 'rxjs'; -import { AuthService } from 'src/app/modules/auth.service'; - -@Injectable({ - providedIn: 'root' -}) -export class AuthInterceptorService implements HttpInterceptor { - constructor(private authService: AuthService, private snackBar: MatSnackBar) {} - intercept(request: HttpRequest, next: HttpHandler): Observable> { - const token = this.authService.getAuthToken(); - - if (token) { - // If we have a token, we set it to the header - request = request.clone({ - setHeaders: {Authorization: `Bearer ${token}`} - }); - } - - return next.handle(request).pipe( - catchError((err) => { - if (err instanceof HttpErrorResponse) { - if (err.status === 401 && this.authService.isLoggedIn()) { - this.snackBar.open('Sitzung abgelaufen, bitte erneut anmelden', undefined, { duration: 5000 }); - this.authService.logout(); - } - } - return throwError(err); - }) - ) - } -} \ No newline at end of file diff --git a/myteamwallet_frontend/src/app/core/translate/translate-loader.ts b/myteamwallet_frontend/src/app/core/translate/translate-loader.ts deleted file mode 100644 index d2eae50..0000000 --- a/myteamwallet_frontend/src/app/core/translate/translate-loader.ts +++ /dev/null @@ -1,13 +0,0 @@ -import { HttpClient } from '@angular/common/http'; -import { TranslateLoader } from '@ngx-translate/core'; -import { Observable } from 'rxjs'; - -import { environment } from '../../../environments/environment'; - -export class CustomTranslateLoader implements TranslateLoader { - constructor(private http: HttpClient) {} - - getTranslation(lang: string): Observable { - return this.http.get(`${environment.apiUrl}translations/${lang}`); - } -} \ No newline at end of file diff --git a/myteamwallet_frontend/src/app/core/user/user.service.spec.ts b/myteamwallet_frontend/src/app/core/user/user.service.spec.ts deleted file mode 100644 index 7c7ef51..0000000 --- a/myteamwallet_frontend/src/app/core/user/user.service.spec.ts +++ /dev/null @@ -1,19 +0,0 @@ -import { HttpClientModule } from '@angular/common/http'; -import { TestBed } from '@angular/core/testing'; - -import { UserService } from './user.service'; - -describe('UserService', () => { - let service: UserService; - - beforeEach(() => { - TestBed.configureTestingModule({ - imports: [ HttpClientModule ] - }); - service = TestBed.inject(UserService); - }); - - it('should be created', () => { - expect(service).toBeTruthy(); - }); -}); diff --git a/myteamwallet_frontend/src/app/core/user/user.service.ts b/myteamwallet_frontend/src/app/core/user/user.service.ts deleted file mode 100644 index fd3750d..0000000 --- a/myteamwallet_frontend/src/app/core/user/user.service.ts +++ /dev/null @@ -1,30 +0,0 @@ -import { HttpClient } from '@angular/common/http'; -import { Injectable } from '@angular/core'; -import { MatSnackBar } from '@angular/material/snack-bar'; -import { AuthService } from 'src/app/modules/auth.service'; -import { environment } from 'src/environments/environment'; - -@Injectable({ - providedIn: 'root' -}) -export class UserService { - - players: any[] = []; - - constructor(private http: HttpClient, private authService: AuthService, private snackBar: MatSnackBar) { } - - - loadTeamsOfUser() { - this.http.get(`${environment.apiUrl}users/${this.authService.user.id}/teams`).subscribe({ - next: data => { this.players = data as any[]; }, - error: () => { this.onUserLoadFailure(); } - }) - } - - onUserLoadFailure() { - this.snackBar.open('Teams konnten nicht geladen werden', undefined, { - duration: 5000, - panelClass: 'snackbar_error' - }) - } -} diff --git a/myteamwallet_frontend/src/app/model/index.ts b/myteamwallet_frontend/src/app/model/index.ts deleted file mode 100644 index 2736192..0000000 --- a/myteamwallet_frontend/src/app/model/index.ts +++ /dev/null @@ -1,3 +0,0 @@ -export * from './player'; -export * from './teamrole'; -export * from './transaction'; \ No newline at end of file diff --git a/myteamwallet_frontend/src/app/model/player.ts b/myteamwallet_frontend/src/app/model/player.ts deleted file mode 100644 index ef02bf2..0000000 --- a/myteamwallet_frontend/src/app/model/player.ts +++ /dev/null @@ -1,16 +0,0 @@ -import { Team } from '../modules/teams/model/team'; -import { TeamRole } from './teamrole'; - -export interface Player { - firstName: string; - lastName: string; - id: number; - balance: number; - team: Team; - teamRole: TeamRole; - active: boolean; - - hide: boolean; - - usersPlayer?: boolean; -} \ No newline at end of file diff --git a/myteamwallet_frontend/src/app/model/teamrole.ts b/myteamwallet_frontend/src/app/model/teamrole.ts deleted file mode 100644 index 681ffa1..0000000 --- a/myteamwallet_frontend/src/app/model/teamrole.ts +++ /dev/null @@ -1,4 +0,0 @@ -export interface TeamRole { - id: number; - name: string; -} \ No newline at end of file diff --git a/myteamwallet_frontend/src/app/model/transaction.ts b/myteamwallet_frontend/src/app/model/transaction.ts deleted file mode 100644 index 7d97e32..0000000 --- a/myteamwallet_frontend/src/app/model/transaction.ts +++ /dev/null @@ -1,9 +0,0 @@ -export interface Transaction { - id: number; - amount: number; - playerName?: string; - date: string; - type: string; - note: string; - isTeamWalletTransaction: boolean; -} \ No newline at end of file diff --git a/myteamwallet_frontend/src/app/model/user.ts b/myteamwallet_frontend/src/app/model/user.ts deleted file mode 100644 index a1e5d4e..0000000 --- a/myteamwallet_frontend/src/app/model/user.ts +++ /dev/null @@ -1,17 +0,0 @@ -export interface User { - createdAt: string; - deletedAt: string; - email: string; - firstName: string; - lastName: string; - id: number; - photo: string; - role: Role; - status: any; - updatedAt: string; -} - -export interface Role { - id: number; - name: string; -} \ No newline at end of file diff --git a/myteamwallet_frontend/src/app/modules/auth.service.spec.ts b/myteamwallet_frontend/src/app/modules/auth.service.spec.ts deleted file mode 100644 index 38fde55..0000000 --- a/myteamwallet_frontend/src/app/modules/auth.service.spec.ts +++ /dev/null @@ -1,37 +0,0 @@ -import { HttpClient } from '@angular/common/http'; -import { TestBed } from '@angular/core/testing'; -import { of } from 'rxjs'; - -import { AuthService } from './auth.service'; - -describe('AuthService', () => { - let service: AuthService; - const mockHttp = jasmine.createSpyObj('HttpClient', ['post']); - mockHttp.post.and.returnValue(of({ - token: 'token', - user: {id: 1, email: 'mail', firstName: 'first', lastName: 'last'} - })) - - beforeEach(() => { - TestBed.configureTestingModule({ - imports: [], - providers: [{ provide: HttpClient, useValue: mockHttp }] - }); - service = TestBed.inject(AuthService); - }); - - it('should be created', () => { - expect(service).toBeTruthy(); - }); - - it('should log in', async () => { - expect(service['authInfoSubject'].value).toBeNull(); - const success = await service.login('mail', 'passwort123'); - expect(success).toBeTrue(); - expect(service['authInfoSubject'].value).not.toBeNull(); - expect(service['authInfoSubject'].value.id).toBe(1); - expect(service['authInfoSubject'].value.email).toEqual('mail'); - expect(service['authInfoSubject'].value.firstName).toEqual('first'); - expect(service['authInfoSubject'].value.lastName).toEqual('last'); - }) -}); diff --git a/myteamwallet_frontend/src/app/modules/auth.service.ts b/myteamwallet_frontend/src/app/modules/auth.service.ts deleted file mode 100644 index 1f699b5..0000000 --- a/myteamwallet_frontend/src/app/modules/auth.service.ts +++ /dev/null @@ -1,117 +0,0 @@ -import { HttpClient } from '@angular/common/http'; -import { Injectable } from '@angular/core'; -import { Router } from '@angular/router'; -import { BehaviorSubject, Observable } from 'rxjs'; -import { environment } from 'src/environments/environment'; -import { User } from '../model/user'; - -@Injectable({ - providedIn: 'root' -}) -export class AuthService { - - private authInfoSubject: BehaviorSubject = new BehaviorSubject(null as any); - authInfo$: Observable = this.authInfoSubject.asObservable(); - - private token: string = ''; - - constructor(private http: HttpClient, private router: Router) { - } - - get isAdmin(): boolean { - return this.user != null && this.user.role != null && this.user.role.id == 1; - } - - isLoggedIn(): boolean { - return this.authInfoSubject.value != null; - } - - get user(): User { - return this.authInfoSubject.value; - } - - public async login(email: string, password: string): Promise { - return new Promise(resolve => { - this.http.post(`${environment.apiUrl}auth/email/login`, { email, password }).subscribe((result: any) => { - localStorage.setItem('accessToken', window.btoa(result['token'])); - this.authInfoSubject.next(result['user']); - this.token = result['token']; - resolve(true); - }, error => { - this.http.post(`${environment.apiUrl}auth/admin/email/login`, { email, password }).subscribe((result: any) => { - if (result && result['token']) { - localStorage.setItem('accessToken', window.btoa(result['token'])); - this.authInfoSubject.next(result['user']); - this.token = result['token']; - resolve(true) - } - }, error => { - resolve(false); - }) - }) - }) - } - - getAuthToken(): string { - return this.token; - } - - async verifyAccessToken(token: string): Promise { - this.token = token; - return new Promise(resolve => { - this.http.get(`${environment.apiUrl}auth/me`).subscribe(res => { - if (res && res.firstName) { - this.authInfoSubject.next(res); - if ((res as any)['token']) { - const token = (res as any)['token']; - this.token = token; - localStorage.setItem('accessToken', window.btoa(token)); - } - return resolve(true); - } - return resolve(false); - - }, () => { - return resolve(false); - }) - }) - - } - - logout() { - this.authInfoSubject.next(null as any); - localStorage.removeItem('accessToken'); - this.router.navigate(['auth']) - } - - register(data: {email: string, password: string, firstName: string, lastName: string, linkPlayerId?: number}): Observable { - return this.http.post(`${environment.apiUrl}auth/email/register`, data); - } - - forgotPassword(email: string): Observable { - return this.http.post(`${environment.apiUrl}auth/forgot/password`, { email }); - } - - resetPassword(hash: string, password: string): Observable { - return this.http.post(`${environment.apiUrl}auth/reset/password`, { hash, password }); - } - - async loginFromLocalStorage(suppressNavigation = false): Promise { - return new Promise(async resolve => { - const authToken = localStorage.getItem('accessToken'); - - if (!authToken || authToken.length == 0) { - if (!suppressNavigation) { - this.router.navigate(['/auth']).then(); - } - return resolve(false); - } - - const accessToken = window.atob(authToken); - - - const success = await this.verifyAccessToken(accessToken); - resolve(success) - }) - } -} diff --git a/myteamwallet_frontend/src/app/modules/auth/auth.component.html b/myteamwallet_frontend/src/app/modules/auth/auth.component.html deleted file mode 100644 index ee410ce..0000000 --- a/myteamwallet_frontend/src/app/modules/auth/auth.component.html +++ /dev/null @@ -1,12 +0,0 @@ - - - - -
-
Teams:
- @for(t of cachedTeams; track t) { - - } - - -
\ No newline at end of file diff --git a/myteamwallet_frontend/src/app/modules/auth/auth.component.scss b/myteamwallet_frontend/src/app/modules/auth/auth.component.scss deleted file mode 100644 index abf38c8..0000000 --- a/myteamwallet_frontend/src/app/modules/auth/auth.component.scss +++ /dev/null @@ -1,25 +0,0 @@ -:host { - display: flex; - justify-content: center; - align-items: center; - width: 100vw; - height: 100%; - flex-direction: column; - gap: 64px; -} - -mat-card { - width: 500px; - max-width: 90vw; -} - -.cached_teams { - display: flex; - flex-direction: column; - justify-content: stretch; - gap: 4px; - - button { - width: 100%; - } -} \ No newline at end of file diff --git a/myteamwallet_frontend/src/app/modules/auth/auth.component.spec.ts b/myteamwallet_frontend/src/app/modules/auth/auth.component.spec.ts deleted file mode 100644 index 00cff93..0000000 --- a/myteamwallet_frontend/src/app/modules/auth/auth.component.spec.ts +++ /dev/null @@ -1,27 +0,0 @@ -import { ComponentFixture, TestBed } from '@angular/core/testing'; -import { MatCardModule } from '@angular/material/card'; -import { RouterModule } from '@angular/router'; - -import { AuthComponent } from './auth.component'; - -describe('AuthComponent', () => { - let component: AuthComponent; - let fixture: ComponentFixture; - - beforeEach(async () => { - await TestBed.configureTestingModule({ - declarations: [ AuthComponent ], - imports: [ MatCardModule, RouterModule ], - providers: [ ] - }) - .compileComponents(); - - fixture = TestBed.createComponent(AuthComponent); - component = fixture.componentInstance; - fixture.detectChanges(); - }); - - it('should create', () => { - expect(component).toBeTruthy(); - }); -}); diff --git a/myteamwallet_frontend/src/app/modules/auth/auth.component.ts b/myteamwallet_frontend/src/app/modules/auth/auth.component.ts deleted file mode 100644 index a8b3a86..0000000 --- a/myteamwallet_frontend/src/app/modules/auth/auth.component.ts +++ /dev/null @@ -1,63 +0,0 @@ -import { Component, inject } from '@angular/core'; -import { AuthService } from '../auth.service'; -import { Router, RouterModule } from '@angular/router'; -import { CommonModule } from '@angular/common'; -import { HttpClientModule } from '@angular/common/http'; -import { MatCardModule } from '@angular/material/card'; -import { AuthGuard } from '../../core/guards/auth.guard'; -import { MatButtonModule } from '@angular/material/button'; - -@Component({ - selector: 'app-auth', - templateUrl: './auth.component.html', - styleUrls: ['./auth.component.scss'], - standalone: true, - imports: [ - CommonModule, - MatCardModule, - HttpClientModule, - RouterModule, - MatButtonModule - ], - providers: [ AuthGuard ] -}) -export class AuthComponent { - - private auth: AuthService = inject(AuthService); - private router: Router = inject(Router); - - cachedTeams: any[] = []; - - constructor() { - // this.login(); - this.getCachedTeams(); - } - - login() { - this.auth.loginFromLocalStorage().then(res => { - if (res) { - this.router.navigate(['/dashboard']); - } - }) - } - - - getCachedTeams() { - let t = localStorage.getItem('cached_teams'); - if (!t) { return; } - - let teams = JSON.parse(t); - this.cachedTeams = Object.keys(teams).map((k: any) => { - return { alias: k, name: teams[k] } - }); - } - - openTeam(alias: string) { - this.router.navigate([`teams/${alias}`]) - } - - clear() { - localStorage.removeItem('cached_teams'); - this.cachedTeams = []; - } -} diff --git a/myteamwallet_frontend/src/app/modules/auth/auth.routes.ts b/myteamwallet_frontend/src/app/modules/auth/auth.routes.ts deleted file mode 100644 index e0d74b1..0000000 --- a/myteamwallet_frontend/src/app/modules/auth/auth.routes.ts +++ /dev/null @@ -1,18 +0,0 @@ -import { Routes } from '@angular/router'; -import { AuthComponent } from './auth.component'; - -export const authRoutes: Routes = [ - { - path: '', component: AuthComponent, - children: [{ - path: '', loadChildren: () => import('./login/login.module').then(m => m.LoginModule) - }, - { - path: 'register', loadChildren: () => import('./register/register.module').then(m => m.RegisterModule) - }, - { - path: 'forgot-password', loadComponent: () => import('./forgot-password/forgot-password.component').then(m => m.ForgotPasswordComponent) - }] - }, - -]; diff --git a/myteamwallet_frontend/src/app/modules/auth/forgot-password/forgot-password.component.html b/myteamwallet_frontend/src/app/modules/auth/forgot-password/forgot-password.component.html deleted file mode 100644 index a75c67b..0000000 --- a/myteamwallet_frontend/src/app/modules/auth/forgot-password/forgot-password.component.html +++ /dev/null @@ -1,29 +0,0 @@ - - Passwort vergessen - - - - - -

Gib deine E-Mail-Adresse ein. Falls sie bei uns registriert ist, schicken wir dir einen Link zum Zurücksetzen des Passworts.

- -
- - Email - - -
- -

Anfrage konnte nicht gesendet werden. Bitte später erneut versuchen.

-
- - -

Falls die E-Mail-Adresse bei uns registriert ist, wurde eine Nachricht mit einem Link zum Zurücksetzen des Passworts verschickt. Bitte Posteingang (und Spam-Ordner) prüfen.

-
- -
- - - Zurück zum Login - - diff --git a/myteamwallet_frontend/src/app/modules/auth/forgot-password/forgot-password.component.scss b/myteamwallet_frontend/src/app/modules/auth/forgot-password/forgot-password.component.scss deleted file mode 100644 index 44fc5a7..0000000 --- a/myteamwallet_frontend/src/app/modules/auth/forgot-password/forgot-password.component.scss +++ /dev/null @@ -1,13 +0,0 @@ -mat-form-field { - width: 100%; -} - -mat-card-header { - margin-bottom: 16px; -} - -.forgot-error { - color: #b3261e; - margin: 8px 0 0; - font-size: 0.9rem; -} diff --git a/myteamwallet_frontend/src/app/modules/auth/forgot-password/forgot-password.component.ts b/myteamwallet_frontend/src/app/modules/auth/forgot-password/forgot-password.component.ts deleted file mode 100644 index 6dda896..0000000 --- a/myteamwallet_frontend/src/app/modules/auth/forgot-password/forgot-password.component.ts +++ /dev/null @@ -1,56 +0,0 @@ -import { CommonModule } from '@angular/common'; -import { Component } from '@angular/core'; -import { FormControl, FormGroup, ReactiveFormsModule, Validators } from '@angular/forms'; -import { MatButtonModule } from '@angular/material/button'; -import { MatCardModule } from '@angular/material/card'; -import { MatFormFieldModule } from '@angular/material/form-field'; -import { MatInputModule } from '@angular/material/input'; -import { RouterModule } from '@angular/router'; -import { AuthService } from '../../auth.service'; - -@Component({ - selector: 'app-forgot-password', - templateUrl: './forgot-password.component.html', - styleUrls: ['./forgot-password.component.scss'], - standalone: true, - imports: [ - CommonModule, - ReactiveFormsModule, - MatCardModule, - MatFormFieldModule, - MatInputModule, - MatButtonModule, - RouterModule - ] -}) -export class ForgotPasswordComponent { - - submitted = false; - error = false; - - form = new FormGroup({ - email: new FormControl('', [Validators.required, Validators.email]) - }); - - constructor(private authService: AuthService) {} - - submit() { - if (this.form.invalid) { return; } - const email = this.form.controls.email.value + ''; - this.error = false; - - this.authService.forgotPassword(email).subscribe({ - next: () => { this.submitted = true; }, - error: (err) => { - // Aus Datenschutzgründen wird bei unbekannter E-Mail dieselbe - // Erfolgsmeldung angezeigt wie bei einer bekannten Adresse. - if (err?.error?.errors?.email === 'emailNotExists') { - this.submitted = true; - return; - } - this.error = true; - } - }); - } - -} diff --git a/myteamwallet_frontend/src/app/modules/auth/login/login-routing.module.ts b/myteamwallet_frontend/src/app/modules/auth/login/login-routing.module.ts deleted file mode 100644 index 502fa32..0000000 --- a/myteamwallet_frontend/src/app/modules/auth/login/login-routing.module.ts +++ /dev/null @@ -1,16 +0,0 @@ - -import { NgModule } from '@angular/core'; -import { RouterModule, Routes } from '@angular/router'; -import { LoginComponent } from './login.component'; - -const routes: Routes = [ - { - path: '', component: LoginComponent - } -]; - -@NgModule({ - imports: [RouterModule.forChild(routes)], - exports: [RouterModule] -}) -export class LoginRoutingModule { } \ No newline at end of file diff --git a/myteamwallet_frontend/src/app/modules/auth/login/login.component.html b/myteamwallet_frontend/src/app/modules/auth/login/login.component.html deleted file mode 100644 index c19032d..0000000 --- a/myteamwallet_frontend/src/app/modules/auth/login/login.component.html +++ /dev/null @@ -1,31 +0,0 @@ - - Login - - - -
- -
- - Email - - -
- -
- - Passwort - - -
- - - -
- -
- - - Passwort vergessen? - - \ No newline at end of file diff --git a/myteamwallet_frontend/src/app/modules/auth/login/login.component.scss b/myteamwallet_frontend/src/app/modules/auth/login/login.component.scss deleted file mode 100644 index d6a6c0d..0000000 --- a/myteamwallet_frontend/src/app/modules/auth/login/login.component.scss +++ /dev/null @@ -1,13 +0,0 @@ -mat-form-field { - width: 100%; -} - -mat-card-header { - margin-bottom: 24px; -} - -.login-error { - color: #b3261e; - margin: 0 0 8px; - font-size: 0.9rem; -} \ No newline at end of file diff --git a/myteamwallet_frontend/src/app/modules/auth/login/login.component.spec.ts b/myteamwallet_frontend/src/app/modules/auth/login/login.component.spec.ts deleted file mode 100644 index e642643..0000000 --- a/myteamwallet_frontend/src/app/modules/auth/login/login.component.spec.ts +++ /dev/null @@ -1,35 +0,0 @@ -import { ComponentFixture, TestBed } from '@angular/core/testing'; -import { FormsModule, ReactiveFormsModule } from '@angular/forms'; -import { MatButtonModule } from '@angular/material/button'; -import { MatCardModule } from '@angular/material/card'; -import { MatFormFieldModule } from '@angular/material/form-field'; -import { MatInputModule } from '@angular/material/input'; -import { MatSnackBarModule } from '@angular/material/snack-bar'; -import { NoopAnimationsModule } from '@angular/platform-browser/animations'; -import { AuthService } from '../../auth.service'; - -import { LoginComponent } from './login.component'; - -describe('LoginComponent', () => { - let component: LoginComponent; - let fixture: ComponentFixture; - const mockAuthService = jasmine.createSpyObj('AuthService', ['']) - beforeEach(async () => { - await TestBed.configureTestingModule({ - declarations: [ LoginComponent ], - providers: [ - { provide: AuthService, useValue: mockAuthService } - ], - imports: [ MatCardModule, FormsModule, MatFormFieldModule, ReactiveFormsModule, MatInputModule, MatButtonModule, MatSnackBarModule, NoopAnimationsModule ] - }) - .compileComponents(); - - fixture = TestBed.createComponent(LoginComponent); - component = fixture.componentInstance; - fixture.detectChanges(); - }); - - it('should create', () => { - expect(component).toBeTruthy(); - }); -}); diff --git a/myteamwallet_frontend/src/app/modules/auth/login/login.component.ts b/myteamwallet_frontend/src/app/modules/auth/login/login.component.ts deleted file mode 100644 index 825b8aa..0000000 --- a/myteamwallet_frontend/src/app/modules/auth/login/login.component.ts +++ /dev/null @@ -1,42 +0,0 @@ -import { Component } from '@angular/core'; -import { FormGroup, FormControl, Validators } from '@angular/forms'; -import { Router } from '@angular/router'; -import { MatSnackBar } from '@angular/material/snack-bar'; -import { AuthService } from '../../auth.service'; - -@Component({ - selector: 'app-login', - templateUrl: './login.component.html', - styleUrls: ['./login.component.scss'] -}) -export class LoginComponent { - - loginFailed = false; - - constructor(private authService: AuthService, private router: Router, private snackBar: MatSnackBar) { - } - - loginForm = new FormGroup({ - email: new FormControl('', [Validators.required, Validators.email]), - password: new FormControl('', [Validators.required]) - }); - - - async login() { - const email = this.loginForm.controls.email.value + ''; - const password = this.loginForm.controls.password.value + '' - this.loginFailed = false; - const success = await this.authService.login(email, password); - - if (success) { - this.router.navigate(['/dashboard']).then(); - } else { - this.loginFailed = true; - this.snackBar.open('E-Mail oder Passwort ist falsch', undefined, { - duration: 5000, - panelClass: 'snackbar_error' - }); - } - } - -} diff --git a/myteamwallet_frontend/src/app/modules/auth/login/login.module.ts b/myteamwallet_frontend/src/app/modules/auth/login/login.module.ts deleted file mode 100644 index 600b982..0000000 --- a/myteamwallet_frontend/src/app/modules/auth/login/login.module.ts +++ /dev/null @@ -1,25 +0,0 @@ -import { NgModule } from '@angular/core'; -import { CommonModule } from '@angular/common'; -import { LoginComponent } from './login.component'; -import { LoginRoutingModule } from './login-routing.module'; -import { MatCardModule } from '@angular/material/card'; -import {MatButtonModule} from '@angular/material/button'; -import {MatFormFieldModule} from '@angular/material/form-field'; -import { ReactiveFormsModule } from '@angular/forms'; -import {MatInputModule} from '@angular/material/input'; - -@NgModule({ - declarations: [ - LoginComponent - ], - imports: [ - CommonModule, - LoginRoutingModule, - MatCardModule, - MatButtonModule, - MatFormFieldModule, - MatInputModule, - ReactiveFormsModule - ] -}) -export class LoginModule { } diff --git a/myteamwallet_frontend/src/app/modules/auth/password-change/password-change.component.html b/myteamwallet_frontend/src/app/modules/auth/password-change/password-change.component.html deleted file mode 100644 index 9ba41b6..0000000 --- a/myteamwallet_frontend/src/app/modules/auth/password-change/password-change.component.html +++ /dev/null @@ -1,45 +0,0 @@ - - - Neues Passwort vergeben - - - - - -
- - Neues Passwort - - Mindestens 6 Zeichen - - - - Passwort wiederholen - - - -

- Die Passwörter stimmen nicht überein. -

-
- -

- Der Link ist ungültig oder abgelaufen. Bitte fordere über "Passwort vergessen" einen neuen Link an. -

-
- - -

Dein Passwort wurde geändert. Du wirst gleich zum Login weitergeleitet.

-
- - -

Dieser Link ist unvollständig. Bitte fordere über "Passwort vergessen" einen neuen Link an.

-
- -
- - - Zurück zum Login - - -
diff --git a/myteamwallet_frontend/src/app/modules/auth/password-change/password-change.component.scss b/myteamwallet_frontend/src/app/modules/auth/password-change/password-change.component.scss deleted file mode 100644 index a1f7fa8..0000000 --- a/myteamwallet_frontend/src/app/modules/auth/password-change/password-change.component.scss +++ /dev/null @@ -1,26 +0,0 @@ -:host { - display: flex; - justify-content: center; - align-items: center; - width: 100vw; - height: 100%; -} - -mat-card { - width: 500px; - max-width: 90vw; -} - -mat-form-field { - width: 100%; -} - -mat-card-header { - margin-bottom: 16px; -} - -.password-error { - color: #b3261e; - margin: 8px 0 0; - font-size: 0.9rem; -} diff --git a/myteamwallet_frontend/src/app/modules/auth/password-change/password-change.component.ts b/myteamwallet_frontend/src/app/modules/auth/password-change/password-change.component.ts deleted file mode 100644 index 5b7cadd..0000000 --- a/myteamwallet_frontend/src/app/modules/auth/password-change/password-change.component.ts +++ /dev/null @@ -1,65 +0,0 @@ -import { CommonModule } from '@angular/common'; -import { Component, OnInit } from '@angular/core'; -import { AbstractControl, FormControl, FormGroup, ReactiveFormsModule, ValidationErrors, Validators } from '@angular/forms'; -import { MatButtonModule } from '@angular/material/button'; -import { MatCardModule } from '@angular/material/card'; -import { MatFormFieldModule } from '@angular/material/form-field'; -import { MatInputModule } from '@angular/material/input'; -import { ActivatedRoute, Router, RouterModule } from '@angular/router'; -import { AuthService } from '../../auth.service'; - -function passwordsMatch(control: AbstractControl): ValidationErrors | null { - const password = control.get('password')?.value; - const confirmPassword = control.get('confirmPassword')?.value; - return password && confirmPassword && password !== confirmPassword ? { passwordMismatch: true } : null; -} - -@Component({ - selector: 'app-password-change', - templateUrl: './password-change.component.html', - styleUrls: ['./password-change.component.scss'], - standalone: true, - imports: [ - CommonModule, - ReactiveFormsModule, - MatCardModule, - MatFormFieldModule, - MatInputModule, - MatButtonModule, - RouterModule - ] -}) -export class PasswordChangeComponent implements OnInit { - - hash: string | null = null; - success = false; - error = false; - - form = new FormGroup({ - password: new FormControl('', [Validators.required, Validators.minLength(6)]), - confirmPassword: new FormControl('', [Validators.required]), - }, { validators: passwordsMatch }); - - constructor(private route: ActivatedRoute, private router: Router, private authService: AuthService) {} - - ngOnInit(): void { - this.hash = this.route.snapshot.paramMap.get('hash'); - if (!this.hash) { - this.error = true; - } - } - - submit() { - if (this.form.invalid || !this.hash) { return; } - this.error = false; - - this.authService.resetPassword(this.hash, this.form.controls.password.value + '').subscribe({ - next: () => { - this.success = true; - setTimeout(() => this.router.navigateByUrl('/auth'), 3000); - }, - error: () => { this.error = true; } - }); - } - -} diff --git a/myteamwallet_frontend/src/app/modules/auth/register/components/no-token-provided/no-token-provided.component.html b/myteamwallet_frontend/src/app/modules/auth/register/components/no-token-provided/no-token-provided.component.html deleted file mode 100644 index af896cc..0000000 --- a/myteamwallet_frontend/src/app/modules/auth/register/components/no-token-provided/no-token-provided.component.html +++ /dev/null @@ -1,9 +0,0 @@ - - Registrieren nicht möglich - - - -
- Es ist kein gültiger Registrierungstoken vorhanden. Das Registrieren ist derzeit nur über einen Link mit gültigem Token möglich. -
-
diff --git a/myteamwallet_frontend/src/app/modules/auth/register/components/no-token-provided/no-token-provided.component.scss b/myteamwallet_frontend/src/app/modules/auth/register/components/no-token-provided/no-token-provided.component.scss deleted file mode 100644 index e69de29..0000000 diff --git a/myteamwallet_frontend/src/app/modules/auth/register/components/no-token-provided/no-token-provided.component.spec.ts b/myteamwallet_frontend/src/app/modules/auth/register/components/no-token-provided/no-token-provided.component.spec.ts deleted file mode 100644 index ef92e00..0000000 --- a/myteamwallet_frontend/src/app/modules/auth/register/components/no-token-provided/no-token-provided.component.spec.ts +++ /dev/null @@ -1,23 +0,0 @@ -import { ComponentFixture, TestBed } from '@angular/core/testing'; - -import { NoTokenProvidedComponent } from './no-token-provided.component'; - -describe('NoTokenProvidedComponent', () => { - let component: NoTokenProvidedComponent; - let fixture: ComponentFixture; - - beforeEach(async () => { - await TestBed.configureTestingModule({ - declarations: [ NoTokenProvidedComponent ] - }) - .compileComponents(); - - fixture = TestBed.createComponent(NoTokenProvidedComponent); - component = fixture.componentInstance; - fixture.detectChanges(); - }); - - it('should create', () => { - expect(component).toBeTruthy(); - }); -}); diff --git a/myteamwallet_frontend/src/app/modules/auth/register/components/no-token-provided/no-token-provided.component.ts b/myteamwallet_frontend/src/app/modules/auth/register/components/no-token-provided/no-token-provided.component.ts deleted file mode 100644 index 1ba449c..0000000 --- a/myteamwallet_frontend/src/app/modules/auth/register/components/no-token-provided/no-token-provided.component.ts +++ /dev/null @@ -1,10 +0,0 @@ -import { Component } from '@angular/core'; - -@Component({ - selector: 'app-no-token-provided', - templateUrl: './no-token-provided.component.html', - styleUrls: ['./no-token-provided.component.scss'] -}) -export class NoTokenProvidedComponent { - -} diff --git a/myteamwallet_frontend/src/app/modules/auth/register/components/register-base/register-base.component.html b/myteamwallet_frontend/src/app/modules/auth/register/components/register-base/register-base.component.html deleted file mode 100644 index 0680b43..0000000 --- a/myteamwallet_frontend/src/app/modules/auth/register/components/register-base/register-base.component.html +++ /dev/null @@ -1 +0,0 @@ - diff --git a/myteamwallet_frontend/src/app/modules/auth/register/components/register-base/register-base.component.scss b/myteamwallet_frontend/src/app/modules/auth/register/components/register-base/register-base.component.scss deleted file mode 100644 index e69de29..0000000 diff --git a/myteamwallet_frontend/src/app/modules/auth/register/components/register-base/register-base.component.spec.ts b/myteamwallet_frontend/src/app/modules/auth/register/components/register-base/register-base.component.spec.ts deleted file mode 100644 index e70a319..0000000 --- a/myteamwallet_frontend/src/app/modules/auth/register/components/register-base/register-base.component.spec.ts +++ /dev/null @@ -1,23 +0,0 @@ -import { ComponentFixture, TestBed } from '@angular/core/testing'; - -import { RegisterBaseComponent } from './register-base.component'; - -describe('RegisterBaseComponent', () => { - let component: RegisterBaseComponent; - let fixture: ComponentFixture; - - beforeEach(async () => { - await TestBed.configureTestingModule({ - declarations: [ RegisterBaseComponent ] - }) - .compileComponents(); - - fixture = TestBed.createComponent(RegisterBaseComponent); - component = fixture.componentInstance; - fixture.detectChanges(); - }); - - it('should create', () => { - expect(component).toBeTruthy(); - }); -}); diff --git a/myteamwallet_frontend/src/app/modules/auth/register/components/register-base/register-base.component.ts b/myteamwallet_frontend/src/app/modules/auth/register/components/register-base/register-base.component.ts deleted file mode 100644 index af4fbe6..0000000 --- a/myteamwallet_frontend/src/app/modules/auth/register/components/register-base/register-base.component.ts +++ /dev/null @@ -1,10 +0,0 @@ -import { Component } from '@angular/core'; - -@Component({ - selector: 'app-register-base', - templateUrl: './register-base.component.html', - styleUrls: ['./register-base.component.scss'] -}) -export class RegisterBaseComponent { - -} diff --git a/myteamwallet_frontend/src/app/modules/auth/register/components/register/register-form/register-form.component.html b/myteamwallet_frontend/src/app/modules/auth/register/components/register/register-form/register-form.component.html deleted file mode 100644 index bd18ed8..0000000 --- a/myteamwallet_frontend/src/app/modules/auth/register/components/register/register-form/register-form.component.html +++ /dev/null @@ -1,30 +0,0 @@ -
- -
- - Vorname - - - - - Nachname - - -
- -
- - Email - - -
- -
- - Passwort - - Mindestens 6 Zeichen - -
- -
\ No newline at end of file diff --git a/myteamwallet_frontend/src/app/modules/auth/register/components/register/register-form/register-form.component.scss b/myteamwallet_frontend/src/app/modules/auth/register/components/register/register-form/register-form.component.scss deleted file mode 100644 index de0feff..0000000 --- a/myteamwallet_frontend/src/app/modules/auth/register/components/register/register-form/register-form.component.scss +++ /dev/null @@ -1,5 +0,0 @@ -mat-form-field { - width: 100%; -} - - diff --git a/myteamwallet_frontend/src/app/modules/auth/register/components/register/register-form/register-form.component.spec.ts b/myteamwallet_frontend/src/app/modules/auth/register/components/register/register-form/register-form.component.spec.ts deleted file mode 100644 index e0fc93b..0000000 --- a/myteamwallet_frontend/src/app/modules/auth/register/components/register/register-form/register-form.component.spec.ts +++ /dev/null @@ -1,23 +0,0 @@ -import { ComponentFixture, TestBed } from '@angular/core/testing'; - -import { RegisterFormComponent } from './register-form.component'; - -describe('RegisterFormComponent', () => { - let component: RegisterFormComponent; - let fixture: ComponentFixture; - - beforeEach(async () => { - await TestBed.configureTestingModule({ - declarations: [ RegisterFormComponent ] - }) - .compileComponents(); - - fixture = TestBed.createComponent(RegisterFormComponent); - component = fixture.componentInstance; - fixture.detectChanges(); - }); - - it('should create', () => { - expect(component).toBeTruthy(); - }); -}); diff --git a/myteamwallet_frontend/src/app/modules/auth/register/components/register/register-form/register-form.component.ts b/myteamwallet_frontend/src/app/modules/auth/register/components/register/register-form/register-form.component.ts deleted file mode 100644 index b9eef47..0000000 --- a/myteamwallet_frontend/src/app/modules/auth/register/components/register/register-form/register-form.component.ts +++ /dev/null @@ -1,37 +0,0 @@ -import { Component, Input, OnInit } from '@angular/core'; -import { FormGroup, FormControl, Validators } from '@angular/forms'; -import { TeamInvite } from 'src/app/modules/teams/model/team-invite'; - -@Component({ - selector: 'app-register-form', - templateUrl: './register-form.component.html', - styleUrls: ['./register-form.component.scss'] -}) -export class RegisterFormComponent implements OnInit { - - - @Input('teamInfo') teamInfo: TeamInvite | undefined; - - registerForm = new FormGroup({ - email: new FormControl('', [Validators.required, Validators.email]), - password: new FormControl('', [Validators.required, Validators.minLength(6)]), - lastName: new FormControl('', [Validators.required]), - firstName: new FormControl('', [Validators.required]), - }); - - - - ngOnInit(): void { - if (this.teamInfo) { - let names = this.teamInfo.playerName.split(' '); - if (names && names.length == 2) { - this.registerForm.controls.firstName.patchValue(names[0]) - this.registerForm.controls.lastName.patchValue(names[1]) - } - } - } - - register() { - - } -} diff --git a/myteamwallet_frontend/src/app/modules/auth/register/components/register/register.component.html b/myteamwallet_frontend/src/app/modules/auth/register/components/register/register.component.html deleted file mode 100644 index 7005d40..0000000 --- a/myteamwallet_frontend/src/app/modules/auth/register/components/register/register.component.html +++ /dev/null @@ -1,27 +0,0 @@ - - Registrieren - - - - -
Hallo {{ teamInfo.playerName }},
- - - du wurdes eingeladen dich für das Team {{ teamInfo.teamName }} zu registrieren. - - -
- -
- -
- -
- Registrierung fehlgeschlagen. Bitte wende dich an deinen Ansprechpartner. -
- -
- - - - \ No newline at end of file diff --git a/myteamwallet_frontend/src/app/modules/auth/register/components/register/register.component.scss b/myteamwallet_frontend/src/app/modules/auth/register/components/register/register.component.scss deleted file mode 100644 index 9dba3cd..0000000 --- a/myteamwallet_frontend/src/app/modules/auth/register/components/register/register.component.scss +++ /dev/null @@ -1,12 +0,0 @@ -.info { - font-weight: bold; -} - -.register_form { - margin-top: 24px; -} - -.error { - margin-top: 24px; - color: red; -} \ No newline at end of file diff --git a/myteamwallet_frontend/src/app/modules/auth/register/components/register/register.component.spec.ts b/myteamwallet_frontend/src/app/modules/auth/register/components/register/register.component.spec.ts deleted file mode 100644 index f975533..0000000 --- a/myteamwallet_frontend/src/app/modules/auth/register/components/register/register.component.spec.ts +++ /dev/null @@ -1,23 +0,0 @@ -import { ComponentFixture, TestBed } from '@angular/core/testing'; - -import { RegisterComponent } from './register.component'; - -describe('RegisterComponent', () => { - let component: RegisterComponent; - let fixture: ComponentFixture; - - beforeEach(async () => { - await TestBed.configureTestingModule({ - declarations: [ RegisterComponent ] - }) - .compileComponents(); - - fixture = TestBed.createComponent(RegisterComponent); - component = fixture.componentInstance; - fixture.detectChanges(); - }); - - it('should create', () => { - expect(component).toBeTruthy(); - }); -}); diff --git a/myteamwallet_frontend/src/app/modules/auth/register/components/register/register.component.ts b/myteamwallet_frontend/src/app/modules/auth/register/components/register/register.component.ts deleted file mode 100644 index 2ddebf8..0000000 --- a/myteamwallet_frontend/src/app/modules/auth/register/components/register/register.component.ts +++ /dev/null @@ -1,85 +0,0 @@ -import { Component, OnInit, ViewChild } from '@angular/core'; -import { MatSnackBar } from '@angular/material/snack-bar'; -import { ActivatedRoute, Router } from '@angular/router'; -import { AuthService } from 'src/app/modules/auth.service'; -import { TeamsService } from 'src/app/modules/teams/teams.service'; -import { RegisterFormComponent } from './register-form/register-form.component'; - -@Component({ - selector: 'app-register', - templateUrl: './register.component.html', - styleUrls: ['./register.component.scss'] -}) -export class RegisterComponent implements OnInit { - - private token: string | null= null; - public teamInfo: { playerId: number, playerName: string, teamId: number, teamName: string} | undefined; - error: boolean = false; - - constructor(private route: ActivatedRoute, private router: Router, private teamsService: TeamsService, private authService: AuthService, private snackBar: MatSnackBar) {} - - - @ViewChild('formComponent') formComponent!: RegisterFormComponent; - - - ngOnInit(): void { - this.validateToken(this.route.snapshot.paramMap.get('token')); - - } - - private async validateToken(token: string | null) { - - if (!token) { - return this.onNoTokenProvided(); - } else { - this.teamsService.validateRegistrationToken(token).subscribe({ - next: data => { this.teamInfo = data; }, - error: () => { return this.onNoTokenProvided(); } - }); - } - - this.token = token; - } - - private onNoTokenProvided() { - this.router.navigateByUrl('auth/register/no-token'); - } - - get registerForm() { - return this.formComponent?.registerForm; - } - - get registerFormInvalid(): boolean { - return !this.registerForm || this.registerForm.invalid; - } - - register() { - const data = this.registerForm.value as any; - data.linkPlayerId = this.teamInfo?.playerId; - - this.authService.register(data).subscribe({ - next: () => { this.onPlayerRegistrationSuccess() }, - error: () => { this.onPlayerRegistrationFailure() } - }) - } - - onPlayerRegistrationSuccess() { - this.error = false; - this.snackBar.open('Erfolgreich registriert', undefined, { - duration: 5000 - }); - - this.router.navigateByUrl('/auth') - } - - onPlayerRegistrationFailure() { - - this.snackBar.open('Registrierung nicht möglich', undefined, { - duration: 5000, - panelClass: 'snackbar_error' - }); - - this.registerForm.reset() - } - -} diff --git a/myteamwallet_frontend/src/app/modules/auth/register/register-routing.module.ts b/myteamwallet_frontend/src/app/modules/auth/register/register-routing.module.ts deleted file mode 100644 index 97d7dd6..0000000 --- a/myteamwallet_frontend/src/app/modules/auth/register/register-routing.module.ts +++ /dev/null @@ -1,24 +0,0 @@ -import { NgModule } from '@angular/core'; -import { RouterModule, Routes } from '@angular/router'; -import { NoTokenProvidedComponent } from './components/no-token-provided/no-token-provided.component'; -import { RegisterBaseComponent } from './components/register-base/register-base.component'; -import { RegisterComponent } from './components/register/register.component'; - -const routes: Routes = [ - { path: '', component: RegisterBaseComponent, children: [ - { - path: 'no-token', - component: NoTokenProvidedComponent - }, - { - path: ':token', - component: RegisterComponent - } - ] } -]; - -@NgModule({ - imports: [RouterModule.forChild(routes)], - exports: [RouterModule] -}) -export class RegisterRoutingModule { } diff --git a/myteamwallet_frontend/src/app/modules/auth/register/register.module.ts b/myteamwallet_frontend/src/app/modules/auth/register/register.module.ts deleted file mode 100644 index 764ae3e..0000000 --- a/myteamwallet_frontend/src/app/modules/auth/register/register.module.ts +++ /dev/null @@ -1,35 +0,0 @@ -import { NgModule } from '@angular/core'; -import { CommonModule } from '@angular/common'; - -import { RegisterRoutingModule } from './register-routing.module'; -import { NoTokenProvidedComponent } from './components/no-token-provided/no-token-provided.component'; -import { RegisterBaseComponent } from './components/register-base/register-base.component'; -import { MatCardModule } from '@angular/material/card'; -import { RegisterComponent } from './components/register/register.component'; -import { RegisterFormComponent } from './components/register/register-form/register-form.component'; -import { ReactiveFormsModule } from '@angular/forms'; -import { MatFormFieldModule } from '@angular/material/form-field'; -import { MatInputModule } from '@angular/material/input'; -import { MatButtonModule } from '@angular/material/button'; -import { MatSnackBarModule } from '@angular/material/snack-bar'; - - -@NgModule({ - declarations: [ - NoTokenProvidedComponent, - RegisterBaseComponent, - RegisterComponent, - RegisterFormComponent - ], - imports: [ - CommonModule, - RegisterRoutingModule, - MatCardModule, - MatFormFieldModule, - MatInputModule, - ReactiveFormsModule, - MatButtonModule, - MatSnackBarModule - ] -}) -export class RegisterModule { } diff --git a/myteamwallet_frontend/src/app/modules/home/dashboard/dashboard.component.html b/myteamwallet_frontend/src/app/modules/home/dashboard/dashboard.component.html deleted file mode 100644 index 4fb291c..0000000 --- a/myteamwallet_frontend/src/app/modules/home/dashboard/dashboard.component.html +++ /dev/null @@ -1,34 +0,0 @@ - -
- Welcome {{ name }}, your Role is {{ role }} -
- - -
-
Deine Teams
-
Klicke auf eins der Teams um es zu verwalten
-
-
-
- {{ p.team.name }} -
-
Balance: {{ p.team.balance | currency:'EUR' }}
-
- {{ p.firstName }} {{ p.lastName }} -
-
- Rolle: {{ p.teamRole.name | translate }} -
- -
-
- - -
-
-
- diff --git a/myteamwallet_frontend/src/app/modules/home/dashboard/dashboard.component.scss b/myteamwallet_frontend/src/app/modules/home/dashboard/dashboard.component.scss deleted file mode 100644 index 67a0621..0000000 --- a/myteamwallet_frontend/src/app/modules/home/dashboard/dashboard.component.scss +++ /dev/null @@ -1,38 +0,0 @@ - - -.icons { - display: flex; - align-items: center; - opacity: 0; - pointer-events: none; - transition: opacity 0.2s ease-in-out; -} - -.team_row { - padding: 2px 8px; - border: 1px solid #ccc; - border-radius: 4px; - align-items: stretch; - - &:hover > .icons { - opacity: 1; - pointer-events: all; - } - - &:not(:first-of-type) { - margin-top: 8px; - } -} - -@media screen and (max-width: 700px) { - .icons { - opacity: 1; - pointer-events: all; - align-items: stretch; - - button { - height: inherit; - width: 48px; - } - } -} \ No newline at end of file diff --git a/myteamwallet_frontend/src/app/modules/home/dashboard/dashboard.component.spec.ts b/myteamwallet_frontend/src/app/modules/home/dashboard/dashboard.component.spec.ts deleted file mode 100644 index f041725..0000000 --- a/myteamwallet_frontend/src/app/modules/home/dashboard/dashboard.component.spec.ts +++ /dev/null @@ -1,25 +0,0 @@ -import { HttpClientModule } from '@angular/common/http'; -import { ComponentFixture, TestBed } from '@angular/core/testing'; - -import { DashboardComponent } from './dashboard.component'; - -describe('DashboardComponent', () => { - let component: DashboardComponent; - let fixture: ComponentFixture; - - beforeEach(async () => { - await TestBed.configureTestingModule({ - declarations: [ DashboardComponent ], - imports: [ HttpClientModule ] - }) - .compileComponents(); - - fixture = TestBed.createComponent(DashboardComponent); - component = fixture.componentInstance; - fixture.detectChanges(); - }); - - it('should create', () => { - expect(component).toBeTruthy(); - }); -}); diff --git a/myteamwallet_frontend/src/app/modules/home/dashboard/dashboard.component.ts b/myteamwallet_frontend/src/app/modules/home/dashboard/dashboard.component.ts deleted file mode 100644 index 101f9e7..0000000 --- a/myteamwallet_frontend/src/app/modules/home/dashboard/dashboard.component.ts +++ /dev/null @@ -1,60 +0,0 @@ -import { Component } from '@angular/core'; -import { Router } from '@angular/router'; -import { TranslateModule, TranslateService } from '@ngx-translate/core'; -import { UserService } from 'src/app/core/user/user.service'; -import { AuthService } from '../../auth.service'; -import { CommonModule } from '@angular/common'; -import { Player } from 'src/app/model'; -import { MatButtonModule } from '@angular/material/button'; -import { MatIconModule } from '@angular/material/icon'; - -@Component({ - selector: 'app-dashboard', - templateUrl: './dashboard.component.html', - styleUrls: ['./dashboard.component.scss'], - standalone: true, - imports: [ CommonModule, TranslateModule, MatButtonModule, MatIconModule ] -}) -export class DashboardComponent { - - link: string = window.location.host; - - constructor( - private authService: AuthService - , private userService: UserService - , private router: Router - , public translate: TranslateService) {} - - - - get role(): string { - - if (!this.authService || !this.authService.isLoggedIn()) { return ''} - - return this.authService.user.role.name; - } - - get name(): string { - if (!this.authService || !this.authService.isLoggedIn()) { return ''} - - return this.authService.user.firstName + ' ' + this.authService.user.lastName; - } - - get players(): any[] { - return this.userService.players; - } - - onTeamClick(team: any) { - this.router.navigate([`dashboard/${team.alias}/details`]) - } - - onLinkClick(event: any) { - event.stopPropagation(); - return; - } - - async copyLink(p: Player) { - const link = `https://${this.link}/teams/${p.team.alias}` - await navigator.clipboard.writeText(link); - } -} diff --git a/myteamwallet_frontend/src/app/modules/home/dashboard/dashboard.routes.ts b/myteamwallet_frontend/src/app/modules/home/dashboard/dashboard.routes.ts deleted file mode 100644 index 93f6319..0000000 --- a/myteamwallet_frontend/src/app/modules/home/dashboard/dashboard.routes.ts +++ /dev/null @@ -1,7 +0,0 @@ -import { Routes } from '@angular/router'; - -export const dashboardRoutes: Routes = [ - { path: '', loadComponent: () => import('./dashboard.component').then(m => m.DashboardComponent) }, - { path: ':id/details', loadComponent: () => import('./team-details/team-details.component').then(m => m.TeamDetailsComponent) } -]; - diff --git a/myteamwallet_frontend/src/app/modules/home/dashboard/team-details/player-card/player-card.component.html b/myteamwallet_frontend/src/app/modules/home/dashboard/team-details/player-card/player-card.component.html deleted file mode 100644 index 63efba2..0000000 --- a/myteamwallet_frontend/src/app/modules/home/dashboard/team-details/player-card/player-card.component.html +++ /dev/null @@ -1,11 +0,0 @@ -
- {{ playerInitials }} -
- -
- -
{{ player.firstName}} {{ player.lastName }}
-
{{ player.teamRole.name | translate }}
- -
{{ 'balance' | translate }}: {{ player.balance | currency:'EUR' }}
-
\ No newline at end of file diff --git a/myteamwallet_frontend/src/app/modules/home/dashboard/team-details/player-card/player-card.component.scss b/myteamwallet_frontend/src/app/modules/home/dashboard/team-details/player-card/player-card.component.scss deleted file mode 100644 index c9627aa..0000000 --- a/myteamwallet_frontend/src/app/modules/home/dashboard/team-details/player-card/player-card.component.scss +++ /dev/null @@ -1,31 +0,0 @@ -:host { - display: flex; - flex: 250px 1 1; - cursor: pointer; -} - -.player_icon { - width: 48px; - height: 48px; - line-height: 48px; - text-align: center; - font-size: 20px; - border-radius: 50%; - border: 1px solid #ccc - -} -.content{ - margin-left: 12px; -} - -.name { - font-weight: bold; -} - -.line_through{ - text-decoration: line-through; -} - -.inactive { - opacity: 0.5; -} \ No newline at end of file diff --git a/myteamwallet_frontend/src/app/modules/home/dashboard/team-details/player-card/player-card.component.spec.ts b/myteamwallet_frontend/src/app/modules/home/dashboard/team-details/player-card/player-card.component.spec.ts deleted file mode 100644 index 99efc21..0000000 --- a/myteamwallet_frontend/src/app/modules/home/dashboard/team-details/player-card/player-card.component.spec.ts +++ /dev/null @@ -1,23 +0,0 @@ -import { ComponentFixture, TestBed } from '@angular/core/testing'; - -import { PlayerCardComponent } from './player-card.component'; - -describe('PlayerCardComponent', () => { - let component: PlayerCardComponent; - let fixture: ComponentFixture; - - beforeEach(async () => { - await TestBed.configureTestingModule({ - declarations: [ PlayerCardComponent ] - }) - .compileComponents(); - - fixture = TestBed.createComponent(PlayerCardComponent); - component = fixture.componentInstance; - fixture.detectChanges(); - }); - - it('should create', () => { - expect(component).toBeTruthy(); - }); -}); diff --git a/myteamwallet_frontend/src/app/modules/home/dashboard/team-details/player-card/player-card.component.ts b/myteamwallet_frontend/src/app/modules/home/dashboard/team-details/player-card/player-card.component.ts deleted file mode 100644 index 355306b..0000000 --- a/myteamwallet_frontend/src/app/modules/home/dashboard/team-details/player-card/player-card.component.ts +++ /dev/null @@ -1,27 +0,0 @@ -import { CommonModule } from '@angular/common'; -import { Component, Input, OnInit, Output } from '@angular/core'; -import { TranslateModule } from '@ngx-translate/core'; -import { Player } from 'src/app/model'; - -@Component({ - selector: 'app-player-card', - templateUrl: './player-card.component.html', - styleUrls: ['./player-card.component.scss'], - standalone: true, - imports: [CommonModule, TranslateModule] -}) -export class PlayerCardComponent implements OnInit { - - @Input() player!: Player; - - - ngOnInit(): void {} - - - get playerInitials(): string { - if (!this.player) { return ' '; } - - return this.player.firstName.substring(0, 1) + this.player.lastName.substring(0, 1); - } - -} diff --git a/myteamwallet_frontend/src/app/modules/home/dashboard/team-details/player-card/player-details/player-details.component.html b/myteamwallet_frontend/src/app/modules/home/dashboard/team-details/player-card/player-details/player-details.component.html deleted file mode 100644 index aee3c79..0000000 --- a/myteamwallet_frontend/src/app/modules/home/dashboard/team-details/player-card/player-details/player-details.component.html +++ /dev/null @@ -1,9 +0,0 @@ -

{{ player.firstName }} {{ player.lastName }}

- -
- -
- Spieler aktiv -
- -
\ No newline at end of file diff --git a/myteamwallet_frontend/src/app/modules/home/dashboard/team-details/player-card/player-details/player-details.component.scss b/myteamwallet_frontend/src/app/modules/home/dashboard/team-details/player-card/player-details/player-details.component.scss deleted file mode 100644 index 55b1cda..0000000 --- a/myteamwallet_frontend/src/app/modules/home/dashboard/team-details/player-card/player-details/player-details.component.scss +++ /dev/null @@ -1,10 +0,0 @@ -:host { - display: flex; - overflow: hidden; - flex-direction: column; - padding: 8px 14px 8px 14px; -} - -.body { - padding: 6px 12px 24px 6px; -} \ No newline at end of file diff --git a/myteamwallet_frontend/src/app/modules/home/dashboard/team-details/player-card/player-details/player-details.component.ts b/myteamwallet_frontend/src/app/modules/home/dashboard/team-details/player-card/player-details/player-details.component.ts deleted file mode 100644 index 106cfb5..0000000 --- a/myteamwallet_frontend/src/app/modules/home/dashboard/team-details/player-card/player-details/player-details.component.ts +++ /dev/null @@ -1,59 +0,0 @@ -import { CommonModule } from '@angular/common'; -import { HttpClient } from '@angular/common/http'; -import { Component, EventEmitter, inject, Inject, Output } from '@angular/core'; -import { MAT_DIALOG_DATA } from '@angular/material/dialog'; -import { MatSlideToggleModule } from '@angular/material/slide-toggle'; -import { MatSnackBar } from '@angular/material/snack-bar'; -import { Player } from '../../../../../../model'; -import { AuthService } from 'src/app/modules/auth.service'; -import { environment } from 'src/environments/environment'; - -@Component({ - selector: 'app-player-details', - templateUrl: './player-details.component.html', - styleUrls: ['./player-details.component.scss'], - standalone: true, - imports: [CommonModule, MatSlideToggleModule] -}) -export class PlayerDetailsComponent { - - player: Player; - loading: boolean = false; - private auth: AuthService = inject(AuthService); - - @Output('onReload') changed = new EventEmitter(); - - constructor(@Inject(MAT_DIALOG_DATA) public data: DialogData, private http: HttpClient, private snackBar: MatSnackBar) { - this.player = data.player; - } - - - get isAdmin() { - return this.auth.isAdmin; - } - - setPlayerActive(event: any) { - this.loading = true; - const copy = { ...this.player } - this.player.active = event.checked; - this.http.put(`${environment.apiUrl}teams/${this.player.team.id}/players`, this.player).subscribe({ - next: r => { - this.changed.emit(); - }, - error: e => { - this.player.active = copy.active; - - this.snackBar.open('Spieler konnte nicht aktualisiert werden', undefined, { - duration: 5000, - panelClass: 'snackbar_error' - }) - - }, - complete: () => { this.loading = false; } - }) - } -} - -interface DialogData { - player: Player; -} diff --git a/myteamwallet_frontend/src/app/modules/home/dashboard/team-details/team-details.component.html b/myteamwallet_frontend/src/app/modules/home/dashboard/team-details/team-details.component.html deleted file mode 100644 index c5270be..0000000 --- a/myteamwallet_frontend/src/app/modules/home/dashboard/team-details/team-details.component.html +++ /dev/null @@ -1,92 +0,0 @@ -
-
- {{ team.name }} ({{ translateRolename(roleName) }}) -
Spieleranzahl: {{ team.players?.length }} (aktiv: {{ activePlayerCount }})
-
-
-
Saldo: {{ team.balance | currency:'EUR' }}
-
Ausstehend: {{ team.outstanding | currency:'EUR' }} -
-
- -
- - - - - - - -
- - -
- - - - - s - - -
- -
-
-
- - - -
-
-
-
Alle
-
- -
- - Suche - - - - - - -
{{ p.firstName}} {{ p.lastName }} - Ich
-
{{ p.balance | currency:'EUR'}}
- -
- -
- -
-
-
-
- -
- -
- -
- -
- - {{players.selectedOptions.selected.length}} Spieler gewählt - Spieler für einen Eintrag wählen - -
-
- - - - - - - \ No newline at end of file diff --git a/myteamwallet_frontend/src/app/modules/home/dashboard/team-details/team-details.component.scss b/myteamwallet_frontend/src/app/modules/home/dashboard/team-details/team-details.component.scss deleted file mode 100644 index ec220ce..0000000 --- a/myteamwallet_frontend/src/app/modules/home/dashboard/team-details/team-details.component.scss +++ /dev/null @@ -1,59 +0,0 @@ -.title-row { - display: flex; - justify-content: space-between; -} - -:host { - display: flex; - flex-direction: column; - overflow: hidden; - flex: 1 1 auto; -} - -.list{ - flex: 1 1 100%; - overflow: auto; -} - -.back { - width: 28px; - height: 28px; - background-color: red; - cursor: pointer; -} - -.select_all { - margin-right: 52px; - text-decoration: underline; - cursor: pointer; - color: #646464; - - &:hover { - color: black; - } -} - -.buttons { - margin-top: 6px; -} - -.highlight { - // text-decoration: wavy; - font-style: italic; -} - -mat-tab-group { - flex: 1 1 100%; - height: 257px; -} - -.mat-tab__content { - height: 100%; - overflow: hidden; - display: flex; - flex-direction: column; -} - -.break { - flex-wrap: wrap; -} \ No newline at end of file diff --git a/myteamwallet_frontend/src/app/modules/home/dashboard/team-details/team-details.component.spec.ts b/myteamwallet_frontend/src/app/modules/home/dashboard/team-details/team-details.component.spec.ts deleted file mode 100644 index 278b460..0000000 --- a/myteamwallet_frontend/src/app/modules/home/dashboard/team-details/team-details.component.spec.ts +++ /dev/null @@ -1,93 +0,0 @@ -import { HttpClient } from '@angular/common/http'; -import { ComponentFixture, TestBed } from '@angular/core/testing'; -import { MatListModule } from '@angular/material/list'; -import { By } from '@angular/platform-browser'; -import { ActivatedRoute } from '@angular/router'; -import { of } from 'rxjs'; - -import { TeamDetailsComponent } from './team-details.component'; - -describe('TeamDetailsComponent', () => { - let component: TeamDetailsComponent; - let fixture: ComponentFixture; - const paramMap = jasmine.createSpyObj('ParamMap', ['get']) - const fakeActivatedRoute = { - snapshot: { paramMap: paramMap } - } - - paramMap.get.and.returnValue('9999'); - - const mockhttp = jasmine.createSpyObj('HttpClient', ['get']); - mockhttp.get.and.returnValue(of({ - alias: "9999", - balance: 48.09, - name: "Development Team", - outstanding: -582.00, - players: [{id: 1, firstName: 'Filiberto', lastName: 'Spencer', balance: -32.97}, {id: 2, firstName: 'Adam', lastName: 'West', balance: -50}], - settings: [] - })) - - - beforeEach(async () => { - await TestBed.configureTestingModule({ - declarations: [ TeamDetailsComponent ], - providers: [ - {provide: ActivatedRoute, useValue: fakeActivatedRoute}, - {provide: HttpClient, useValue: mockhttp}, - ], - imports: [ MatListModule ] - }) - .compileComponents(); - - fixture = TestBed.createComponent(TeamDetailsComponent); - component = fixture.componentInstance; - fixture.detectChanges(); - }); - - it('should create', () => { - expect(component).toBeTruthy(); - }); - - it('should extract the id from the url', () => { - expect(component.id).toEqual("9999"); - }); - - it('should load the teams data', () => { - expect(component.team).not.toBeNull(); - }); - - it('should display name and alias', () => { - const nameElement = fixture.debugElement.query(By.css('#teamName')); - const text = (nameElement.nativeElement as HTMLElement).textContent; - expect(text).toEqual(`${component.team.name} (${component.team.alias})`) - - // const htmlList = (list.nativeElement as HTMLElement).children; - // expect(htmlList).not.toBeNull(); - // expect(htmlList.length).toBe(4) - }); - - it('should display a list with players', () => { - const element = fixture.debugElement.query(By.css('#playerlist')); - const ch = (element.nativeElement as HTMLElement).children; - expect(ch.length).toBe(component.team.players.length); - for (let index = 0; index < component.team.players.length; index++) { - const playerName = ch[index].textContent?.trim(); - const expectedName = `${component.team.players[index].firstName} ${component.team.players[index].lastName}`; - expect(playerName).toEqual(expectedName) - } - }); - - it('button should be disabled', () => { - const element = fixture.debugElement.query(By.css('#buttonNewTransaction')); - expect(element.nativeElement.disabled).toBeTrue(); - }); - - it('should enable the button when selecting a player', () => { - const element = fixture.debugElement.query(By.css('.mdc-checkbox')); - element.nativeElement.click(); - fixture.detectChanges(); - const buttonelement = fixture.debugElement.query(By.css('#buttonNewTransaction')); - expect(buttonelement.nativeElement.disabled).toBeFalse(); - - }) -}); \ No newline at end of file diff --git a/myteamwallet_frontend/src/app/modules/home/dashboard/team-details/team-details.component.ts b/myteamwallet_frontend/src/app/modules/home/dashboard/team-details/team-details.component.ts deleted file mode 100644 index 88cbd1f..0000000 --- a/myteamwallet_frontend/src/app/modules/home/dashboard/team-details/team-details.component.ts +++ /dev/null @@ -1,303 +0,0 @@ -import { Component, createNgModuleRef, Injector, OnInit, ViewChild } from '@angular/core'; -import { MatDialog } from '@angular/material/dialog'; -import { MatSnackBar } from '@angular/material/snack-bar'; -import { ActivatedRoute, Router } from '@angular/router'; -import { Player } from 'src/app/model'; -import { AuthService } from 'src/app/modules/auth.service'; -import { Team } from 'src/app/modules/teams/model/team'; -import { TeamInvite } from 'src/app/modules/teams/model/team-invite'; -import { TeamsService } from 'src/app/modules/teams/teams.service'; -import { NewTransactionDialogComponent, TeamTransactionDialogComponent } from 'src/app/shared'; -import { CreatePlayerDialogComponent } from 'src/app/shared/dialog/create-player-dialog/create-player.dialog.component'; -import { PrivilegesInfoDialogComponent } from 'src/app/shared/dialog/privileges-info-dialog/privileges-info-dialog.component'; -import { PlayerDetailsComponent } from './player-card/player-details/player-details.component'; -import { CommonModule } from '@angular/common'; -import { MatDividerModule } from '@angular/material/divider'; -import { MatButtonModule } from '@angular/material/button'; -import { MatIconModule } from '@angular/material/icon'; -import { MatMenuModule } from '@angular/material/menu'; -import { MatTabsModule } from '@angular/material/tabs'; -import { PlayerCardComponent } from './player-card/player-card.component'; -import { MatFormFieldModule } from '@angular/material/form-field'; -import { MatListModule } from '@angular/material/list'; -import { MatSlideToggleModule } from '@angular/material/slide-toggle'; -import { MatInputModule } from '@angular/material/input'; -import { FormsModule, ReactiveFormsModule } from '@angular/forms'; -import { MatProgressSpinnerModule } from '@angular/material/progress-spinner'; - -@Component({ - selector: 'app-team-details', - templateUrl: './team-details.component.html', - styleUrls: ['./team-details.component.scss'], - standalone: true, - imports: [ - CommonModule - , ReactiveFormsModule - , FormsModule - , MatProgressSpinnerModule - , MatDividerModule - , MatButtonModule - , MatIconModule - , MatMenuModule - , MatTabsModule - , MatFormFieldModule - , MatListModule - , MatSlideToggleModule - , MatInputModule - , PlayerCardComponent - ] -}) -export class TeamDetailsComponent implements OnInit { - id: string | null = null; - - team: Team | undefined; - - correspondingPlayer: Player | undefined; - - canDoTransactions: boolean = false; - canInvite: boolean = false; - roleName: string = ''; - - isLoading: boolean = true; - - selectedPlayers: Player[] = []; - - usersPlayers: Player[] = []; - - @ViewChild('players') players: any; - - constructor(private route: ActivatedRoute, private teamsService: TeamsService, private authService: AuthService, - private router: Router, public dialog: MatDialog, private injector: Injector, private _snackBar: MatSnackBar) {} - - ngOnInit(): void { - this.id = this.route.snapshot.paramMap.get('id'); - - if (this.id) { - this.loadTeamDetails(); - } - } - - protected loadTeamDetails() { - if (!this.id) { return; } - this.teamsService.loadTeamDetails(this.id).subscribe(result => { - this.team = result; - this.findCorrespondingPlayer(); - this.isLoading = false; - }) - } - - back() { - this.router.navigate(['../dashboard']) - } - - openDialog(): void { - - const dialogRef = this.dialog.open(NewTransactionDialogComponent, { - data: { - team: this.team, - players: this.selectedPlayers - } - }); - - dialogRef.afterClosed().subscribe(async result => { - if (result && result.length > 0) { - this.isLoading = true; - this.teamsService.createTransactions(result).subscribe(res => { - if (res && res.length > 0) { - this.loadTeamDetails(); - } - }) - - } - }); - } - - - openTeamTransactionDialog() { - if (!this.team) { return; } - const dialogRef = this.dialog.open(TeamTransactionDialogComponent, { - data: { - teamId: this.team.id - } - }); - - dialogRef.afterClosed().subscribe(async result => { - - if (result) { this.saveTeamTransaction(result); } - }); - } - - saveTeamTransaction(transaction: any) { - this.isLoading = true; - this.teamsService.createTeamTransaction(transaction).subscribe(res => { - if (res && res['id']) { - this.loadTeamDetails(); - } - }) - } - - selectAll() { - if (this.team == null || this.team.players == null) { return; } - if (this.selectedPlayers.length < this.team.players.length) { - this.selectedPlayers = []; - for (let p of this.team.players) { - this.selectedPlayers.push(p); - } - } else { - this.selectedPlayers = []; - } - - } - - onAllClick() { - if (!this.team) { return; } - const dialogRef = this.dialog.open(NewTransactionDialogComponent, { - data: { - team: this.team, - players: this.selectedPlayers, - all: this.team.players?.length == this.selectedPlayers.length - } - }); - } - - onAddPlayerClick() { - if (!this.team) { return; } - const dialogRef = this.dialog.open(CreatePlayerDialogComponent, { - data: { }, - width: '350px' - }); - - dialogRef.afterClosed().subscribe(result => { - if (result && this.team) { - this.teamsService.createNewPlayer(this.team.id, result).subscribe({ - next: () => { this.loadTeamDetails()}, - error: () => { this.onPlayerCreateError();} - }) - } - }) - } - - onPlayerCreateError() { - this._snackBar.open('Spieler konnte nicht erstellt werden', undefined, { - duration: 10000, - panelClass: 'snackbar_error' - }) - } - - async onCreateLink() { - if (!this.team) { return; } - - try { - const invite: TeamInvite = { - teamId: this.team.id, - teamName: this.team.name, - playerId: this.selectedPlayers[0].id, - playerName: this.selectedPlayers[0].firstName + ' ' + this.selectedPlayers[0].lastName - } - const token = await this.getInviteFromServer(invite); - - const link = location.origin + '/auth/register/' + token - - await navigator.clipboard.writeText(link); - this._snackBar.open('Einladungslink für ' + invite.playerName + ' in die Zwischenablage kopiert. Der Link ist auf den gewählten Spieler personalisiert und darf nicht an mehrere Spieler verteilt werden.', undefined, { - duration: 10000, - - }); - - } catch { - this._snackBar.open('Der Einladungslink konnte nicht erzeugt werden.', undefined, { - panelClass: 'snackbar_error', - duration: 5000, - }); - } - } - - private async getInviteFromServer(invite: TeamInvite): Promise { - return new Promise((resolve, reject) => { - this.teamsService.createRegisterLink(invite).subscribe({ - next: token => { return resolve(token.token); }, - error: () => { return reject(null); } - }) - }) - } - - findCorrespondingPlayer() { - if (!this.team || !this.team.players) { return; } - const id = this.authService.user?.id; - this.usersPlayers = this.team.players.filter((p: any) => { return p.user?.id == id }); - this.canInvite = this.authService.isAdmin || this.usersPlayers.find(p => p.teamRole.id > 2) != null; - this.canDoTransactions = this.authService.isAdmin || this.usersPlayers.find(p => p.teamRole.id >= 2) != null; - - this.roleName = this.usersPlayers.reduce((prev, curr) => { return (prev.teamRole.id > curr.teamRole.id) ? prev : curr})?.teamRole.name; - - for (let u of this.usersPlayers) { - u.usersPlayer = true; - } - } - - onShowPrivileges() { - const dialogRef = this.dialog.open(PrivilegesInfoDialogComponent, { - data: null - }); - - - } - - translateRolename(roleName: string): string { - switch (roleName) { - case 'treasurer': - return 'Kassenwart' - case 'scnd_treasurer': - return 'zweiter Kassenwart' - case 'captain': - return 'Kapitän' - case 'coach': - return 'Trainer' - default: - return 'Spieler' - } - } - - - - async onShowTeamTransactions() { - if (!this.team) { return; } - - const { ShowTeamTransactionsComponent } = await import( - 'src/app/shared/dialog/show-team-transactions/show-team-transactions.component' - ); - - this.dialog.open(ShowTeamTransactionsComponent, { - data: { - id: this.team.id - } - }); - } - - openPlayerdetails(player: Player) { - if (!player) { return; } - const dialogRef = this.dialog.open(PlayerDetailsComponent, { - data: { - player - } - }); - - dialogRef.componentInstance.changed.subscribe(() => { - this.loadTeamDetails(); - }) - } - - filter(event: any) { - const search = event.target.value; - const s = search.toLowerCase().trim(); - this.team?.players?.map(p => { - const n = p.firstName.toLowerCase().trim() + '' + p.lastName.toLowerCase().trim(); - p.hide = !n.includes(s); - }); - } - - get activePlayerCount(): number { - if (!this.team || !this.team.players) { return 0; } - return this.team.players.filter(p => p.active).length; - } -} diff --git a/myteamwallet_frontend/src/app/modules/home/home.component.html b/myteamwallet_frontend/src/app/modules/home/home.component.html deleted file mode 100644 index a47e106..0000000 --- a/myteamwallet_frontend/src/app/modules/home/home.component.html +++ /dev/null @@ -1,9 +0,0 @@ - - {{ username }} - - - - -
- -
\ No newline at end of file diff --git a/myteamwallet_frontend/src/app/modules/home/home.component.scss b/myteamwallet_frontend/src/app/modules/home/home.component.scss deleted file mode 100644 index 0616313..0000000 --- a/myteamwallet_frontend/src/app/modules/home/home.component.scss +++ /dev/null @@ -1,18 +0,0 @@ -.content_container { - display: flex; - flex-direction: column; - padding: 8px; - flex: 1 1 auto; - overflow: hidden; - - .card { - padding: 12px; - } -} - -:host { - height: 100%; - display: flex; - flex-direction: column; - overflow: hidden; -} \ No newline at end of file diff --git a/myteamwallet_frontend/src/app/modules/home/home.component.ts b/myteamwallet_frontend/src/app/modules/home/home.component.ts deleted file mode 100644 index ca5b4b0..0000000 --- a/myteamwallet_frontend/src/app/modules/home/home.component.ts +++ /dev/null @@ -1,73 +0,0 @@ -import { Component, inject } from '@angular/core'; -import { Router, RouterModule } from '@angular/router'; -import { UserService } from 'src/app/core/user/user.service'; -import { AuthService } from '../auth.service'; -import { CommonModule } from '@angular/common'; -import { MatToolbarModule } from '@angular/material/toolbar'; -import { MatButtonModule } from '@angular/material/button'; - -@Component({ - selector: 'app-home', - templateUrl: './home.component.html', - styleUrls: ['./home.component.scss'], - standalone: true, - imports: [ - CommonModule, - MatToolbarModule, - RouterModule, - MatButtonModule - ] -}) -export class HomeComponent { - private authService: AuthService = inject(AuthService); - private userService: UserService = inject(UserService); - private router: Router = inject(Router); - - - constructor( - ) {} - - - ngOnInit(): void { - this.loginFromLocalStorage(); - - } - - get username(): string { - if (!this.authService || !this.authService.isLoggedIn()) { return ''} - return this.authService.user.firstName + ' ' + this.authService.user.lastName - } - - logout() { - this.authService.logout(); - } - - get isLoggedIn(): boolean { - return this.authService.isLoggedIn() - } - - private async loginFromLocalStorage() { - const success = await this.authService.loginFromLocalStorage(); - - if (!success) { - this.router.navigate(['/auth']).then(); - return; - } - - if (this.authService && this.authService.isLoggedIn()) { - this.userService.loadTeamsOfUser(); - } - - if (this.router.url == '/') { - this.router.navigate(['/dashboard']).then(); - } - } - - async login() { - - - // this.router.navigate(['/auth']).then(); - - } - -} diff --git a/myteamwallet_frontend/src/app/modules/home/home.routes.ts b/myteamwallet_frontend/src/app/modules/home/home.routes.ts deleted file mode 100644 index d8bca69..0000000 --- a/myteamwallet_frontend/src/app/modules/home/home.routes.ts +++ /dev/null @@ -1,9 +0,0 @@ -import { AuthGuard } from 'src/app/core/guards/auth.guard'; -import { Route } from '@angular/router'; -import { dashboardRoutes } from './dashboard/dashboard.routes'; - -export const homeRoutes: Route[] = [ - { path: '', loadComponent: () => import('./home.component').then(m => m.HomeComponent), children: [ - { path: 'dashboard', canLoad: [AuthGuard], children: dashboardRoutes }, - ] }, -]; \ No newline at end of file diff --git a/myteamwallet_frontend/src/app/modules/teams/model/team-invite.ts b/myteamwallet_frontend/src/app/modules/teams/model/team-invite.ts deleted file mode 100644 index e8ae1b3..0000000 --- a/myteamwallet_frontend/src/app/modules/teams/model/team-invite.ts +++ /dev/null @@ -1,6 +0,0 @@ -export interface TeamInvite { - teamId: number; - teamName: string; - playerId: number; - playerName: string; -} diff --git a/myteamwallet_frontend/src/app/modules/teams/model/team.ts b/myteamwallet_frontend/src/app/modules/teams/model/team.ts deleted file mode 100644 index 37c1737..0000000 --- a/myteamwallet_frontend/src/app/modules/teams/model/team.ts +++ /dev/null @@ -1,11 +0,0 @@ -import { Player } from 'src/app/model'; - -export interface Team { - id: number; - alias: string; - balance: number; - name: string; - outstanding?: number; - players?: Player[]; - settings?: any[]; -} \ No newline at end of file diff --git a/myteamwallet_frontend/src/app/modules/teams/overview/details/details.component.html b/myteamwallet_frontend/src/app/modules/teams/overview/details/details.component.html deleted file mode 100644 index b4ebc9d..0000000 --- a/myteamwallet_frontend/src/app/modules/teams/overview/details/details.component.html +++ /dev/null @@ -1,48 +0,0 @@ - - -
-
{{ data.user.firstName }}: {{ data.user.balance | currency:'EUR' }}
-
- -@if(isLoading) { - -} @else if (transactions.length > 0) { - - - - {{ transaction.date | date }} - - - - - {{transaction.amount | currency:'EUR' }} - - {{ transaction.type.name | translate }} - - - {{ transaction.note }} - - - - - -} @else { -
Es sind keine Einträge vorhanden
-} - - - - \ No newline at end of file diff --git a/myteamwallet_frontend/src/app/modules/teams/overview/details/details.component.scss b/myteamwallet_frontend/src/app/modules/teams/overview/details/details.component.scss deleted file mode 100644 index 128e0cb..0000000 --- a/myteamwallet_frontend/src/app/modules/teams/overview/details/details.component.scss +++ /dev/null @@ -1,61 +0,0 @@ -:host { - display: flex; - flex-direction: column; - height: 100%; - overflow: hidden; - min-height: 200px; -} - -.row { - display: flex; -} - -.list { - max-height: 500px; - overflow: auto; -} - -.amount { - color: rgb(49, 119, 49); -} - -.negative { - color: rgb(202, 62, 62); -} - -.actions { - display: flex; - flex-direction: row; - justify-content: space-between; - padding-left: 8px; - align-items: center; - - .name { - font-weight: bold; - } - - &__buttons { - display: flex; - flex-direction: row; - padding-right: 2px; - button { - margin: 4px 2px; - } - } -} - -.balance { - - color: #fff; - padding: 12px; - text-align: center; - font-size: 1.5rem; - - &.pos { - background-color: rgb(49, 119, 49); - } - - &.neg { - background-color: rgb(202, 62, 62); - } -} \ No newline at end of file diff --git a/myteamwallet_frontend/src/app/modules/teams/overview/details/details.component.spec.ts b/myteamwallet_frontend/src/app/modules/teams/overview/details/details.component.spec.ts deleted file mode 100644 index 63aa403..0000000 --- a/myteamwallet_frontend/src/app/modules/teams/overview/details/details.component.spec.ts +++ /dev/null @@ -1,81 +0,0 @@ -import { HttpClientModule } from '@angular/common/http'; -import { ComponentFixture, TestBed } from '@angular/core/testing'; -import { MatDialogModule, MatDialogRef, MAT_DIALOG_DATA } from '@angular/material/dialog'; -import { MatListModule } from '@angular/material/list'; -import { By } from '@angular/platform-browser'; -import { TeamsService } from '../../teams.service'; - -import { DetailsComponent } from './details.component'; - -describe('DetailsComponent', () => { - let component: DetailsComponent; - let fixture: ComponentFixture; - const mockTeamService = jasmine.createSpyObj('TeamsService', ['loadTransactionsOfUser']); - mockTeamService.selectedUserTransaction = [ - {id: 1, note: 'dev1', createdAt: '', date: '', amount: 100, type: {id: 1}}, - {id: 2, note: 'dev2', createdAt: '', date: '', amount: 100, type: {id: 1}}, - {id: 3, note: 'dev3', createdAt: '', date: '', amount: 100, type: {id: 1}}, - {id: 4, note: 'dev4', createdAt: '', date: '', amount: 100, type: {id: 1}}, - ]; - - beforeEach(async () => { - await TestBed.configureTestingModule({ - declarations: [ DetailsComponent ], - imports: [ MatDialogModule, HttpClientModule, MatListModule ], - providers: [ - { provide: MAT_DIALOG_DATA, useValue: {} }, - { provide: MatDialogRef, useValue: {} }, - { provide: TeamsService, useValue: mockTeamService } - ] - }) - .compileComponents(); - - fixture = TestBed.createComponent(DetailsComponent); - - component = fixture.componentInstance; - - component.data.user = { - id: 2, - balance: 46.64, - firstName: 'Rover', - lastName: 'Stiedeman', - user: null - } - - fixture.detectChanges(); - }); - - it('should create', () => { - expect(component).toBeTruthy(); - }); - - it('should initialise the user', () => { - - - expect(component.data.user).not.toBeNull(); - }) - - it('should have a users transactions', () => { - expect(component.transactions).not.toBeNull(); - expect(component.transactions.length).toBe(4) - }) - - it('should display the users balance', () => { - const balance = 46.64; - component.data.user.balance = balance; - const el = fixture.debugElement.query(By.css('#userBalance')); - expect(el).not.toBeNull(); - expect(el.nativeElement.textContent.trim()).toEqual('Rover: €' + balance); - }) - - it('should display users transactions', () => { - const list = fixture.debugElement.query(By.css('#transactionsList')); - const htmlList = (list.nativeElement as HTMLElement).children; - expect(htmlList).not.toBeNull(); - expect(htmlList.length).toBe(4) - - - }) -}); - - diff --git a/myteamwallet_frontend/src/app/modules/teams/overview/details/details.component.ts b/myteamwallet_frontend/src/app/modules/teams/overview/details/details.component.ts deleted file mode 100644 index 200cb66..0000000 --- a/myteamwallet_frontend/src/app/modules/teams/overview/details/details.component.ts +++ /dev/null @@ -1,38 +0,0 @@ -import { Component, Inject, OnInit } from '@angular/core'; -import { MatDialogRef, MAT_DIALOG_DATA, MatDialogModule } from '@angular/material/dialog'; -import { TeamsService } from '../../teams.service'; -import {MatListModule} from '@angular/material/list'; -import {MatProgressSpinnerModule} from '@angular/material/progress-spinner'; -import { CommonModule } from '@angular/common'; -import { TranslateModule, TranslatePipe } from '@ngx-translate/core'; - -@Component({ - selector: 'app-details', - templateUrl: './details.component.html', - styleUrls: ['./details.component.scss'], - standalone: true, - imports: [CommonModule, MatDialogModule, MatListModule, MatProgressSpinnerModule, TranslateModule], - providers: [] -}) -export class DetailsComponent implements OnInit { - - constructor( - public dialogRef: MatDialogRef, - @Inject(MAT_DIALOG_DATA) public data: { user: any }, - private teamService: TeamsService - ) {} - - ngOnInit(): void { - console.log("Onmit") - this.teamService.loadTransactionsOfUser(this.data.user.id); - } - - get transactions(): any[] { - return this.teamService.selectedUserTransaction; - } - - get isLoading(): boolean { - return this.teamService.transactionsLoading; - } - -} diff --git a/myteamwallet_frontend/src/app/modules/teams/overview/overview-routing.module.ts b/myteamwallet_frontend/src/app/modules/teams/overview/overview-routing.module.ts deleted file mode 100644 index b425c6a..0000000 --- a/myteamwallet_frontend/src/app/modules/teams/overview/overview-routing.module.ts +++ /dev/null @@ -1,15 +0,0 @@ -import { NgModule } from '@angular/core'; -import { RouterModule, Routes } from '@angular/router'; -import { OverviewComponent } from './overview.component'; - -const routes: Routes = [ - { - path: '', component: OverviewComponent, pathMatch: 'full' - } -]; - -@NgModule({ - imports: [RouterModule.forChild(routes)], - exports: [RouterModule] -}) -export class OverviewRoutingModule { } diff --git a/myteamwallet_frontend/src/app/modules/teams/overview/overview.component.html b/myteamwallet_frontend/src/app/modules/teams/overview/overview.component.html deleted file mode 100644 index 983f851..0000000 --- a/myteamwallet_frontend/src/app/modules/teams/overview/overview.component.html +++ /dev/null @@ -1,72 +0,0 @@ - - - {{ teamsService.team?.name }} - - - - -
- -
- Kontostand: {{ teamsService.team.balance | currency:'EUR' }} -
-
- Ausstehend: {{ teamsService.team.outstanding | currency:'EUR' }} -
-
- Total: {{ teamsService.team.outstanding + teamsService.team.balance | currency:'EUR' }} -
-
- - - -
- -
- - Suche - - - - -
-
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
Vorname {{element.firstName}} Nachname {{element.lastName}} Total Saldo {{element.balance | currency:'EUR' }} {{getTotalBalance() | currency:'EUR' }}
-
\ No newline at end of file diff --git a/myteamwallet_frontend/src/app/modules/teams/overview/overview.component.scss b/myteamwallet_frontend/src/app/modules/teams/overview/overview.component.scss deleted file mode 100644 index 829518b..0000000 --- a/myteamwallet_frontend/src/app/modules/teams/overview/overview.component.scss +++ /dev/null @@ -1,41 +0,0 @@ -:host { - width: 100vw; - height: 100%; -} - -.table-container { - position: relative; - min-height: 200px; - max-height: calc(100% - 280px); - width: calc(100vw - 48px); - margin: 12px 24px; - overflow: auto; -} - -.mat-mdc-table-sticky { - border-top: 1px solid #e0e0e0; -} - -.align-end { - text-align: end; - width: 120px; -} - -.team-info { - width: calc(100vw - 48px); - margin: 12px 24px; - height: 100px; - display: flex; - align-items: center; - justify-content: space-around; -} - -.blurr { - color: transparent; - text-shadow: 1px 1px 5px #000000; - pointer-events: none; -} - -.tr { - cursor: pointer; -} \ No newline at end of file diff --git a/myteamwallet_frontend/src/app/modules/teams/overview/overview.component.spec.ts b/myteamwallet_frontend/src/app/modules/teams/overview/overview.component.spec.ts deleted file mode 100644 index 95d33c6..0000000 --- a/myteamwallet_frontend/src/app/modules/teams/overview/overview.component.spec.ts +++ /dev/null @@ -1,40 +0,0 @@ -import { HttpClientModule } from '@angular/common/http'; -import { ComponentFixture, TestBed } from '@angular/core/testing'; -import { MatDialogModule } from '@angular/material/dialog'; -import { MatTableModule } from '@angular/material/table'; -import { MatToolbarModule } from '@angular/material/toolbar'; -import { MatTooltipModule } from '@angular/material/tooltip'; -import { TeamsService } from '../teams.service'; - -import { OverviewComponent } from './overview.component'; - -describe('OverviewComponent', () => { - let component: OverviewComponent; - let fixture: ComponentFixture; - const mockTeamsService = jasmine.createSpyObj('TeamsService', ['']); - mockTeamsService.team = { players: []} - - beforeEach(async () => { - await TestBed.configureTestingModule({ - declarations: [ OverviewComponent ], - imports: [ HttpClientModule, MatDialogModule, MatToolbarModule, MatTableModule, MatTooltipModule ], - providers: [ - { provide: TeamsService, useValue: mockTeamsService } - ] - }) - .compileComponents(); - - fixture = TestBed.createComponent(OverviewComponent); - component = fixture.componentInstance; - fixture.detectChanges(); - }); - - it('should create', () => { - expect(component).toBeTruthy(); - }); - - it('should initialise the datasource', () => { - expect(component.dataSource).not.toBeNull(); - }) -}); -// this.teamsService.team.players \ No newline at end of file diff --git a/myteamwallet_frontend/src/app/modules/teams/overview/overview.component.ts b/myteamwallet_frontend/src/app/modules/teams/overview/overview.component.ts deleted file mode 100644 index db1120b..0000000 --- a/myteamwallet_frontend/src/app/modules/teams/overview/overview.component.ts +++ /dev/null @@ -1,100 +0,0 @@ -import { LiveAnnouncer } from '@angular/cdk/a11y'; -import { AfterViewInit, Component, OnInit, ViewChild } from '@angular/core'; -import { MatDialog } from '@angular/material/dialog'; -import { MatSort, Sort } from '@angular/material/sort'; -import { MatTableDataSource } from '@angular/material/table'; -import { Router } from '@angular/router'; -import { AuthService } from '../../auth.service'; -import { TeamsService } from '../teams.service'; -import { DetailsComponent } from './details/details.component'; -import { Player } from 'src/app/model'; -import { PenaltiesComponent } from '../../../shared/penalties/penalties.component'; - -@Component({ - selector: 'app-overview', - templateUrl: './overview.component.html', - styleUrls: ['./overview.component.scss'] -}) -export class OverviewComponent implements OnInit, AfterViewInit { - - displayedColumns: string[] = ['firstName', 'lastName', 'balance']; - dataSource: any; - - @ViewChild(MatSort) sort!: MatSort; - - constructor(public teamsService: TeamsService - , private _liveAnnouncer: LiveAnnouncer - , public dialog: MatDialog, private authService: AuthService - , private router: Router) {} - ngAfterViewInit(): void { - this.dataSource.sort = this.sort; - } - - - ngOnInit(): void { - if (this.teamsService.team && this.teamsService.team.players) { - this.dataSource = new MatTableDataSource(this.teamsService.team.players.filter((p: Player) => p.active)); - this.addCachedTeam(); - } - } - - addCachedTeam() { - let t = localStorage.getItem('cached_teams'); - let teams: any = {}; - if (t) { - teams = JSON.parse(t); - - } - const key = this.teamsService.team.alias as any; - const name = this.teamsService.team.name as any; - teams[key] = name; - localStorage.setItem('cached_teams', JSON.stringify(teams)); - } - - - getTotalBalance(): number { - if (!this.teamsService || !this.teamsService.team || !this.teamsService.team.players) { return 0 } - const sum = this.teamsService.team.players.filter((p: Player) => p.active).reduce((acc: any, succ: { balance: any; }) => acc + succ.balance, 0); - return sum; - } - /** Announce the change in sort state for assistive technology. */ - announceSortChange(sortState: any) { - // This example uses English messages. If your application supports - // multiple language, you would internationalize these strings. - // Furthermore, you can customize the message to add additional - // details about the values being sorted. - if (sortState.direction) { - this._liveAnnouncer.announce(`Sorted ${sortState.direction}ending`); - } else { - this._liveAnnouncer.announce('Sorting cleared'); - } - } - - openDetails(row: any) { - this.dialog.open(DetailsComponent, { - width: '500px', - enterAnimationDuration: 500, - data: { user: row } - }) - } - - onLoginClick() { - if (this.authService.isLoggedIn()) { return; } - - this.router.navigate(['auth']) - } - - - applyFilter(event: Event) { - const filterValue = (event.target as HTMLInputElement).value; - this.dataSource.filter = filterValue.trim().toLowerCase(); - } - - openPenalties() { - this.dialog.open(PenaltiesComponent, { - data: this.teamsService.team.id, - height: '80vh' - }) - } - -} diff --git a/myteamwallet_frontend/src/app/modules/teams/overview/overview.module.ts b/myteamwallet_frontend/src/app/modules/teams/overview/overview.module.ts deleted file mode 100644 index eb5a869..0000000 --- a/myteamwallet_frontend/src/app/modules/teams/overview/overview.module.ts +++ /dev/null @@ -1,43 +0,0 @@ -import { NgModule } from '@angular/core'; -import { CommonModule } from '@angular/common'; - -import {MatToolbarModule} from '@angular/material/toolbar'; -import {MatTableModule} from '@angular/material/table'; -import {MatButtonModule} from '@angular/material/button'; -import { MatSortModule } from '@angular/material/sort'; -import {MatDialogModule} from '@angular/material/dialog'; -import {MatListModule} from '@angular/material/list'; -import {MatTooltipModule} from '@angular/material/tooltip'; -import {MatInputModule} from '@angular/material/input'; -import {MatFormFieldModule} from '@angular/material/form-field'; - -import { OverviewRoutingModule } from './overview-routing.module'; -import { OverviewComponent } from './overview.component'; -import { TeamsService } from '../teams.service'; -import { DetailsComponent } from './details/details.component'; -import { TranslateModule } from '@ngx-translate/core'; - - -@NgModule({ - declarations: [ - OverviewComponent, - ], - imports: [ - CommonModule, - OverviewRoutingModule, - MatToolbarModule, - MatTableModule, - MatSortModule, - MatButtonModule, - MatDialogModule, - MatListModule, - MatTooltipModule, - TranslateModule, - MatInputModule, - MatFormFieldModule, - DetailsComponent - ], - providers: [ TeamsService ], - exports: [ OverviewComponent ] -}) -export class OverviewModule { } diff --git a/myteamwallet_frontend/src/app/modules/teams/teams-routing.module.ts b/myteamwallet_frontend/src/app/modules/teams/teams-routing.module.ts deleted file mode 100644 index 1767e90..0000000 --- a/myteamwallet_frontend/src/app/modules/teams/teams-routing.module.ts +++ /dev/null @@ -1,19 +0,0 @@ -import { NgModule } from '@angular/core'; -import { RouterModule, Routes } from '@angular/router'; -import { OverviewComponent } from './overview/overview.component'; -import { TeamsComponent } from './teams.component'; - -const routes: Routes = [ - { - path: ':hash', component: TeamsComponent - }, - { - path: 'overview', loadChildren: () => import('./overview/overview.module').then(m => m.OverviewModule) - } -]; - -@NgModule({ - imports: [RouterModule.forChild(routes)], - exports: [RouterModule] -}) -export class TeamsRoutingModule { } diff --git a/myteamwallet_frontend/src/app/modules/teams/teams.component.html b/myteamwallet_frontend/src/app/modules/teams/teams.component.html deleted file mode 100644 index f8ba862..0000000 --- a/myteamwallet_frontend/src/app/modules/teams/teams.component.html +++ /dev/null @@ -1,12 +0,0 @@ - -
-
- -
Loading Data...
-
-
-
- - - - \ No newline at end of file diff --git a/myteamwallet_frontend/src/app/modules/teams/teams.component.scss b/myteamwallet_frontend/src/app/modules/teams/teams.component.scss deleted file mode 100644 index 1214678..0000000 --- a/myteamwallet_frontend/src/app/modules/teams/teams.component.scss +++ /dev/null @@ -1,11 +0,0 @@ -.loading-indicator { - display: flex; - align-items: center; - justify-content: center; - width: 100vw; - height: 100%; - - .loading-text { - margin-top: 24px; - } -} \ No newline at end of file diff --git a/myteamwallet_frontend/src/app/modules/teams/teams.component.spec.ts b/myteamwallet_frontend/src/app/modules/teams/teams.component.spec.ts deleted file mode 100644 index 95b36a5..0000000 --- a/myteamwallet_frontend/src/app/modules/teams/teams.component.spec.ts +++ /dev/null @@ -1,56 +0,0 @@ -import { HttpClient } from '@angular/common/http'; -import { Component } from '@angular/core'; -import { ComponentFixture, TestBed } from '@angular/core/testing'; -import { MatProgressSpinnerModule } from '@angular/material/progress-spinner'; -import { ActivatedRoute, Router } from '@angular/router'; -import { of } from 'rxjs'; - -import { TeamsComponent } from './teams.component'; -import { TeamsService } from './teams.service'; - -describe('TeamsComponent', () => { - let component: TeamsComponent; - let fixture: ComponentFixture; - const mockRoute = jasmine.createSpyObj('ActivatedRoute', ['']); - const mockParam = jasmine.createSpyObj('P', ['get']); - mockParam.get.and.returnValue('abc'); - mockRoute.snapshot = { paramMap: mockParam }; - - const mockTeamService = jasmine.createSpyObj('TeamsService', ['']); - const mockRouter = jasmine.createSpyObj('Router', ['']); - const mockHttp = jasmine.createSpyObj('HttpClient', ['get']); - mockHttp.get.and.returnValue(of({})) - - beforeEach(async () => { - await TestBed.configureTestingModule({ - declarations: [ TeamsComponent, MockOverviewComponent ], - imports: [ MatProgressSpinnerModule ], - providers: [ - { provide: ActivatedRoute, useValue: mockRoute}, - { provide: Router, useValue: mockRouter}, - { provide: TeamsService, useValue: mockTeamService}, - { provide: HttpClient, useValue: mockHttp}, - ] - }) - .compileComponents(); - - fixture = TestBed.createComponent(TeamsComponent); - component = fixture.componentInstance; - fixture.detectChanges(); - }); - - it('should create', () => { - expect(component).toBeTruthy(); - }); - - it('should load a team', () => { - expect(component.teamsService.team).not.toBeNull(); - }) -}); - -@Component({ - selector: 'app-overview', - template: '', -}) -class MockOverviewComponent { -} diff --git a/myteamwallet_frontend/src/app/modules/teams/teams.component.ts b/myteamwallet_frontend/src/app/modules/teams/teams.component.ts deleted file mode 100644 index 10e44c0..0000000 --- a/myteamwallet_frontend/src/app/modules/teams/teams.component.ts +++ /dev/null @@ -1,41 +0,0 @@ -import { HttpClient } from '@angular/common/http'; -import { Component, OnInit } from '@angular/core'; -import { ActivatedRoute, Router } from '@angular/router'; -import { environment } from 'src/environments/environment'; -import { TeamsService } from './teams.service'; - -@Component({ - selector: 'app-teams', - templateUrl: './teams.component.html', - styleUrls: ['./teams.component.scss'] -}) -export class TeamsComponent implements OnInit { - - constructor( - private route: ActivatedRoute, - private http: HttpClient, - private router: Router, - public teamsService: TeamsService) {} - -ngOnInit() { - const hash = this.route.snapshot.paramMap.get('hash'); - if (hash) { - this.loadTeamOverviewByAlias(hash); - } - -} - - private async loadTeamOverviewByAlias(alias: string) { - const url = `${environment.apiUrl}teams/` + alias; - this.http.get(url).subscribe(result => { - if (result) { - this.teamsService.team = result; - } else { - this.router.navigate(['/auth']) - } - }, error => { - this.router.navigate(['/auth']) - }) - } - -} diff --git a/myteamwallet_frontend/src/app/modules/teams/teams.module.ts b/myteamwallet_frontend/src/app/modules/teams/teams.module.ts deleted file mode 100644 index 9d90726..0000000 --- a/myteamwallet_frontend/src/app/modules/teams/teams.module.ts +++ /dev/null @@ -1,26 +0,0 @@ -import { NgModule } from '@angular/core'; -import { CommonModule } from '@angular/common'; -import { HttpClientModule } from '@angular/common/http'; - -import {MatProgressSpinnerModule} from '@angular/material/progress-spinner'; - -import { TeamsRoutingModule } from './teams-routing.module'; -import { TeamsComponent } from './teams.component'; -import { TeamsService } from './teams.service'; -import { OverviewModule } from './overview/overview.module'; - - -@NgModule({ - declarations: [ - TeamsComponent - ], - imports: [ - CommonModule, - TeamsRoutingModule, - HttpClientModule, - OverviewModule, - MatProgressSpinnerModule - ], - providers: [ TeamsService ] -}) -export class TeamsModule { } diff --git a/myteamwallet_frontend/src/app/modules/teams/teams.service.spec.ts b/myteamwallet_frontend/src/app/modules/teams/teams.service.spec.ts deleted file mode 100644 index f9bfbad..0000000 --- a/myteamwallet_frontend/src/app/modules/teams/teams.service.spec.ts +++ /dev/null @@ -1,19 +0,0 @@ -import { HttpClientModule } from '@angular/common/http'; -import { TestBed } from '@angular/core/testing'; - -import { TeamsService } from './teams.service'; - -describe('TeamsService', () => { - let service: TeamsService; - - beforeEach(() => { - TestBed.configureTestingModule({ - imports: [ HttpClientModule ] - }); - service = TestBed.inject(TeamsService); - }); - - it('should be created', () => { - expect(service).toBeTruthy(); - }); -}); diff --git a/myteamwallet_frontend/src/app/modules/teams/teams.service.ts b/myteamwallet_frontend/src/app/modules/teams/teams.service.ts deleted file mode 100644 index 4c4b888..0000000 --- a/myteamwallet_frontend/src/app/modules/teams/teams.service.ts +++ /dev/null @@ -1,61 +0,0 @@ -import { HttpClient } from '@angular/common/http'; -import { Injectable } from '@angular/core'; -import { Observable } from 'rxjs'; -import { Transaction } from '../../model'; -import { environment } from 'src/environments/environment'; -import { TeamInvite } from './model/team-invite'; - -@Injectable({ - providedIn: 'root' -}) -export class TeamsService { - - team: any; - selectedUserTransaction: any[]; - transactionsLoading: boolean = false; - - constructor(private http: HttpClient) { - this.selectedUserTransaction = []; - } - - loadTransactionsOfUser(userId: number) { - this.transactionsLoading = true; - const url = `${environment.apiUrl}teams/${this.team.id}/${userId}`; - this.http.get(url).subscribe(res => { - this.selectedUserTransaction = res as any; - this.transactionsLoading = false; - }) - } - - loadTeamDetails(id: string): Observable { - return this.http.get(`${environment.apiUrl}teams/${id}`); - } - - createTransactions(transactions: any[]): Observable { - return this.http.post(`${environment.apiUrl}transactions`, transactions); - } - - reverseTransaction(transactionId: number): Observable { - return this.http.post(`${environment.apiUrl}transactions/${transactionId}/reverse`, {}); - } - - createTeamTransaction(transaction: any): Observable { - return this.http.post(`${environment.apiUrl}team-wallet-transactions`, transaction); - } - - createNewPlayer(teamId: number, player: {firstName: string, lastName: string, teamRole: number}) { - return this.http.post(`${environment.apiUrl}teams/${teamId}/players`, player); - } - - createRegisterLink(invite: TeamInvite): Observable { - return this.http.post(`${environment.apiUrl}auth/invite`, invite); - } - - validateRegistrationToken(token: string): Observable { - return this.http.post(`${environment.apiUrl}auth/verify-invite`, { token }); - } - - loadTeamsTransactions(id: number): Observable { - return this.http.get(`${environment.apiUrl}teams/${id}/transactions`); - } -} diff --git a/myteamwallet_frontend/src/app/shared/dialog/components/player-info-form/player-info-form.component.html b/myteamwallet_frontend/src/app/shared/dialog/components/player-info-form/player-info-form.component.html deleted file mode 100644 index 42b726d..0000000 --- a/myteamwallet_frontend/src/app/shared/dialog/components/player-info-form/player-info-form.component.html +++ /dev/null @@ -1,32 +0,0 @@ -
-
- - Vorname - - - - -
- -
- - Nachname - - -
- -
- - Rolle - - Spieler - zweiter Kassenwart - Kapitän - Kassenwart - Trainer - - -
- - -
\ No newline at end of file diff --git a/myteamwallet_frontend/src/app/shared/dialog/components/player-info-form/player-info-form.component.scss b/myteamwallet_frontend/src/app/shared/dialog/components/player-info-form/player-info-form.component.scss deleted file mode 100644 index 2e8484f..0000000 --- a/myteamwallet_frontend/src/app/shared/dialog/components/player-info-form/player-info-form.component.scss +++ /dev/null @@ -1,16 +0,0 @@ -:host { - display: block; -} - -mat-form-field { - width: 100%; -} - -.form-field-container { - margin-bottom: 12px; -} - - -.mat-body{ - margin-bottom: 24px; -} diff --git a/myteamwallet_frontend/src/app/shared/dialog/components/player-info-form/player-info-form.component.spec.ts b/myteamwallet_frontend/src/app/shared/dialog/components/player-info-form/player-info-form.component.spec.ts deleted file mode 100644 index 7fe3868..0000000 --- a/myteamwallet_frontend/src/app/shared/dialog/components/player-info-form/player-info-form.component.spec.ts +++ /dev/null @@ -1,23 +0,0 @@ -import { ComponentFixture, TestBed } from '@angular/core/testing'; - -import { PlayerInfoFormComponent } from './player-info-form.component'; - -describe('PlayerInfoFormComponent', () => { - let component: PlayerInfoFormComponent; - let fixture: ComponentFixture; - - beforeEach(async () => { - await TestBed.configureTestingModule({ - declarations: [ PlayerInfoFormComponent ] - }) - .compileComponents(); - - fixture = TestBed.createComponent(PlayerInfoFormComponent); - component = fixture.componentInstance; - fixture.detectChanges(); - }); - - it('should create', () => { - expect(component).toBeTruthy(); - }); -}); diff --git a/myteamwallet_frontend/src/app/shared/dialog/components/player-info-form/player-info-form.component.ts b/myteamwallet_frontend/src/app/shared/dialog/components/player-info-form/player-info-form.component.ts deleted file mode 100644 index aeed5f7..0000000 --- a/myteamwallet_frontend/src/app/shared/dialog/components/player-info-form/player-info-form.component.ts +++ /dev/null @@ -1,27 +0,0 @@ -import { CommonModule } from '@angular/common'; -import { Component } from '@angular/core'; -import { FormGroup, FormControl, Validators, FormsModule, ReactiveFormsModule } from '@angular/forms'; -import { MatButtonModule } from '@angular/material/button'; -import { MatOptionModule } from '@angular/material/core'; -import { MatFormFieldModule } from '@angular/material/form-field'; -import { MatInputModule } from '@angular/material/input'; -import { MatSelectModule } from '@angular/material/select'; - -@Component({ - selector: 'app-player-info-form', - templateUrl: './player-info-form.component.html', - styleUrls: ['./player-info-form.component.scss'], - standalone: true, - imports: [CommonModule, FormsModule, ReactiveFormsModule, MatFormFieldModule, MatOptionModule, MatSelectModule, MatInputModule] -}) -export class PlayerInfoFormComponent { - disableSelect = new FormControl(true); - - form = new FormGroup({ - firstName: new FormControl('', [Validators.required]), - lastName: new FormControl(null, [Validators.required]), - teamRole: new FormControl({value: 1, disabled: false}) - }); - - -} diff --git a/myteamwallet_frontend/src/app/shared/dialog/components/transaction-form/transaction-form.component.html b/myteamwallet_frontend/src/app/shared/dialog/components/transaction-form/transaction-form.component.html deleted file mode 100644 index 8484817..0000000 --- a/myteamwallet_frontend/src/app/shared/dialog/components/transaction-form/transaction-form.component.html +++ /dev/null @@ -1,36 +0,0 @@ -
- {{ text }} -
- -
-
- - Anmerkung - - Optionale Bemerkung / Erklärung - -
- - - Art der Buchung - - - {{ transactionType(t) }} - - - {{ description }} - - - - Betrag - - - als positiver Betrag, z. B. 12,50 - Bitte Betrag prüfen, maximal 10.000 € - Betrag muss größer als 0 € sein - - -
- Betrag gleichmäßig aufteilen -
-
\ No newline at end of file diff --git a/myteamwallet_frontend/src/app/shared/dialog/components/transaction-form/transaction-form.component.scss b/myteamwallet_frontend/src/app/shared/dialog/components/transaction-form/transaction-form.component.scss deleted file mode 100644 index 73067af..0000000 --- a/myteamwallet_frontend/src/app/shared/dialog/components/transaction-form/transaction-form.component.scss +++ /dev/null @@ -1,28 +0,0 @@ -:host { - display: flex; - flex-direction: column; - overflow: hidden; -} - -.first { - margin-right: 2px; -} - -.second { - margin-left: 2px; -} - -.input_note { - width: 100%; - margin-bottom: 24px; -} - -.mat-body{ - margin-bottom: 24px; -} - -@media screen and (max-width: 700px) { - mat-form-field { - width: 100%; - } -} \ No newline at end of file diff --git a/myteamwallet_frontend/src/app/shared/dialog/components/transaction-form/transaction-form.component.spec.ts b/myteamwallet_frontend/src/app/shared/dialog/components/transaction-form/transaction-form.component.spec.ts deleted file mode 100644 index 81e86fe..0000000 --- a/myteamwallet_frontend/src/app/shared/dialog/components/transaction-form/transaction-form.component.spec.ts +++ /dev/null @@ -1,23 +0,0 @@ -import { ComponentFixture, TestBed } from '@angular/core/testing'; - -import { TransactionFormComponent } from './transaction-form.component'; - -describe('TransactionFormComponent', () => { - let component: TransactionFormComponent; - let fixture: ComponentFixture; - - beforeEach(async () => { - await TestBed.configureTestingModule({ - declarations: [ TransactionFormComponent ] - }) - .compileComponents(); - - fixture = TestBed.createComponent(TransactionFormComponent); - component = fixture.componentInstance; - fixture.detectChanges(); - }); - - it('should create', () => { - expect(component).toBeTruthy(); - }); -}); diff --git a/myteamwallet_frontend/src/app/shared/dialog/components/transaction-form/transaction-form.component.ts b/myteamwallet_frontend/src/app/shared/dialog/components/transaction-form/transaction-form.component.ts deleted file mode 100644 index 8d78ef7..0000000 --- a/myteamwallet_frontend/src/app/shared/dialog/components/transaction-form/transaction-form.component.ts +++ /dev/null @@ -1,71 +0,0 @@ -import { Component, Input } from '@angular/core'; -import { FormGroup, FormControl, Validators, FormsModule, ReactiveFormsModule } from '@angular/forms'; -import { TransactionType } from '../../new-transaction/model/transaction-type.enum'; -import { CommonModule } from '@angular/common'; -import { MatOptionModule } from '@angular/material/core'; -import { MatFormFieldModule } from '@angular/material/form-field'; -import { MatSelectModule } from '@angular/material/select'; -import { MatInputModule } from '@angular/material/input'; -import { MatButtonModule } from '@angular/material/button'; -import { MatSlideToggleModule } from '@angular/material/slide-toggle'; - -@Component({ - selector: 'app-transaction-form', - templateUrl: './transaction-form.component.html', - styleUrls: ['./transaction-form.component.scss'], - standalone: true, - imports: [ - CommonModule - , FormsModule - , ReactiveFormsModule - , MatFormFieldModule - , MatOptionModule - , MatSelectModule - , MatInputModule - , MatButtonModule - , MatSlideToggleModule - ] -}) -export class TransactionFormComponent { - - @Input('transactionTypes') transactionTypes = [TransactionType.credit, TransactionType.fee, TransactionType.fine, TransactionType.levy, TransactionType.payment]; - - @Input('totalSlider') showTotalSlider: boolean = true; - @Input('text') text: string | undefined; - - description = 'Art wählen'; - - translations = { - fee: 'Gebühr', - fine: 'Strafe', - levy: 'Umlage', - payment: 'Zahlung', - credit: 'Guthaben', - expense: 'Ausgabe' - } - - - form = new FormGroup({ - note: new FormControl('', []), - amount: new FormControl(null, [Validators.required, Validators.min(0.01), Validators.max(10000)]), - type: new FormControl(null, [Validators.required]), - total: new FormControl(false, []) - }); - - transactionType(id: number | null): string { - if (id == null) { return ''; } - const key: any = TransactionType[id]; - const t = this.translations as any; - return t[key]; - } - - onTypeChange() { - if (this.form.controls.type.value != null && this.form.controls.type.value < 10) { - this.description = 'Spieler bekommt Geld' - } else { - this.description = 'Spieler zahlt Geld' - } - - } - -} diff --git a/myteamwallet_frontend/src/app/shared/dialog/confirm-dialog/confirm-dialog.component.html b/myteamwallet_frontend/src/app/shared/dialog/confirm-dialog/confirm-dialog.component.html deleted file mode 100644 index c2a1875..0000000 --- a/myteamwallet_frontend/src/app/shared/dialog/confirm-dialog/confirm-dialog.component.html +++ /dev/null @@ -1,8 +0,0 @@ -

{{ data.title }}

-
-

{{ data.message }}

-
-
- - -
diff --git a/myteamwallet_frontend/src/app/shared/dialog/confirm-dialog/confirm-dialog.component.ts b/myteamwallet_frontend/src/app/shared/dialog/confirm-dialog/confirm-dialog.component.ts deleted file mode 100644 index 6dc2202..0000000 --- a/myteamwallet_frontend/src/app/shared/dialog/confirm-dialog/confirm-dialog.component.ts +++ /dev/null @@ -1,33 +0,0 @@ -import { CommonModule } from '@angular/common'; -import { Component, Inject } from '@angular/core'; -import { MatButtonModule } from '@angular/material/button'; -import { MAT_DIALOG_DATA, MatDialogModule, MatDialogRef } from '@angular/material/dialog'; - -@Component({ - selector: 'app-confirm-dialog', - templateUrl: './confirm-dialog.component.html', - standalone: true, - imports: [CommonModule, MatButtonModule, MatDialogModule] -}) -export class ConfirmDialogComponent { - - constructor( - public dialogRef: MatDialogRef, - @Inject(MAT_DIALOG_DATA) public data: ConfirmDialogData, - ) {} - - confirm(): void { - this.dialogRef.close(true); - } - - cancel(): void { - this.dialogRef.close(false); - } -} - -export interface ConfirmDialogData { - title: string; - message: string; - confirmLabel?: string; - cancelLabel?: string; -} diff --git a/myteamwallet_frontend/src/app/shared/dialog/create-player-dialog/create-player.dialog.component.html b/myteamwallet_frontend/src/app/shared/dialog/create-player-dialog/create-player.dialog.component.html deleted file mode 100644 index e6e482c..0000000 --- a/myteamwallet_frontend/src/app/shared/dialog/create-player-dialog/create-player.dialog.component.html +++ /dev/null @@ -1,10 +0,0 @@ -

Spieler anlegen

- -
- -
- -
- - -
\ No newline at end of file diff --git a/myteamwallet_frontend/src/app/shared/dialog/create-player-dialog/create-player.dialog.component.scss b/myteamwallet_frontend/src/app/shared/dialog/create-player-dialog/create-player.dialog.component.scss deleted file mode 100644 index 8bc9896..0000000 --- a/myteamwallet_frontend/src/app/shared/dialog/create-player-dialog/create-player.dialog.component.scss +++ /dev/null @@ -1,6 +0,0 @@ -:host { - display: flex; - overflow: hidden; - flex-direction: column; - padding: 8px 14px 8px 14px; -} \ No newline at end of file diff --git a/myteamwallet_frontend/src/app/shared/dialog/create-player-dialog/create-player.dialog.component.spec.ts b/myteamwallet_frontend/src/app/shared/dialog/create-player-dialog/create-player.dialog.component.spec.ts deleted file mode 100644 index 65fdf25..0000000 --- a/myteamwallet_frontend/src/app/shared/dialog/create-player-dialog/create-player.dialog.component.spec.ts +++ /dev/null @@ -1,23 +0,0 @@ -import { ComponentFixture, TestBed } from '@angular/core/testing'; - -import { CreatePlayerDialogComponent } from './create-player.dialog.component'; - -describe('CreatePlayerDialogComponent', () => { - let component: CreatePlayerDialogComponent; - let fixture: ComponentFixture; - - beforeEach(async () => { - await TestBed.configureTestingModule({ - declarations: [ CreatePlayerDialogComponent ] - }) - .compileComponents(); - - fixture = TestBed.createComponent(CreatePlayerDialogComponent); - component = fixture.componentInstance; - fixture.detectChanges(); - }); - - it('should create', () => { - expect(component).toBeTruthy(); - }); -}); diff --git a/myteamwallet_frontend/src/app/shared/dialog/create-player-dialog/create-player.dialog.component.ts b/myteamwallet_frontend/src/app/shared/dialog/create-player-dialog/create-player.dialog.component.ts deleted file mode 100644 index 24db26a..0000000 --- a/myteamwallet_frontend/src/app/shared/dialog/create-player-dialog/create-player.dialog.component.ts +++ /dev/null @@ -1,36 +0,0 @@ -import { Component, ViewChild } from '@angular/core'; -import { MatDialogRef } from '@angular/material/dialog'; -import { PlayerInfoFormComponent } from '../components/player-info-form/player-info-form.component'; -import { CommonModule } from '@angular/common'; -import { MatFormFieldModule } from '@angular/material/form-field'; -import { MatButtonModule } from '@angular/material/button'; - -@Component({ - selector: 'app-create-player.dialog', - templateUrl: './create-player.dialog.component.html', - styleUrls: ['./create-player.dialog.component.scss'], - standalone: true, - imports: [ CommonModule, PlayerInfoFormComponent, MatButtonModule ] -}) -export class CreatePlayerDialogComponent { - @ViewChild('formComponent') formComponent!: PlayerInfoFormComponent; - - constructor( - public dialogRef: MatDialogRef - ) {} - - - get disableSave(): boolean { - return !this.formComponent || !this.formComponent.form || this.formComponent?.form.invalid; - } - - close(save?: boolean) { - if (save) { - this.dialogRef.close(this.formComponent.form.value); - return; - } - - this.dialogRef.close(); - - } -} diff --git a/myteamwallet_frontend/src/app/shared/dialog/dialog.module.ts b/myteamwallet_frontend/src/app/shared/dialog/dialog.module.ts deleted file mode 100644 index b03af8d..0000000 --- a/myteamwallet_frontend/src/app/shared/dialog/dialog.module.ts +++ /dev/null @@ -1,60 +0,0 @@ -import { NgModule } from '@angular/core'; -import { CommonModule } from '@angular/common'; -import { NewTransactionDialogComponent } from './new-transaction/new-transaction.component'; -import { MatButtonModule } from '@angular/material/button'; -import { MatFormFieldModule } from '@angular/material/form-field'; -import { MatInputModule } from '@angular/material/input'; -import { MatSelectModule } from '@angular/material/select'; -import { MatSlideToggleModule } from '@angular/material/slide-toggle'; -import { FormsModule, ReactiveFormsModule } from '@angular/forms'; -import { TeamTransactionDialogComponent } from './team-transaction-dialog/team-transaction-dialog.component'; -import { TransactionFormComponent } from './components/transaction-form/transaction-form.component'; -import { CreatePlayerDialogComponent } from './create-player-dialog/create-player.dialog.component'; -import { PlayerInfoFormComponent } from './components/player-info-form/player-info-form.component'; -import { PrivilegesInfoDialogComponent } from './privileges-info-dialog/privileges-info-dialog.component'; -import { MatDialogModule } from '@angular/material/dialog'; -import { ShowTeamTransactionsComponent } from './show-team-transactions/show-team-transactions.component'; -import {MatProgressSpinnerModule} from '@angular/material/progress-spinner'; -import {MatTableModule} from '@angular/material/table'; -import { MatSortModule } from '@angular/material/sort'; -import { MatPaginatorModule } from '@angular/material/paginator'; - - -const components = [ ] - -@NgModule({ - declarations: [], - imports: [ - CommonModule, - MatFormFieldModule, - MatSelectModule, - MatInputModule, - MatButtonModule, - MatSlideToggleModule, - FormsModule, - ReactiveFormsModule, - MatDialogModule, - MatProgressSpinnerModule, - MatTableModule, - MatSortModule, - MatPaginatorModule, - PlayerInfoFormComponent, - TransactionFormComponent, - TeamTransactionDialogComponent, - PrivilegesInfoDialogComponent, - CreatePlayerDialogComponent, - ShowTeamTransactionsComponent, - NewTransactionDialogComponent - ], - exports: [ - PlayerInfoFormComponent, - TransactionFormComponent, - TeamTransactionDialogComponent, - PrivilegesInfoDialogComponent, - CreatePlayerDialogComponent, - ShowTeamTransactionsComponent, - NewTransactionDialogComponent - ] -}) -export class DialogModule { -} diff --git a/myteamwallet_frontend/src/app/shared/dialog/index.ts b/myteamwallet_frontend/src/app/shared/dialog/index.ts deleted file mode 100644 index 8ad253c..0000000 --- a/myteamwallet_frontend/src/app/shared/dialog/index.ts +++ /dev/null @@ -1,2 +0,0 @@ -export * from './new-transaction/new-transaction.component'; -export * from './team-transaction-dialog/team-transaction-dialog.component'; \ No newline at end of file diff --git a/myteamwallet_frontend/src/app/shared/dialog/new-transaction/model/transaction-type.enum.ts b/myteamwallet_frontend/src/app/shared/dialog/new-transaction/model/transaction-type.enum.ts deleted file mode 100644 index 542c5cb..0000000 --- a/myteamwallet_frontend/src/app/shared/dialog/new-transaction/model/transaction-type.enum.ts +++ /dev/null @@ -1,8 +0,0 @@ -export enum TransactionType { - payment = 0, - credit = 1, - fine = 11, - levy = 12, - fee = 13, - expense = 14 -} \ No newline at end of file diff --git a/myteamwallet_frontend/src/app/shared/dialog/new-transaction/new-transaction.component.html b/myteamwallet_frontend/src/app/shared/dialog/new-transaction/new-transaction.component.html deleted file mode 100644 index 067de71..0000000 --- a/myteamwallet_frontend/src/app/shared/dialog/new-transaction/new-transaction.component.html +++ /dev/null @@ -1,27 +0,0 @@ -

Buchung anlegen

- -
-
Gewählte Spieler:
- -
{{ p.firstName }} {{ p.lastName }}
-
- + {{ data.players.length - 5 }} weitere -
-
- - -
Gesamte Mannschaft
-
-
- - -
- -
-
Jeder Spieler bekommt {{ transactionType }} über {{ amount | currency:'EUR' }}
-
- - - - - diff --git a/myteamwallet_frontend/src/app/shared/dialog/new-transaction/new-transaction.component.scss b/myteamwallet_frontend/src/app/shared/dialog/new-transaction/new-transaction.component.scss deleted file mode 100644 index f576fcd..0000000 --- a/myteamwallet_frontend/src/app/shared/dialog/new-transaction/new-transaction.component.scss +++ /dev/null @@ -1,30 +0,0 @@ -:host { - display: flex; - overflow: hidden; - flex-direction: column; - padding: 2px 4px 4px 4px; -} - -.selected_players { - padding: 2px; - border: 1px solid #ccc; - border-radius: 4px; - margin-bottom: 4px; - - .header { - background-color: #e7e7e7; - margin: -2px -2px 0 -2px; - padding: 2px; - text-align: center; - } -} - -.form { - margin-top: 20px; -} - -.summary { - margin-top: 32px; - margin-bottom: 20px; - text-align: center; -} diff --git a/myteamwallet_frontend/src/app/shared/dialog/new-transaction/new-transaction.component.spec.ts b/myteamwallet_frontend/src/app/shared/dialog/new-transaction/new-transaction.component.spec.ts deleted file mode 100644 index aa94111..0000000 --- a/myteamwallet_frontend/src/app/shared/dialog/new-transaction/new-transaction.component.spec.ts +++ /dev/null @@ -1,51 +0,0 @@ -import { forwardRef } from '@angular/core'; -import { ComponentFixture, TestBed } from '@angular/core/testing'; -import { FormsModule, NG_VALUE_ACCESSOR, ReactiveFormsModule } from '@angular/forms'; -import { MatDialogModule, MatDialogRef, MAT_DIALOG_DATA } from '@angular/material/dialog'; -import { MatFormFieldModule } from '@angular/material/form-field'; -import { MatInputModule } from '@angular/material/input'; -import { MatSelectModule } from '@angular/material/select'; -import { MatSlideToggleModule } from '@angular/material/slide-toggle'; -import { NoopAnimationsModule } from '@angular/platform-browser/animations'; - -import { NewTransactionDialogComponent } from './new-transaction.component'; - -describe('NewTransactionDialogComponent', () => { - let component: NewTransactionDialogComponent; - let fixture: ComponentFixture; - - beforeEach(async () => { - await TestBed.configureTestingModule({ - declarations: [ NewTransactionDialogComponent ], - providers: [ - - { provide: MatDialogRef, useValue: {} }, - { provide: MAT_DIALOG_DATA, useValue: {} }, - { - provide: NG_VALUE_ACCESSOR, - useExisting: forwardRef(() => NewTransactionDialogComponent), - multi: true, - } - ], - imports: [ - MatDialogModule, - MatFormFieldModule, - ReactiveFormsModule, - MatInputModule, - NoopAnimationsModule, - MatSelectModule, - FormsModule, - MatSlideToggleModule - ] - }) - .compileComponents(); - - fixture = TestBed.createComponent(NewTransactionDialogComponent); - component = fixture.componentInstance; - fixture.detectChanges(); - }); - - it('should create', () => { - expect(component).toBeTruthy(); - }); -}); diff --git a/myteamwallet_frontend/src/app/shared/dialog/new-transaction/new-transaction.component.ts b/myteamwallet_frontend/src/app/shared/dialog/new-transaction/new-transaction.component.ts deleted file mode 100644 index 12362e4..0000000 --- a/myteamwallet_frontend/src/app/shared/dialog/new-transaction/new-transaction.component.ts +++ /dev/null @@ -1,121 +0,0 @@ -import { Component, Inject, OnInit, ViewChild } from '@angular/core'; -import { FormControl, FormGroup, FormsModule, ReactiveFormsModule, Validators } from '@angular/forms'; -import { MatDialog, MatDialogRef, MAT_DIALOG_DATA, MatDialogModule } from '@angular/material/dialog'; -import { Player } from 'src/app/model'; -import { Team } from 'src/app/modules/teams/model/team'; -import { TransactionFormComponent } from '../components/transaction-form/transaction-form.component'; -import { TransactionType } from './model/transaction-type.enum'; -import { CommonModule } from '@angular/common'; -import { MatFormFieldModule } from '@angular/material/form-field'; -import { MatInputModule } from '@angular/material/input'; -import { MatSelectModule } from '@angular/material/select'; -import { MatButtonModule } from '@angular/material/button'; -import { ConfirmDialogComponent } from '../confirm-dialog/confirm-dialog.component'; - -const HIGH_AMOUNT_CONFIRM_THRESHOLD = 300; - -@Component({ - selector: 'app-new-transaction', - templateUrl: './new-transaction.component.html', - styleUrls: ['./new-transaction.component.scss'], - standalone: true, - imports: [ - CommonModule - , TransactionFormComponent - , MatButtonModule - , MatDialogModule - ] -}) -export class NewTransactionDialogComponent implements OnInit { - - @ViewChild('formComponent') formComponent!: TransactionFormComponent; - - - selectedTransactionType: number | null = null; - - isTotal: boolean = false; - - constructor( - public dialogRef: MatDialogRef, - private dialog: MatDialog, - @Inject(MAT_DIALOG_DATA) public data: DialogData, - ) {} - - ngOnInit(): void { - } - - - close() { - this.dialogRef.close(); - } - - create() { - - const value = this.formComponent.form.value; - if (!value || value.amount == null || value.total == null || value.type == null) { return; } - let amount = value.total ? value.amount / this.data.players.length : value.amount; - amount = Math.round(amount * 100) / 100; - - let res: Transaction[] = []; - for (let p of this.data.players) { - res.push({ - amount, - playerId: p.id, - type: value.type as any, - note: value.note as any - }) - - - } - - if (value.amount >= HIGH_AMOUNT_CONFIRM_THRESHOLD) { - const confirmRef = this.dialog.open(ConfirmDialogComponent, { - data: { - title: 'Betrag prüfen', - message: `Es wird${this.data.players.length > 1 ? ' für jede:n der ' + this.data.players.length + ' gewählten Spieler:innen' : ''} ein Betrag von ${value.amount} € gebucht. Bitte kurz prüfen, bevor du fortfährst.`, - confirmLabel: 'Buchen' - } - }); - - confirmRef.afterClosed().subscribe(confirmed => { - if (confirmed) { - this.dialogRef.close(res); - } - }); - return; - } - - this.dialogRef.close(res); - - } - - get amount(): number { - const value = this.formComponent?.form?.value; - if (!value || value.amount == null) { return 0; } - return Math.round((value.total ? value.amount / this.data.players.length : value.amount) * 100) / 100; - } - - get transactionType(): string { - if (this.formComponent?.form?.value?.type == null) { return ''; } - return this.formComponent.transactionType(this.formComponent.form.value.type); - } - - get formValid(): boolean { - return this.formComponent?.form != null && this.formComponent.form.valid; - } - -} - - -interface DialogData { - team: Team, - players: Player[]; - all?: boolean; -} - -export interface Transaction { - playerId: Number; - amount: number; - type: TransactionType; - note: string; -} \ No newline at end of file diff --git a/myteamwallet_frontend/src/app/shared/dialog/privileges-info-dialog/privileges-info-dialog.component.html b/myteamwallet_frontend/src/app/shared/dialog/privileges-info-dialog/privileges-info-dialog.component.html deleted file mode 100644 index 24b6811..0000000 --- a/myteamwallet_frontend/src/app/shared/dialog/privileges-info-dialog/privileges-info-dialog.component.html +++ /dev/null @@ -1,46 +0,0 @@ -

Berechtigungen nach Teamrolle

- - - -
- Für jeden Spieler kann ein Einladungslink erstellt werden, mit dem sich der Spieler registrieren und verknüpfen kann. - Jeder Link darf nur an einen Spieler gegeben werden, da jeder Spieler (pro Team) nur mit einem User-Account verbunden sein kann. - Derzeit ist eine Verlinkung nur mit einer neuen Registrierung möglich. Jeder User-Account erhält pro Team die Rolle seines zugeordneten Spielers. -
- -
Zweiter Kassenwart:
-
-
    -
  • Transaktionen und Buchungen anlegen
  • -
-
- -
Kassenwart:
-
-
    -
  • Transaktionen und Buchungen anlegen
  • -
  • Spieler anlegen & verwalten
  • -
  • Registrierungslinks erstellen
  • -
-
- -
Kapitän:
-
-
    -
  • Transaktionen und Buchungen anlegen
  • -
  • Spieler anlegen & verwalten
  • -
  • Registrierungslinks erstellen
  • -
-
- -
Trainer:
-
-
    -
  • Transaktionen und Buchungen anlegen
  • -
  • Spieler anlegen & verwalten
  • -
  • Registrierungslinks erstellen
  • -
-
- - -
\ No newline at end of file diff --git a/myteamwallet_frontend/src/app/shared/dialog/privileges-info-dialog/privileges-info-dialog.component.scss b/myteamwallet_frontend/src/app/shared/dialog/privileges-info-dialog/privileges-info-dialog.component.scss deleted file mode 100644 index 0e1f964..0000000 --- a/myteamwallet_frontend/src/app/shared/dialog/privileges-info-dialog/privileges-info-dialog.component.scss +++ /dev/null @@ -1,9 +0,0 @@ -:host { - display: flex; - flex-direction: column; - max-width: 850px; -} - -.description{ - margin-bottom: 24px; -} \ No newline at end of file diff --git a/myteamwallet_frontend/src/app/shared/dialog/privileges-info-dialog/privileges-info-dialog.component.spec.ts b/myteamwallet_frontend/src/app/shared/dialog/privileges-info-dialog/privileges-info-dialog.component.spec.ts deleted file mode 100644 index 2690444..0000000 --- a/myteamwallet_frontend/src/app/shared/dialog/privileges-info-dialog/privileges-info-dialog.component.spec.ts +++ /dev/null @@ -1,23 +0,0 @@ -import { ComponentFixture, TestBed } from '@angular/core/testing'; - -import { PrivilegesInfoDialogComponent } from './privileges-info-dialog.component'; - -describe('PrivilegesInfoDialogComponent', () => { - let component: PrivilegesInfoDialogComponent; - let fixture: ComponentFixture; - - beforeEach(async () => { - await TestBed.configureTestingModule({ - declarations: [ PrivilegesInfoDialogComponent ] - }) - .compileComponents(); - - fixture = TestBed.createComponent(PrivilegesInfoDialogComponent); - component = fixture.componentInstance; - fixture.detectChanges(); - }); - - it('should create', () => { - expect(component).toBeTruthy(); - }); -}); diff --git a/myteamwallet_frontend/src/app/shared/dialog/privileges-info-dialog/privileges-info-dialog.component.ts b/myteamwallet_frontend/src/app/shared/dialog/privileges-info-dialog/privileges-info-dialog.component.ts deleted file mode 100644 index 8d7a298..0000000 --- a/myteamwallet_frontend/src/app/shared/dialog/privileges-info-dialog/privileges-info-dialog.component.ts +++ /dev/null @@ -1,14 +0,0 @@ -import { CommonModule } from '@angular/common'; -import { Component } from '@angular/core'; -import { MatDialogModule } from '@angular/material/dialog'; - -@Component({ - selector: 'app-privileges-info-dialog', - templateUrl: './privileges-info-dialog.component.html', - styleUrls: ['./privileges-info-dialog.component.scss'], - standalone: true, - imports: [CommonModule, MatDialogModule] -}) -export class PrivilegesInfoDialogComponent { - -} diff --git a/myteamwallet_frontend/src/app/shared/dialog/show-team-transactions/show-team-transactions.component.html b/myteamwallet_frontend/src/app/shared/dialog/show-team-transactions/show-team-transactions.component.html deleted file mode 100644 index a9730c3..0000000 --- a/myteamwallet_frontend/src/app/shared/dialog/show-team-transactions/show-team-transactions.component.html +++ /dev/null @@ -1,118 +0,0 @@ -
-
-

Alle Transaktionen

-

Buchungen des gesamten Teams

-
- - -
- - -
- - Transaktionen werden geladen … -
- -
- error_outline - Transaktionen konnten nicht geladen werden. - -
- - -
- - Transaktionen durchsuchen - search - - - - -
- -
-
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
Betrag - {{ element.amount | currency:'EUR' }} - Datum{{ element.date | date:'shortDate' }}Typ{{ element.type }}Notiz{{ element.note || '–' }}Spieler{{ element.playerName }} - -
- {{ input.value ? 'Keine passenden Transaktionen gefunden.' : 'Noch keine Transaktionen vorhanden.' }} -
-
- - - -
-
-
diff --git a/myteamwallet_frontend/src/app/shared/dialog/show-team-transactions/show-team-transactions.component.scss b/myteamwallet_frontend/src/app/shared/dialog/show-team-transactions/show-team-transactions.component.scss deleted file mode 100644 index f3e06aa..0000000 --- a/myteamwallet_frontend/src/app/shared/dialog/show-team-transactions/show-team-transactions.component.scss +++ /dev/null @@ -1,172 +0,0 @@ -:host { - display: block; - width: min(900px, 86vw); -} - -.dialog-header { - display: flex; - align-items: flex-start; - justify-content: space-between; - gap: 24px; - padding: 24px 24px 16px; - border-bottom: 1px solid var(--mat-divider-color, #e0e0e0); - - h2[mat-dialog-title] { - margin: 0; - padding: 0; - line-height: 1.25; - } -} - -.dialog-subtitle { - margin: 4px 0 0; - color: rgba(0, 0, 0, 0.6); -} - -.close-button { - flex: 0 0 auto; - margin: -8px -8px 0 0; -} - -mat-dialog-content { - display: flex; - height: min(70vh, 620px); - max-height: none; - flex-direction: column; - overflow: hidden; - padding: 20px 24px 24px !important; -} - -.dialog-state { - min-height: 260px; - display: flex; - flex-direction: column; - align-items: center; - justify-content: center; - gap: 16px; - color: rgba(0, 0, 0, 0.6); - text-align: center; -} - -.error-state { - mat-icon { - width: 44px; - height: 44px; - color: #ba1a1a; - font-size: 44px; - } - -} - -.table-toolbar { - flex: 0 0 auto; - display: flex; - align-items: center; - justify-content: space-between; - gap: 16px; - margin-bottom: 16px; - - mat-form-field { - flex: 1 1 360px; - max-width: 520px; - } -} - -.note-toggle { - flex: 0 0 auto; - - &.active { - color: var(--mat-sys-primary, #343dff); - background: #eef3ff; - } -} - -.table-shell { - display: flex; - min-height: 0; - flex: 1 1 auto; - flex-direction: column; - overflow: hidden; - border: 1px solid var(--mat-divider-color, #e0e0e0); - border-radius: 12px; - background: #fff; -} - -.table-scroll { - min-height: 0; - flex: 1 1 auto; - overflow: auto; -} - -table { - width: 100%; - min-width: 690px; -} - -th.mat-mdc-header-cell { - color: rgba(0, 0, 0, 0.68); - font-weight: 600; - white-space: nowrap; -} - -td.mat-mdc-cell { - border-bottom-color: rgba(0, 0, 0, 0.08); -} - -.amount-cell { - font-weight: 600; -} - -.note-cell { - min-width: 180px; - max-width: 320px; - overflow: hidden; - text-overflow: ellipsis; - white-space: nowrap; -} - -.actions-cell { - width: 48px; - padding-right: 8px; - text-align: right; -} - -.empty-row td { - height: 128px; - color: rgba(0, 0, 0, 0.6); - text-align: center; -} - -mat-paginator { - flex: 0 0 auto; - border-top: 1px solid var(--mat-divider-color, #e0e0e0); -} - -@media (max-width: 700px) { - :host { - width: 92vw; - } - - .dialog-header { - padding: 20px 16px 14px; - } - - mat-dialog-content { - height: min(72vh, 620px); - padding: 16px !important; - } - - .table-toolbar { - align-items: stretch; - flex-direction: column; - - mat-form-field { - flex-basis: auto; - max-width: none; - } - } - - .note-toggle { - align-self: flex-start; - } -} diff --git a/myteamwallet_frontend/src/app/shared/dialog/show-team-transactions/show-team-transactions.component.spec.ts b/myteamwallet_frontend/src/app/shared/dialog/show-team-transactions/show-team-transactions.component.spec.ts deleted file mode 100644 index ebf27b0..0000000 --- a/myteamwallet_frontend/src/app/shared/dialog/show-team-transactions/show-team-transactions.component.spec.ts +++ /dev/null @@ -1,23 +0,0 @@ -import { ComponentFixture, TestBed } from '@angular/core/testing'; - -import { ShowTeamTransactionsComponent } from './show-team-transactions.component'; - -describe('ShowTeamTransactionsComponent', () => { - let component: ShowTeamTransactionsComponent; - let fixture: ComponentFixture; - - beforeEach(async () => { - await TestBed.configureTestingModule({ - declarations: [ ShowTeamTransactionsComponent ] - }) - .compileComponents(); - - fixture = TestBed.createComponent(ShowTeamTransactionsComponent); - component = fixture.componentInstance; - fixture.detectChanges(); - }); - - it('should create', () => { - expect(component).toBeTruthy(); - }); -}); diff --git a/myteamwallet_frontend/src/app/shared/dialog/show-team-transactions/show-team-transactions.component.ts b/myteamwallet_frontend/src/app/shared/dialog/show-team-transactions/show-team-transactions.component.ts deleted file mode 100644 index f73a470..0000000 --- a/myteamwallet_frontend/src/app/shared/dialog/show-team-transactions/show-team-transactions.component.ts +++ /dev/null @@ -1,137 +0,0 @@ -import { CommonModule } from '@angular/common'; -import { Component, Inject, OnInit, ViewChild } from '@angular/core'; -import { MAT_DIALOG_DATA, MatDialog, MatDialogModule } from '@angular/material/dialog'; -import { MatButtonModule } from '@angular/material/button'; -import { MatFormFieldModule } from '@angular/material/form-field'; -import { MatIconModule } from '@angular/material/icon'; -import { MatInputModule } from '@angular/material/input'; -import { MatPaginator, MatPaginatorModule } from '@angular/material/paginator'; -import { MatProgressSpinnerModule } from '@angular/material/progress-spinner'; -import { MatSnackBar } from '@angular/material/snack-bar'; -import { MatSort, MatSortModule } from '@angular/material/sort'; -import { MatTableDataSource, MatTableModule } from '@angular/material/table'; -import { MatTooltipModule } from '@angular/material/tooltip'; -import { Transaction } from 'src/app/model'; -import { TeamsService } from 'src/app/modules/teams/teams.service'; -import { ConfirmDialogComponent } from '../confirm-dialog/confirm-dialog.component'; - -@Component({ - selector: 'app-show-team-transactions', - templateUrl: './show-team-transactions.component.html', - styleUrls: ['./show-team-transactions.component.scss'], - standalone: true, - imports: [ CommonModule, MatDialogModule, MatTableModule, MatSortModule, MatPaginatorModule, MatFormFieldModule, MatInputModule, MatProgressSpinnerModule, MatButtonModule, MatIconModule, MatTooltipModule ] -}) -export class ShowTeamTransactionsComponent implements OnInit { - - isLoading: boolean = true; - loadError: boolean = false; - - displayedColumns: string[] = ['amount', 'date', 'type', 'playerName', 'actions']; - dataSource: MatTableDataSource = new MatTableDataSource([]); - - private paginator?: MatPaginator; - private sort?: MatSort; - - @ViewChild(MatPaginator) - set matPaginator(paginator: MatPaginator | undefined) { - this.paginator = paginator; - if (paginator) { - this.dataSource.paginator = paginator; - } - } - - @ViewChild(MatSort) - set matSort(sort: MatSort | undefined) { - this.sort = sort; - if (sort) { - this.dataSource.sort = sort; - } - } - constructor(private teamService: TeamsService, - private dialog: MatDialog, - private snackBar: MatSnackBar, - @Inject(MAT_DIALOG_DATA) public data: DialogData,) {} - - ngOnInit(): void { - this.load(); - } - - load(): void { - this.isLoading = true; - this.loadError = false; - this.teamService.loadTeamsTransactions(this.data.id).subscribe({ - next: data => { - this.setupData(data); - }, - error: () => { - this.isLoading = false; - this.loadError = true; - } - }) - } - - setupData(data: Transaction[]) { - this.isLoading = false; - this.dataSource = new MatTableDataSource(data); - - if (this.paginator) { - this.dataSource.paginator = this.paginator; - } - if (this.sort) { - this.dataSource.sort = this.sort; - } - } - - applyFilter(event: Event) { - const filterValue = (event.target as HTMLInputElement).value; - this.dataSource.filter = filterValue.trim().toLowerCase(); - - if (this.dataSource.paginator) { - this.dataSource.paginator.firstPage(); - } - } - - reverseTransaction(transaction: Transaction) { - if (transaction.isTeamWalletTransaction || transaction.note?.startsWith('Stornierung von Buchung #')) { - return; - } - - const confirmRef = this.dialog.open(ConfirmDialogComponent, { - data: { - title: 'Buchung stornieren', - message: `Buchung über ${transaction.amount} € (${transaction.playerName}, ${transaction.type}) wirklich stornieren? Es wird eine Ausgleichsbuchung erstellt, die Originalbuchung bleibt sichtbar.`, - confirmLabel: 'Stornieren' - } - }); - - confirmRef.afterClosed().subscribe(confirmed => { - if (!confirmed) { return; } - - this.teamService.reverseTransaction(transaction.id).subscribe({ - next: () => { - this.snackBar.open('Buchung wurde storniert', undefined, { duration: 5000 }); - this.load(); - }, - error: (err) => { - const message = err?.error?.message || 'Buchung konnte nicht storniert werden'; - this.snackBar.open(message, undefined, { duration: 5000, panelClass: 'snackbar_error' }); - } - }); - }); - } - - toggleNote() { - const index = this.displayedColumns.indexOf('note'); - if (index != -1) { - this.displayedColumns = this.displayedColumns.filter(column => column !== 'note'); - } else { - this.displayedColumns = [...this.displayedColumns, 'note']; - } - } - -} - -interface DialogData { - id: number; -} diff --git a/myteamwallet_frontend/src/app/shared/dialog/team-transaction-dialog/team-transaction-dialog.component.html b/myteamwallet_frontend/src/app/shared/dialog/team-transaction-dialog/team-transaction-dialog.component.html deleted file mode 100644 index 83d190d..0000000 --- a/myteamwallet_frontend/src/app/shared/dialog/team-transaction-dialog/team-transaction-dialog.component.html +++ /dev/null @@ -1,10 +0,0 @@ -

Buchung anlegen

- - - - - - - \ No newline at end of file diff --git a/myteamwallet_frontend/src/app/shared/dialog/team-transaction-dialog/team-transaction-dialog.component.scss b/myteamwallet_frontend/src/app/shared/dialog/team-transaction-dialog/team-transaction-dialog.component.scss deleted file mode 100644 index 34d47c8..0000000 --- a/myteamwallet_frontend/src/app/shared/dialog/team-transaction-dialog/team-transaction-dialog.component.scss +++ /dev/null @@ -1,6 +0,0 @@ -:host { - display: flex; - overflow: hidden; - flex-direction: column; - padding: 2px 4px 4px 4px; -} \ No newline at end of file diff --git a/myteamwallet_frontend/src/app/shared/dialog/team-transaction-dialog/team-transaction-dialog.component.spec.ts b/myteamwallet_frontend/src/app/shared/dialog/team-transaction-dialog/team-transaction-dialog.component.spec.ts deleted file mode 100644 index d1e4731..0000000 --- a/myteamwallet_frontend/src/app/shared/dialog/team-transaction-dialog/team-transaction-dialog.component.spec.ts +++ /dev/null @@ -1,23 +0,0 @@ -import { ComponentFixture, TestBed } from '@angular/core/testing'; - -import { TeamTransactionDialogComponent } from './team-transaction-dialog.component'; - -describe('TeamTransactionDialogComponent', () => { - let component: TeamTransactionDialogComponent; - let fixture: ComponentFixture; - - beforeEach(async () => { - await TestBed.configureTestingModule({ - declarations: [ TeamTransactionDialogComponent ] - }) - .compileComponents(); - - fixture = TestBed.createComponent(TeamTransactionDialogComponent); - component = fixture.componentInstance; - fixture.detectChanges(); - }); - - it('should create', () => { - expect(component).toBeTruthy(); - }); -}); diff --git a/myteamwallet_frontend/src/app/shared/dialog/team-transaction-dialog/team-transaction-dialog.component.ts b/myteamwallet_frontend/src/app/shared/dialog/team-transaction-dialog/team-transaction-dialog.component.ts deleted file mode 100644 index e5ed721..0000000 --- a/myteamwallet_frontend/src/app/shared/dialog/team-transaction-dialog/team-transaction-dialog.component.ts +++ /dev/null @@ -1,51 +0,0 @@ -import { Component, Inject, ViewChild } from '@angular/core'; -import { FormGroup, FormControl, FormsModule, ReactiveFormsModule } from '@angular/forms'; -import { MatDialogRef, MAT_DIALOG_DATA, MatDialogModule } from '@angular/material/dialog'; -import { TransactionFormComponent } from '../components/transaction-form/transaction-form.component'; -import { CommonModule } from '@angular/common'; -import { MatFormFieldModule } from '@angular/material/form-field'; -import { MatButtonModule } from '@angular/material/button'; - -@Component({ - selector: 'app-team-transaction-dialog', - templateUrl: './team-transaction-dialog.component.html', - styleUrls: ['./team-transaction-dialog.component.scss'], - standalone: true, - imports: [CommonModule, FormsModule, ReactiveFormsModule, MatFormFieldModule, TransactionFormComponent, MatButtonModule, MatDialogModule] -}) -export class TeamTransactionDialogComponent { - - constructor( - public dialogRef: MatDialogRef, - @Inject(MAT_DIALOG_DATA) public data: DialogData, - ) {} - - @ViewChild('formComponent') formComponent!: TransactionFormComponent; - - explanation = 'Hier kann eine Ausgabe oder Einnahme des Teams gebucht werden.'; - - - onOkClick() { - const form = this.formComponent.form; - const transaction = { ...form.value, teamId: this.data.teamId }; - - if (transaction.amount != null && transaction.teamId != null && transaction.type != null) { - this.dialogRef.close(transaction); - } - - - } - - close(): void { - this.dialogRef.close(); - } - - get formInvalid(): boolean { - return !this.formComponent || !this.formComponent.form.value || this.formComponent.form.value.amount == null || - this.formComponent.form.value.total == null || this.formComponent.form.value.type == null; - } -} - -interface DialogData { - teamId: number; -} \ No newline at end of file diff --git a/myteamwallet_frontend/src/app/shared/index.ts b/myteamwallet_frontend/src/app/shared/index.ts deleted file mode 100644 index bb01b0a..0000000 --- a/myteamwallet_frontend/src/app/shared/index.ts +++ /dev/null @@ -1 +0,0 @@ -export * from './dialog'; \ No newline at end of file diff --git a/myteamwallet_frontend/src/app/shared/penalties/model/penalty.interface.ts b/myteamwallet_frontend/src/app/shared/penalties/model/penalty.interface.ts deleted file mode 100644 index 06bbf62..0000000 --- a/myteamwallet_frontend/src/app/shared/penalties/model/penalty.interface.ts +++ /dev/null @@ -1,6 +0,0 @@ -export interface Penalty { - id: number; - description: string; - createdAt: string; - amount: number; -} \ No newline at end of file diff --git a/myteamwallet_frontend/src/app/shared/penalties/penalties.component.html b/myteamwallet_frontend/src/app/shared/penalties/penalties.component.html deleted file mode 100644 index cc16c1e..0000000 --- a/myteamwallet_frontend/src/app/shared/penalties/penalties.component.html +++ /dev/null @@ -1,19 +0,0 @@ -

Strafenkatalog

- -
- - Suche - - -
- @if(penalties.length > 0) { - - - {{ p.description }} - {{ p.amount | currency:'EUR' }} - - - } @else { -
Nix da...
- } -
diff --git a/myteamwallet_frontend/src/app/shared/penalties/penalties.component.scss b/myteamwallet_frontend/src/app/shared/penalties/penalties.component.scss deleted file mode 100644 index e69de29..0000000 diff --git a/myteamwallet_frontend/src/app/shared/penalties/penalties.component.spec.ts b/myteamwallet_frontend/src/app/shared/penalties/penalties.component.spec.ts deleted file mode 100644 index 7c9cda5..0000000 --- a/myteamwallet_frontend/src/app/shared/penalties/penalties.component.spec.ts +++ /dev/null @@ -1,23 +0,0 @@ -import { ComponentFixture, TestBed } from '@angular/core/testing'; - -import { PenaltiesComponent } from './penalties.component'; - -describe('PenaltiesComponent', () => { - let component: PenaltiesComponent; - let fixture: ComponentFixture; - - beforeEach(async () => { - await TestBed.configureTestingModule({ - imports: [PenaltiesComponent] - }) - .compileComponents(); - - fixture = TestBed.createComponent(PenaltiesComponent); - component = fixture.componentInstance; - fixture.detectChanges(); - }); - - it('should create', () => { - expect(component).toBeTruthy(); - }); -}); diff --git a/myteamwallet_frontend/src/app/shared/penalties/penalties.component.ts b/myteamwallet_frontend/src/app/shared/penalties/penalties.component.ts deleted file mode 100644 index 0d88e8d..0000000 --- a/myteamwallet_frontend/src/app/shared/penalties/penalties.component.ts +++ /dev/null @@ -1,49 +0,0 @@ -import { HttpClient } from '@angular/common/http'; -import { Component, Inject, inject } from '@angular/core'; -import { MatDialogRef, MAT_DIALOG_DATA, MatDialogModule } from '@angular/material/dialog'; -import { environment } from '../../../environments/environment'; -import { Penalty } from './model/penalty.interface'; -import { MatButtonModule } from '@angular/material/button'; -import { MatListModule } from '@angular/material/list'; -import { CommonModule } from '@angular/common'; -import { FormsModule, ReactiveFormsModule } from '@angular/forms'; -import { MatInputModule } from '@angular/material/input'; - -@Component({ - selector: 'app-penalties', - standalone: true, - imports: [MatDialogModule, MatButtonModule, MatListModule, CommonModule, MatInputModule, FormsModule, ReactiveFormsModule], - templateUrl: './penalties.component.html', - styleUrl: './penalties.component.scss' -}) -export class PenaltiesComponent { - - searchStr = ""; - - private http: HttpClient = inject(HttpClient); - public penalties: Penalty[] = []; - constructor( - public dialogRef: MatDialogRef, - @Inject(MAT_DIALOG_DATA) public teamId: string, - ) {} - - ngOnInit(): void { - this.loadPenalties(); - } - - get getPenalties(): any[] { - - return this.penalties.filter(p => p.description.toLocaleLowerCase().includes(this.searchStr.toLowerCase())) - return []; - } - - loadPenalties() { - const url = `${environment.apiUrl}penalty/` + this.teamId; - this.http.get(url).subscribe({ - next: n => { - this.penalties = n as Penalty[]; - } - }) - } - -} diff --git a/myteamwallet_frontend/src/app/shared/shared.module.ts b/myteamwallet_frontend/src/app/shared/shared.module.ts deleted file mode 100644 index e2f4c49..0000000 --- a/myteamwallet_frontend/src/app/shared/shared.module.ts +++ /dev/null @@ -1,15 +0,0 @@ -import { NgModule } from '@angular/core'; -import { CommonModule } from '@angular/common'; -import { UnderConstructionComponent } from './under-construction/under-construction.component'; -import { DialogModule } from './dialog/dialog.module'; - - -@NgModule({ - declarations: [ UnderConstructionComponent ], - imports: [ - CommonModule, - DialogModule - ], - exports: [ UnderConstructionComponent ] -}) -export class SharedModule { } diff --git a/myteamwallet_frontend/src/app/shared/under-construction/under-construction.component.html b/myteamwallet_frontend/src/app/shared/under-construction/under-construction.component.html deleted file mode 100644 index 92af98d..0000000 --- a/myteamwallet_frontend/src/app/shared/under-construction/under-construction.component.html +++ /dev/null @@ -1,4 +0,0 @@ - - -
Under Construction
-
please stand by for news
diff --git a/myteamwallet_frontend/src/app/shared/under-construction/under-construction.component.scss b/myteamwallet_frontend/src/app/shared/under-construction/under-construction.component.scss deleted file mode 100644 index 14df634..0000000 --- a/myteamwallet_frontend/src/app/shared/under-construction/under-construction.component.scss +++ /dev/null @@ -1,8 +0,0 @@ -:host { - width: 100vw; - height: 100vh; - display: flex; - justify-content: center; - flex-direction: column; - align-items: center; -} \ No newline at end of file diff --git a/myteamwallet_frontend/src/app/shared/under-construction/under-construction.component.spec.ts b/myteamwallet_frontend/src/app/shared/under-construction/under-construction.component.spec.ts deleted file mode 100644 index 338a2ca..0000000 --- a/myteamwallet_frontend/src/app/shared/under-construction/under-construction.component.spec.ts +++ /dev/null @@ -1,23 +0,0 @@ -import { ComponentFixture, TestBed } from '@angular/core/testing'; - -import { UnderConstructionComponent } from './under-construction.component'; - -describe('UnderConstructionComponent', () => { - let component: UnderConstructionComponent; - let fixture: ComponentFixture; - - beforeEach(async () => { - await TestBed.configureTestingModule({ - declarations: [ UnderConstructionComponent ] - }) - .compileComponents(); - - fixture = TestBed.createComponent(UnderConstructionComponent); - component = fixture.componentInstance; - fixture.detectChanges(); - }); - - it('should create', () => { - expect(component).toBeTruthy(); - }); -}); diff --git a/myteamwallet_frontend/src/app/shared/under-construction/under-construction.component.ts b/myteamwallet_frontend/src/app/shared/under-construction/under-construction.component.ts deleted file mode 100644 index 617f2d3..0000000 --- a/myteamwallet_frontend/src/app/shared/under-construction/under-construction.component.ts +++ /dev/null @@ -1,10 +0,0 @@ -import { Component } from '@angular/core'; - -@Component({ - selector: 'app-under-construction', - templateUrl: './under-construction.component.html', - styleUrls: ['./under-construction.component.scss'] -}) -export class UnderConstructionComponent { - -} diff --git a/myteamwallet_frontend/src/assets/.gitkeep b/myteamwallet_frontend/src/assets/.gitkeep deleted file mode 100644 index e69de29..0000000 diff --git a/myteamwallet_frontend/src/assets/favicon.png b/myteamwallet_frontend/src/assets/favicon.png deleted file mode 100644 index b92db68..0000000 Binary files a/myteamwallet_frontend/src/assets/favicon.png and /dev/null differ diff --git a/myteamwallet_frontend/src/assets/screenshots/screen_mobile.png b/myteamwallet_frontend/src/assets/screenshots/screen_mobile.png deleted file mode 100644 index dd973c4..0000000 Binary files a/myteamwallet_frontend/src/assets/screenshots/screen_mobile.png and /dev/null differ diff --git a/myteamwallet_frontend/src/assets/screenshots/screen_wide.png b/myteamwallet_frontend/src/assets/screenshots/screen_wide.png deleted file mode 100644 index 5e76c78..0000000 Binary files a/myteamwallet_frontend/src/assets/screenshots/screen_wide.png and /dev/null differ diff --git a/myteamwallet_frontend/src/assets/sports.svg b/myteamwallet_frontend/src/assets/sports.svg deleted file mode 100644 index 5a14a15..0000000 --- a/myteamwallet_frontend/src/assets/sports.svg +++ /dev/null @@ -1,84 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/myteamwallet_frontend/src/environments/environment.dev.ts b/myteamwallet_frontend/src/environments/environment.dev.ts deleted file mode 100644 index 0d3e58b..0000000 --- a/myteamwallet_frontend/src/environments/environment.dev.ts +++ /dev/null @@ -1,5 +0,0 @@ -export const environment = { - production: false, - apiUrl: 'http://localhost:3999/api/v1/', - appVersion: require('../../package.json').version + '-dev', -}; \ No newline at end of file diff --git a/myteamwallet_frontend/src/environments/environment.prod.ts b/myteamwallet_frontend/src/environments/environment.prod.ts deleted file mode 100644 index f065de1..0000000 --- a/myteamwallet_frontend/src/environments/environment.prod.ts +++ /dev/null @@ -1,5 +0,0 @@ -export const environment = { - production: true, - apiUrl: 'https://myteamwallet.de/api/v1/', - appVersion: require('../../package.json').version, -}; \ No newline at end of file diff --git a/myteamwallet_frontend/src/environments/environment.ts b/myteamwallet_frontend/src/environments/environment.ts deleted file mode 100644 index f065de1..0000000 --- a/myteamwallet_frontend/src/environments/environment.ts +++ /dev/null @@ -1,5 +0,0 @@ -export const environment = { - production: true, - apiUrl: 'https://myteamwallet.de/api/v1/', - appVersion: require('../../package.json').version, -}; \ No newline at end of file diff --git a/myteamwallet_frontend/src/favicon.ico b/myteamwallet_frontend/src/favicon.ico deleted file mode 100644 index 997406a..0000000 Binary files a/myteamwallet_frontend/src/favicon.ico and /dev/null differ diff --git a/myteamwallet_frontend/src/index.html b/myteamwallet_frontend/src/index.html deleted file mode 100644 index 9db87f6..0000000 --- a/myteamwallet_frontend/src/index.html +++ /dev/null @@ -1,19 +0,0 @@ - - - - - My Teamwallet - - - - - - - - - - - - - - diff --git a/myteamwallet_frontend/src/main.ts b/myteamwallet_frontend/src/main.ts deleted file mode 100644 index c58dc05..0000000 --- a/myteamwallet_frontend/src/main.ts +++ /dev/null @@ -1,7 +0,0 @@ -import { platformBrowserDynamic } from '@angular/platform-browser-dynamic'; - -import { AppModule } from './app/app.module'; - - -platformBrowserDynamic().bootstrapModule(AppModule) - .catch(err => console.error(err)); diff --git a/myteamwallet_frontend/src/manifest.webmanifest b/myteamwallet_frontend/src/manifest.webmanifest deleted file mode 100644 index 2f8c355..0000000 --- a/myteamwallet_frontend/src/manifest.webmanifest +++ /dev/null @@ -1,34 +0,0 @@ -{ - "name": "Teamwallet", - "short_name": "Teamwallet", - "description": "Teamwallet is a simple app to manage your team's expenses.", - "theme_color": "#000", - "background_color": "#000", - "display": "fullscreen", - "scope": "./", - "start_url": "./", - "icons": [ - { - "src": "assets/sports.svg", - "sizes": "150x150", - "type": "image/svg+xml", - "purpose": "any" - } - ], - "screenshots": [ - { - "src": "assets/screenshots/screen_mobile.png", - "sizes": "800x1748", - "type": "image/png", - "form_factor": "narrow", - "label": "Wonder Widgets" - }, - { - "src": "assets/screenshots/screen_wide.png", - "sizes": "2732x2048", - "type": "image/png", - "form_factor": "wide", - "label": "Wonder Widgets" - } - ] -} diff --git a/myteamwallet_frontend/src/styles.scss b/myteamwallet_frontend/src/styles.scss deleted file mode 100644 index e8de282..0000000 --- a/myteamwallet_frontend/src/styles.scss +++ /dev/null @@ -1,118 +0,0 @@ -/* You can add global styles to this file, and also import other style files */ - -@use '@angular/material' as mat; -@use './styles/theme'; -@use './styles/tokens'; - -@include mat.core(); - -html { - @include mat.all-component-themes(theme.$teamwallet-theme); - @include mat.typography-hierarchy(theme.$teamwallet-theme); -} - -html, body { height: 100%; overflow: hidden; } -body { margin: 0; font-family: Inter, Roboto, "Helvetica Neue", sans-serif; background-color: var(--tw-surface-bg); } - -app-root { - height: 100%; - overflow: hidden; - display: block; -} - -.table-row { - cursor: pointer; - background-color: white !important; - transition: background-color 0.4s ease-in-out; - - &:hover { - background-color: rgb(245, 245, 245) !important; - } -} - -/* custom scrollbar */ -::-webkit-scrollbar { - width: 20px; -} - -::-webkit-scrollbar-track { - background-color: transparent; -} - -::-webkit-scrollbar-thumb { - background-color: #d6dee1; - border-radius: 20px; - border: 6px solid transparent; - background-clip: content-box; -} - -::-webkit-scrollbar-thumb:hover { - background-color: #a8bbbf; -} - -.toolbar { - display: flex; - justify-content: space-between; -} - -.card { - padding: var(--tw-space-3); - box-shadow: var(--tw-elevation-1); - margin: var(--tw-space-1); - background-color: var(--tw-surface-card); - border-radius: var(--tw-radius-md); - - &.flat { - background-color: transparent; - box-shadow: none; - outline: #ddd solid 1px; - } -} - -.flex-row { - display: flex; - justify-content: space-between; - align-items: center; - flex-direction: row !important; -} - -.snackbar_error > .mdc-snackbar__surface { - background-color: var(--tw-balance-negative) !important; - - .mat-mdc-snack-bar-label { - color: white !important; - } -} - -.splitted_form { - display: flex; -} - -.first { - margin-right: 4px; -} - -.last { - margin-left: 4px; -} - -.middle { - margin-left: 4px; - margin-right: 4px; -} - -.spinner_container { - position: absolute; - width: 100%; - height: 100%; - background-color: rgba(50, 50, 50, 0.2); - display: flex; - flex-direction: column; - align-items: center; - justify-content: center; - z-index: 100; -} - -h1 { - font-size: 2rem !important; -} \ No newline at end of file diff --git a/myteamwallet_frontend/src/styles/_theme.scss b/myteamwallet_frontend/src/styles/_theme.scss deleted file mode 100644 index 9d1afa1..0000000 --- a/myteamwallet_frontend/src/styles/_theme.scss +++ /dev/null @@ -1,16 +0,0 @@ -@use '@angular/material' as mat; - -$teamwallet-theme: mat.define-theme(( - color: ( - theme-type: light, - primary: mat.$blue-palette, - tertiary: mat.$spring-green-palette, - ), - typography: ( - brand-family: 'Inter, Roboto, "Helvetica Neue", sans-serif', - plain-family: 'Inter, Roboto, "Helvetica Neue", sans-serif', - ), - density: ( - scale: 0, - ), -)); diff --git a/myteamwallet_frontend/src/styles/_tokens.scss b/myteamwallet_frontend/src/styles/_tokens.scss deleted file mode 100644 index 605bbd9..0000000 --- a/myteamwallet_frontend/src/styles/_tokens.scss +++ /dev/null @@ -1,30 +0,0 @@ -:root { - // Spacing (8px-Grid) - --tw-space-1: 4px; - --tw-space-2: 8px; - --tw-space-3: 12px; - --tw-space-4: 16px; - --tw-space-6: 24px; - --tw-space-8: 32px; - - // Radius - --tw-radius-sm: 8px; - --tw-radius-md: 12px; - --tw-radius-lg: 16px; - - // Elevation (ersetzt die bisher wiederholte box-shadow-Deklaration) - --tw-elevation-1: 0 1px 2px rgba(15, 23, 42, 0.06), 0 1px 3px rgba(15, 23, 42, 0.1); - --tw-elevation-2: 0 2px 4px rgba(15, 23, 42, 0.06), 0 4px 8px rgba(15, 23, 42, 0.1); - - // Semantische Saldo-Farben (fintech-modern: gedämpftes Grün/Rot statt Signalfarben) - --tw-balance-positive: #1b8a5a; - --tw-balance-negative: #c4351c; - --tw-balance-neutral: #64748b; - - // Flächen - --tw-surface-bg: #f7f8fa; - --tw-surface-card: #ffffff; - - // Angular Material's own app-level background variable should follow our token - --mat-app-background-color: var(--tw-surface-bg); -} diff --git a/myteamwallet_frontend/tsconfig.app.json b/myteamwallet_frontend/tsconfig.app.json deleted file mode 100644 index 374cc9d..0000000 --- a/myteamwallet_frontend/tsconfig.app.json +++ /dev/null @@ -1,14 +0,0 @@ -/* To learn more about this file see: https://angular.io/config/tsconfig. */ -{ - "extends": "./tsconfig.json", - "compilerOptions": { - "outDir": "./out-tsc/app", - "types": [] - }, - "files": [ - "src/main.ts" - ], - "include": [ - "src/**/*.d.ts" - ] -} diff --git a/myteamwallet_frontend/tsconfig.json b/myteamwallet_frontend/tsconfig.json deleted file mode 100644 index aba032a..0000000 --- a/myteamwallet_frontend/tsconfig.json +++ /dev/null @@ -1,36 +0,0 @@ -/* To learn more about this file see: https://angular.io/config/tsconfig. */ -{ - "compileOnSave": false, - "compilerOptions": { - "baseUrl": "./", - "outDir": "./dist/out-tsc", - "forceConsistentCasingInFileNames": true, - "strict": true, - "noImplicitOverride": true, - "noPropertyAccessFromIndexSignature": true, - "noImplicitReturns": true, - "noFallthroughCasesInSwitch": true, - "sourceMap": true, - "declaration": false, - "downlevelIteration": true, - "experimentalDecorators": true, - "moduleResolution": "node", - "importHelpers": true, - "target": "ES2022", - "module": "ES2022", - "useDefineForClassFields": false, - "lib": [ - "ES2022", - "dom" - ] - }, - "angularCompilerOptions": { - "enableI18nLegacyMessageIdFormat": false, - "strictInjectionParameters": true, - "strictInputAccessModifiers": true, - "strictTemplates": true, - }, - "include": [ - "public/*" - ] -} diff --git a/myteamwallet_frontend/tsconfig.spec.json b/myteamwallet_frontend/tsconfig.spec.json deleted file mode 100644 index be7e9da..0000000 --- a/myteamwallet_frontend/tsconfig.spec.json +++ /dev/null @@ -1,14 +0,0 @@ -/* To learn more about this file see: https://angular.io/config/tsconfig. */ -{ - "extends": "./tsconfig.json", - "compilerOptions": { - "outDir": "./out-tsc/spec", - "types": [ - "jasmine" - ] - }, - "include": [ - "src/**/*.spec.ts", - "src/**/*.d.ts" - ] -}