components
This commit is contained in:
@@ -11,7 +11,7 @@ import { ButtonComponent } from '../../ui/button/button.component';
|
||||
import { PaginatorComponent } from '../paginator/paginator.component';
|
||||
|
||||
|
||||
import { OrderStatus } from '../../../../core/types/order';
|
||||
// import { any } from '../../../../core/types/order';
|
||||
import { SearchBarComponent } from '../../layout/search-bar/search-bar.component';
|
||||
|
||||
@Component({
|
||||
@@ -38,7 +38,7 @@ export class OrdersTableComponent {
|
||||
@Output() delete = new EventEmitter<string>();
|
||||
|
||||
public searchTerm = '';
|
||||
public selectedStatus: OrderStatus | 'all' = 'all';
|
||||
public selectedStatus: any | 'all' = 'all';
|
||||
|
||||
public statusOptions: any[] = [
|
||||
{ value: 'all', label: 'Alle' },
|
||||
@@ -52,7 +52,7 @@ export class OrdersTableComponent {
|
||||
public displayedOrders: any[] = [];
|
||||
public currentPage = 1;
|
||||
|
||||
private statusTextMap = new Map<OrderStatus, string>([
|
||||
private statusTextMap = new Map<any, string>([
|
||||
['completed', 'Abgeschlossen'],
|
||||
['processing', 'In Bearbeitung'],
|
||||
['cancelled', 'Storniert'],
|
||||
@@ -76,7 +76,7 @@ export class OrdersTableComponent {
|
||||
}
|
||||
|
||||
// Called when a status pill is clicked
|
||||
onStatusChange(status: OrderStatus | 'all'): void {
|
||||
onStatusChange(status: any | 'all'): void {
|
||||
this.selectedStatus = status;
|
||||
this.applyFiltersAndPagination();
|
||||
}
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
import { Component, Input, OnChanges } from '@angular/core';
|
||||
import { CommonModule, NgClass } from '@angular/common';
|
||||
import { OrderStatus } from '../../../../core/types/order';
|
||||
// import { OrderStatus } from '../../../../core/types/order';
|
||||
|
||||
@Component({
|
||||
selector: 'app-status-pill',
|
||||
@@ -11,14 +11,14 @@ import { OrderStatus } from '../../../../core/types/order';
|
||||
})
|
||||
export class StatusPillComponent implements OnChanges {
|
||||
// Nimmt jetzt den neuen, sprechenden Status entgegen
|
||||
@Input() status: OrderStatus = 'info';
|
||||
@Input() status: any = 'info';
|
||||
|
||||
// Diese Eigenschaften werden vom Template verwendet
|
||||
public displayText = '';
|
||||
public cssClass = '';
|
||||
|
||||
// Eine Map, die Statusnamen auf Text und CSS-Klasse abbildet
|
||||
private statusMap = new Map<OrderStatus, { text: string, css: string }>([
|
||||
private statusMap = new Map<any, { text: string, css: string }>([
|
||||
['completed', { text: 'Abgeschlossen', css: 'pill-success' }],
|
||||
['processing', { text: 'In Bearbeitung', css: 'pill-warning' }],
|
||||
['cancelled', { text: 'Storniert', css: 'pill-danger' }],
|
||||
|
||||
Reference in New Issue
Block a user