Pass this.modifiedNonWorkingDays to the angular component

45001-component-to-show-the-list-of-non-working-days-of-year
Dombi Attila 2 years ago
parent 5df6dfde50
commit 3c66eca1b9
  1. 10
      frontend/src/app/shared/components/op-non-working-days-list/op-non-working-days-list.component.ts

@ -50,7 +50,7 @@ export class OpNonWorkingDaysListComponent implements OnInit {
@HostBinding('class.op-non-working-days-list') className = true;
@Input() public modified_non_working_days:INonWorkingDay[] = [];
@Input() public modifiedNonWorkingDays:INonWorkingDay[] = [];
text = {
empty_state_header: this.I18n.t('js.admin.working_days.calendar.empty_state_header'),
@ -145,8 +145,8 @@ export class OpNonWorkingDaysListComponent implements OnInit {
}
ngOnInit():void {
if (this.modified_non_working_days.length > 0) {
const removedNWD = this.modified_non_working_days.filter((event) => event._deleted === true);
if (this.modifiedNonWorkingDays.length > 0) {
const removedNWD = this.modifiedNonWorkingDays.filter((event) => event._deleted === true);
if (removedNWD.length > 0) {
removedNWD.forEach((NWD) => {
this.addRemovedNonWorkingdayInputs(NWD);
@ -164,8 +164,8 @@ export class OpNonWorkingDaysListComponent implements OnInit {
.subscribe(
(days:IDay[]) => {
this.nonWorkingDays = days;
if (this.modified_non_working_days.length > 0) {
this.mergeEvents(this.modified_non_working_days);
if (this.modifiedNonWorkingDays.length > 0) {
this.mergeEvents(this.modifiedNonWorkingDays);
}
const events = this.mapToCalendarEvents(this.nonWorkingDays);
successCallback(events);

Loading…
Cancel
Save