diff --git a/ng-seed/src/app/appoinment/consultant-setting/consultant-setting/consultant-setting.component.ts b/ng-seed/src/app/appoinment/consultant-setting/consultant-setting/consultant-setting.component.ts index 60ea0db..326b764 100644 --- a/ng-seed/src/app/appoinment/consultant-setting/consultant-setting/consultant-setting.component.ts +++ b/ng-seed/src/app/appoinment/consultant-setting/consultant-setting/consultant-setting.component.ts @@ -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' }, diff --git a/ng-seed/src/app/appoinment/consultant-setting/edit-working-hours/edit-working-hours.component.html b/ng-seed/src/app/appoinment/consultant-setting/edit-working-hours/edit-working-hours.component.html index 0bf0714..44fd5d7 100644 --- a/ng-seed/src/app/appoinment/consultant-setting/edit-working-hours/edit-working-hours.component.html +++ b/ng-seed/src/app/appoinment/consultant-setting/edit-working-hours/edit-working-hours.component.html @@ -57,13 +57,14 @@ formControlName="value" [placeholder]="apiField.value"> --> - + - Apply to All + + Apply to All @@ -129,13 +130,14 @@ formControlName="value" [placeholder]="apiField.value"> --> - + - Apply to All + + Apply to All @@ -201,13 +203,14 @@ formControlName="value" [placeholder]="apiField.value"> --> - + - Apply to All + + Apply to All @@ -273,13 +276,14 @@ formControlName="value" [placeholder]="apiField.value"> --> - + - Apply to All + + Apply to All @@ -345,13 +349,14 @@ formControlName="value" [placeholder]="apiField.value"> --> - + - Apply to All + + Apply to All @@ -417,13 +422,14 @@ formControlName="value" [placeholder]="apiField.value"> --> - + - Apply to All + + Apply to All @@ -489,13 +495,14 @@ formControlName="value" [placeholder]="apiField.value"> --> - + - Apply to All + + Apply to All diff --git a/ng-seed/src/app/appoinment/consultant-setting/edit-working-hours/edit-working-hours.component.scss b/ng-seed/src/app/appoinment/consultant-setting/edit-working-hours/edit-working-hours.component.scss index 6a30b91..ffd244c 100644 --- a/ng-seed/src/app/appoinment/consultant-setting/edit-working-hours/edit-working-hours.component.scss +++ b/ng-seed/src/app/appoinment/consultant-setting/edit-working-hours/edit-working-hours.component.scss @@ -147,3 +147,7 @@ mat-checkbox{ display: block; } } +.applyToAllStyle{ + color: green; + padding: 25px; +} \ No newline at end of file diff --git a/ng-seed/src/app/appoinment/consultant-setting/edit-working-hours/edit-working-hours.component.ts b/ng-seed/src/app/appoinment/consultant-setting/edit-working-hours/edit-working-hours.component.ts index 2a881f6..9a09e45 100644 --- a/ng-seed/src/app/appoinment/consultant-setting/edit-working-hours/edit-working-hours.component.ts +++ b/ng-seed/src/app/appoinment/consultant-setting/edit-working-hours/edit-working-hours.component.ts @@ -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) } -} +} \ No newline at end of file