feat: add new standalone components for system and organization management modules
This commit is contained in:
@@ -38,6 +38,7 @@ import { MatCheckbox } from '@angular/material/checkbox';
|
||||
import { MatButton, MatIconButton } from '@angular/material/button';
|
||||
import { FaIconComponent } from '@fortawesome/angular-fontawesome';
|
||||
import { STANDALONE_SHARED_IMPORTS } from 'app/standalone-shared.module';
|
||||
import { AlertService } from 'app/core/alert/alert.service';
|
||||
|
||||
/**
|
||||
* Create Hook Component.
|
||||
@@ -73,6 +74,7 @@ export class CreateHookComponent implements OnInit {
|
||||
private formBuilder = inject(UntypedFormBuilder);
|
||||
private dialog = inject(MatDialog);
|
||||
private translateService = inject(TranslateService);
|
||||
private alertService = inject(AlertService);
|
||||
|
||||
/** Hooks Template Data. */
|
||||
hooksTemplateData: any;
|
||||
@@ -253,6 +255,14 @@ export class CreateHookComponent implements OnInit {
|
||||
}
|
||||
};
|
||||
this.systemService.createHook(hook).subscribe((response: any) => {
|
||||
if (response?.rollbackTransaction) {
|
||||
this.alertService.alert({
|
||||
type: 'Success',
|
||||
message: 'Hook creation has been submitted for approval.'
|
||||
});
|
||||
this.router.navigate(['../'], { relativeTo: this.route });
|
||||
return;
|
||||
}
|
||||
this.router.navigate(
|
||||
[
|
||||
'../',
|
||||
|
||||
@@ -44,6 +44,7 @@ import { MatDivider } from '@angular/material/divider';
|
||||
import { MatButton, MatIconButton } from '@angular/material/button';
|
||||
import { FaIconComponent } from '@fortawesome/angular-fontawesome';
|
||||
import { STANDALONE_SHARED_IMPORTS } from 'app/standalone-shared.module';
|
||||
import { AlertService } from 'app/core/alert/alert.service';
|
||||
|
||||
/**
|
||||
* Edit Hook Component.
|
||||
@@ -83,6 +84,7 @@ export class EditHookComponent implements OnInit {
|
||||
private translateService = inject(TranslateService);
|
||||
private snackBar = inject(MatSnackBar);
|
||||
private cdr = inject(ChangeDetectorRef);
|
||||
private alertService = inject(AlertService);
|
||||
|
||||
@NgModule({
|
||||
imports: [
|
||||
@@ -286,6 +288,12 @@ export class EditHookComponent implements OnInit {
|
||||
}
|
||||
};
|
||||
this.systemService.updateHook(this.hookData.id, hook).subscribe((response: any) => {
|
||||
if (response?.rollbackTransaction) {
|
||||
this.alertService.alert({
|
||||
type: 'Success',
|
||||
message: 'Hook update has been submitted for approval.'
|
||||
});
|
||||
}
|
||||
this.router.navigate(['../'], { relativeTo: this.route });
|
||||
});
|
||||
}
|
||||
|
||||
@@ -20,6 +20,7 @@ import { SystemService } from '../../system.service';
|
||||
import { FaIconComponent } from '@fortawesome/angular-fontawesome';
|
||||
import { DateFormatPipe } from '../../../pipes/date-format.pipe';
|
||||
import { STANDALONE_SHARED_IMPORTS } from 'app/standalone-shared.module';
|
||||
import { AlertService } from 'app/core/alert/alert.service';
|
||||
|
||||
/**
|
||||
* View Hook Component.
|
||||
@@ -40,6 +41,7 @@ export class ViewHookComponent {
|
||||
private systemService = inject(SystemService);
|
||||
private router = inject(Router);
|
||||
private translateService = inject(TranslateService);
|
||||
private alertService = inject(AlertService);
|
||||
|
||||
/** Hook Data. */
|
||||
hookData: any;
|
||||
@@ -67,7 +69,13 @@ export class ViewHookComponent {
|
||||
});
|
||||
deleteHookDialogRef.afterClosed().subscribe((response: any) => {
|
||||
if (response.delete) {
|
||||
this.systemService.deleteHook(this.hookData.id).subscribe(() => {
|
||||
this.systemService.deleteHook(this.hookData.id).subscribe((deleteResponse: any) => {
|
||||
if (deleteResponse?.rollbackTransaction) {
|
||||
this.alertService.alert({
|
||||
type: 'Success',
|
||||
message: 'Hook deletion has been submitted for approval.'
|
||||
});
|
||||
}
|
||||
this.router.navigate(['/system/hooks']);
|
||||
});
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user