working hours

This commit is contained in:
Surendiran 2023-05-22 15:20:32 +05:30
parent 80e95b3f91
commit 1c541f1a07
10 changed files with 100 additions and 50 deletions

View File

@ -4,6 +4,7 @@
<mat-label>Filter</mat-label> <mat-label>Filter</mat-label>
<input matInput (keyup)="applyFilter($event.target.value)" placeholder="Type Here" #input> <input matInput (keyup)="applyFilter($event.target.value)" placeholder="Type Here" #input>
</mat-form-field> </mat-form-field>
<mat-checkbox class="example-margin" (change)="setAll($event.checked)">Click here to see Inactive List</mat-checkbox>
<button mat-button (click)="openDialog('Add',{})" class="button">Add Business</button> <button mat-button (click)="openDialog('Add',{})" class="button">Add Business</button>
<!-- <div class="example-container mat-elevation-z8 "> --> <!-- <div class="example-container mat-elevation-z8 "> -->
<mat-sidenav-container class="app-inner background-none shadow-none mail-db"> <mat-sidenav-container class="app-inner background-none shadow-none mail-db">
@ -67,7 +68,8 @@
</ng-container> </ng-container>
<tr mat-header-row *matHeaderRowDef="displayedColumns; sticky: true"></tr> <tr mat-header-row *matHeaderRowDef="displayedColumns; sticky: true"></tr>
<tr mat-row *matRowDef="let row; columns: displayedColumns;" [ngClass]="row.isActive != 1 ? 'bgRowColor' : ''"></tr> <tr mat-row *matRowDef="let row; columns: displayedColumns;"></tr>
<!-- <tr mat-row *matRowDef="let row; columns: displayedColumns;" [ngClass]="row.isActive != 1 ? 'bgRowColor' : ''"></tr> -->
</table> </table>
</ng-scrollbar> </ng-scrollbar>

View File

@ -34,6 +34,7 @@ export class BusinessListComponent implements OnInit {
businessList: any[] = []; businessList: any[] = [];
private apiUrl = environment.apiEndpoint; private apiUrl = environment.apiEndpoint;
isLoading = true isLoading = true
activeAndInactive: boolean = false;
constructor(private notifierService: NotifierService,private router:Router,public dialog: MatDialog,public _bus:BusinessService) { constructor(private notifierService: NotifierService,private router:Router,public dialog: MatDialog,public _bus:BusinessService) {
} }
@ -97,22 +98,34 @@ export class BusinessListComponent implements OnInit {
this.isLoading = false this.isLoading = false
this.businessList = res.data; this.businessList = res.data;
console.log(this.businessList) console.log(this.businessList)
this.businessListLength = res.data.length;
console.log(this.businessListLength)
this.businessList.sort((a: any, b: any) => { this.businessList.sort((a: any, b: any) => {
return b.id - a.id; return b.id - a.id;
}); });
this.businessList.forEach((element, index) => { if(this.activeAndInactive == true){
this.businessListSource['data'] = this.businessList.filter(val => val.isActive == 0)
console.log('Inactive',this.businessListSource['data'])
}else {
this.businessListSource['data'] = this.businessList.filter(val => val.isActive == 1)
console.log('Active',this.businessListSource['data'])
}
this.businessListSource['data'].forEach((element:any, index) => {
element.index = index element.index = index
element.state = JSON.parse(element.state) element.state = JSON.parse(element.state)
console.log(element.state) console.log(element.state)
element.city = JSON.parse(element.city) element.city = JSON.parse(element.city)
console.log(element.city) console.log(element.city)
}); });
console.log(this.businessList) // console.log(this.businessList)
this.businessListSource['data'] = this.businessList; // this.businessListSource['data'] = this.businessList;
console.log(this.businessListSource) this.businessListLength = this.businessListSource['data'].length
// this.recordStatus= true;
if(this.businessListLength > 0){
this.recordStatus= false; this.recordStatus= false;
}else{
this.recordStatus=true;
}
console.log(this.businessListSource)
// this.recordStatus=false;
} }
else{ else{
this.isLoading = false this.isLoading = false
@ -290,4 +303,10 @@ export class BusinessListComponent implements OnInit {
return this.apiUrl+'imageViewer?img_name='+image; return this.apiUrl+'imageViewer?img_name='+image;
} }
setAll(check) {
console.log(check)
this.activeAndInactive = check
this.getBusinessList()
}
} }

