edit apply to all working hours
This commit is contained in:
parent
dcc6c9f2ea
commit
1e82c698a7
@ -184,7 +184,7 @@ edit_table(param){
|
||||
workingDialog(action,obj) {
|
||||
obj.action = action;
|
||||
const dialogRef = this.dialog.open(ExtraWorkingHoursComponent, {
|
||||
width: '48%',
|
||||
width: '50%',
|
||||
height: '100%',
|
||||
// maxWidth: '38vw',
|
||||
position: { right: '0' },
|
||||
@ -375,7 +375,7 @@ unavailability(action,obj) {
|
||||
//if(this.working_customize == false){
|
||||
// obj.action = action;
|
||||
const dialogRef = this.dialog.open(EditWorkingHoursComponent, {
|
||||
width: '45%',
|
||||
width: '50%',
|
||||
height: '100%',
|
||||
// maxWidth: '38vw',
|
||||
position: { right: '0' },
|
||||
|
||||
@ -57,13 +57,14 @@
|
||||
formControlName="value"
|
||||
[placeholder]="apiField.value">
|
||||
</mat-form-field> -->
|
||||
<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>
|
||||
</button>
|
||||
|
||||
<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>
|
||||
</button>
|
||||
<a *ngIf="i == 0" (click)="applyToAll(1,selectFilterTimeDropdown)">Apply to All</a>
|
||||
<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>
|
||||
</button>
|
||||
<a *ngIf="filtersFormArray.length == i+1" class="applyToAllStyle" (click)="applyToAll(1,selectFilterTimeDropdown)"><u>Apply to All</u></a>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
@ -129,13 +130,14 @@
|
||||
formControlName="value"
|
||||
[placeholder]="apiField.value">
|
||||
</mat-form-field> -->
|
||||
<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>
|
||||
</button>
|
||||
|
||||
<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>
|
||||
</button>
|
||||
<a *ngIf="i == 0" (click)="applyToAll(2,selectFilterTimeDropdown2)">Apply to All</a>
|
||||
<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>
|
||||
</button>
|
||||
<a *ngIf="filtersFormArray2.length == i+1" class="applyToAllStyle" (click)="applyToAll(2,selectFilterTimeDropdown2)">Apply to All</a>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
@ -201,13 +203,14 @@
|
||||
formControlName="value"
|
||||
[placeholder]="apiField.value">
|
||||
</mat-form-field> -->
|
||||
<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>
|
||||
</button>
|
||||
|
||||
<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>
|
||||
</button>
|
||||
<a *ngIf="i == 0" (click)="applyToAll(3,selectFilterTimeDropdown3)">Apply to All</a>
|
||||
<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>
|
||||
</button>
|
||||
<a *ngIf="filtersFormArray3.length == i+1" class="applyToAllStyle" (click)="applyToAll(3,selectFilterTimeDropdown3)">Apply to All</a>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
@ -273,13 +276,14 @@
|
||||
formControlName="value"
|
||||
[placeholder]="apiField.value">
|
||||
</mat-form-field> -->
|
||||
<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>
|
||||
</button>
|
||||
|
||||
<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>
|
||||
</button>
|
||||
<a *ngIf="i == 0" (click)="applyToAll(4,selectFilterTimeDropdown4)">Apply to All</a>
|
||||
<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>
|
||||
</button>
|
||||
<a *ngIf="filtersFormArray4.length == i+1" class="applyToAllStyle" (click)="applyToAll(4,selectFilterTimeDropdown4)">Apply to All</a>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
@ -345,13 +349,14 @@
|
||||
formControlName="value"
|
||||
[placeholder]="apiField.value">
|
||||
</mat-form-field> -->
|
||||
<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>
|
||||
</button>
|
||||
|
||||
<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>
|
||||
</button>
|
||||
<a *ngIf="i == 0" (click)="applyToAll(5,selectFilterTimeDropdown5)">Apply to All</a>
|
||||
<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>
|
||||
</button>
|
||||
<a *ngIf="filtersFormArray5.length == i+1" class="applyToAllStyle" (click)="applyToAll(5,selectFilterTimeDropdown5)">Apply to All</a>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
@ -417,13 +422,14 @@
|
||||
formControlName="value"
|
||||
[placeholder]="apiField.value">
|
||||
</mat-form-field> -->
|
||||
<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>
|
||||
</button>
|
||||
|
||||
<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>
|
||||
</button>
|
||||
<a *ngIf="i == 0" (click)="applyToAll(6,selectFilterTimeDropdown6)">Apply to All</a>
|
||||
<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>
|
||||
</button>
|
||||
<a *ngIf="filtersFormArray6.length == i+1" class="applyToAllStyle" (click)="applyToAll(6,selectFilterTimeDropdown6)">Apply to All</a>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
@ -489,13 +495,14 @@
|
||||
formControlName="value"
|
||||
[placeholder]="apiField.value">
|
||||
</mat-form-field> -->
|
||||
<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>
|
||||
</button>
|
||||
|
||||
<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>
|
||||
</button>
|
||||
<a *ngIf="i == 0" (click)="applyToAll(7,selectFilterTimeDropdown7)">Apply to All</a>
|
||||
<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>
|
||||
</button>
|
||||
<a *ngIf="filtersFormArray7.length == i+1" class="applyToAllStyle" (click)="applyToAll(7,selectFilterTimeDropdown7)">Apply to All</a>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
@ -147,3 +147,7 @@ mat-checkbox{
|
||||
display: block;
|
||||
}
|
||||
}
|
||||
.applyToAllStyle{
|
||||
color: green;
|
||||
padding: 25px;
|
||||
}
|
||||
@ -827,10 +827,16 @@ export class EditWorkingHoursComponent implements OnInit {
|
||||
fliterTimeSelect2(data , i)
|
||||
{
|
||||
// console.log(data[i][0])
|
||||
if(data[i][0][0] != undefined){
|
||||
return data[i][0][0]
|
||||
if(data[i] instanceof Array){
|
||||
if(data[i][0]){
|
||||
if(data[i][0][0] != undefined){
|
||||
return data[i][0][0]
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
}
|
||||
|
||||
fliterTimeSelect3(data , i)
|
||||
@ -883,14 +889,67 @@ return data[i][1][0]
|
||||
}
|
||||
|
||||
applyToAll(i,param){
|
||||
|
||||
if(this['dynamicForm'+i].value['filters'+i].length>1){
|
||||
if(i == 2){
|
||||
this.dynamicForm1.reset();
|
||||
this.dynamicForm3.reset();
|
||||
this.dynamicForm4.reset();
|
||||
this.dynamicForm5.reset();
|
||||
this.dynamicForm6.reset();
|
||||
this.dynamicForm7.reset();
|
||||
}else if(i==1){
|
||||
this.dynamicForm2.reset();
|
||||
this.dynamicForm3.reset();
|
||||
this.dynamicForm4.reset();
|
||||
this.dynamicForm5.reset();
|
||||
this.dynamicForm6.reset();
|
||||
this.dynamicForm7.reset();
|
||||
}else if(i==3){
|
||||
this.dynamicForm2.reset();
|
||||
this.dynamicForm1.reset();
|
||||
this.dynamicForm4.reset();
|
||||
this.dynamicForm5.reset();
|
||||
this.dynamicForm6.reset();
|
||||
this.dynamicForm7.reset();
|
||||
}else if(i==4){
|
||||
this.dynamicForm2.reset();
|
||||
this.dynamicForm3.reset();
|
||||
this.dynamicForm1.reset();
|
||||
this.dynamicForm5.reset();
|
||||
this.dynamicForm6.reset();
|
||||
this.dynamicForm7.reset();
|
||||
}else if(i==5){
|
||||
this.dynamicForm2.reset();
|
||||
this.dynamicForm3.reset();
|
||||
this.dynamicForm4.reset();
|
||||
this.dynamicForm1.reset();
|
||||
this.dynamicForm6.reset();
|
||||
this.dynamicForm7.reset();
|
||||
}else if(i==6){
|
||||
this.dynamicForm2.reset();
|
||||
this.dynamicForm3.reset();
|
||||
this.dynamicForm4.reset();
|
||||
this.dynamicForm5.reset();
|
||||
this.dynamicForm1.reset();
|
||||
this.dynamicForm7.reset();
|
||||
}else if(i==7){
|
||||
this.dynamicForm2.reset();
|
||||
this.dynamicForm3.reset();
|
||||
this.dynamicForm4.reset();
|
||||
this.dynamicForm5.reset();
|
||||
this.dynamicForm6.reset();
|
||||
this.dynamicForm1.reset();
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
// this.seedFiltersFormArray();
|
||||
// this.seedFiltersFormArray2();
|
||||
// this.seedFiltersFormArray3();
|
||||
// this.seedFiltersFormArray4();
|
||||
// this.seedFiltersFormArray5();
|
||||
// this.seedFiltersFormArray6();
|
||||
// this.seedFiltersFormArray7();
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
console.log(i,param)
|
||||
let num = i
|
||||
@ -901,7 +960,9 @@ return data[i][1][0]
|
||||
this.selectFilterTimeDropdown5 = param
|
||||
this.selectFilterTimeDropdown6 = param
|
||||
this.selectFilterTimeDropdown7 = param
|
||||
console.log(this['dynamicForm'+num])
|
||||
console.log(this['dynamicForm'+num]);
|
||||
|
||||
|
||||
|
||||
let sunday ={filters1 :this['dynamicForm'+num].value['filters'+num] }
|
||||
let monday ={filters2 :this['dynamicForm'+num].value['filters'+num] }
|
||||
@ -915,33 +976,101 @@ return data[i][1][0]
|
||||
if(this['dynamicForm'+num].value['filters'+num].length>1){
|
||||
console.log('length')
|
||||
for(let j=1;j<=this['dynamicForm'+num].value['filters'+num].length-1;j++){
|
||||
|
||||
if(i==1){
|
||||
|
||||
this.filtersFormArray2.removeAt(j);
|
||||
this.filtersFormArray3.removeAt(j);
|
||||
this.filtersFormArray4.removeAt(j);
|
||||
this.filtersFormArray5.removeAt(j);
|
||||
this.filtersFormArray6.removeAt(j);
|
||||
this.filtersFormArray7.removeAt(j);
|
||||
}else if(i==2){
|
||||
this.filtersFormArray.removeAt(j);
|
||||
|
||||
this.filtersFormArray3.removeAt(j);
|
||||
this.filtersFormArray4.removeAt(j);
|
||||
this.filtersFormArray5.removeAt(j);
|
||||
this.filtersFormArray6.removeAt(j);
|
||||
this.filtersFormArray7.removeAt(j);
|
||||
}else if(i==3){
|
||||
this.filtersFormArray.removeAt(j);
|
||||
|
||||
this.filtersFormArray2.removeAt(j);
|
||||
this.filtersFormArray4.removeAt(j);
|
||||
this.filtersFormArray5.removeAt(j);
|
||||
this.filtersFormArray6.removeAt(j);
|
||||
this.filtersFormArray7.removeAt(j);
|
||||
}else if(i==4){
|
||||
this.filtersFormArray.removeAt(j);
|
||||
|
||||
this.filtersFormArray3.removeAt(j);
|
||||
this.filtersFormArray2.removeAt(j);
|
||||
this.filtersFormArray5.removeAt(j);
|
||||
this.filtersFormArray6.removeAt(j);
|
||||
this.filtersFormArray7.removeAt(j);
|
||||
}else if(i==5){
|
||||
this.filtersFormArray.removeAt(j);
|
||||
|
||||
this.filtersFormArray3.removeAt(j);
|
||||
this.filtersFormArray4.removeAt(j);
|
||||
this.filtersFormArray2.removeAt(j);
|
||||
this.filtersFormArray6.removeAt(j);
|
||||
this.filtersFormArray7.removeAt(j);
|
||||
}else if(i==6){
|
||||
this.filtersFormArray.removeAt(j);
|
||||
|
||||
this.filtersFormArray3.removeAt(j);
|
||||
this.filtersFormArray4.removeAt(j);
|
||||
this.filtersFormArray5.removeAt(j);
|
||||
this.filtersFormArray2.removeAt(j);
|
||||
this.filtersFormArray7.removeAt(j);
|
||||
}else if(i==7){
|
||||
this.filtersFormArray.removeAt(j);
|
||||
|
||||
this.filtersFormArray3.removeAt(j);
|
||||
this.filtersFormArray4.removeAt(j);
|
||||
this.filtersFormArray5.removeAt(j);
|
||||
this.filtersFormArray6.removeAt(j);
|
||||
this.filtersFormArray2.removeAt(j);
|
||||
}
|
||||
|
||||
|
||||
if(i != 1){
|
||||
console.log('1')
|
||||
this.filtersFormArray.removeAt(j);
|
||||
this.filtersFormArray.push(this.createFilterGroup());
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
if(i != 2){
|
||||
console.log('2')
|
||||
this.dynamicForm2.reset();
|
||||
this.filtersFormArray2.removeAt(j);
|
||||
this.filtersFormArray2.push(this.createFilterGroup());
|
||||
}
|
||||
if(i != 3){
|
||||
console.log('3')
|
||||
this.filtersFormArray3.removeAt(j);
|
||||
this.filtersFormArray3.push(this.createFilterGroup());
|
||||
}
|
||||
if(i != 4){
|
||||
console.log('4')
|
||||
this.filtersFormArray4.removeAt(j);
|
||||
this.filtersFormArray4.push(this.createFilterGroup());
|
||||
}
|
||||
if(i != 5){
|
||||
console.log('5')
|
||||
this.filtersFormArray5.removeAt(j);
|
||||
this.filtersFormArray5.push(this.createFilterGroup());
|
||||
}
|
||||
if(i != 6){
|
||||
console.log('6')
|
||||
this.filtersFormArray6.removeAt(j);
|
||||
this.filtersFormArray6.push(this.createFilterGroup());
|
||||
}
|
||||
if(i != 7){
|
||||
console.log('7')
|
||||
this.filtersFormArray7.removeAt(j);
|
||||
this.filtersFormArray7.push(this.createFilterGroup());
|
||||
}
|
||||
|
||||
@ -982,4 +1111,4 @@ return data[i][1][0]
|
||||
this.filtersFormArray7.push(this.createFilterGroup());
|
||||
// this.addFilterToFiltersFormArray(i)
|
||||
}
|
||||
}
|
||||
}
|
||||
Loading…
Reference in New Issue
Block a user