Skip to content

Conversation

@tamibalogh
Copy link
Collaborator

No description provided.

@tamibalogh tamibalogh added this to the v1.1.0 milestone Dec 29, 2025
Copilot AI review requested due to automatic review settings December 29, 2025 22:57
@tamibalogh tamibalogh review requested due to automatic review settings December 29, 2025 22:58
@tamibalogh tamibalogh assigned tamibalogh and unassigned ntamasa Dec 29, 2025
@tamibalogh tamibalogh requested a review from ntamasa December 29, 2025 22:59
this.dialog.open<CreateTransactionDialogComponent, CreateTransactionDialogData, Transaction>(
CreateTransactionDialogComponent, undefined
).afterClosed().subscribe(
async (newTransaction?: Transaction) => {
Copy link
Collaborator

Choose a reason for hiding this comment

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

Fölösleges az async, nincs benne semmi asynchronous művelet.

return this.categories().length > 0;
}

hasTransactions(): boolean {
Copy link
Collaborator

Choose a reason for hiding this comment

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

Legyenek inkább getterek.

<span class="">{{ category.emoji }}</span>
{{ category.name }}
</div>
@if (hasCategories()) {
Copy link
Collaborator

Choose a reason for hiding this comment

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

Mivel nem lehet transaction category nelkül, így ez a feltétel felesleges és csak az else ágat duplikálja. így ezt vegyük ki és alul pedig vonjuk össze egy else ágba a kettőt, akár ternary akár logikai operatorral.

return Math.floor((amount / this.totalExpense()) * 100);
}

get hasCategories(): boolean {
Copy link
Collaborator

Choose a reason for hiding this comment

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

Az Exenceben mi követünk egy kód sorrendet ts fileok esetén amire van is eslint config, ami ahogy látom neked most nem nagyon akar működni.

fieldek (erre nincs külön, de itt is próbáljuk tartani a private readonly -> private -> readonly/public sorrendet tartani)
getterek, setterek
constructor
public methodok
private methodok

Próbáld meg, hogy Ctrl + Shift + P és Restart ESLint Server ezzel jónak kellene lennie.

  • meggondoltam magam legyenek inkább computed valuek, jobbak mint a getterek mert nem számtjuk ki őket minden rerendernél, hanem cachelve vannak és csak akkor számítódnaki ki újra, ha az a dolog változik amit benne használunk (mondjuk itt a categories InputSignal)

}

get hasTransactions(): boolean {
return this.categorySummaries().length > 0;
Copy link
Collaborator

Choose a reason for hiding this comment

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

Nekem ez is megfelel, rád van bízva megváltoztatod-e de én a legtöbb helyen így csinálom:

Suggested change
return this.categorySummaries().length > 0;
return !!this.categorySummaries().length;

class="h-100"
[totalExpense]="totals.totalExpense"
[categories]="topCategories!"
[categorySummaries]="topCategories!"
Copy link
Collaborator

Choose a reason for hiding this comment

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

Legyen konzisztensen topCategories.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants