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 parent
d2d26ab1ae
commit
22cac61761
344 files changed
+3247
-2370
No files matched your search
@@ -1,5 +1,4 @@
|
||||
import { Injectable } from '@angular/core';
|
||||
import { Resolve } from '@angular/router';
|
||||
import { Observable } from 'rxjs/internal/Observable';
|
||||
|
||||
import { CostCentre } from '../core/cost-centre';
|
||||
@@ -9,7 +8,7 @@ import { CostCentreService } from './cost-centre.service';
|
||||
@Injectable({
|
||||
providedIn: 'root',
|
||||
})
|
||||
export class CostCentreListResolver implements Resolve<CostCentre[]> {
|
||||
export class CostCentreListResolver {
|
||||
constructor(private ser: CostCentreService) {}
|
||||
|
||||
resolve(): Observable<CostCentre[]> {
|
||||
|
||||
@@ -16,11 +16,7 @@ export class CostCentreListDataSource extends DataSource<CostCentre> {
|
||||
}
|
||||
|
||||
connect(): Observable<CostCentre[]> {
|
||||
const dataMutations: (
|
||||
| Observable<CostCentre[]>
|
||||
| EventEmitter<PageEvent>
|
||||
| EventEmitter<Sort>
|
||||
)[] = [observableOf(this.data)];
|
||||
const dataMutations: (EventEmitter<PageEvent> | EventEmitter<Sort>)[] = [];
|
||||
if (this.paginator) {
|
||||
dataMutations.push((this.paginator as MatPaginator).page);
|
||||
}
|
||||
@@ -33,7 +29,7 @@ export class CostCentreListDataSource extends DataSource<CostCentre> {
|
||||
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 { CostCentre } from '../core/cost-centre';
|
||||
@@ -9,7 +9,7 @@ import { CostCentreService } from './cost-centre.service';
|
||||
@Injectable({
|
||||
providedIn: 'root',
|
||||
})
|
||||
export class CostCentreResolver implements Resolve<CostCentre> {
|
||||
export class CostCentreResolver {
|
||||
constructor(private ser: CostCentreService) {}
|
||||
|
||||
resolve(route: ActivatedRouteSnapshot): Observable<CostCentre> {
|
||||
|
||||
@@ -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 { CostCentreDetailComponent } from './cost-centre-detail/cost-centre-detail.component';
|
||||
import { CostCentreListResolver } from './cost-centre-list-resolver.service';
|
||||
import { CostCentreListComponent } from './cost-centre-list/cost-centre-list.component';
|
||||
import { CostCentreListResolver } from './cost-centre-list-resolver.service';
|
||||
import { CostCentreResolver } from './cost-centre-resolver.service';
|
||||
|
||||
const costCentreRoutes: Routes = [
|
||||
{
|
||||
path: '',
|
||||
component: CostCentreListComponent,
|
||||
canActivate: [AuthGuard],
|
||||
canActivate: [
|
||||
(route: ActivatedRouteSnapshot, state: RouterStateSnapshot) =>
|
||||
inject(AuthGuard).canActivate(route, state),
|
||||
],
|
||||
data: {
|
||||
permission: 'Cost Centres',
|
||||
},
|
||||
resolve: {
|
||||
list: CostCentreListResolver,
|
||||
list: () => inject(CostCentreListResolver).resolve(),
|
||||
},
|
||||
},
|
||||
{
|
||||
path: 'new',
|
||||
component: CostCentreDetailComponent,
|
||||
canActivate: [AuthGuard],
|
||||
canActivate: [
|
||||
(route: ActivatedRouteSnapshot, state: RouterStateSnapshot) =>
|
||||
inject(AuthGuard).canActivate(route, state),
|
||||
],
|
||||
data: {
|
||||
permission: 'Cost Centres',
|
||||
},
|
||||
resolve: {
|
||||
item: CostCentreResolver,
|
||||
item: (route: ActivatedRouteSnapshot) => inject(CostCentreResolver).resolve(route),
|
||||
},
|
||||
},
|
||||
{
|
||||
path: ':id',
|
||||
component: CostCentreDetailComponent,
|
||||
canActivate: [AuthGuard],
|
||||
canActivate: [
|
||||
(route: ActivatedRouteSnapshot, state: RouterStateSnapshot) =>
|
||||
inject(AuthGuard).canActivate(route, state),
|
||||
],
|
||||
data: {
|
||||
permission: 'Cost Centres',
|
||||
},
|
||||
resolve: {
|
||||
item: CostCentreResolver,
|
||||
item: (route: ActivatedRouteSnapshot) => inject(CostCentreResolver).resolve(route),
|
||||
},
|
||||
},
|
||||
];
|
||||
|
||||
Reference in new issue
Block a user