feat: add new standalone components for system and organization management modules
This commit is contained in:
@@ -15,6 +15,7 @@ import { forkJoin } from 'rxjs';
|
||||
import { UserAgreementService, UserAgreement } from './user-agreement.service';
|
||||
import { ConfirmationDialogComponent } from 'app/shared/confirmation-dialog/confirmation-dialog.component';
|
||||
import { HasPermissionDirective } from 'app/directives/has-permission/has-permission.directive';
|
||||
import { AlertService } from 'app/core/alert/alert.service';
|
||||
|
||||
@Component({
|
||||
selector: 'mifosx-manage-user-agreement',
|
||||
@@ -34,6 +35,7 @@ export class ManageUserAgreementComponent implements OnInit {
|
||||
private service = inject(UserAgreementService);
|
||||
private dialog = inject(MatDialog);
|
||||
private snackBar = inject(MatSnackBar);
|
||||
private alertService = inject(AlertService);
|
||||
|
||||
agreements: UserAgreement[] = [];
|
||||
activeId: number | null = null;
|
||||
@@ -118,10 +120,18 @@ export class ManageUserAgreementComponent implements OnInit {
|
||||
body: this.model.body
|
||||
})
|
||||
.subscribe({
|
||||
next: () => {
|
||||
this.snackBar.open('Agreement published', 'Close', { duration: 3000 });
|
||||
next: (response: any) => {
|
||||
this.saving = false;
|
||||
this.drawerOpen = false;
|
||||
if (response?.rollbackTransaction) {
|
||||
this.alertService.alert({
|
||||
type: 'Success',
|
||||
message: 'Agreement publication has been submitted for approval.'
|
||||
});
|
||||
this.load();
|
||||
return;
|
||||
}
|
||||
this.snackBar.open('Agreement published', 'Close', { duration: 3000 });
|
||||
this.load();
|
||||
},
|
||||
error: (err: any) => {
|
||||
|
||||
@@ -35,7 +35,7 @@ export class UserAgreementService {
|
||||
}
|
||||
|
||||
/** Publish a new version. The backend deactivates the previous active row automatically. */
|
||||
create(data: { title: string; body: string }): Observable<{ resourceId: number }> {
|
||||
return this.http.post<{ resourceId: number }>('/useragreements', data);
|
||||
create(data: { title: string; body: string }): Observable<{ resourceId: number; rollbackTransaction?: boolean }> {
|
||||
return this.http.post<{ resourceId: number; rollbackTransaction?: boolean }>('/useragreements', data);
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user