Skip to content

Commit

Permalink
Remove order history from the balance tab to improve performance
Browse files Browse the repository at this point in the history
  • Loading branch information
konkit committed Dec 17, 2023
1 parent c6eec75 commit dd8396f
Show file tree
Hide file tree
Showing 7 changed files with 1 addition and 132 deletions.
2 changes: 0 additions & 2 deletions frontend-angular/src/app/app.module.ts
Original file line number Diff line number Diff line change
Expand Up @@ -85,7 +85,6 @@ import {
} from './views/orders/show-order-view/components/order-entries-list/components/edit-order-entry/edit-order-entry.component';
import {UserOrdersComponent} from './views/orders/make-an-order-view/components/user-orders/user-orders.component';
import {EditOrderViewComponent} from './views/orders/edit-order-view/edit-order-view.component';
import {BalanceEntryComponent} from './views/balance/balance-view/components/balance-entry/balance-entry.component';
import {MatAutocompleteModule} from "@angular/material/autocomplete";
import {
OrderEntryFormComponent
Expand Down Expand Up @@ -176,7 +175,6 @@ import {
EditOrderEntryComponent,
UserOrdersComponent,
EditOrderViewComponent,
BalanceEntryComponent,
OrderEntryFormComponent,
SideDishesInputComponent,
OrderStateButtonsComponent,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -30,28 +30,6 @@ <h2>Your Balance</h2>
</mat-list>
</div>
</div>

<div class="pb-5">
<h2>Your order history:</h2>

<div *ngIf="orderHistoryEntries.length > 0">
<mat-list>
<mat-list-item matListItemLine *ngFor="let historyEntry of orderHistoryEntries">
<div>
<app-balance-entry [historyEntry]="historyEntry"></app-balance-entry>
</div>
</mat-list-item>
</mat-list>
</div>

<div *ngIf="orderHistoryEntries.length === 0">
<mat-list>
<mat-list-item>
Your order history is empty.
</mat-list-item>
</mat-list>
</div>
</div>
</div>

<ng-template #spinner>
Expand Down
Original file line number Diff line number Diff line change
@@ -1,9 +1,5 @@
import {Component, OnInit} from '@angular/core';
import {
BalanceControllerService,
OrderHistoryCreatedEntry,
OrderHistoryParticipatedEntry
} from "../../../../frontend-client";
import {BalanceControllerService,} from "../../../../frontend-client";

@Component({
selector: 'app-balance-view',
Expand All @@ -12,7 +8,6 @@ import {
})
export class BalanceViewComponent implements OnInit {
isLoading = true
orderHistoryEntries: (OrderHistoryCreatedEntry | OrderHistoryParticipatedEntry)[] = []
owedMoneyEntries: [string, number][] = []

constructor(private balanceControllerService: BalanceControllerService) {
Expand All @@ -21,17 +16,8 @@ export class BalanceViewComponent implements OnInit {
ngOnInit() {
this.balanceControllerService.getBalanceForUser()
.subscribe(response => {
this.orderHistoryEntries = response.entries
this.owedMoneyEntries = Object.entries(response.owedMoney)
this.isLoading = false
})
}

isCreatedEntry(entry: OrderHistoryCreatedEntry | OrderHistoryParticipatedEntry): entry is OrderHistoryCreatedEntry {
return entry.kind == "createdEntry"
}

isParticipatedEntry(entry: OrderHistoryCreatedEntry | OrderHistoryParticipatedEntry): entry is OrderHistoryParticipatedEntry {
return entry.kind == "participatedEntry"
}
}

This file was deleted.

Empty file.

This file was deleted.

This file was deleted.

2 comments on commit dd8396f

@Mierunski
Copy link

Choose a reason for hiding this comment

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

please revert :( This really makes problems when trying to collect payment from ppl

@konkit
Copy link
Owner Author

@konkit konkit commented on dd8396f Jan 9, 2024

Choose a reason for hiding this comment

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

Should be reverted now, apologies for the inconvenience.

Please sign in to comment.