From bd1a52234cdc378747cdf1d12d21344757938bae Mon Sep 17 00:00:00 2001 From: bsatarnejad Date: Tue, 31 Jan 2023 09:04:29 +0100 Subject: [PATCH] remove unnecessary imports --- .../wp-table/timeline/cells/timeline-cell-renderer.ts | 3 --- .../container/wp-timeline-container.directive.ts | 9 ++++++++- .../wp-table/timeline/grid/wp-timeline-grid.directive.ts | 2 -- 3 files changed, 8 insertions(+), 6 deletions(-) diff --git a/frontend/src/app/features/work-packages/components/wp-table/timeline/cells/timeline-cell-renderer.ts b/frontend/src/app/features/work-packages/components/wp-table/timeline/cells/timeline-cell-renderer.ts index 8b350fd684..5fe6d7d9e5 100644 --- a/frontend/src/app/features/work-packages/components/wp-table/timeline/cells/timeline-cell-renderer.ts +++ b/frontend/src/app/features/work-packages/components/wp-table/timeline/cells/timeline-cell-renderer.ts @@ -21,7 +21,6 @@ import { timelineMarkerSelectionStartClass, } from '../wp-timeline'; import Moment = moment.Moment; -import { DayResourceService } from 'core-app/core/state/days/day.service'; export interface CellDateMovement { // Target values to move work package to @@ -52,8 +51,6 @@ export class TimelineCellRenderer { @InjectField() weekdayService:WeekdayService; - @InjectField() dayService:DayResourceService; - @InjectField() schemaCache:SchemaCacheService; @InjectField() I18n!:I18nService; diff --git a/frontend/src/app/features/work-packages/components/wp-table/timeline/container/wp-timeline-container.directive.ts b/frontend/src/app/features/work-packages/components/wp-table/timeline/container/wp-timeline-container.directive.ts index 0d4acf175e..58e7731a6a 100644 --- a/frontend/src/app/features/work-packages/components/wp-table/timeline/container/wp-timeline-container.directive.ts +++ b/frontend/src/app/features/work-packages/components/wp-table/timeline/container/wp-timeline-container.directive.ts @@ -147,6 +147,13 @@ export class WorkPackageTimelineTableController extends UntilDestroyedMixin impl ngAfterViewInit() { this.$element = jQuery(this.elementRef.nativeElement); + const scrollBar = document.querySelector('.work-packages-tabletimeline--timeline-side'); + if (scrollBar) { + scrollBar.addEventListener("scroll", async () => { + await this.requireNonWorkingDays(this.getFirstDayInViewport().format('YYYY-MM-DD'), this.getLastDayInViewport().format('YYYY-MM-DD')); + }) + } + this.text = { selectionMode: this.I18n.t('js.timelines.selection_mode.notification'), }; @@ -236,7 +243,7 @@ export class WorkPackageTimelineTableController extends UntilDestroyedMixin impl this.calculateViewParams(this._viewParameters); - await this.requireNonWorkingDays(this._viewParameters.visibleViewportAtCalculationTime[0].format('YYYY-MM-DD'), this._viewParameters.visibleViewportAtCalculationTime[1].format('YYYY-MM-DD')); + await this.requireNonWorkingDays(this.getFirstDayInViewport().format('YYYY-MM-DD'), this.getLastDayInViewport().format('YYYY-MM-DD')); // Update all cells this.cellsRenderer.refreshAllCells(); diff --git a/frontend/src/app/features/work-packages/components/wp-table/timeline/grid/wp-timeline-grid.directive.ts b/frontend/src/app/features/work-packages/components/wp-table/timeline/grid/wp-timeline-grid.directive.ts index 6454cd6907..4cd244e7b3 100644 --- a/frontend/src/app/features/work-packages/components/wp-table/timeline/grid/wp-timeline-grid.directive.ts +++ b/frontend/src/app/features/work-packages/components/wp-table/timeline/grid/wp-timeline-grid.directive.ts @@ -42,7 +42,6 @@ import { } from '../wp-timeline'; import { WeekdayService } from 'core-app/core/days/weekday.service'; import Moment = moment.Moment; -import { DayResourceService } from 'core-app/core/state/days/day.service'; @Component({ selector: 'wp-timeline-grid', @@ -57,7 +56,6 @@ export class WorkPackageTableTimelineGrid implements AfterViewInit { private elementRef:ElementRef, public wpTimeline:WorkPackageTimelineTableController, private weekdaysService:WeekdayService, - private daysService:DayResourceService, ) {} ngAfterViewInit():void {