Feature: Adding recipe templates to print recipes.
Feautre: Recipe export to xlsx Chore: Python 11 style type annotations Chore: Moved to sqlalchemy 2.0 Chore: Minimum python is 3.11 Fix: Fix nullability of a lot of fields in the database.
This commit is contained in:
@@ -1,5 +1,4 @@
|
||||
import { Injectable } from '@angular/core';
|
||||
import { Resolve } from '@angular/router';
|
||||
import { Observable } from 'rxjs/internal/Observable';
|
||||
|
||||
import { ProductGroup } from '../core/product-group';
|
||||
@@ -9,7 +8,7 @@ import { ProductGroupService } from './product-group.service';
|
||||
@Injectable({
|
||||
providedIn: 'root',
|
||||
})
|
||||
export class ProductGroupListResolver implements Resolve<ProductGroup[]> {
|
||||
export class ProductGroupListResolver {
|
||||
constructor(private ser: ProductGroupService) {}
|
||||
|
||||
resolve(): Observable<ProductGroup[]> {
|
||||
|
||||
@@ -20,11 +20,7 @@ export class ProductGroupListDataSource extends DataSource<ProductGroup> {
|
||||
}
|
||||
|
||||
connect(): Observable<ProductGroup[]> {
|
||||
const dataMutations: (
|
||||
| Observable<ProductGroup[]>
|
||||
| EventEmitter<PageEvent>
|
||||
| EventEmitter<Sort>
|
||||
)[] = [observableOf(this.data)];
|
||||
const dataMutations: (EventEmitter<PageEvent> | EventEmitter<Sort>)[] = [];
|
||||
if (this.paginator) {
|
||||
dataMutations.push((this.paginator as MatPaginator).page);
|
||||
}
|
||||
@@ -37,7 +33,7 @@ export class ProductGroupListDataSource extends DataSource<ProductGroup> {
|
||||
this.paginator.length = this.data.length;
|
||||
}
|
||||
|
||||
return merge(...dataMutations).pipe(
|
||||
return merge(observableOf(this.data), ...dataMutations).pipe(
|
||||
map(() => this.getPagedData(this.getSortedData([...this.data]))),
|
||||
);
|
||||
}
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
import { Injectable } from '@angular/core';
|
||||
import { ActivatedRouteSnapshot, Resolve } from '@angular/router';
|
||||
import { ActivatedRouteSnapshot } from '@angular/router';
|
||||
import { Observable } from 'rxjs/internal/Observable';
|
||||
|
||||
import { ProductGroup } from '../core/product-group';
|
||||
@@ -9,7 +9,7 @@ import { ProductGroupService } from './product-group.service';
|
||||
@Injectable({
|
||||
providedIn: 'root',
|
||||
})
|
||||
export class ProductGroupResolver implements Resolve<ProductGroup> {
|
||||
export class ProductGroupResolver {
|
||||
constructor(private ser: ProductGroupService) {}
|
||||
|
||||
resolve(route: ActivatedRouteSnapshot): Observable<ProductGroup> {
|
||||
|
||||
@@ -1,46 +1,55 @@
|
||||
import { CommonModule } from '@angular/common';
|
||||
import { NgModule } from '@angular/core';
|
||||
import { RouterModule, Routes } from '@angular/router';
|
||||
import { NgModule, inject } from '@angular/core';
|
||||
import { ActivatedRouteSnapshot, RouterModule, RouterStateSnapshot, Routes } from '@angular/router';
|
||||
|
||||
import { AuthGuard } from '../auth/auth-guard.service';
|
||||
|
||||
import { ProductGroupDetailComponent } from './product-group-detail/product-group-detail.component';
|
||||
import { ProductGroupListResolver } from './product-group-list-resolver.service';
|
||||
import { ProductGroupListComponent } from './product-group-list/product-group-list.component';
|
||||
import { ProductGroupListResolver } from './product-group-list-resolver.service';
|
||||
import { ProductGroupResolver } from './product-group-resolver.service';
|
||||
|
||||
const productGroupRoutes: Routes = [
|
||||
{
|
||||
path: '',
|
||||
component: ProductGroupListComponent,
|
||||
canActivate: [AuthGuard],
|
||||
canActivate: [
|
||||
(route: ActivatedRouteSnapshot, state: RouterStateSnapshot) =>
|
||||
inject(AuthGuard).canActivate(route, state),
|
||||
],
|
||||
data: {
|
||||
permission: 'Cost Centres',
|
||||
},
|
||||
resolve: {
|
||||
list: ProductGroupListResolver,
|
||||
list: () => inject(ProductGroupListResolver).resolve(),
|
||||
},
|
||||
},
|
||||
{
|
||||
path: 'new',
|
||||
component: ProductGroupDetailComponent,
|
||||
canActivate: [AuthGuard],
|
||||
canActivate: [
|
||||
(route: ActivatedRouteSnapshot, state: RouterStateSnapshot) =>
|
||||
inject(AuthGuard).canActivate(route, state),
|
||||
],
|
||||
data: {
|
||||
permission: 'Cost Centres',
|
||||
},
|
||||
resolve: {
|
||||
item: ProductGroupResolver,
|
||||
item: (route: ActivatedRouteSnapshot) => inject(ProductGroupResolver).resolve(route),
|
||||
},
|
||||
},
|
||||
{
|
||||
path: ':id',
|
||||
component: ProductGroupDetailComponent,
|
||||
canActivate: [AuthGuard],
|
||||
canActivate: [
|
||||
(route: ActivatedRouteSnapshot, state: RouterStateSnapshot) =>
|
||||
inject(AuthGuard).canActivate(route, state),
|
||||
],
|
||||
data: {
|
||||
permission: 'Cost Centres',
|
||||
},
|
||||
resolve: {
|
||||
item: ProductGroupResolver,
|
||||
item: (route: ActivatedRouteSnapshot) => inject(ProductGroupResolver).resolve(route),
|
||||
},
|
||||
},
|
||||
];
|
||||
|
||||
Reference in New Issue
Block a user