diff --git a/myteamwallet_frontend_modern/src/app/features/public-team/public-player.html b/myteamwallet_frontend_modern/src/app/features/public-team/public-player.html index a64df09..7f6160c 100644 --- a/myteamwallet_frontend_modern/src/app/features/public-team/public-player.html +++ b/myteamwallet_frontend_modern/src/app/features/public-team/public-player.html @@ -21,8 +21,8 @@ } @else {
@for (transaction of transactions(); track transaction.id) { -
receipt_long
+ +
receipt_long
{{ typeLabel(transaction) }}{{ transaction.date | date: 'dd.MM.yyyy' }} @@ -30,10 +30,14 @@ {{ transaction.note }} }
- {{ - displayAmount(transaction) | currency: 'EUR' - }}
+ + + +
}
} diff --git a/myteamwallet_frontend_modern/src/app/features/public-team/public-player.scss b/myteamwallet_frontend_modern/src/app/features/public-team/public-player.scss index 9f0d8f0..c3859af 100644 --- a/myteamwallet_frontend_modern/src/app/features/public-team/public-player.scss +++ b/myteamwallet_frontend_modern/src/app/features/public-team/public-player.scss @@ -74,9 +74,6 @@ main { .transactions small { color: var(--mat-sys-on-surface-variant); } -.amount { - font-variant-numeric: tabular-nums; -} .state { min-height: 300px; display: grid; diff --git a/myteamwallet_frontend_modern/src/app/features/public-team/public-player.spec.ts b/myteamwallet_frontend_modern/src/app/features/public-team/public-player.spec.ts index 0e2f94f..ba6f087 100644 --- a/myteamwallet_frontend_modern/src/app/features/public-team/public-player.spec.ts +++ b/myteamwallet_frontend_modern/src/app/features/public-team/public-player.spec.ts @@ -32,6 +32,20 @@ describe('PublicPlayer', () => { { id: 1, date: '2026-07-31', + amount: 12, + note: 'Beitrag', + type: { id: 0, name: 'payment' }, + }, + { + id: 2, + date: '2026-07-30', + amount: -3, + note: 'Korrektur', + type: { id: 0, name: 'payment' }, + }, + { + id: 3, + date: '2026-07-29', amount: 5, note: 'Training', type: { id: 11, name: 'fine' }, @@ -48,6 +62,17 @@ describe('PublicPlayer', () => { expect(fixture.nativeElement.textContent).toContain('Ada Lovelace'); expect(fixture.nativeElement.textContent).toContain('Training'); - expect(fixture.nativeElement.textContent).toContain('-5,00'); + const amounts = [ + ...fixture.nativeElement.querySelectorAll( + 'app-transaction-amount [data-testid="transaction-amount"]', + ), + ] as HTMLElement[]; + expect(amounts).toHaveLength(3); + expect(amounts[0].classList).toContain('inflow'); + expect(amounts[1].classList).toContain('outflow'); + expect(amounts[2].classList).toContain('neutral'); + expect( + amounts.map((amount) => amount.querySelector('.transaction-amount__sign')?.textContent), + ).toEqual(['+', '−', '']); }); }); diff --git a/myteamwallet_frontend_modern/src/app/features/public-team/public-player.ts b/myteamwallet_frontend_modern/src/app/features/public-team/public-player.ts index 59398c2..b6dc58d 100644 --- a/myteamwallet_frontend_modern/src/app/features/public-team/public-player.ts +++ b/myteamwallet_frontend_modern/src/app/features/public-team/public-player.ts @@ -1,4 +1,4 @@ -import { CurrencyPipe, DatePipe, registerLocaleData } from '@angular/common'; +import { DatePipe, registerLocaleData } from '@angular/common'; import localeDe from '@angular/common/locales/de'; import { Component, LOCALE_ID, inject, signal } from '@angular/core'; import { ActivatedRoute, RouterLink } from '@angular/router'; @@ -8,21 +8,21 @@ import { MatIconModule } from '@angular/material/icon'; import { MatProgressSpinnerModule } from '@angular/material/progress-spinner'; import { PublicTeamApi } from '../../core/team/public-team-api'; import { PlayerTransaction } from '../../models/transaction.model'; -import { signedTransactionAmount } from '../../models/transaction-amount'; import { PublicPlayer as PublicPlayerModel } from '../../models/public-access.model'; +import { TransactionAmount } from '../../shared/transaction-amount/transaction-amount'; registerLocaleData(localeDe); @Component({ selector: 'app-public-player', imports: [ - CurrencyPipe, DatePipe, RouterLink, MatButtonModule, MatCardModule, MatIconModule, MatProgressSpinnerModule, + TransactionAmount, ], providers: [{ provide: LOCALE_ID, useValue: 'de-DE' }], templateUrl: './public-player.html', @@ -72,8 +72,4 @@ export class PublicPlayer { )[type] ?? type ); } - - protected displayAmount(transaction: PlayerTransaction): number { - return signedTransactionAmount(transaction.amount, transaction.type); - } } diff --git a/myteamwallet_frontend_modern/src/app/features/team/cashbox/cashbox.html b/myteamwallet_frontend_modern/src/app/features/team/cashbox/cashbox.html index 3b5cfa1..e811427 100644 --- a/myteamwallet_frontend_modern/src/app/features/team/cashbox/cashbox.html +++ b/myteamwallet_frontend_modern/src/app/features/team/cashbox/cashbox.html @@ -167,7 +167,13 @@ {{ activity.note }} } - {{ displayAmount(activity) | currency: 'EUR' }} + + + @if (canReverse(activity)) {