Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Adjust unconfirmed transactions table #758

Open
wants to merge 1 commit into
base: develop
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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),
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think this could still be helpful to see first hand

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