View File

@ -57,13 +57,13 @@
formControlName="value" formControlName="value"
[placeholder]="apiField.value"> [placeholder]="apiField.value">
</mat-form-field> --> </mat-form-field> -->
<button *ngIf="i == 0" (click)="addFilterToFiltersFormArray(i)" [disabled]="Select1 != true" mat-icon-button aria-label="Example icon-button with a heart icon"> <button *ngIf="filtersFormArray.length == i+1" (click)="addFilterToFiltersFormArray(i)" [disabled]="Select1 != true" mat-icon-button aria-label="Example icon-button with a heart icon">
<mat-icon class="deleteRow">add</mat-icon> <mat-icon class="deleteRow">add</mat-icon>
</button> </button>
<button (click)="removeFilterFromFiltersFormArray(i)" [disabled]="Select1 != true" mat-icon-button aria-label="Example icon-button with a heart icon"> <button *ngIf="i != 0" (click)="removeFilterFromFiltersFormArray(i)" [disabled]="Select1 != true" mat-icon-button aria-label="Example icon-button with a heart icon">
<mat-icon class="deleteRow">delete</mat-icon> <mat-icon class="deleteRow">delete</mat-icon>
</button> </button>
<!-- <a *ngIf="i == 0" (click)="applyToAll(1,selectFilterTimeDropdown)">Apply to All</a> --> <a *ngIf="i == 0" (click)="applyToAll(1,selectFilterTimeDropdown)">Apply to All</a>
</div> </div>
</div> </div>
</div> </div>
@ -129,13 +129,13 @@
formControlName="value" formControlName="value"
[placeholder]="apiField.value"> [placeholder]="apiField.value">
</mat-form-field> --> </mat-form-field> -->
<button *ngIf="i == 0" (click)="addFilterToFiltersFormArray2(i)" [disabled]="Select2 != true" mat-icon-button aria-label="Example icon-button with a heart icon"> <button *ngIf="filtersFormArray2.length == i+1" (click)="addFilterToFiltersFormArray2(i)" [disabled]="Select2 != true" mat-icon-button aria-label="Example icon-button with a heart icon">
<mat-icon class="deleteRow">add</mat-icon> <mat-icon class="deleteRow">add</mat-icon>
</button> </button>
<button (click)="removeFilterFromFiltersFormArray2(i)" [disabled]="Select2 != true" mat-icon-button aria-label="Example icon-button with a heart icon"> <button *ngIf="i != 0" (click)="removeFilterFromFiltersFormArray2(i)" [disabled]="Select2 != true" mat-icon-button aria-label="Example icon-button with a heart icon">
<mat-icon class="deleteRow">delete</mat-icon> <mat-icon class="deleteRow">delete</mat-icon>
</button> </button>
<!-- <a *ngIf="i == 0" (click)="applyToAll(2,selectFilterTimeDropdown2)">Apply to All</a> --> <a *ngIf="i == 0" (click)="applyToAll(2,selectFilterTimeDropdown2)">Apply to All</a>
</div> </div>
</div> </div>
</div> </div>
@ -201,13 +201,13 @@
formControlName="value" formControlName="value"
[placeholder]="apiField.value"> [placeholder]="apiField.value">
</mat-form-field> --> </mat-form-field> -->
<button *ngIf="i == 0" (click)="addFilterToFiltersFormArray3(i)" [disabled]="Select3 != true" mat-icon-button aria-label="Example icon-button with a heart icon"> <button *ngIf="filtersFormArray3.length == i+1" (click)="addFilterToFiltersFormArray3(i)" [disabled]="Select3 != true" mat-icon-button aria-label="Example icon-button with a heart icon">
<mat-icon class="deleteRow">add</mat-icon> <mat-icon class="deleteRow">add</mat-icon>
</button> </button>
<button (click)="removeFilterFromFiltersFormArray3(i)" [disabled]="Select3 != true" mat-icon-button aria-label="Example icon-button with a heart icon"> <button *ngIf="i != 0" (click)="removeFilterFromFiltersFormArray3(i)" [disabled]="Select3 != true" mat-icon-button aria-label="Example icon-button with a heart icon">
<mat-icon class="deleteRow">delete</mat-icon> <mat-icon class="deleteRow">delete</mat-icon>
</button> </button>
<!-- <a *ngIf="i == 0" (click)="applyToAll(3,selectFilterTimeDropdown3)">Apply to All</a> --> <a *ngIf="i == 0" (click)="applyToAll(3,selectFilterTimeDropdown3)">Apply to All</a>
</div> </div>
</div> </div>
</div> </div>
@ -273,13 +273,13 @@
formControlName="value" formControlName="value"
[placeholder]="apiField.value"> [placeholder]="apiField.value">
</mat-form-field> --> </mat-form-field> -->
<button *ngIf="i == 0" (click)="addFilterToFiltersFormArray4(i)" [disabled]="Select4 != true" mat-icon-button aria-label="Example icon-button with a heart icon"> <button *ngIf="filtersFormArray4.length == i+1" (click)="addFilterToFiltersFormArray4(i)" [disabled]="Select4 != true" mat-icon-button aria-label="Example icon-button with a heart icon">
<mat-icon class="deleteRow">add</mat-icon> <mat-icon class="deleteRow">add</mat-icon>
</button> </button>
<button (click)="removeFilterFromFiltersFormArray4(i)" [disabled]="Select4 != true" mat-icon-button aria-label="Example icon-button with a heart icon"> <button *ngIf="i != 0" (click)="removeFilterFromFiltersFormArray4(i)" [disabled]="Select4 != true" mat-icon-button aria-label="Example icon-button with a heart icon">
<mat-icon class="deleteRow">delete</mat-icon> <mat-icon class="deleteRow">delete</mat-icon>
</button> </button>
<!-- <a *ngIf="i == 0" (click)="applyToAll(4,selectFilterTimeDropdown4)">Apply to All</a> --> <a *ngIf="i == 0" (click)="applyToAll(4,selectFilterTimeDropdown4)">Apply to All</a>
</div> </div>
</div> </div>
</div> </div>
@ -345,13 +345,13 @@
formControlName="value" formControlName="value"
[placeholder]="apiField.value"> [placeholder]="apiField.value">
</mat-form-field> --> </mat-form-field> -->
<button *ngIf="i == 0" (click)="addFilterToFiltersFormArray5(i)" [disabled]="Select5 != true" mat-icon-button aria-label="Example icon-button with a heart icon"> <button *ngIf="filtersFormArray5.length == i+1" (click)="addFilterToFiltersFormArray5(i)" [disabled]="Select5 != true" mat-icon-button aria-label="Example icon-button with a heart icon">
<mat-icon class="deleteRow">add</mat-icon> <mat-icon class="deleteRow">add</mat-icon>
</button> </button>
<button (click)="removeFilterFromFiltersFormArray5(i)" [disabled]="Select5 != true" mat-icon-button aria-label="Example icon-button with a heart icon"> <button *ngIf="i != 0" (click)="removeFilterFromFiltersFormArray5(i)" [disabled]="Select5 != true" mat-icon-button aria-label="Example icon-button with a heart icon">
<mat-icon class="deleteRow">delete</mat-icon> <mat-icon class="deleteRow">delete</mat-icon>
</button> </button>
<!-- <a *ngIf="i == 0" (click)="applyToAll(5,selectFilterTimeDropdown5)">Apply to All</a> --> <a *ngIf="i == 0" (click)="applyToAll(5,selectFilterTimeDropdown5)">Apply to All</a>
</div> </div>
</div> </div>
</div> </div>
@ -417,13 +417,13 @@
formControlName="value" formControlName="value"
[placeholder]="apiField.value"> [placeholder]="apiField.value">
</mat-form-field> --> </mat-form-field> -->
<button *ngIf="i == 0" (click)="addFilterToFiltersFormArray6(i)" [disabled]="Select6 != true" mat-icon-button aria-label="Example icon-button with a heart icon"> <button *ngIf="filtersFormArray6.length == i+1" (click)="addFilterToFiltersFormArray6(i)" [disabled]="Select6 != true" mat-icon-button aria-label="Example icon-button with a heart icon">
<mat-icon class="deleteRow">add</mat-icon> <mat-icon class="deleteRow">add</mat-icon>
</button> </button>
<button (click)="removeFilterFromFiltersFormArray6(i)" [disabled]="Select6 != true" mat-icon-button aria-label="Example icon-button with a heart icon"> <button *ngIf="i != 0" (click)="removeFilterFromFiltersFormArray6(i)" [disabled]="Select6 != true" mat-icon-button aria-label="Example icon-button with a heart icon">
<mat-icon class="deleteRow">delete</mat-icon> <mat-icon class="deleteRow">delete</mat-icon>
</button> </button>
<!-- <a *ngIf="i == 0" (click)="applyToAll(6,selectFilterTimeDropdown6)">Apply to All</a> --> <a *ngIf="i == 0" (click)="applyToAll(6,selectFilterTimeDropdown6)">Apply to All</a>
</div> </div>
</div> </div>
</div> </div>
@ -489,13 +489,13 @@
formControlName="value" formControlName="value"
[placeholder]="apiField.value"> [placeholder]="apiField.value">
</mat-form-field> --> </mat-form-field> -->
<button *ngIf="i == 0" (click)="addFilterToFiltersFormArray7(i)" [disabled]="Select7 != true" mat-icon-button aria-label="Example icon-button with a heart icon"> <button *ngIf="filtersFormArray7.length == i+1" (click)="addFilterToFiltersFormArray7(i)" [disabled]="Select7 != true" mat-icon-button aria-label="Example icon-button with a heart icon">
<mat-icon class="deleteRow">add</mat-icon> <mat-icon class="deleteRow">add</mat-icon>
</button> </button>
<button (click)="removeFilterFromFiltersFormArray7(i)" [disabled]="Select7 != true" mat-icon-button aria-label="Example icon-button with a heart icon"> <button *ngIf="i != 0" (click)="removeFilterFromFiltersFormArray7(i)" [disabled]="Select7 != true" mat-icon-button aria-label="Example icon-button with a heart icon">
<mat-icon class="deleteRow">delete</mat-icon> <mat-icon class="deleteRow">delete</mat-icon>
</button> </button>
<!-- <a *ngIf="i == 0" (click)="applyToAll(7,selectFilterTimeDropdown7)">Apply to All</a> --> <a *ngIf="i == 0" (click)="applyToAll(7,selectFilterTimeDropdown7)">Apply to All</a>
</div> </div>
</div> </div>
</div> </div>

