Moved to Angular 20
Moved to Tailwind 4 Moved to Python 3.13 Enabled arm64/v8 Builds
This commit is contained in:
@ -2,11 +2,10 @@ import { Routes } from '@angular/router';
|
||||
|
||||
import { authGuard } from '../auth/auth-guard.service';
|
||||
import { taxListResolver } from '../taxes/tax-list.resolver';
|
||||
|
||||
import { productListResolver } from './product-list.resolver';
|
||||
import { SaleCategoryDetailComponent } from './sale-category-detail/sale-category-detail.component';
|
||||
import { SaleCategoryListComponent } from './sale-category-list/sale-category-list.component';
|
||||
import { saleCategoryListResolver } from './sale-category-list.resolver';
|
||||
import { SaleCategoryListComponent } from './sale-category-list/sale-category-list.component';
|
||||
import { saleCategoryResolver } from './sale-category.resolver';
|
||||
|
||||
export const routes: Routes = [
|
||||
|
||||
@ -1,5 +1,5 @@
|
||||
import { CurrencyPipe } from '@angular/common';
|
||||
import { AfterViewInit, Component, ElementRef, OnInit, ViewChild } from '@angular/core';
|
||||
import { AfterViewInit, Component, ElementRef, OnInit, ViewChild, inject } from '@angular/core';
|
||||
import { FormControl, FormGroup, ReactiveFormsModule } from '@angular/forms';
|
||||
import { MatButtonModule } from '@angular/material/button';
|
||||
import { MatCardModule } from '@angular/material/card';
|
||||
@ -19,7 +19,6 @@ import { Tax } from '../../core/tax';
|
||||
import { ToasterService } from '../../core/toaster.service';
|
||||
import { ConfirmDialogComponent } from '../../shared/confirm-dialog/confirm-dialog.component';
|
||||
import { SaleCategoryService } from '../sale-category.service';
|
||||
|
||||
import { SaleCategoryDetailDatasource } from './sale-category-detail-datasource';
|
||||
|
||||
@Component({
|
||||
@ -40,6 +39,12 @@ import { SaleCategoryDetailDatasource } from './sale-category-detail-datasource'
|
||||
],
|
||||
})
|
||||
export class SaleCategoryDetailComponent implements OnInit, AfterViewInit {
|
||||
private route = inject(ActivatedRoute);
|
||||
private router = inject(Router);
|
||||
private dialog = inject(MatDialog);
|
||||
private toaster = inject(ToasterService);
|
||||
private ser = inject(SaleCategoryService);
|
||||
|
||||
@ViewChild('nameElement', { static: true }) nameElement?: ElementRef;
|
||||
form: FormGroup<{
|
||||
name: FormControl<string>;
|
||||
@ -53,13 +58,7 @@ export class SaleCategoryDetailComponent implements OnInit, AfterViewInit {
|
||||
dataSource: SaleCategoryDetailDatasource = new SaleCategoryDetailDatasource(this.products);
|
||||
displayedColumns = ['name', 'price', 'menuCategory'];
|
||||
|
||||
constructor(
|
||||
private route: ActivatedRoute,
|
||||
private router: Router,
|
||||
private dialog: MatDialog,
|
||||
private toaster: ToasterService,
|
||||
private ser: SaleCategoryService,
|
||||
) {
|
||||
constructor() {
|
||||
// Create form
|
||||
this.form = new FormGroup({
|
||||
name: new FormControl<string>('', { nonNullable: true }),
|
||||
|
||||
@ -2,7 +2,6 @@ import { inject } from '@angular/core';
|
||||
import { ResolveFn } from '@angular/router';
|
||||
|
||||
import { SaleCategory } from '../core/sale-category';
|
||||
|
||||
import { SaleCategoryService } from './sale-category.service';
|
||||
|
||||
export const saleCategoryListResolver: ResolveFn<SaleCategory[]> = () => {
|
||||
|
||||
@ -1,5 +1,5 @@
|
||||
import { PercentPipe } from '@angular/common';
|
||||
import { Component, OnInit } from '@angular/core';
|
||||
import { Component, OnInit, inject } from '@angular/core';
|
||||
import { MatButtonModule } from '@angular/material/button';
|
||||
import { MatCardModule } from '@angular/material/card';
|
||||
import { MatIconModule } from '@angular/material/icon';
|
||||
@ -10,7 +10,6 @@ import { BehaviorSubject } from 'rxjs';
|
||||
import { SaleCategory } from '../../core/sale-category';
|
||||
import { ToasterService } from '../../core/toaster.service';
|
||||
import { SaleCategoryService } from '../sale-category.service';
|
||||
|
||||
import { SaleCategoryListDatasource } from './sale-category-list-datasource';
|
||||
|
||||
@Component({
|
||||
@ -20,6 +19,11 @@ import { SaleCategoryListDatasource } from './sale-category-list-datasource';
|
||||
imports: [MatButtonModule, MatCardModule, MatIconModule, MatTableModule, PercentPipe, RouterLink],
|
||||
})
|
||||
export class SaleCategoryListComponent implements OnInit {
|
||||
private route = inject(ActivatedRoute);
|
||||
private router = inject(Router);
|
||||
private toaster = inject(ToasterService);
|
||||
private ser = inject(SaleCategoryService);
|
||||
|
||||
// @ViewChild('table', { static: true }) table?: MatTable<SaleCategory>;
|
||||
data: BehaviorSubject<SaleCategory[]> = new BehaviorSubject<SaleCategory[]>([]);
|
||||
dataSource: SaleCategoryListDatasource = new SaleCategoryListDatasource(this.data);
|
||||
@ -27,12 +31,7 @@ export class SaleCategoryListComponent implements OnInit {
|
||||
/** Columns displayed in the table. Columns IDs can be added, removed, or reordered. */
|
||||
displayedColumns = ['name', 'discountLimit', 'tax'];
|
||||
|
||||
constructor(
|
||||
private route: ActivatedRoute,
|
||||
private router: Router,
|
||||
private toaster: ToasterService,
|
||||
private ser: SaleCategoryService,
|
||||
) {
|
||||
constructor() {
|
||||
this.data.subscribe((data: SaleCategory[]) => {
|
||||
this.list = data;
|
||||
});
|
||||
|
||||
@ -2,7 +2,6 @@ import { inject } from '@angular/core';
|
||||
import { ResolveFn } from '@angular/router';
|
||||
|
||||
import { SaleCategory } from '../core/sale-category';
|
||||
|
||||
import { SaleCategoryService } from './sale-category.service';
|
||||
|
||||
export const saleCategoryResolver: ResolveFn<SaleCategory> = (route) => {
|
||||
|
||||
@ -1,5 +1,5 @@
|
||||
import { HttpClient, HttpHeaders } from '@angular/common/http';
|
||||
import { Injectable } from '@angular/core';
|
||||
import { Injectable, inject } from '@angular/core';
|
||||
import { Observable } from 'rxjs';
|
||||
import { catchError } from 'rxjs/operators';
|
||||
|
||||
@ -16,10 +16,8 @@ const serviceName = 'SaleCategoryService';
|
||||
providedIn: 'root',
|
||||
})
|
||||
export class SaleCategoryService {
|
||||
constructor(
|
||||
private http: HttpClient,
|
||||
private log: ErrorLoggerService,
|
||||
) {}
|
||||
private http = inject(HttpClient);
|
||||
private log = inject(ErrorLoggerService);
|
||||
|
||||
get(id: string | null): Observable<SaleCategory> {
|
||||
const getUrl: string = id === null ? url : `${url}/${id}`;
|
||||
|
||||
Reference in New Issue
Block a user