fix: Configuration Wizard type error (#2313)

This commit is contained in:
Fahim Ahmed
2025-03-09 14:33:56 -06:00
committed by GitHub
parent 4a67c2f679
commit d6a96221b2
+36 -27
View File
@@ -149,34 +149,43 @@ export class ToolbarComponent implements OnInit, AfterViewInit, AfterContentChec
*/ */
openDialog() { openDialog() {
const configWizardRef = this.dialog.open(ConfigurationWizardComponent, {}); const configWizardRef = this.dialog.open(ConfigurationWizardComponent, {});
configWizardRef.afterClosed().subscribe((response: { show: number }) => {
if (response.show === 1) { configWizardRef.afterClosed().subscribe((response: { show: number } | undefined) => {
this.configurationWizardService.showToolbar = true; if (!response) {
this.router.routeReuseStrategy.shouldReuseRoute = () => false; return;
this.router.onSameUrlNavigation = 'reload';
this.router.navigate(['/home']);
} }
if (response.show === 2) {
this.configurationWizardService.showCreateOffice = true; switch (response.show) {
this.router.navigate(['/organization']); case 1:
} this.configurationWizardService.showToolbar = true;
if (response.show === 3) { this.router.routeReuseStrategy.shouldReuseRoute = () => false;
this.configurationWizardService.showDatatables = true; this.router.onSameUrlNavigation = 'reload';
this.router.navigate(['/system']); this.router.navigate(['/home']);
} break;
if (response.show === 4) { case 2:
this.configurationWizardService.showChartofAccounts = true; this.configurationWizardService.showCreateOffice = true;
this.router.navigate(['/accounting']); this.router.navigate(['/organization']);
} break;
if (response.show === 5) { case 3:
this.configurationWizardService.showCharges = true; this.configurationWizardService.showDatatables = true;
this.router.navigate(['/products']); this.router.navigate(['/system']);
} break;
if (response.show === 6) { case 4:
this.configurationWizardService.showManageFunds = true; this.configurationWizardService.showChartofAccounts = true;
this.router.navigate(['/organization']); this.router.navigate(['/accounting']);
} break;
if (response.show === 0) { case 5:
this.configurationWizardService.showCharges = true;
this.router.navigate(['/products']);
break;
case 6:
this.configurationWizardService.showManageFunds = true;
this.router.navigate(['/organization']);
break;
case 0:
break;
default:
break;
} }
}); });
} }