View File

@ -827,7 +827,10 @@ export class EditWorkingHoursComponent implements OnInit {
fliterTimeSelect2(data , i) fliterTimeSelect2(data , i)
{ {
// console.log(data[i][0]) // console.log(data[i][0])
if(data[i][0][0] != undefined){
return data[i][0][0] return data[i][0][0]
}
} }
fliterTimeSelect3(data , i) fliterTimeSelect3(data , i)
@ -898,7 +901,7 @@ return data[i][1][0]
this.selectFilterTimeDropdown5 = param this.selectFilterTimeDropdown5 = param
this.selectFilterTimeDropdown6 = param this.selectFilterTimeDropdown6 = param
this.selectFilterTimeDropdown7 = param this.selectFilterTimeDropdown7 = param
console.log(this['dynamicForm'+num].value['filters'+num]) console.log(this['dynamicForm'+num])
let sunday ={filters1 :this['dynamicForm'+num].value['filters'+num] } let sunday ={filters1 :this['dynamicForm'+num].value['filters'+num] }
let monday ={filters2 :this['dynamicForm'+num].value['filters'+num] } let monday ={filters2 :this['dynamicForm'+num].value['filters'+num] }
@ -908,6 +911,7 @@ return data[i][1][0]
let friday ={filters6:this['dynamicForm'+num].value['filters'+num] } let friday ={filters6:this['dynamicForm'+num].value['filters'+num] }
let saturday ={filters7 :this['dynamicForm'+num].value['filters'+num] } let saturday ={filters7 :this['dynamicForm'+num].value['filters'+num] }
if(this['dynamicForm'+num].value['filters'+num].length>1){ if(this['dynamicForm'+num].value['filters'+num].length>1){
console.log('length') console.log('length')
for(let j=1;j<=this['dynamicForm'+num].value['filters'+num].length-1;j++){ for(let j=1;j<=this['dynamicForm'+num].value['filters'+num].length-1;j++){
@ -917,6 +921,7 @@ return data[i][1][0]
} }
if(i != 2){ if(i != 2){
console.log('2') console.log('2')
this.dynamicForm2.reset();
this.filtersFormArray2.push(this.createFilterGroup()); this.filtersFormArray2.push(this.createFilterGroup());
} }
if(i != 3){ if(i != 3){

View File

@ -24,6 +24,7 @@
<mat-option value="BIZADMIN" (click)="applyFilter('BIZADMIN')">BIZADMIN</mat-option> <mat-option value="BIZADMIN" (click)="applyFilter('BIZADMIN')">BIZADMIN</mat-option>
</mat-select> </mat-select>
</mat-form-field> --> </mat-form-field> -->
<mat-checkbox class="example-margin" (change)="setAll($event.checked)">Click here to see Inactive List</mat-checkbox>
<button mat-button (click)="openDialog('Add',{})" class="button">Add Users</button> <button mat-button (click)="openDialog('Add',{})" class="button">Add Users</button>
<!-- <div class="example-container mat-elevation-z8 "> --> <!-- <div class="example-container mat-elevation-z8 "> -->
@ -113,7 +114,8 @@
</td> </td>
</ng-container> </ng-container>
<tr mat-header-row *matHeaderRowDef="displayedColumns; sticky: true"></tr> <tr mat-header-row *matHeaderRowDef="displayedColumns; sticky: true"></tr>
<tr mat-row *matRowDef="let row; columns: displayedColumns;" [ngClass]="row.isActive != 1 ? 'bgRowColor' : ''"></tr> <!-- <tr mat-row *matRowDef="let row; columns: displayedColumns;" [ngClass]="row.isActive != 1 ? 'bgRowColor' : ''"></tr> -->
<tr mat-row *matRowDef="let row; columns: displayedColumns;"></tr>
</table> </table>
</ng-scrollbar> </ng-scrollbar>

View File

@ -64,6 +64,7 @@ export class UserListComponent implements OnInit {
usersListLength: any=5; usersListLength: any=5;
businessList: any; businessList: any;
isLoading = true isLoading = true
activeAndInactive: boolean = false;
constructor(private notifierService: NotifierService,public dialog: MatDialog, public _use:UserService,public _bus:BusinessService) { constructor(private notifierService: NotifierService,public dialog: MatDialog, public _use:UserService,public _bus:BusinessService) {
let open_go_admin = localStorage.getItem('go_admin') let open_go_admin = localStorage.getItem('go_admin')
if(open_go_admin == '0'){ if(open_go_admin == '0'){
@ -152,14 +153,28 @@ export class UserListComponent implements OnInit {
usersList = usersList.filter((value,key)=>{ usersList = usersList.filter((value,key)=>{
return value.id != userID return value.id != userID
}); });
usersList.forEach((element, index) => {
if(this.activeAndInactive == true){
this.usersList['data'] = usersList.filter(val => val.isActive == 0)
console.log('Inactive',this.usersList['data'])
}else {
this.usersList['data'] = usersList.filter(val => val.isActive == 1)
console.log('Active',this.usersList['data'])
}
this.usersList['data'].forEach((element:any, index) => {
element.index = index element.index = index
}); });
this.usersList['data'] = usersList; // this.users/List['data'] = usersList;
this.usersListLength = usersList.length; this.usersListLength = this.usersList['data'].length;
if(this.usersListLength > 0){
this.recordStatus= false; this.recordStatus= false;
}else{
this.recordStatus=true;
}
// this.recordStatus=false;
} }
else{ else{
// this.usersList=[]; // this.usersList=[];
@ -422,4 +437,10 @@ export class UserListComponent implements OnInit {
return this.apiUrl+'imageViewer?img_name='+image; return this.apiUrl+'imageViewer?img_name='+image;
} }
setAll(check) {
console.log(check)
this.activeAndInactive = check
this.getUsersList()
}
} }

View File

@ -62,11 +62,11 @@ export class CustomerInfoComponent implements OnInit {
'[a-zA-Z0-9._%+-]+@[a-zA-Z0-9.-]+.[a-zA-Z]{2,63}$', '[a-zA-Z0-9._%+-]+@[a-zA-Z0-9.-]+.[a-zA-Z]{2,63}$',
),]), ),]),
phoneNo: new FormControl('', [Validators.required, Validators.minLength(10),Validators.maxLength(10)]), phoneNo: new FormControl('', [Validators.required, Validators.minLength(10),Validators.maxLength(10)]),
address_1: new FormControl('', [ Validators.maxLength(100)]), address_1: new FormControl('', [Validators.required,Validators.maxLength(100)]),
city: new FormControl(''), city: new FormControl('',[Validators.required]),
state: new FormControl(''), state: new FormControl('',[Validators.required]),
otp: new FormControl('', [ Validators.maxLength(6),Validators.minLength(6)]), otp: new FormControl('', [ Validators.maxLength(6),Validators.minLength(6)]),
pincode: new FormControl(''), pincode: new FormControl('',[Validators.required]),
}); });
} }

