diff --git a/.vscode/settings.json b/.vscode/settings.json index 3d0ebd07..dbc35fca 100644 --- a/.vscode/settings.json +++ b/.vscode/settings.json @@ -1,13 +1,24 @@ { - // Use WSL paths + Poetry venv interpreter - "python.defaultInterpreterPath": "${workspaceFolder}/brewman/.venv/bin/python", + "python.defaultInterpreterPath": "/brewman/.venv/bin/python", + "python.terminal.useEnvFile": true, + "python.venvFolders": [ + "barker/.venv", + "frank/.venv", + ".venv" + ], + "python.venvPath": "${workspaceFolder}/barker", "python.terminal.activateEnvironment": true, - // Quality-of-life + // Quality-of-life /* --- Pylance: keep IntelliSense, disable type checking --- */ // "python.analysis.typeCheckingMode": "off", // "python.analysis.diagnosticMode": "openFilesOnly", "python.analysis.typeCheckingMode": "basic", "python.analysis.extraPaths": [ + "${workspaceFolder}/brewman", + "./brewman" + ], + "python.autoComplete.extraPaths": [ + "${workspaceFolder}/brewman", "./brewman" ], // Ruff (you have ruff installed via poetry) diff --git a/overlord/src/app/app.config.ts b/overlord/src/app/app.config.ts index 919fec7d..6b51cce5 100644 --- a/overlord/src/app/app.config.ts +++ b/overlord/src/app/app.config.ts @@ -10,7 +10,7 @@ import { MomentDateAdapter } from '@angular/material-moment-adapter'; import { DateAdapter, MAT_DATE_FORMATS, MAT_DATE_LOCALE } from '@angular/material/core'; import { MAT_SNACK_BAR_DEFAULT_OPTIONS } from '@angular/material/snack-bar'; import { BrowserModule } from '@angular/platform-browser'; -import { provideRouter, withComponentInputBinding, withRouterConfig } from '@angular/router'; +import { provideRouter, withComponentInputBinding } from '@angular/router'; import { dateFormat } from './app.environment'; import { routes } from './app.routes'; @@ -33,13 +33,7 @@ export const appConfig: ApplicationConfig = { ...(isDevMode() ? [delayInterceptor] : []), ]), ), - provideRouter( - routes, - withRouterConfig({ - onSameUrlNavigation: 'reload', - }), - withComponentInputBinding(), - ), + provideRouter(routes, withComponentInputBinding()), { provide: DateAdapter, useClass: MomentDateAdapter, deps: [MAT_DATE_LOCALE] }, { provide: MAT_DATE_FORMATS, useValue: dateFormat }, { provide: MAT_SNACK_BAR_DEFAULT_OPTIONS, useValue: { duration: 3000 } }, diff --git a/overlord/src/app/attendance/attendance.component.ts b/overlord/src/app/attendance/attendance.component.ts index b8ad97f1..2cb01ce2 100644 --- a/overlord/src/app/attendance/attendance.component.ts +++ b/overlord/src/app/attendance/attendance.component.ts @@ -99,7 +99,11 @@ export class AttendanceComponent { show() { const date = moment(this.model().date).format('DD-MMM-YYYY'); - this.router.navigate(['/attendance', date]); + if (this.date() === date) { + this.infoResource.reload(); + } else { + this.router.navigate(['/attendance', date]); + } } save() { diff --git a/overlord/src/app/attendance/attendance.routes.ts b/overlord/src/app/attendance/attendance.routes.ts index c04bdd65..d8d4bd4e 100644 --- a/overlord/src/app/attendance/attendance.routes.ts +++ b/overlord/src/app/attendance/attendance.routes.ts @@ -11,7 +11,6 @@ export const routes: Routes = [ data: { permission: 'Attendance', }, - runGuardsAndResolvers: 'always', }, { path: ':date', @@ -20,6 +19,5 @@ export const routes: Routes = [ data: { permission: 'Attendance', }, - runGuardsAndResolvers: 'always', }, ]; diff --git a/overlord/src/app/balance-sheet/balance-sheet.component.ts b/overlord/src/app/balance-sheet/balance-sheet.component.ts index c59648c0..4a6b1b14 100644 --- a/overlord/src/app/balance-sheet/balance-sheet.component.ts +++ b/overlord/src/app/balance-sheet/balance-sheet.component.ts @@ -112,7 +112,11 @@ export class BalanceSheetComponent { show() { const date = this.getDate(); - this.router.navigate(['balance-sheet', date]); + if (this.date() === date) { + this.infoResource.reload(); + } else { + this.router.navigate(['balance-sheet', date]); + } } getDate(): string { diff --git a/overlord/src/app/balance-sheet/balance-sheet.routes.ts b/overlord/src/app/balance-sheet/balance-sheet.routes.ts index 01006ad5..1cb671cf 100644 --- a/overlord/src/app/balance-sheet/balance-sheet.routes.ts +++ b/overlord/src/app/balance-sheet/balance-sheet.routes.ts @@ -11,7 +11,6 @@ export const routes: Routes = [ data: { permission: 'Balance Sheet', }, - runGuardsAndResolvers: 'always', }, { path: ':date', @@ -20,6 +19,5 @@ export const routes: Routes = [ data: { permission: 'Balance Sheet', }, - runGuardsAndResolvers: 'always', }, ]; diff --git a/overlord/src/app/batch-integrity-report/batch-integrity-report.routes.ts b/overlord/src/app/batch-integrity-report/batch-integrity-report.routes.ts index 19668617..7fea344e 100644 --- a/overlord/src/app/batch-integrity-report/batch-integrity-report.routes.ts +++ b/overlord/src/app/batch-integrity-report/batch-integrity-report.routes.ts @@ -11,6 +11,5 @@ export const routes: Routes = [ data: { permission: 'Product Ledger', }, - runGuardsAndResolvers: 'always', }, ]; diff --git a/overlord/src/app/cash-flow/cash-flow.component.ts b/overlord/src/app/cash-flow/cash-flow.component.ts index 7f3bf53e..cb34de88 100644 --- a/overlord/src/app/cash-flow/cash-flow.component.ts +++ b/overlord/src/app/cash-flow/cash-flow.component.ts @@ -105,12 +105,16 @@ export class CashFlowComponent { show() { const info = this.getInfo(); - this.router.navigate(['cash-flow'], { - queryParams: { - startDate: info.startDate, - finishDate: info.finishDate, - }, - }); + if (this.startDate() === info.startDate && this.finishDate() === info.finishDate) { + this.infoResource.reload(); + } else { + this.router.navigate(['cash-flow'], { + queryParams: { + startDate: info.startDate, + finishDate: info.finishDate, + }, + }); + } } getInfo(): CashFlow { diff --git a/overlord/src/app/cash-flow/cash-flow.routes.ts b/overlord/src/app/cash-flow/cash-flow.routes.ts index 6c45e094..3035d5c5 100644 --- a/overlord/src/app/cash-flow/cash-flow.routes.ts +++ b/overlord/src/app/cash-flow/cash-flow.routes.ts @@ -11,7 +11,6 @@ export const routes: Routes = [ data: { permission: 'Cash Flow', }, - runGuardsAndResolvers: 'always', }, { path: ':id', @@ -20,6 +19,5 @@ export const routes: Routes = [ data: { permission: 'Cash Flow', }, - runGuardsAndResolvers: 'always', }, ]; diff --git a/overlord/src/app/closing-stock/closing-stock.component.ts b/overlord/src/app/closing-stock/closing-stock.component.ts index f93fad5d..27a50e20 100644 --- a/overlord/src/app/closing-stock/closing-stock.component.ts +++ b/overlord/src/app/closing-stock/closing-stock.component.ts @@ -151,11 +151,15 @@ export class ClosingStockComponent { return; } const info = this.getInfo(); - this.router.navigate(['closing-stock', info.date], { - queryParams: { - d: info.costCentre.id, - }, - }); + if (this.date() === info.date && this.d() === info.costCentre.id) { + this.infoResource.reload(); + } else { + this.router.navigate(['closing-stock', info.date], { + queryParams: { + d: info.costCentre.id, + }, + }); + } } save() { diff --git a/overlord/src/app/closing-stock/closing-stock.routes.ts b/overlord/src/app/closing-stock/closing-stock.routes.ts index b3478fb9..d61a9a87 100644 --- a/overlord/src/app/closing-stock/closing-stock.routes.ts +++ b/overlord/src/app/closing-stock/closing-stock.routes.ts @@ -11,7 +11,6 @@ export const routes: Routes = [ data: { permission: 'Closing Stock', }, - runGuardsAndResolvers: 'always', }, { path: ':date', @@ -20,6 +19,5 @@ export const routes: Routes = [ data: { permission: 'Closing Stock', }, - runGuardsAndResolvers: 'always', }, ]; diff --git a/overlord/src/app/daybook/daybook.component.ts b/overlord/src/app/daybook/daybook.component.ts index b44e2da5..9cec6941 100644 --- a/overlord/src/app/daybook/daybook.component.ts +++ b/overlord/src/app/daybook/daybook.component.ts @@ -127,12 +127,16 @@ export class DaybookComponent { show() { const l = this.prepareSubmit(); - this.router.navigate(['daybook'], { - queryParams: { - startDate: l.startDate, - finishDate: l.finishDate, - }, - }); + if (this.startDate() === l.startDate && this.finishDate() === l.finishDate) { + this.infoResource.reload(); + } else { + this.router.navigate(['daybook'], { + queryParams: { + startDate: l.startDate, + finishDate: l.finishDate, + }, + }); + } } prepareSubmit(): Daybook { diff --git a/overlord/src/app/daybook/daybook.routes.ts b/overlord/src/app/daybook/daybook.routes.ts index 7b148d2d..39a0813b 100644 --- a/overlord/src/app/daybook/daybook.routes.ts +++ b/overlord/src/app/daybook/daybook.routes.ts @@ -11,6 +11,5 @@ export const routes: Routes = [ data: { permission: 'Daybook', }, - runGuardsAndResolvers: 'always', }, ]; diff --git a/overlord/src/app/employee-attendance/employee-attendance.component.ts b/overlord/src/app/employee-attendance/employee-attendance.component.ts index f32738ec..d78c96b7 100644 --- a/overlord/src/app/employee-attendance/employee-attendance.component.ts +++ b/overlord/src/app/employee-attendance/employee-attendance.component.ts @@ -126,12 +126,20 @@ export class EmployeeAttendanceComponent { currentInfo.employee = typeof formValue.employee !== 'string' && formValue.employee ? formValue.employee : undefined; if (currentInfo.employee) { - this.router.navigate(['/employee-attendance', currentInfo.employee.id], { - queryParams: { - startDate: currentInfo.startDate, - finishDate: currentInfo.finishDate, - }, - }); + if ( + this.id() === currentInfo.employee.id && + this.startDate() === currentInfo.startDate && + this.finishDate() === currentInfo.finishDate + ) { + this.infoResource.reload(); + } else { + this.router.navigate(['/employee-attendance', currentInfo.employee.id], { + queryParams: { + startDate: currentInfo.startDate, + finishDate: currentInfo.finishDate, + }, + }); + } } } diff --git a/overlord/src/app/employee-attendance/employee-attendance.routes.ts b/overlord/src/app/employee-attendance/employee-attendance.routes.ts index 3155f918..18d541e1 100644 --- a/overlord/src/app/employee-attendance/employee-attendance.routes.ts +++ b/overlord/src/app/employee-attendance/employee-attendance.routes.ts @@ -11,7 +11,6 @@ export const routes: Routes = [ data: { permission: 'Attendance', }, - runGuardsAndResolvers: 'always', }, { path: ':id', @@ -20,6 +19,5 @@ export const routes: Routes = [ data: { permission: 'Attendance', }, - runGuardsAndResolvers: 'always', }, ]; diff --git a/overlord/src/app/employee-benefits/employee-benefits.routes.ts b/overlord/src/app/employee-benefits/employee-benefits.routes.ts index 17577718..cc16ba14 100644 --- a/overlord/src/app/employee-benefits/employee-benefits.routes.ts +++ b/overlord/src/app/employee-benefits/employee-benefits.routes.ts @@ -11,7 +11,6 @@ export const routes: Routes = [ data: { permission: 'employee-benefit', }, - runGuardsAndResolvers: 'always', }, { path: ':id', @@ -20,6 +19,5 @@ export const routes: Routes = [ data: { permission: 'employee-benefit', }, - runGuardsAndResolvers: 'always', }, ]; diff --git a/overlord/src/app/employee-functions/employee-functions.routes.ts b/overlord/src/app/employee-functions/employee-functions.routes.ts index 5f7a3d7d..3f1f0ef6 100644 --- a/overlord/src/app/employee-functions/employee-functions.routes.ts +++ b/overlord/src/app/employee-functions/employee-functions.routes.ts @@ -11,6 +11,5 @@ export const routes: Routes = [ data: { permission: 'employee-benefit', }, - runGuardsAndResolvers: 'always', }, ]; diff --git a/overlord/src/app/entries/entries.routes.ts b/overlord/src/app/entries/entries.routes.ts index f1a4b0c0..ca5ec4ea 100644 --- a/overlord/src/app/entries/entries.routes.ts +++ b/overlord/src/app/entries/entries.routes.ts @@ -11,6 +11,5 @@ export const routes: Routes = [ data: { permission: 'Ledger', }, - runGuardsAndResolvers: 'always', }, ]; diff --git a/overlord/src/app/incentive/incentive.routes.ts b/overlord/src/app/incentive/incentive.routes.ts index a6c38da5..923c4d5a 100644 --- a/overlord/src/app/incentive/incentive.routes.ts +++ b/overlord/src/app/incentive/incentive.routes.ts @@ -11,7 +11,6 @@ export const routes: Routes = [ data: { permission: 'incentive', }, - runGuardsAndResolvers: 'always', }, { path: ':id', @@ -20,6 +19,5 @@ export const routes: Routes = [ data: { permission: 'incentive', }, - runGuardsAndResolvers: 'always', }, ]; diff --git a/overlord/src/app/issue/issue.routes.ts b/overlord/src/app/issue/issue.routes.ts index 51f90733..0c294125 100644 --- a/overlord/src/app/issue/issue.routes.ts +++ b/overlord/src/app/issue/issue.routes.ts @@ -11,7 +11,6 @@ export const routes: Routes = [ data: { permission: 'Issue', }, - runGuardsAndResolvers: 'always', }, { path: ':id', @@ -20,6 +19,5 @@ export const routes: Routes = [ data: { permission: 'Issue', }, - runGuardsAndResolvers: 'always', }, ]; diff --git a/overlord/src/app/journal/journal.routes.ts b/overlord/src/app/journal/journal.routes.ts index 00576fbb..66b5cf48 100644 --- a/overlord/src/app/journal/journal.routes.ts +++ b/overlord/src/app/journal/journal.routes.ts @@ -11,7 +11,6 @@ export const routes: Routes = [ data: { permission: 'Journal', }, - runGuardsAndResolvers: 'paramsChange', }, { path: ':id', @@ -20,6 +19,5 @@ export const routes: Routes = [ data: { permission: 'Journal', }, - runGuardsAndResolvers: 'paramsChange', }, ]; diff --git a/overlord/src/app/ledger/ledger.component.ts b/overlord/src/app/ledger/ledger.component.ts index 99ff7131..d5fc3179 100644 --- a/overlord/src/app/ledger/ledger.component.ts +++ b/overlord/src/app/ledger/ledger.component.ts @@ -260,7 +260,13 @@ export class LedgerComponent { show() { const info = this.getInfo(); - if (info.account) { + if ( + this.id() === info.account?.id && + this.startDate() === info.startDate && + this.finishDate() === info.finishDate + ) { + this.infoResource.reload(); + } else if (info.account) { this.router.navigate(['ledger', info.account.id], { queryParams: { startDate: info.startDate, diff --git a/overlord/src/app/ledger/ledger.routes.ts b/overlord/src/app/ledger/ledger.routes.ts index cddaf5e1..f2635c8d 100644 --- a/overlord/src/app/ledger/ledger.routes.ts +++ b/overlord/src/app/ledger/ledger.routes.ts @@ -11,7 +11,6 @@ export const routes: Routes = [ data: { permission: 'Ledger', }, - runGuardsAndResolvers: 'always', }, { path: ':id', @@ -20,6 +19,5 @@ export const routes: Routes = [ data: { permission: 'Ledger', }, - runGuardsAndResolvers: 'always', }, ]; diff --git a/overlord/src/app/mozimo-daily-register/mozimo-daily-register.component.ts b/overlord/src/app/mozimo-daily-register/mozimo-daily-register.component.ts index d1316d1d..78f6793d 100644 --- a/overlord/src/app/mozimo-daily-register/mozimo-daily-register.component.ts +++ b/overlord/src/app/mozimo-daily-register/mozimo-daily-register.component.ts @@ -111,7 +111,11 @@ export class MozimoDailyRegisterComponent { show() { const date = moment(this.model().date).format('DD-MMM-YYYY'); - this.router.navigate(['/mozimo-daily-register', date]); + if (this.date() === date) { + this.infoResource.reload(); + } else { + this.router.navigate(['/mozimo-daily-register', date]); + } } save() { diff --git a/overlord/src/app/mozimo-daily-register/mozimo-daily-register.routes.ts b/overlord/src/app/mozimo-daily-register/mozimo-daily-register.routes.ts index 2a0379da..e0256ee3 100644 --- a/overlord/src/app/mozimo-daily-register/mozimo-daily-register.routes.ts +++ b/overlord/src/app/mozimo-daily-register/mozimo-daily-register.routes.ts @@ -11,7 +11,6 @@ export const routes: Routes = [ data: { permission: 'Product Ledger', }, - runGuardsAndResolvers: 'always', }, { path: ':date', @@ -20,6 +19,5 @@ export const routes: Routes = [ data: { permission: 'Product Ledger', }, - runGuardsAndResolvers: 'always', }, ]; diff --git a/overlord/src/app/mozimo-product-register/mozimo-product-register.component.ts b/overlord/src/app/mozimo-product-register/mozimo-product-register.component.ts index 3780b63c..584cdec1 100644 --- a/overlord/src/app/mozimo-product-register/mozimo-product-register.component.ts +++ b/overlord/src/app/mozimo-product-register/mozimo-product-register.component.ts @@ -136,12 +136,20 @@ export class MozimoProductRegisterComponent { show() { const info = this.getInfo(); if (info.product) { - this.router.navigate(['mozimo-product-register', info.product.id], { - queryParams: { - startDate: info.startDate, - finishDate: info.finishDate, - }, - }); + if ( + this.id() === info.product.id && + this.startDate() === info.startDate && + this.finishDate() === info.finishDate + ) { + this.infoResource.reload(); + } else { + this.router.navigate(['mozimo-product-register', info.product.id], { + queryParams: { + startDate: info.startDate, + finishDate: info.finishDate, + }, + }); + } } } diff --git a/overlord/src/app/mozimo-product-register/mozimo-product-register.routes.ts b/overlord/src/app/mozimo-product-register/mozimo-product-register.routes.ts index 69ae81fe..0bd1e1ab 100644 --- a/overlord/src/app/mozimo-product-register/mozimo-product-register.routes.ts +++ b/overlord/src/app/mozimo-product-register/mozimo-product-register.routes.ts @@ -11,7 +11,6 @@ export const routes: Routes = [ data: { permission: 'Product Ledger', }, - runGuardsAndResolvers: 'always', }, { path: ':id', @@ -20,6 +19,5 @@ export const routes: Routes = [ data: { permission: 'Product Ledger', }, - runGuardsAndResolvers: 'always', }, ]; diff --git a/overlord/src/app/net-transactions/net-transactions.component.ts b/overlord/src/app/net-transactions/net-transactions.component.ts index 226c43c8..2ec8cc6b 100644 --- a/overlord/src/app/net-transactions/net-transactions.component.ts +++ b/overlord/src/app/net-transactions/net-transactions.component.ts @@ -117,12 +117,16 @@ export class NetTransactionsComponent { show() { const l = this.prepareSubmit(); - this.router.navigate(['net-transactions'], { - queryParams: { - startDate: l.startDate, - finishDate: l.finishDate, - }, - }); + if (this.startDate() === l.startDate && this.finishDate() === l.finishDate) { + this.infoResource.reload(); + } else { + this.router.navigate(['net-transactions'], { + queryParams: { + startDate: l.startDate, + finishDate: l.finishDate, + }, + }); + } } prepareSubmit(): NetTransactions { diff --git a/overlord/src/app/net-transactions/net-transactions.routes.ts b/overlord/src/app/net-transactions/net-transactions.routes.ts index 6c17d5b1..e5ae0fcb 100644 --- a/overlord/src/app/net-transactions/net-transactions.routes.ts +++ b/overlord/src/app/net-transactions/net-transactions.routes.ts @@ -11,6 +11,5 @@ export const routes: Routes = [ data: { permission: 'Net Transactions', }, - runGuardsAndResolvers: 'always', }, ]; diff --git a/overlord/src/app/non-contact-purchase/non-contract-purchase.routes.ts b/overlord/src/app/non-contact-purchase/non-contract-purchase.routes.ts index 19454f30..b9f64bd4 100644 --- a/overlord/src/app/non-contact-purchase/non-contract-purchase.routes.ts +++ b/overlord/src/app/non-contact-purchase/non-contract-purchase.routes.ts @@ -11,6 +11,5 @@ export const routes: Routes = [ data: { permission: 'Product Ledger', }, - runGuardsAndResolvers: 'always', }, ]; diff --git a/overlord/src/app/payment/payment.routes.ts b/overlord/src/app/payment/payment.routes.ts index 55b47495..8474da83 100644 --- a/overlord/src/app/payment/payment.routes.ts +++ b/overlord/src/app/payment/payment.routes.ts @@ -11,7 +11,6 @@ export const routes: Routes = [ data: { permission: 'journal', }, - runGuardsAndResolvers: 'paramsChange', }, { path: ':id', @@ -20,6 +19,5 @@ export const routes: Routes = [ data: { permission: 'journal', }, - runGuardsAndResolvers: 'paramsChange', }, ]; diff --git a/overlord/src/app/product-ledger/product-ledger.component.ts b/overlord/src/app/product-ledger/product-ledger.component.ts index e7207b57..26da2ee0 100644 --- a/overlord/src/app/product-ledger/product-ledger.component.ts +++ b/overlord/src/app/product-ledger/product-ledger.component.ts @@ -211,12 +211,20 @@ export class ProductLedgerComponent { show() { const info = this.getInfo(); if (info.product) { - this.router.navigate(['product-ledger', info.product.id], { - queryParams: { - startDate: info.startDate, - finishDate: info.finishDate, - }, - }); + if ( + this.id() === info.product.id && + this.startDate() === info.startDate && + this.finishDate() === info.finishDate + ) { + this.infoResource.reload(); + } else { + this.router.navigate(['product-ledger', info.product.id], { + queryParams: { + startDate: info.startDate, + finishDate: info.finishDate, + }, + }); + } } } diff --git a/overlord/src/app/product-ledger/product-ledger.routes.ts b/overlord/src/app/product-ledger/product-ledger.routes.ts index 758b4fb2..fa1c4f09 100644 --- a/overlord/src/app/product-ledger/product-ledger.routes.ts +++ b/overlord/src/app/product-ledger/product-ledger.routes.ts @@ -11,7 +11,6 @@ export const routes: Routes = [ data: { permission: 'Product Ledger', }, - runGuardsAndResolvers: 'always', }, { path: ':id', @@ -20,6 +19,5 @@ export const routes: Routes = [ data: { permission: 'Product Ledger', }, - runGuardsAndResolvers: 'always', }, ]; diff --git a/overlord/src/app/profit-loss/profit-loss.component.ts b/overlord/src/app/profit-loss/profit-loss.component.ts index 23460408..e52f7387 100644 --- a/overlord/src/app/profit-loss/profit-loss.component.ts +++ b/overlord/src/app/profit-loss/profit-loss.component.ts @@ -117,12 +117,16 @@ export class ProfitLossComponent { show() { const info = this.getInfo(); - this.router.navigate(['profit-loss'], { - queryParams: { - startDate: info.startDate, - finishDate: info.finishDate, - }, - }); + if (this.startDate() === info.startDate && this.finishDate() === info.finishDate) { + this.infoResource.reload(); + } else { + this.router.navigate(['profit-loss'], { + queryParams: { + startDate: info.startDate, + finishDate: info.finishDate, + }, + }); + } } getInfo(): ProfitLoss { diff --git a/overlord/src/app/profit-loss/profit-loss.routes.ts b/overlord/src/app/profit-loss/profit-loss.routes.ts index 1af005e0..b83d145b 100644 --- a/overlord/src/app/profit-loss/profit-loss.routes.ts +++ b/overlord/src/app/profit-loss/profit-loss.routes.ts @@ -11,6 +11,5 @@ export const routes: Routes = [ data: { permission: 'Profit & Loss', }, - runGuardsAndResolvers: 'always', }, ]; diff --git a/overlord/src/app/purchase-entries/purchase-entries.component.ts b/overlord/src/app/purchase-entries/purchase-entries.component.ts index 9211be77..d7f7ccac 100644 --- a/overlord/src/app/purchase-entries/purchase-entries.component.ts +++ b/overlord/src/app/purchase-entries/purchase-entries.component.ts @@ -121,12 +121,16 @@ export class PurchaseEntriesComponent { show() { const l = this.prepareSubmit(); - this.router.navigate(['purchase-entries'], { - queryParams: { - startDate: l.startDate, - finishDate: l.finishDate, - }, - }); + if (this.startDate() === l.startDate && this.finishDate() === l.finishDate) { + this.resource.reload(); + } else { + this.router.navigate(['purchase-entries'], { + queryParams: { + startDate: l.startDate, + finishDate: l.finishDate, + }, + }); + } } prepareSubmit(): PurchaseEntries { diff --git a/overlord/src/app/purchase-entries/purchase-entries.routes.ts b/overlord/src/app/purchase-entries/purchase-entries.routes.ts index bfd6d112..e757b189 100644 --- a/overlord/src/app/purchase-entries/purchase-entries.routes.ts +++ b/overlord/src/app/purchase-entries/purchase-entries.routes.ts @@ -11,6 +11,5 @@ export const routes: Routes = [ data: { permission: 'Purchase Entries', }, - runGuardsAndResolvers: 'always', }, ]; diff --git a/overlord/src/app/purchase-return/purchase-return.routes.ts b/overlord/src/app/purchase-return/purchase-return.routes.ts index cacc278d..74e754fc 100644 --- a/overlord/src/app/purchase-return/purchase-return.routes.ts +++ b/overlord/src/app/purchase-return/purchase-return.routes.ts @@ -11,7 +11,6 @@ export const routes: Routes = [ data: { permission: 'Purchase Return', }, - runGuardsAndResolvers: 'always', }, { path: ':id', @@ -20,6 +19,5 @@ export const routes: Routes = [ data: { permission: 'Purchase Return', }, - runGuardsAndResolvers: 'always', }, ]; diff --git a/overlord/src/app/purchase/purchase.routes.ts b/overlord/src/app/purchase/purchase.routes.ts index 947b9254..a04b0c4b 100644 --- a/overlord/src/app/purchase/purchase.routes.ts +++ b/overlord/src/app/purchase/purchase.routes.ts @@ -11,7 +11,6 @@ export const routes: Routes = [ data: { permission: 'Purchase', }, - runGuardsAndResolvers: 'always', }, { path: ':id', @@ -20,6 +19,5 @@ export const routes: Routes = [ data: { permission: 'Purchase', }, - runGuardsAndResolvers: 'always', }, ]; diff --git a/overlord/src/app/purchases/purchases.component.ts b/overlord/src/app/purchases/purchases.component.ts index ce43c313..75c8d47c 100644 --- a/overlord/src/app/purchases/purchases.component.ts +++ b/overlord/src/app/purchases/purchases.component.ts @@ -115,12 +115,16 @@ export class PurchasesComponent { show() { const l = this.prepareSubmit(); - this.router.navigate(['purchases'], { - queryParams: { - startDate: l.startDate, - finishDate: l.finishDate, - }, - }); + if (this.startDate() === l.startDate && this.finishDate() === l.finishDate) { + this.resource.reload(); + } else { + this.router.navigate(['purchases'], { + queryParams: { + startDate: l.startDate, + finishDate: l.finishDate, + }, + }); + } } prepareSubmit(): Purchases { diff --git a/overlord/src/app/purchases/purchases.routes.ts b/overlord/src/app/purchases/purchases.routes.ts index 2ea5ea12..c31119e2 100644 --- a/overlord/src/app/purchases/purchases.routes.ts +++ b/overlord/src/app/purchases/purchases.routes.ts @@ -11,6 +11,5 @@ export const routes: Routes = [ data: { permission: 'Purchases', }, - runGuardsAndResolvers: 'always', }, ]; diff --git a/overlord/src/app/raw-material-cost/raw-material-cost.component.ts b/overlord/src/app/raw-material-cost/raw-material-cost.component.ts index 8ec21a6a..4e235e3b 100644 --- a/overlord/src/app/raw-material-cost/raw-material-cost.component.ts +++ b/overlord/src/app/raw-material-cost/raw-material-cost.component.ts @@ -131,12 +131,16 @@ export class RawMaterialCostComponent { show() { const model = this.prepareSubmit(); - this.router.navigate(['raw-material-cost'], { - queryParams: { - startDate: model.startDate, - finishDate: model.finishDate, - }, - }); + if (!this.id() && this.startDate() === model.startDate && this.finishDate() === model.finishDate) { + this.infoResource.reload(); + } else { + this.router.navigate(['raw-material-cost'], { + queryParams: { + startDate: model.startDate, + finishDate: model.finishDate, + }, + }); + } } prepareSubmit(): RawMaterialCost { diff --git a/overlord/src/app/raw-material-cost/raw-material-cost.routes.ts b/overlord/src/app/raw-material-cost/raw-material-cost.routes.ts index de7bdcd5..1ed0734f 100644 --- a/overlord/src/app/raw-material-cost/raw-material-cost.routes.ts +++ b/overlord/src/app/raw-material-cost/raw-material-cost.routes.ts @@ -11,7 +11,6 @@ export const routes: Routes = [ data: { permission: 'Raw Material Cost', }, - runGuardsAndResolvers: 'always', }, { path: ':id', @@ -20,6 +19,5 @@ export const routes: Routes = [ data: { permission: 'Raw Material Cost', }, - runGuardsAndResolvers: 'always', }, ]; diff --git a/overlord/src/app/receipt/receipt.routes.ts b/overlord/src/app/receipt/receipt.routes.ts index 017ad6f4..e47bc20d 100644 --- a/overlord/src/app/receipt/receipt.routes.ts +++ b/overlord/src/app/receipt/receipt.routes.ts @@ -11,7 +11,6 @@ export const routes: Routes = [ data: { permission: 'journal', }, - runGuardsAndResolvers: 'paramsChange', }, { path: ':id', @@ -20,6 +19,5 @@ export const routes: Routes = [ data: { permission: 'journal', }, - runGuardsAndResolvers: 'paramsChange', }, ]; diff --git a/overlord/src/app/recipe/recipe.routes.ts b/overlord/src/app/recipe/recipe.routes.ts index 75bbf98d..b7a5398c 100644 --- a/overlord/src/app/recipe/recipe.routes.ts +++ b/overlord/src/app/recipe/recipe.routes.ts @@ -12,7 +12,6 @@ export const routes: Routes = [ data: { permission: 'Recipes', }, - runGuardsAndResolvers: 'paramsOrQueryParamsChange', }, { path: 'new', diff --git a/overlord/src/app/settings/settings.routes.ts b/overlord/src/app/settings/settings.routes.ts index eca57b00..a737c7ff 100644 --- a/overlord/src/app/settings/settings.routes.ts +++ b/overlord/src/app/settings/settings.routes.ts @@ -11,6 +11,5 @@ export const routes: Routes = [ data: { permission: 'Maintenance', // 'Lock Date' }, - runGuardsAndResolvers: 'always', }, ]; diff --git a/overlord/src/app/stock-movement/stock-movement.component.ts b/overlord/src/app/stock-movement/stock-movement.component.ts index 80fe6157..9d8f8cbe 100644 --- a/overlord/src/app/stock-movement/stock-movement.component.ts +++ b/overlord/src/app/stock-movement/stock-movement.component.ts @@ -114,12 +114,16 @@ export class StockMovementComponent { show() { const l = this.prepareSubmit(); - this.router.navigate(['stock-movement'], { - queryParams: { - startDate: l.startDate, - finishDate: l.finishDate, - }, - }); + if (this.startDate() === l.startDate && this.finishDate() === l.finishDate) { + this.resource.reload(); + } else { + this.router.navigate(['stock-movement'], { + queryParams: { + startDate: l.startDate, + finishDate: l.finishDate, + }, + }); + } } prepareSubmit(): StockMovement { diff --git a/overlord/src/app/stock-movement/stock-movement.routes.ts b/overlord/src/app/stock-movement/stock-movement.routes.ts index 97f430a1..d5a0e37e 100644 --- a/overlord/src/app/stock-movement/stock-movement.routes.ts +++ b/overlord/src/app/stock-movement/stock-movement.routes.ts @@ -11,6 +11,5 @@ export const routes: Routes = [ data: { permission: 'Stock Movement', }, - runGuardsAndResolvers: 'always', }, ]; diff --git a/overlord/src/app/trial-balance/trial-balance.component.ts b/overlord/src/app/trial-balance/trial-balance.component.ts index ca277621..05867820 100644 --- a/overlord/src/app/trial-balance/trial-balance.component.ts +++ b/overlord/src/app/trial-balance/trial-balance.component.ts @@ -109,7 +109,11 @@ export class TrialBalanceComponent { show() { const info = this.getInfo(); - this.router.navigate(['trial-balance', info.date]); + if (this.date() === info.date) { + this.resource.reload(); + } else { + this.router.navigate(['trial-balance', info.date]); + } } getInfo(): TrialBalance { diff --git a/overlord/src/app/trial-balance/trial-balance.routes.ts b/overlord/src/app/trial-balance/trial-balance.routes.ts index 7aa2c04b..74884e05 100644 --- a/overlord/src/app/trial-balance/trial-balance.routes.ts +++ b/overlord/src/app/trial-balance/trial-balance.routes.ts @@ -11,7 +11,6 @@ export const routes: Routes = [ data: { permission: 'Trial Balance', }, - runGuardsAndResolvers: 'always', }, { path: ':date', @@ -20,6 +19,5 @@ export const routes: Routes = [ data: { permission: 'Trial Balance', }, - runGuardsAndResolvers: 'always', }, ]; diff --git a/overlord/src/styles.sass b/overlord/src/styles.sass index 52bea1e7..28ca7e66 100644 --- a/overlord/src/styles.sass +++ b/overlord/src/styles.sass @@ -32,12 +32,12 @@ a text-decoration: underline -button.mat-primary +button.mat-primary:not(:disabled) background: var(--mat-sys-primary) !important color: var(--mat-sys-on-primary) !important -button.mat-warn +button.mat-warn:not(:disabled) background: var(--mat-sys-error) !important color: var(--mat-sys-on-error) !important