Merge branch 'maker-checker' into dev
Brings in the UI side of maker-checker for users and roles: a Pending User Edits tab with a compare dialog, user/role create-edit-view wired to the pending-request flow, plus keyboard shortcuts and inline-create dialogs. Both conflicts resolved in dev's favour: .env.ts — auto-generated build stamp; dev's (260901) is the newer one. share-product-general-tab.component.html — dev had deliberately removed the per-product Dividends button, leaving a comment explaining that dividends are declared society-wide from Share Products -> Dividends because the board resolves one rate for the year rather than one per product. The branch simply predates that change, so taking its side would have resurrected a button that was removed on purpose. checker-inbox-and-tasks.component.html and tasks-routing.module.ts auto-merged cleanly, with both the new Pending User Edits tab and the existing Closure Requests tab intact. Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
This commit is contained in:
+1
-1
@@ -119,7 +119,7 @@
|
||||
<button
|
||||
mat-raised-button
|
||||
color="primary"
|
||||
[disabled]="!glAccountForm.valid"
|
||||
[disabled]="!glAccountForm.valid || submitting"
|
||||
*mifosxHasPermission="'CREATE_GLACCOUNT'"
|
||||
>
|
||||
{{ 'labels.buttons.Submit' | translate }}
|
||||
|
||||
+34
-14
@@ -14,6 +14,7 @@ import { MatDialog } from '@angular/material/dialog';
|
||||
|
||||
/** Custom Services */
|
||||
import { AccountingService } from '../../accounting.service';
|
||||
import { AlertService } from 'app/core/alert/alert.service';
|
||||
import { PopoverService } from '../../../configuration-wizard/popover/popover.service';
|
||||
import { ConfigurationWizardService } from '../../../configuration-wizard/configuration-wizard.service';
|
||||
|
||||
@@ -42,6 +43,7 @@ import { STANDALONE_SHARED_IMPORTS } from 'app/standalone-shared.module';
|
||||
export class CreateGlAccountComponent implements OnInit, AfterViewInit {
|
||||
private formBuilder = inject(UntypedFormBuilder);
|
||||
private accountingService = inject(AccountingService);
|
||||
private alertService = inject(AlertService);
|
||||
private route = inject(ActivatedRoute);
|
||||
private router = inject(Router);
|
||||
private configurationWizardService = inject(ConfigurationWizardService);
|
||||
@@ -50,6 +52,8 @@ export class CreateGlAccountComponent implements OnInit, AfterViewInit {
|
||||
|
||||
/** GL account form. */
|
||||
glAccountForm: UntypedFormGroup;
|
||||
/** Submitting state to prevent duplicate submissions. */
|
||||
submitting = false;
|
||||
/** Chart of accounts data. */
|
||||
chartOfAccountsData: any;
|
||||
/** Account type data. */
|
||||
@@ -166,24 +170,40 @@ export class CreateGlAccountComponent implements OnInit, AfterViewInit {
|
||||
|
||||
/**
|
||||
* Submits the gl account form and creates gl account,
|
||||
* if successful redirects to view created account.
|
||||
* if successful redirects to view created account or back to list if awaiting approval.
|
||||
*/
|
||||
submit() {
|
||||
if (this.glAccountForm.invalid) {
|
||||
if (this.glAccountForm.invalid || this.submitting) {
|
||||
return;
|
||||
}
|
||||
this.accountingService.createGlAccount(this.glAccountForm.value).subscribe((response: any) => {
|
||||
if (this.configurationWizardService.showChartofAccounts) {
|
||||
this.configurationWizardService.showChartofAccounts = false;
|
||||
this.openDialog();
|
||||
} else {
|
||||
this.router.navigate(
|
||||
[
|
||||
'../view',
|
||||
response.resourceId
|
||||
],
|
||||
{ relativeTo: this.route }
|
||||
);
|
||||
this.submitting = true;
|
||||
this.accountingService.createGlAccount(this.glAccountForm.value).subscribe({
|
||||
next: (response: any) => {
|
||||
if (response?.resourceId) {
|
||||
if (this.configurationWizardService.showChartofAccounts) {
|
||||
this.configurationWizardService.showChartofAccounts = false;
|
||||
this.openDialog();
|
||||
} else {
|
||||
this.router.navigate(
|
||||
[
|
||||
'../view',
|
||||
response.resourceId
|
||||
],
|
||||
{ relativeTo: this.route }
|
||||
);
|
||||
}
|
||||
} else if (response?.rollbackTransaction) {
|
||||
this.alertService.alert({
|
||||
type: 'Success',
|
||||
message: 'GL Account submitted successfully for approval.'
|
||||
});
|
||||
this.router.navigate([this.cancelRoute], { relativeTo: this.route });
|
||||
} else {
|
||||
this.router.navigate([this.cancelRoute], { relativeTo: this.route });
|
||||
}
|
||||
},
|
||||
error: () => {
|
||||
this.submitting = false;
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user