+
+
0" class="my-table mat-elevation-z8 len-table">
-
+
// pagination variable details
length = 5;
diff --git a/ng-seed/src/app/appoinment/user/add-user/add-user.component.html b/ng-seed/src/app/appoinment/user/add-user/add-user.component.html
index 27ee5f5..0af0936 100644
--- a/ng-seed/src/app/appoinment/user/add-user/add-user.component.html
+++ b/ng-seed/src/app/appoinment/user/add-user/add-user.component.html
@@ -2,16 +2,17 @@
+
-
+
Sure to delete {{local_data.name}}?
diff --git a/ng-seed/src/app/appoinment/user/add-user/add-user.component.scss b/ng-seed/src/app/appoinment/user/add-user/add-user.component.scss index d25aaa5..cb5c7cd 100644 --- a/ng-seed/src/app/appoinment/user/add-user/add-user.component.scss +++ b/ng-seed/src/app/appoinment/user/add-user/add-user.component.scss @@ -34,4 +34,21 @@ } .scrollHV { height: calc(100vh - 190px); -} \ No newline at end of file +} + + +input[type=file]::file-selector-button { + margin-right: 20px; + border: none; + background: #084cdf; + padding: 10px 20px; + border-radius: 10px; + + color: #fff; + cursor: pointer; + transition: background .2s ease-in-out; + } + + input[type=file]::file-selector-button:hover { + background: #0d45a5; + } \ No newline at end of file diff --git a/ng-seed/src/app/appoinment/user/add-user/add-user.component.ts b/ng-seed/src/app/appoinment/user/add-user/add-user.component.ts index 3fc573b..5014b90 100644 --- a/ng-seed/src/app/appoinment/user/add-user/add-user.component.ts +++ b/ng-seed/src/app/appoinment/user/add-user/add-user.component.ts @@ -3,6 +3,7 @@ import { FormBuilder, FormControl, FormGroup, Validators } from '@angular/forms' import { MatDialogRef, MAT_DIALOG_DATA } from '@angular/material/dialog'; import { Router } from '@angular/router'; import { BusinessService } from 'app/appoinment/business/business-service/business.service'; + export interface UsersData { userName: string; id: number; @@ -31,6 +32,7 @@ export class AddUserComponent implements OnInit { @Optional() @Inject(MAT_DIALOG_DATA) public data: UsersData,public _bus:BusinessService) { console.log(data); this.local_data = {...data}; + this.action = this.local_data.action; this.formData= new FormData(); this.getBusinessList() @@ -43,9 +45,12 @@ export class AddUserComponent implements OnInit { let businessFilter = res['data'].filter(val => val.busName) this.businessList = businessFilter; let data = localStorage.getItem('busName') - this.form.controls['businessselect'].setValue(data) + // this.form.controls['businessselect'].setValue(data) console.log(this.businessList) console.log(this.form['value'].businessselect) + this.local_data.businessselect = this.local_data.busId + + this.form.patchValue(this.local_data) } } // , error => {this.errorMessage = error});
@@ -74,7 +79,8 @@ export class AddUserComponent implements OnInit {
businessselect: new FormControl('',[Validators.required]),
role: new FormControl('', [Validators.required, Validators.maxLength(20)]),
userName: new FormControl('', [Validators.required, Validators.maxLength(20)]),
- contactNo: new FormControl('', [Validators.required, Validators.maxLength(20)]),
+ // contactNo: new FormControl('', [Validators.required, Validators.maxLength(20)]),
+ contactNo: new FormControl('', [Validators.required, Validators.minLength(10),Validators.maxLength(10), Validators.pattern('^[0-9]{10}$')]),
// lastName: new FormControl('', [Validators.required, Validators.maxLength(20)]),
email: new FormControl('', [Validators.required, Validators.email,Validators.pattern(
'[a-zA-Z0-9._%+-]+@[a-zA-Z0-9.-]+.[a-zA-Z]{2,63}$',
@@ -84,7 +90,13 @@ export class AddUserComponent implements OnInit {
// confirmPassword: new FormControl('', [Validators.required, Validators.minLength(6)]),
createdBy:new FormControl(userrole,[Validators.required]),
});
+ console.log(this.local_data);
+ this.local_data.businessselect = this.local_data.busId
+
this.form.patchValue(this.local_data)
+ setTimeout(() => {
+ this.form.patchValue(this.local_data)
+ }, 500);
}
public myError = (controlName: string, errorName: string) =>{
return this.form.controls[controlName].hasError(errorName);
@@ -113,6 +125,9 @@ export class AddUserComponent implements OnInit {
}
submit(){
console.log(this.form.value);
+ if (!this.form.valid) {
+ return;
+ }
let tmp = this.form.value
tmp.id = this.local_data.id
console.log(this.formData.getAll('image'));
diff --git a/ng-seed/src/app/appoinment/user/user-list/user-list.component.html b/ng-seed/src/app/appoinment/user/user-list/user-list.component.html
index 06ca6a4..49302aa 100644
--- a/ng-seed/src/app/appoinment/user/user-list/user-list.component.html
+++ b/ng-seed/src/app/appoinment/user/user-list/user-list.component.html
@@ -1,26 +1,43 @@
-
-
- Filter
-
-
+
+ Filter
+
+
+
+ Business
+
+ All
+
+ {{business.busName}}
+
+
+
+
+
+
+ Role
+
+ All
+ SADMIN
+ PRACTITIONER
+ BADMIN
+
+
+
+
+
+
+
-
+
+
-
-
+
+
-
-
-
-
+
No Data Available
diff --git a/ng-seed/src/app/appoinment/business/business-list/business-list.component.scss b/ng-seed/src/app/appoinment/business/business-list/business-list.component.scss index 7f0f260..5a04508 100644 --- a/ng-seed/src/app/appoinment/business/business-list/business-list.component.scss +++ b/ng-seed/src/app/appoinment/business/business-list/business-list.component.scss @@ -27,8 +27,8 @@ th.mat-header-cell, td.mat-cell, td.mat-footer-cell { box-shadow: none!important; } img { - width: 30px; - height: 30px; + width: 40px; + height: 40px; border-radius: 50%; } .fullscreen{ @@ -82,4 +82,31 @@ img { /* overflow: auto; */ overflow-x: hidden; overflow-y: auto; - } \ No newline at end of file + } + + .mat-table { + overflow: auto; + max-height: 500px; + } + + .example-container { + display: flex; + flex-direction: column; + min-width: 300px; + } + + .example-header { + min-height: 64px; + padding: 8px 24px 0; + } + + .mat-form-field { + font-size: 14px; + width: 100%; + } + + .mat-table { + overflow: auto; + max-height: 500px; + } + \ No newline at end of file diff --git a/ng-seed/src/app/appoinment/business/business-list/business-list.component.ts b/ng-seed/src/app/appoinment/business/business-list/business-list.component.ts index cf1764d..f5ce091 100644 --- a/ng-seed/src/app/appoinment/business/business-list/business-list.component.ts +++ b/ng-seed/src/app/appoinment/business/business-list/business-list.component.ts @@ -24,6 +24,7 @@ export class BusinessListComponent implements OnInit { @ViewChild(MatPaginator) paginator: MatPaginator; @ViewChild(MatSort) sort: MatSort; recordStatus: boolean; + @ViewChild(MatTable,{static:true}) table: MatTable{{action}} Users
-diff --git a/ng-seed/src/app/appoinment/user/add-user/add-user.component.scss b/ng-seed/src/app/appoinment/user/add-user/add-user.component.scss index d25aaa5..cb5c7cd 100644 --- a/ng-seed/src/app/appoinment/user/add-user/add-user.component.scss +++ b/ng-seed/src/app/appoinment/user/add-user/add-user.component.scss @@ -34,4 +34,21 @@ } .scrollHV { height: calc(100vh - 190px); -} \ No newline at end of file +} + + +input[type=file]::file-selector-button { + margin-right: 20px; + border: none; + background: #084cdf; + padding: 10px 20px; + border-radius: 10px; + + color: #fff; + cursor: pointer; + transition: background .2s ease-in-out; + } + + input[type=file]::file-selector-button:hover { + background: #0d45a5; + } \ No newline at end of file diff --git a/ng-seed/src/app/appoinment/user/add-user/add-user.component.ts b/ng-seed/src/app/appoinment/user/add-user/add-user.component.ts index 3fc573b..5014b90 100644 --- a/ng-seed/src/app/appoinment/user/add-user/add-user.component.ts +++ b/ng-seed/src/app/appoinment/user/add-user/add-user.component.ts @@ -3,6 +3,7 @@ import { FormBuilder, FormControl, FormGroup, Validators } from '@angular/forms' import { MatDialogRef, MAT_DIALOG_DATA } from '@angular/material/dialog'; import { Router } from '@angular/router'; import { BusinessService } from 'app/appoinment/business/business-service/business.service'; + export interface UsersData { userName: string; id: number; @@ -31,6 +32,7 @@ export class AddUserComponent implements OnInit { @Optional() @Inject(MAT_DIALOG_DATA) public data: UsersData,public _bus:BusinessService) { console.log(data); this.local_data = {...data}; + this.action = this.local_data.action; this.formData= new FormData(); this.getBusinessList() @@ -43,9 +45,12 @@ export class AddUserComponent implements OnInit { let businessFilter = res['data'].filter(val => val.busName) this.businessList = businessFilter; let data = localStorage.getItem('busName') - this.form.controls['businessselect'].setValue(data) + // this.form.controls['businessselect'].setValue(data) console.log(this.businessList) console.log(this.form['value'].businessselect) + this.local_data.businessselect = this.local_data.busId + + this.form.patchValue(this.local_data) } } // , error => {this.errorMessage =
Users Details
-
-
-
-
-
-
-
-
+
\ No newline at end of file
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/ng-seed/src/app/appoinment/user/user-list/user-list.component.scss b/ng-seed/src/app/appoinment/user/user-list/user-list.component.scss
index 4905702..221b1c2 100644
--- a/ng-seed/src/app/appoinment/user/user-list/user-list.component.scss
+++ b/ng-seed/src/app/appoinment/user/user-list/user-list.component.scss
@@ -85,4 +85,117 @@ img {
}
.mat-elevation-z8 {
box-shadow: none!important;
-}
\ No newline at end of file
+}
+
+.my-table{
+ width: 100%;
+}
+.button{
+ float: right;
+ background-color: #4caf50;
+ color: #ffff;
+}
+th.mat-header-cell, td.mat-cell, td.mat-footer-cell {
+ padding: 6px;
+ border-bottom-width: 1px;
+ border-bottom-style: solid;
+}
+.mat-expansion-panel-header {
+ display: inline!important;
+}
+::ng-deep .mat-drawer-content {
+ overflow: hidden!important;
+ background-color: #ffff;
+}
+// ::ng-deep .body-container {
+// overflow-x: hidden;
+// overflow-y: hidden;
+// background-color: #ffff;
+// }
+::ng-deep .mat-expansion-panel:not([class*='mat-elevation-z']) {
+ box-shadow: none!important;
+}
+img {
+ width: 40px;
+ height: 40px;
+ border-radius: 50%;
+ }
+ .fullscreen{
+ position: absolute !important;
+ height: auto !important;
+ top: 0;
+ left: 0;
+ right: 0;
+ bottom: 0;
+ }
+ tr.mat-header-row {
+ height: 30px!important;
+}
+.font-color{
+ font-weight: 600;
+ font-size: 14px;
+}
+.edit-color{
+ color: rgba(0, 0, 0, 0.54);
+}
+.edit-color:hover {
+ color: #4caf50;
+ }
+ .delete:hover {
+ color:#ff0000;
+ }
+// ::ng-deep .mat-form-field-appearance-legacy .mat-form-field-wrapper {
+// width: 180%;
+// }
+
+::ng-deep .mat-content {
+ display: block!important;
+ flex: 1;
+ /* flex-direction: row; */
+ /* overflow: hidden; */
+ overflow-x: auto!important;
+ overflow-y: auto!important;
+}
+::ng-deep .mat-select-arrow {
+ margin: 0 15px!important;
+}
+::ng-deep .mat-paginator {
+ margin-top: -10px!important;
+}
+::ng-deep body.swal2-height-auto {
+ height: 100% !important
+ }
+ .example-container {
+ display: block;
+ height: 348px;
+ /* overflow: auto; */
+ overflow-x: hidden;
+ overflow-y: auto;
+ }
+
+ .mat-table {
+ overflow: auto;
+ max-height: 500px;
+ }
+
+ .example-container {
+ display: flex;
+ flex-direction: column;
+ min-width: 300px;
+ }
+
+ .example-header {
+ min-height: 64px;
+ padding: 8px 24px 0;
+ }
+
+ .mat-form-field {
+ font-size: 14px;
+ width: 100%;
+ }
+
+ .mat-table {
+ overflow: auto;
+ max-height: 500px;
+ }
+
\ No newline at end of file
diff --git a/ng-seed/src/app/appoinment/user/user-list/user-list.component.ts b/ng-seed/src/app/appoinment/user/user-list/user-list.component.ts
index 19657db..428a34d 100644
--- a/ng-seed/src/app/appoinment/user/user-list/user-list.component.ts
+++ b/ng-seed/src/app/appoinment/user/user-list/user-list.component.ts
@@ -1,6 +1,6 @@
import { Component, OnInit, ViewChild } from '@angular/core';
import { MatDialog } from '@angular/material/dialog';
-import { MatPaginator } from '@angular/material/paginator';
+import { MatPaginator, PageEvent } from '@angular/material/paginator';
import { MatSort } from '@angular/material/sort';
import { MatTable, MatTableDataSource } from '@angular/material/table';
import { NotifierService } from 'angular-notifier';
@@ -8,6 +8,7 @@ import Swal from 'sweetalert2/dist/sweetalert2.js';
import { AddUserComponent } from '../add-user/add-user.component';
import { UserService } from '../user-service/user.service';
import { environment } from 'environments/environment';
+import { BusinessService } from 'app/appoinment/business/business-service/business.service';
export interface UsersData {
id: number;
@@ -43,14 +44,23 @@ const ELEMENT_DATA: UsersData[] = [
})
export class UserListComponent implements OnInit {
push: any;
- displayedColumns: string[] = ['id','logo', 'role', 'Username', 'Password', 'mobile_no', 'email', 'action'];
+ displayedColumns: string[] = ['id','logo', 'role', 'busId','Username', 'Password', 'mobile_no', 'email', 'action'];
dataSource: any;
addFormData: any;
- public usersList:any = new MatTableDataSource();
+ length = 5;
+ pageIndex = 0;
+ pageSize = 5;
+ pageEvent: PageEvent;
+ public usersList = new MatTableDataSource();
+
@ViewChild(MatTable,{static:true}) table: MatTable;
+
@ViewChild(MatPaginator) paginator: MatPaginator;
private apiUrl = environment.apiEndpoint;
- constructor(private notifierService: NotifierService,public dialog: MatDialog, public _use:UserService) {
+ recordStatus: boolean= true;
+ usersListLength: any=5;
+ businessList: any;
+ constructor(private notifierService: NotifierService,public dialog: MatDialog, public _use:UserService,public _bus:BusinessService) {
let open_go_admin = localStorage.getItem('go_admin')
if(open_go_admin == '0'){
this.openDialog('Add',{})
@@ -62,23 +72,21 @@ export class UserListComponent implements OnInit {
ngOnInit(): void {
// this.dataSource = new MatTableDataSource(ELEMENT_DATA)
this.getUsersList()
+ this.getBusinessList()
}
getUsersList() {
//this._pd.getTabStatusPdDetails(this.tabStatus)
this._use.getUsersListDetails().subscribe(res => {
if (res.status == 200) {
- this.usersList = res.data;
- // console.log(this.usersList)
- // this.dataSource = res.data.length;
- // console.log(this.dataSource)
- // this.dataSource.data = this.usersList;
- // console.log(this.dataSource.data)
- // this.recordStatus=false;
+ let usersList = res.data
+ this.usersList['data'] = usersList;
+ this.usersListLength = res.data.length;
+ this.recordStatus=false;
}
else{
// this.usersList=[];
// this.dataSource = null;
- // this.recordStatus=true;
+ this.recordStatus=true;
}
}
,error => {
@@ -87,16 +95,41 @@ export class UserListComponent implements OnInit {
// alert(error.html_format);
});
}
+ getBusinessList() {
+ //this._pd.getTabStatusPdDetails(this.tabStatus)
+ this._bus.getBusinessListDetails().subscribe(res => {
+ if (res.status == 200) {
+ let businessFilter = res['data'].filter(val => val.busName)
+ this.businessList = businessFilter;
+ }
+ }
+ // , error => {this.errorMessage = error});
+ ,error => {
+ // this.errorMessage.push(error);
+ // this.notifier.notify('error', 'Something Went Wrong Try Again.! \t\"' + (error.error_type == 2 ? error.error_status + ' ( ' + error.error_text + ' ) ' : ' ( ' + error.error_text + ' ) ') +'\" Error Occur.!');
+ // alert(error.html_format);
+ })
+ }
ngAfterViewInit() {
+ console.log(this.usersList,this.paginator)
this.usersList.paginator = this.paginator;
+
+ this.usersList.paginator = this.paginator;
+ console.log(this.usersList,this.paginator)
+ //this.usersList.sort = this.sort;
+
}
- applyFilter(event: Event) {
- const filterValue = (event.target as HTMLInputElement).value;
- this.usersList.filter = filterValue.trim().toLowerCase();
- if (this.usersList.paginator) {
- this.usersList.paginator.firstPage();
+ applyFilter(filterValue: string) {
+ console.log(filterValue)
+ if(filterValue == null){
+ this.usersList.filter = null;
+ }else{
+ filterValue = filterValue.trim(); // Remove whitespace
+ filterValue = filterValue.toLowerCase(); // Datasource defaults to lowercase matches
+ this.usersList.filter = filterValue;
}
+
}
pageChange(e) {
diff --git a/ng-seed/src/app/layouts/admin/admin-layout.component.html b/ng-seed/src/app/layouts/admin/admin-layout.component.html
index ba1e5e0..fcfa162 100644
--- a/ng-seed/src/app/layouts/admin/admin-layout.component.html
+++ b/ng-seed/src/app/layouts/admin/admin-layout.component.html
@@ -22,7 +22,7 @@
@@ -188,9 +188,9 @@
| S.No | @@ -35,11 +52,12 @@{{element.role}} | User Name | {{element.userName}} | @@ -86,13 +104,24 @@
|---|
+
+
+
+
+
+
+
+ No Data Available
+ {{getUser}}
-
+
-