diff --git a/frontend/angular-clarity-master/src/app/modules/main/admin/accesstype/accesstype.component.ts b/frontend/angular-clarity-master/src/app/modules/main/admin/accesstype/accesstype.component.ts index f70cf1c..a54048d 100644 --- a/frontend/angular-clarity-master/src/app/modules/main/admin/accesstype/accesstype.component.ts +++ b/frontend/angular-clarity-master/src/app/modules/main/admin/accesstype/accesstype.component.ts @@ -12,171 +12,178 @@ import { AccesstypeService } from 'src/app/services/admin/accesstype.service'; export class AccesstypeComponent implements OnInit { loading = false; selected: any[] = []; - rowSelected :any= {}; - modaldelete=false; - modalAdd= false; - modaledit=false; - moduleAdd=false; + rowSelected: any = {}; + modaldelete = false; + modalAdd = false; + modaledit = false; + moduleAdd = false; error; data; module; moduledata; - submitted=false; + submitted = false; selected1 = "true"; public entryForm: FormGroup; - public mentryForm:FormGroup; - constructor( private _fb: FormBuilder,private toastr:ToastrService, - private router: Router,private accesstype:AccesstypeService, + public mentryForm: FormGroup; + constructor(private _fb: FormBuilder, private toastr: ToastrService, + private router: Router, private accesstype: AccesstypeService, private route: ActivatedRoute, - ) { } + ) { } ngOnInit(): void { this.entryForm = this._fb.group({ - name:['',[Validators.required]], - defaultvalue:['',[Validators.required]] , - description:['',[Validators.required]] , + name: ['', [Validators.required]], + defaultvalue: ['', [Validators.required]], + description: ['', [Validators.required]], - }); - this.mentryForm=this._fb.group({ - modulename:[null], - }) - this.getdata(); - this.getdata1(); + }); + this.mentryForm = this._fb.group({ + modulename: [null], + }) + this.getdata(); + this.getdata1(); } - getdata(){ + getdata() { this.accesstype.getAll().subscribe(resp => { this.data = resp; console.log('menus: ', this.data); - if(this.data.length==0){ - this.error="No data Available"; + if (this.data.length == 0) { + this.error = "No data Available"; console.log(this.error) } - },(error) => { - console.log(error); - if(error){ - this.error="Server Error"; - } - }) + }, (error) => { + console.log(error); + if (error) { + this.error = "Server Error"; + } + }) } - getdata1(){ + getdata1() { this.accesstype.getAll1().subscribe(resp => { this.moduledata = resp; console.log('menus: ', this.moduledata); - if(this.moduledata.length==0){ - this.error="No data Available"; + if (this.moduledata.length == 0) { + this.error = "No data Available"; console.log(this.error) } - },(error) => { - console.log(error); - if(error){ - this.error="Server Error"; - } - }) + }, (error) => { + console.log(error); + if (error) { + this.error = "Server Error"; + } + }) } - goToAdd(){ - this.modalAdd=true; + goToAdd() { + this.modalAdd = true; } - onSubmit(){ + onSubmit() { console.log(this.entryForm.value); - this.submitted=true; + this.submitted = true; if (this.entryForm.invalid) { return; } console.log(this.entryForm.value); - this.accesstype.create(this.entryForm.value).subscribe((data)=>{ + this.accesstype.create(this.entryForm.value).subscribe((data) => { console.log(data); if (data) { this.toastr.success('Added successfully'); - } + } + this.ngOnInit(); }, - (error) => { - console.log('Error in adding data...',+error); - if(error){ - this.toastr.error('Not added Data Getting Some Error'); - } + (error) => { + console.log('Error in adding data...', error); + if (error) { + this.toastr.error('Not added Data Getting Some Error'); + } + this.ngOnInit(); - }); - this.modalAdd=false; + }); + this.modalAdd = false; } goToEdit(row) { this.rowSelected = row; console.log(row) - this.modaledit=true; + this.modaledit = true; //this.router.navigate(["../edit/" + id], { relativeTo: this.route }); } onDelete(row) { this.rowSelected = row; - this.modaldelete=true; + this.modaldelete = true; } - delete(id) - { + delete(id) { this.modaldelete = false; - console.log("in delete "+id); - this.accesstype.delete(id).subscribe((data)=>{ + console.log("in delete " + id); + this.accesstype.delete(id).subscribe((data) => { console.log(data); if (data) { this.toastr.success('Deleted successfully'); - } - }, - (error) => { - console.log('Error in adding data...',+error); - if(error){ - this.toastr.error('Not Deleted Data Getting Some Error'); } - }); + this.ngOnInit(); + }, + (error) => { + console.log('Error in adding data...', error); + if (error) { + this.toastr.error('Not Deleted Data Getting Some Error'); + } + this.ngOnInit(); + }); } - onUpdate(id){ - this.modaledit=false; -this.accesstype.update(id,this.rowSelected).subscribe((data)=>{ -console.log(data); -if (data) { - this.toastr.success('Updated successfully'); + onUpdate(id) { + this.modaledit = false; + this.accesstype.update(id, this.rowSelected).subscribe((data) => { + console.log(data); + if (data) { + this.toastr.success('Updated successfully'); } -}, -(error) => { -console.log('Error in adding data...',+error); -if(error){ - this.toastr.error('Not updated Data Getting Some Error'); -} -}); + this.ngOnInit(); + }, + (error) => { + console.log('Error in adding data...', error); + if (error) { + this.toastr.error('Not updated Data Getting Some Error'); + } + this.ngOnInit(); + }); } - goTomodules(){ + goTomodules() { this.router.navigate(["../acmodules"], { relativeTo: this.route }); } accessid; - gomodules(row){ + gomodules(row) { this.rowSelected = row; - this.moduleAdd=true; - this.accessid=row.id + this.moduleAdd = true; + this.accessid = row.id this.getallidmodules(this.accessid) } moduledata1; - getallidmodules(id){ - this.accesstype.getById(id).subscribe((data)=>{ + getallidmodules(id) { + this.accesstype.getById(id).subscribe((data) => { console.log(data); - this.moduledata1=data; - if(this.moduledata1.length==0){ - this.error="No data Available"; + this.moduledata1 = data; + if (this.moduledata1.length == 0) { + this.error = "No data Available"; console.log(this.error) } }) } - addmodules(id){ + addmodules(id) { console.log(this.mentryForm.value); -this.accesstype.addById(id,this.mentryForm.value).subscribe((data)=>{ - console.log(data); - if(data){ - this.toastr.success("Added Successfully"); - } -},(error) => { - console.log('Error in adding data...',+error); - if(error){ - this.toastr.error('Not Added Data Getting Some Error'); - } - }) -this.moduleAdd=false; + this.accesstype.addById(id, this.mentryForm.value).subscribe((data) => { + console.log(data); + if (data) { + this.toastr.success("Added Successfully"); + } + this.ngOnInit(); + }, (error) => { + console.log('Error in adding data...', error); + if (error) { + this.toastr.error('Not Added Data Getting Some Error'); + } + this.ngOnInit(); + }) + this.moduleAdd = false; } } diff --git a/frontend/angular-clarity-master/src/app/modules/main/admin/menuaccesscontrol/menuaccesscontrol.component.html b/frontend/angular-clarity-master/src/app/modules/main/admin/menuaccesscontrol/menuaccesscontrol.component.html index ade6898..88a4b66 100644 --- a/frontend/angular-clarity-master/src/app/modules/main/admin/menuaccesscontrol/menuaccesscontrol.component.html +++ b/frontend/angular-clarity-master/src/app/modules/main/admin/menuaccesscontrol/menuaccesscontrol.component.html @@ -4,9 +4,6 @@
  • {{ 'MENU_ACCESS_CONTROL' | translate }}
  • - - -
    @@ -20,8 +17,10 @@ {{ 'FOR' | translate }} - - {{ 'SHOW_ALL' | translate }} {{ 'ONLY_MAIN_MENU' | translate }} + + {{ 'SHOW_ALL' | translate }} {{ 'ONLY_MAIN_MENU' | translate + }}
    @@ -74,8 +74,10 @@ {{user.sequence_size}} - - + + @@ -83,7 +85,8 @@ - {{ 'USERS_PER_PAGE' | translate }} + {{ 'USERS_PER_PAGE' | translate + }} {{pagination.firstItem + 1}} - {{pagination.lastItem + 1}} of {{pagination.totalItems}} users @@ -110,11 +113,11 @@
    - +
    - +
    - +
    @@ -197,7 +200,7 @@
    --> - +
    @@ -216,11 +219,13 @@
    - +
    - +
    diff --git a/frontend/angular-clarity-master/src/app/modules/main/fnd/sequencegenarator/sequencegenarator.component.ts b/frontend/angular-clarity-master/src/app/modules/main/fnd/sequencegenarator/sequencegenarator.component.ts index a4776a0..a9dea2a 100644 --- a/frontend/angular-clarity-master/src/app/modules/main/fnd/sequencegenarator/sequencegenarator.component.ts +++ b/frontend/angular-clarity-master/src/app/modules/main/fnd/sequencegenarator/sequencegenarator.component.ts @@ -15,65 +15,67 @@ export class SequencegenaratorComponent implements OnInit { loading = false; selected: any[] = []; workflow_data; - rowSelected :any= {}; - modaldelete=false; + rowSelected: any = {}; + modaldelete = false; error; - alldata; - modaladd=false; - modaledit=false; + alldata = []; + modaladd = false; + modaledit = false; submitted = false; public entryForm: FormGroup; - constructor(private seqservice:SequenceService,private router: Router, private toastr: ToastrService,private _fb: FormBuilder, - private route: ActivatedRoute,private excel: ExcelService) { } + constructor(private seqservice: SequenceService, private router: Router, private toastr: ToastrService, private _fb: FormBuilder, + private route: ActivatedRoute, private excel: ExcelService) { } ngOnInit(): void { this.getall(); this.entryForm = this._fb.group({ - prefix:[null], -sequence_size:[null], -suffix:[null], -starting_no:[null], -seperator:[null], + prefix: [null], + sequence_size: [null], + suffix: [null], + starting_no: [null], + seperator: [null], -sequence_name:[null], -sequence_code:[null], -demonstration:[null], + sequence_name: [null], + sequence_code: [null], + demonstration: [null], -current_no:[null] - }); + current_no: [null] + }); } - getall(){ - this.seqservice.getAll().subscribe((data)=>{ + getall() { + this.seqservice.getAll().subscribe((data) => { console.log(data); - this.alldata=data; - if(this.alldata.lenght==0){ - this.error="No data" + this.alldata = data; + + if (this.alldata.length == 0) { + console.log('zero data '); + this.error = "No data Available!" } - },(error) => { + }, (error) => { console.log(error); - if(error){ - this.error="No data Available OR server Error"; - } + if (error) { + this.error = "No data Available OR server Error"; + } }) } // onSubmit(){ - // console.log(this.entryForm.value); - // this.seqservice.create(this.entryForm.value).subscribe((data)=>{ - // console.log(data); - // if (data) { - // this.toastr.success('Added successfully'); - // } - // }, - // (error) => { - // console.log('Error in adding data...',+error); - // if(error){ - // this.toastr.error('Not added Data'); - // } + // console.log(this.entryForm.value); + // this.seqservice.create(this.entryForm.value).subscribe((data)=>{ + // console.log(data); + // if (data) { + // this.toastr.success('Added successfully'); + // } + // }, + // (error) => { + // console.log('Error in adding data...',+error); + // if(error){ + // this.toastr.error('Not added Data'); + // } - // }); - // this.modaladd=false; + // }); + // this.modaladd=false; // } @@ -93,20 +95,20 @@ current_no:[null] this.seqservice.create(this.entryForm.value).subscribe( (data) => { console.log(data); - if (data || data.status >=200 && data.status <=299) { + if (data || data.status >= 200 && data.status <= 299) { this.toastr.success("Added Succesfully"); this.ngOnInit(); } - },(error) => { - if(error.status >=200 && error.status <=299){ + }, (error) => { + if (error.status >= 200 && error.status <= 299) { this.toastr.success("Added Succesfully"); this.ngOnInit(); } - if(error.status >=400 && error.status <=499){ + if (error.status >= 400 && error.status <= 499) { this.toastr.error("Not Added"); this.ngOnInit(); } - if(error.status >=500 && error.status <=599){ + if (error.status >= 500 && error.status <= 599) { this.toastr.error("Server Error"); this.ngOnInit(); } @@ -114,8 +116,8 @@ current_no:[null] } - goToAdd(){ - this.modaladd=true; + goToAdd() { + this.modaladd = true; } @@ -127,63 +129,62 @@ current_no:[null] goToEdit(row) { this.rowSelected = row; console.log(row) - this.modaledit=true; + this.modaledit = true; } onDelete(row) { this.rowSelected = row; - this.modaldelete=true; + this.modaldelete = true; } - delete(id) - { + delete(id) { this.modaldelete = false; - console.log("in delete "+id); - this.seqservice.delete(id).subscribe((data)=>{ + console.log("in delete " + id); + this.seqservice.delete(id).subscribe((data) => { console.log(data); - if (data == null || data.status >=200 && data.status <=299) { + if (data == null || data.status >= 200 && data.status <= 299) { this.toastr.success('Deleted successfully'); this.ngOnInit(); } - }, - (error) => { - console.log(error); - if(error.status >=200 && error.status <=299){ - this.toastr.success('Deleted successfully'); - this.ngOnInit(); - } - if(error.status >=400 && error.status <=499){ - this.toastr.error('Not Deleted Data Getting Some Error'); - this.ngOnInit(); - } - if(error.status >=500 && error.status <=599){ - this.toastr.error('Server Error'); - this.ngOnInit(); - } - }); + }, + (error) => { + console.log(error); + if (error.status >= 200 && error.status <= 299) { + this.toastr.success('Deleted successfully'); + this.ngOnInit(); + } + if (error.status >= 400 && error.status <= 499) { + this.toastr.error('Not Deleted Data Getting Some Error'); + this.ngOnInit(); + } + if (error.status >= 500 && error.status <= 599) { + this.toastr.error('Server Error'); + this.ngOnInit(); + } + }); } - onUpdate(id){ - this.modaledit=false; -this.seqservice.update(id,this.rowSelected).subscribe((data)=>{ -console.log(data); -if (data || data.status >=200 && data.status <=299) { - this.toastr.success("Update Succesfully"); - this.ngOnInit(); -} -},(error: HttpErrorResponse) => { -console.log(error?.message); -if(error.status >=200 && error.status <=299){ - this.toastr.success("Update Succesfully"); - this.ngOnInit(); -} -if(error.status >=400 && error.status <=499){ - this.toastr.error("Not Update"); - this.ngOnInit(); -} -if(error.status >=500 && error.status <=599){ - this.toastr.error("Server Error"); - this.ngOnInit(); -} -}); + onUpdate(id) { + this.modaledit = false; + this.seqservice.update(id, this.rowSelected).subscribe((data) => { + console.log(data); + if (data || data.status >= 200 && data.status <= 299) { + this.toastr.success("Update Succesfully"); + this.ngOnInit(); + } + }, (error: HttpErrorResponse) => { + console.log(error?.message); + if (error.status >= 200 && error.status <= 299) { + this.toastr.success("Update Succesfully"); + this.ngOnInit(); + } + if (error.status >= 400 && error.status <= 499) { + this.toastr.error("Not Update"); + this.ngOnInit(); + } + if (error.status >= 500 && error.status <= 599) { + this.toastr.error("Server Error"); + this.ngOnInit(); + } + }); } }