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 { Client } from './client';
|
||||
@@ -8,7 +7,7 @@ import { ClientService } from './client.service';
|
||||
@Injectable({
|
||||
providedIn: 'root',
|
||||
})
|
||||
export class ClientListResolver implements Resolve<Client[]> {
|
||||
export class ClientListResolver {
|
||||
constructor(private ser: ClientService) {}
|
||||
|
||||
resolve(): Observable<Client[]> {
|
||||
|
||||
@@ -16,9 +16,7 @@ export class ClientListDataSource extends DataSource<Client> {
|
||||
}
|
||||
|
||||
connect(): Observable<Client[]> {
|
||||
const dataMutations: (Observable<Client[]> | EventEmitter<PageEvent> | EventEmitter<Sort>)[] = [
|
||||
observableOf(this.data),
|
||||
];
|
||||
const dataMutations: (EventEmitter<PageEvent> | EventEmitter<Sort>)[] = [];
|
||||
if (this.paginator) {
|
||||
dataMutations.push((this.paginator as MatPaginator).page);
|
||||
}
|
||||
@@ -31,7 +29,7 @@ export class ClientListDataSource extends DataSource<Client> {
|
||||
this.paginator.length = this.data.length;
|
||||
}
|
||||
|
||||
return merge(...dataMutations).pipe(
|
||||
return merge(observableOf(this.data), ...dataMutations).pipe(
|
||||
map(() => this.getPagedData(this.getSortedData([...this.data]))),
|
||||
);
|
||||
}
|
||||
|
||||
@@ -6,7 +6,7 @@
|
||||
<mat-table #table [dataSource]="dataSource" matSort aria-label="Elements">
|
||||
<!-- Code Column -->
|
||||
<ng-container matColumnDef="code">
|
||||
<mat-header-cell *matHeaderCellDef mat-sort-header>Name</mat-header-cell>
|
||||
<mat-header-cell *matHeaderCellDef mat-sort-header>Code</mat-header-cell>
|
||||
<mat-cell *matCellDef="let row">{{ row.code }}</mat-cell>
|
||||
</ng-container>
|
||||
|
||||
|
||||
@@ -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 { Client } from './client';
|
||||
@@ -8,7 +8,7 @@ import { ClientService } from './client.service';
|
||||
@Injectable({
|
||||
providedIn: 'root',
|
||||
})
|
||||
export class ClientResolver implements Resolve<Client> {
|
||||
export class ClientResolver {
|
||||
constructor(private ser: ClientService) {}
|
||||
|
||||
resolve(route: ActivatedRouteSnapshot): Observable<Client> {
|
||||
|
||||
@@ -1,35 +1,41 @@
|
||||
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 { ClientDetailComponent } from './client-detail/client-detail.component';
|
||||
import { ClientListResolver } from './client-list-resolver.service';
|
||||
import { ClientListComponent } from './client-list/client-list.component';
|
||||
import { ClientListResolver } from './client-list-resolver.service';
|
||||
import { ClientResolver } from './client-resolver.service';
|
||||
|
||||
const clientRoutes: Routes = [
|
||||
{
|
||||
path: '',
|
||||
component: ClientListComponent,
|
||||
canActivate: [AuthGuard],
|
||||
canActivate: [
|
||||
(route: ActivatedRouteSnapshot, state: RouterStateSnapshot) =>
|
||||
inject(AuthGuard).canActivate(route, state),
|
||||
],
|
||||
data: {
|
||||
permission: 'Cost Centres',
|
||||
},
|
||||
resolve: {
|
||||
list: ClientListResolver,
|
||||
list: () => inject(ClientListResolver).resolve(),
|
||||
},
|
||||
},
|
||||
{
|
||||
path: ':id',
|
||||
component: ClientDetailComponent,
|
||||
canActivate: [AuthGuard],
|
||||
canActivate: [
|
||||
(route: ActivatedRouteSnapshot, state: RouterStateSnapshot) =>
|
||||
inject(AuthGuard).canActivate(route, state),
|
||||
],
|
||||
data: {
|
||||
permission: 'Cost Centres',
|
||||
},
|
||||
resolve: {
|
||||
item: ClientResolver,
|
||||
item: (route: ActivatedRouteSnapshot) => inject(ClientResolver).resolve(route),
|
||||
},
|
||||
},
|
||||
];
|
||||
|
||||
Reference in new issue
Block a user