View File

@ -1,10 +1,10 @@
<div class="relative"> <div class="relative">
<div class="form-bg"> <div class="form-bg">
<div fxLayout="row" fxLayoutAlign="center start" class="pt-2"> <div fxLayout="row" fxLayoutAlign="center center" class="pad_top">
<div fxLayout="column" fxFlex.xl="40" fxFlex.lg="40" fxFlex.md="50" fxFlex.sm="80" fxFlex.xs="90"> <div fxLayout="column" fxFlex.xl="40" fxFlex.lg="40" fxFlex.md="50" fxFlex.sm="80" fxFlex.xs="90">
<mat-card class="login-session"> <mat-card class="login-session">
<div> <div>
<h2 class="base-border">Login Form</h2> <h2 class="base-border">Login</h2>
<p>Enter Your Login Details</p> <p>Enter Your Login Details</p>
<form [formGroup]="loginForm" (ngSubmit)="onSubmit()" novalidate class="d-flex-center"> <form [formGroup]="loginForm" (ngSubmit)="onSubmit()" novalidate class="d-flex-center">
<div fxLayout="column" fxLayoutAlign="start stretch"> <div fxLayout="column" fxLayoutAlign="start stretch">
@ -30,14 +30,12 @@
<!-- <button class="mt-2 mb-1" [disabled]="!loginForm.valid" mat-raised-button color="primary" mat-button>Sign In</button> --> <!-- <button class="mt-2 mb-1" [disabled]="!loginForm.valid" mat-raised-button color="primary" mat-button>Sign In</button> -->
<button class="mt-2 mb-1" mat-raised-button color="primary" mat-button>Sign In</button> <button class="mt-2 mb-1" mat-raised-button color="primary" mat-button>Sign In</button>
<a class="mat-text-warn mb-0" (click)="openForgot()">Forgot password?</a> <a class="mat-text-warn mb-0" (click)="openForgot()">Forgot password?</a>
<p class="mb-0">Don't have an account? <a [routerLink]="['/authentication/register']" class="mat-text-primary">Register Here</a></p> <!-- <p class="mb-0">Don't have an account? <a [routerLink]="['/authentication/register']" class="mat-text-primary">Register Here</a></p> -->
</div> </div>
<div> <!-- <div>
<p>Sign in using</p> <p>Sign in using</p>
<!-- <a href="#" class="shared-icon mr-1 mat-blue">
<i class="fa fa-facebook fa-lg mr-1"></i> Facebook</a> -->
<a href="#" class="shared-icon mat-red"> <a href="#" class="shared-icon mat-red">
<i class="fa fa-google fa-lg mr-1"></i>Google</a></div> <i class="fa fa-google fa-lg mr-1"></i>Google</a></div> -->
</form> </form>
</div> </div>
</mat-card> </mat-card>

View File

@ -1,3 +1,6 @@
::ng-deep .mat-drawer-content{ ::ng-deep .mat-drawer-content{
overflow: hidden !important; overflow: hidden !important;
} }
.pad_top{
padding-top: 5.5rem !important;
}