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:
tanshu committed 2023-07-23 08:12:21 +05:30
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 { LockInfo } from './lock-info';
@@ -8,7 +7,7 @@ import { SettingsService } from './settings.service';
@Injectable({
providedIn: 'root',
})
export class LockInformationResolver implements Resolve<[LockInfo]> {
export class LockInformationResolver {
constructor(private ser: SettingsService) {}
resolve(): Observable<[LockInfo]> {
@@ -1,5 +1,4 @@
import { Injectable } from '@angular/core';
import { Resolve } from '@angular/router';
import { Observable } from 'rxjs/internal/Observable';
import { SettingsService } from './settings.service';
@@ -7,7 +6,7 @@ import { SettingsService } from './settings.service';
@Injectable({
providedIn: 'root',
})
export class MaintenanceResolver implements Resolve<{ enabled: boolean; user: string }> {
export class MaintenanceResolver {
constructor(private ser: SettingsService) {}
resolve(): Observable<{ enabled: boolean; user: string }> {
@@ -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 { AccountTypeResolver } from '../account/account-type-resolver.service';
import { AuthGuard } from '../auth/auth-guard.service';
@@ -14,15 +14,18 @@ const settingsRoutes: Routes = [
{
path: '',
component: SettingsComponent,
canActivate: [AuthGuard],
canActivate: [
(route: ActivatedRouteSnapshot, state: RouterStateSnapshot) =>
inject(AuthGuard).canActivate(route, state),
],
data: {
permission: 'Maintenance', // 'Lock Date'
},
resolve: {
maintenance: MaintenanceResolver,
lockInformation: LockInformationResolver,
accountTypes: AccountTypeResolver,
voucherTypes: VoucherTypeResolver,
maintenance: () => inject(MaintenanceResolver).resolve(),
lockInformation: () => inject(LockInformationResolver).resolve(),
accountTypes: () => inject(AccountTypeResolver).resolve(),
voucherTypes: () => inject(VoucherTypeResolver).resolve(),
},
runGuardsAndResolvers: 'always',
},
@@ -112,7 +112,7 @@ export class SettingsComponent implements OnInit {
showLockInformation(info: LockInfo[]) {
this.lockInformation = info;
this.lockInfoForm.controls.accountTypes.clear();
this.accountTypes.forEach((x) =>
this.accountTypes.forEach(() =>
this.lockInfoForm.controls.accountTypes.push(
new FormGroup({
accountType: new FormControl<boolean>(false, { nonNullable: true }),
@@ -120,7 +120,7 @@ export class SettingsComponent implements OnInit {
),
);
this.lockInfoForm.controls.voucherTypes.clear();
this.voucherTypes.forEach((x) =>
this.voucherTypes.forEach(() =>
this.lockInfoForm.controls.voucherTypes.push(
new FormGroup({
voucherType: new FormControl<boolean>(false, { nonNullable: true }),
+1 -1
View File
@@ -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';
@@ -25,6 +24,7 @@ import { MatSelectModule } from '@angular/material/select';
import { MatSortModule } from '@angular/material/sort';
import { MatTableModule } from '@angular/material/table';
import { MatTabsModule } from '@angular/material/tabs';
import { MomentDateAdapter } from '@angular/material-moment-adapter';
import { SharedModule } from '../shared/shared.module';
@@ -1,5 +1,4 @@
import { Injectable } from '@angular/core';
import { Resolve } from '@angular/router';
import { Observable } from 'rxjs/internal/Observable';
import { AccountType } from '../core/account-type';
@@ -9,7 +8,7 @@ import { VoucherTypeService } from './voucher-type.service';
@Injectable({
providedIn: 'root',
})
export class VoucherTypeResolver implements Resolve<AccountType[]> {
export class VoucherTypeResolver {
constructor(private ser: VoucherTypeService) {}
resolve(): Observable<AccountType[]> {