implement user, role, product, and task management components along with associated services and UI updates
This commit is contained in:
@@ -22,6 +22,7 @@ import { EnableDialogComponent } from '../../../shared/enable-dialog/enable-dial
|
||||
import { FaIconComponent } from '@fortawesome/angular-fontawesome';
|
||||
import { MatCheckbox } from '@angular/material/checkbox';
|
||||
import { STANDALONE_SHARED_IMPORTS } from 'app/standalone-shared.module';
|
||||
import { AlertService } from 'app/core/alert/alert.service';
|
||||
|
||||
/** Custom Service Zitadel */
|
||||
import { environment } from '../../../../environments/environment';
|
||||
@@ -48,6 +49,7 @@ export class ViewRoleComponent implements OnInit {
|
||||
private translateService = inject(TranslateService);
|
||||
dialog = inject(MatDialog);
|
||||
private authService = inject(AuthService);
|
||||
private alertService = inject(AlertService);
|
||||
|
||||
/** Role Permissions Data */
|
||||
rolePermissionService: any;
|
||||
@@ -720,7 +722,14 @@ export class ViewRoleComponent implements OnInit {
|
||||
this.formGroup.controls.roster.disable();
|
||||
this.checkboxesChanged = false;
|
||||
this.isDisabled = true;
|
||||
this.systemService.updateRolePermission(this.roleId, permissionData).subscribe((response: any) => {});
|
||||
this.systemService.updateRolePermission(this.roleId, permissionData).subscribe((response: any) => {
|
||||
if (response?.rollbackTransaction) {
|
||||
this.alertService.alert({
|
||||
type: 'Success',
|
||||
message: 'Role permissions update request submitted successfully for approval.'
|
||||
});
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -756,8 +765,13 @@ export class ViewRoleComponent implements OnInit {
|
||||
});
|
||||
deleteRoleDialogRef.afterClosed().subscribe((response: any) => {
|
||||
if (response.delete) {
|
||||
this.systemService.deleteRole(this.roleId).subscribe(() => {
|
||||
if (environment.OIDC.oidcServerEnabled) {
|
||||
this.systemService.deleteRole(this.roleId).subscribe((res: any) => {
|
||||
if (res?.rollbackTransaction) {
|
||||
this.alertService.alert({
|
||||
type: 'Success',
|
||||
message: 'Role deletion request submitted successfully for approval.'
|
||||
});
|
||||
} else if (environment.OIDC.oidcServerEnabled) {
|
||||
this.authService.deleteRole(this.roleId);
|
||||
}
|
||||
this.router.navigate(['/system/roles-and-permissions']);
|
||||
@@ -776,7 +790,13 @@ export class ViewRoleComponent implements OnInit {
|
||||
});
|
||||
enableRoleDialogRef.afterClosed().subscribe((response: any) => {
|
||||
if (response.enable) {
|
||||
this.systemService.enableRole(this.roleId).subscribe(() => {
|
||||
this.systemService.enableRole(this.roleId).subscribe((res: any) => {
|
||||
if (res?.rollbackTransaction) {
|
||||
this.alertService.alert({
|
||||
type: 'Success',
|
||||
message: 'Role enablement request submitted successfully for approval.'
|
||||
});
|
||||
}
|
||||
this.router.navigate(['/system/roles-and-permissions']);
|
||||
});
|
||||
} else {
|
||||
@@ -793,7 +813,13 @@ export class ViewRoleComponent implements OnInit {
|
||||
});
|
||||
deleteRoleDialogRef.afterClosed().subscribe((response: any) => {
|
||||
if (response.disable) {
|
||||
this.systemService.disableRole(this.roleId).subscribe(() => {
|
||||
this.systemService.disableRole(this.roleId).subscribe((res: any) => {
|
||||
if (res?.rollbackTransaction) {
|
||||
this.alertService.alert({
|
||||
type: 'Success',
|
||||
message: 'Role disablement request submitted successfully for approval.'
|
||||
});
|
||||
}
|
||||
this.router.navigate(['/system/roles-and-permissions']);
|
||||
});
|
||||
} else {
|
||||
|
||||
Reference in New Issue
Block a user