Skip to content

Commit

Permalink
Adjust unconfirmed transactions table
Browse files Browse the repository at this point in the history
id, author, date and amount are usually not of interest in the first
place.
  • Loading branch information
FestplattenSchnitzel committed Oct 2, 2024
1 parent 1940cc7 commit 81659da
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 20 deletions.
13 changes: 1 addition & 12 deletions web/blueprints/finance/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -1181,13 +1181,13 @@ def _format_transaction_row(
bank_acc_act: BankAccountActivity | None,
) -> UnconfirmedTransactionsRow:
return UnconfirmedTransactionsRow(
id=transaction.id,
description=LinkColResponse(
href=url_for(".transactions_show", transaction_id=transaction.id),
title=transaction.description,
new_tab=True,
glyphicon="fa-external-link-alt",
),
other_name=bank_acc_act.other_name if bank_acc_act else None,
user=(
LinkColResponse(
href=url_for("user.user_show", user_id=user_account.user.id),
Expand All @@ -1205,17 +1205,6 @@ def _format_transaction_row(
if user_account and user_account.user and user_account.user.room
else None
),
author=(
LinkColResponse(
href=url_for("user.user_show", user_id=transaction.author.id),
title=transaction.author.name,
new_tab=True,
)
if transaction.author
else None
),
date=date_format(transaction.posted_at, formatter=date_filter),
amount=money_filter(transaction.amount),
actions=list(_iter_transaction_buttons(bank_acc_act, transaction)),
)

Expand Down
10 changes: 2 additions & 8 deletions web/blueprints/finance/tables.py
Original file line number Diff line number Diff line change
Expand Up @@ -306,24 +306,18 @@ class TransactionSplitResponse(TableResponse[TransactionSplitRow]):
class UnconfirmedTransactionsTable(BootstrapTable):
"""A table for displaying unconfirmed transactions """
selection = Column("Checkbox", col_args={"data-checkbox": "true"})
id = Column("id")
description = LinkColumn("Beschreibung")
other_name = Column("Bankkontoinhaber")
user = LinkColumn("Nutzer")
room = Column("Wohnort")
date = DateColumn("Datum")
amount = Column("Wert")
author = LinkColumn("Ersteller")
actions = MultiBtnColumn("Aktionen")


class UnconfirmedTransactionsRow(BaseModel):
id: str | int
description: LinkColResponse
other_name: str | None = None
user: LinkColResponse | None = None
room: str | None = None
date: DateColResponse
amount: str
author: LinkColResponse | None = None
actions: list[BtnColResponse]


Expand Down

0 comments on commit 81659da

Please sign in to comment.