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:
@ -16,11 +16,7 @@ export class LedgerDataSource extends DataSource<LedgerItem> {
|
||||
}
|
||||
|
||||
connect(): Observable<LedgerItem[]> {
|
||||
const dataMutations: (
|
||||
| Observable<LedgerItem[]>
|
||||
| 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 LedgerDataSource extends DataSource<LedgerItem> {
|
||||
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 { Ledger } from './ledger';
|
||||
@ -8,7 +8,7 @@ import { LedgerService } from './ledger.service';
|
||||
@Injectable({
|
||||
providedIn: 'root',
|
||||
})
|
||||
export class LedgerResolver implements Resolve<Ledger> {
|
||||
export class LedgerResolver {
|
||||
constructor(private ser: LedgerService) {}
|
||||
|
||||
resolve(route: ActivatedRouteSnapshot): Observable<Ledger> {
|
||||
|
||||
@ -1,6 +1,6 @@
|
||||
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';
|
||||
|
||||
@ -11,24 +11,30 @@ const ledgerRoutes: Routes = [
|
||||
{
|
||||
path: '',
|
||||
component: LedgerComponent,
|
||||
canActivate: [AuthGuard],
|
||||
canActivate: [
|
||||
(route: ActivatedRouteSnapshot, state: RouterStateSnapshot) =>
|
||||
inject(AuthGuard).canActivate(route, state),
|
||||
],
|
||||
data: {
|
||||
permission: 'Ledger',
|
||||
},
|
||||
resolve: {
|
||||
info: LedgerResolver,
|
||||
info: (route: ActivatedRouteSnapshot) => inject(LedgerResolver).resolve(route),
|
||||
},
|
||||
runGuardsAndResolvers: 'always',
|
||||
},
|
||||
{
|
||||
path: ':id',
|
||||
component: LedgerComponent,
|
||||
canActivate: [AuthGuard],
|
||||
canActivate: [
|
||||
(route: ActivatedRouteSnapshot, state: RouterStateSnapshot) =>
|
||||
inject(AuthGuard).canActivate(route, state),
|
||||
],
|
||||
data: {
|
||||
permission: 'Ledger',
|
||||
},
|
||||
resolve: {
|
||||
info: LedgerResolver,
|
||||
info: (route: ActivatedRouteSnapshot) => inject(LedgerResolver).resolve(route),
|
||||
},
|
||||
runGuardsAndResolvers: 'always',
|
||||
},
|
||||
|
||||
@ -3,7 +3,6 @@ import { CdkTableModule } from '@angular/cdk/table';
|
||||
import { CommonModule } from '@angular/common';
|
||||
import { NgModule } from '@angular/core';
|
||||
import { ReactiveFormsModule } from '@angular/forms';
|
||||
import { MomentDateAdapter } from '@angular/material-moment-adapter';
|
||||
import { MatAutocompleteModule } from '@angular/material/autocomplete';
|
||||
import { MatButtonModule } from '@angular/material/button';
|
||||
import { MatCardModule } from '@angular/material/card';
|
||||
@ -22,6 +21,7 @@ import { MatPaginatorModule } from '@angular/material/paginator';
|
||||
import { MatProgressSpinnerModule } from '@angular/material/progress-spinner';
|
||||
import { MatSortModule } from '@angular/material/sort';
|
||||
import { MatTableModule } from '@angular/material/table';
|
||||
import { MomentDateAdapter } from '@angular/material-moment-adapter';
|
||||
|
||||
import { SharedModule } from '../shared/shared.module';
|
||||
|
||||
|
||||
Reference in New Issue
Block a user