feat: add view, edit roles and permission component (#632)
- Add view roles and permission - Edit roles and permission - Edit role description Fixes: #176
This commit is contained in:
@@ -0,0 +1,8 @@
|
||||
<h1 mat-dialog-title>Disable</h1>
|
||||
<div mat-dialog-content>
|
||||
<p>Are you sure you want to disable {{ data.disableContext }} ?</p>
|
||||
</div>
|
||||
<mat-dialog-actions align="end">
|
||||
<button mat-raised-button mat-dialog-close>Cancel</button>
|
||||
<button mat-raised-button color="warn" [mat-dialog-close]="{ disable: true }">Confirm</button>
|
||||
</mat-dialog-actions>
|
||||
@@ -0,0 +1,25 @@
|
||||
import { async, ComponentFixture, TestBed } from '@angular/core/testing';
|
||||
|
||||
import { DisableDialogComponent } from './disable-dialog.component';
|
||||
|
||||
describe('DisableDialogComponent', () => {
|
||||
let component: DisableDialogComponent;
|
||||
let fixture: ComponentFixture<DisableDialogComponent>;
|
||||
|
||||
beforeEach(async(() => {
|
||||
TestBed.configureTestingModule({
|
||||
declarations: [ DisableDialogComponent ]
|
||||
})
|
||||
.compileComponents();
|
||||
}));
|
||||
|
||||
beforeEach(() => {
|
||||
fixture = TestBed.createComponent(DisableDialogComponent);
|
||||
component = fixture.componentInstance;
|
||||
fixture.detectChanges();
|
||||
});
|
||||
|
||||
it('should create', () => {
|
||||
expect(component).toBeTruthy();
|
||||
});
|
||||
});
|
||||
@@ -0,0 +1,25 @@
|
||||
/** Angular Imports */
|
||||
import { Component, OnInit, Inject } from '@angular/core';
|
||||
import { MatDialogRef, MAT_DIALOG_DATA } from '@angular/material';
|
||||
|
||||
/**
|
||||
* Disable dialog component.
|
||||
*/
|
||||
@Component({
|
||||
selector: 'mifosx-disable-dialog',
|
||||
templateUrl: './disable-dialog.component.html',
|
||||
styleUrls: ['./disable-dialog.component.scss']
|
||||
})
|
||||
export class DisableDialogComponent implements OnInit {
|
||||
|
||||
/**
|
||||
* @param {MatDialogRef} dialogRef Component reference to dialog.
|
||||
* @param {any} data Provides a disableContext.
|
||||
*/
|
||||
constructor(public dialogRef: MatDialogRef<DisableDialogComponent>,
|
||||
@Inject(MAT_DIALOG_DATA) public data: any) { }
|
||||
|
||||
ngOnInit() {
|
||||
}
|
||||
|
||||
}
|
||||
@@ -0,0 +1,8 @@
|
||||
<h1 mat-dialog-title>Enable</h1>
|
||||
<div mat-dialog-content>
|
||||
<p>Are you sure you want to enable {{ data.enableContext }} ?</p>
|
||||
</div>
|
||||
<mat-dialog-actions align="end">
|
||||
<button mat-raised-button mat-dialog-close>Cancel</button>
|
||||
<button mat-raised-button color="warn" [mat-dialog-close]="{ enable: true }">Confirm</button>
|
||||
</mat-dialog-actions>
|
||||
@@ -0,0 +1,25 @@
|
||||
import { async, ComponentFixture, TestBed } from '@angular/core/testing';
|
||||
|
||||
import { EnableDialogComponent } from './enable-dialog.component';
|
||||
|
||||
describe('EnableDialogComponent', () => {
|
||||
let component: EnableDialogComponent;
|
||||
let fixture: ComponentFixture<EnableDialogComponent>;
|
||||
|
||||
beforeEach(async(() => {
|
||||
TestBed.configureTestingModule({
|
||||
declarations: [ EnableDialogComponent ]
|
||||
})
|
||||
.compileComponents();
|
||||
}));
|
||||
|
||||
beforeEach(() => {
|
||||
fixture = TestBed.createComponent(EnableDialogComponent);
|
||||
component = fixture.componentInstance;
|
||||
fixture.detectChanges();
|
||||
});
|
||||
|
||||
it('should create', () => {
|
||||
expect(component).toBeTruthy();
|
||||
});
|
||||
});
|
||||
@@ -0,0 +1,25 @@
|
||||
/** Angular Imports */
|
||||
import { Component, OnInit, Inject } from '@angular/core';
|
||||
import { MatDialogRef, MAT_DIALOG_DATA } from '@angular/material';
|
||||
|
||||
/**
|
||||
* Enable dialog component.
|
||||
*/
|
||||
@Component({
|
||||
selector: 'mifosx-enable-dialog',
|
||||
templateUrl: './enable-dialog.component.html',
|
||||
styleUrls: ['./enable-dialog.component.scss']
|
||||
})
|
||||
export class EnableDialogComponent implements OnInit {
|
||||
|
||||
/**
|
||||
* @param {MatDialogRef} dialogRef Component reference to dialog.
|
||||
* @param {any} data Provides a enableContext.
|
||||
*/
|
||||
constructor(public dialogRef: MatDialogRef<EnableDialogComponent>,
|
||||
@Inject(MAT_DIALOG_DATA) public data: any) { }
|
||||
|
||||
ngOnInit() {
|
||||
}
|
||||
|
||||
}
|
||||
@@ -12,6 +12,8 @@ import { FooterComponent } from './footer/footer.component';
|
||||
import { LanguageSelectorComponent } from './language-selector/language-selector.component';
|
||||
import { ThemePickerComponent } from './theme-picker/theme-picker.component';
|
||||
import { ChangePasswordDialogComponent } from './change-password-dialog/change-password-dialog.component';
|
||||
import { EnableDialogComponent } from './enable-dialog/enable-dialog.component';
|
||||
import { DisableDialogComponent } from './disable-dialog/disable-dialog.component';
|
||||
|
||||
/** Custom Modules */
|
||||
import { IconsModule } from './icons.module';
|
||||
@@ -37,7 +39,9 @@ import { MaterialModule } from './material.module';
|
||||
FooterComponent,
|
||||
LanguageSelectorComponent,
|
||||
ThemePickerComponent,
|
||||
ChangePasswordDialogComponent
|
||||
ChangePasswordDialogComponent,
|
||||
EnableDialogComponent,
|
||||
DisableDialogComponent
|
||||
],
|
||||
exports: [
|
||||
FileUploadComponent,
|
||||
@@ -53,7 +57,9 @@ import { MaterialModule } from './material.module';
|
||||
entryComponents: [
|
||||
FormDialogComponent,
|
||||
DeleteDialogComponent,
|
||||
ChangePasswordDialogComponent
|
||||
ChangePasswordDialogComponent,
|
||||
EnableDialogComponent,
|
||||
DisableDialogComponent
|
||||
]
|
||||
})
|
||||
export class SharedModule { }
|
||||
|
||||
Reference in New Issue
Block a user