OpenProject is the leading open source project management software for product, project and portfolio management. A powerful Jira alternative with agile planning, issue tracking, roadmaps, Gantt charts, time tracking, collaboration features, and more. Available on premises or in the cloud. ⭐ Star us on GitHub
Ruby agile-developmentangularbcfboardsbug-trackerganttgantt-chartifcissue-trackerjira-alternativekanbanopenprojectproduct-managementproject-managementproject-planningroadmaprubyscrumtimelineworkflows
Remove unused angular components which are going to be replaced by ViewComponents
Henriette Darge4bc6b9e63715
diff --git a/frontend/src/app/app.module.ts b/frontend/src/app/app.module.tsindex 76e5546d833..9e48dbc96f7 100644--- a/frontend/src/app/app.module.ts+++ b/frontend/src/app/app.module.ts@@ -415,7 +415,7 @@ export class OpenProjectModule implements DoBootstrap {private registerCustomElements(injector:Injector) {registerCustomElement('opce-macro-embedded-table', EmbeddedTablesMacroComponent, { injector });registerCustomElement('opce-principal', OpPrincipalComponent, { injector });- registerCustomElement('opce-single-date-picker', OpBasicSingleDatePickerComponent, { injector });+ registerCustomElement('opce-basic-single-date-picker', OpBasicSingleDatePickerComponent, { injector });registerCustomElement('opce-range-date-picker', OpBasicRangeDatePickerComponent, { injector });registerCustomElement('opce-global-search', GlobalSearchInputComponent, { injector });registerCustomElement('opce-autocompleter', OpAutocompleterComponent, { injector });@@ -448,7 +448,6 @@ export class OpenProjectModule implements DoBootstrap {registerCustomElement('opce-timer-account-menu', TimerAccountMenuComponent, { injector });registerCustomElement('opce-remote-field-updater', RemoteFieldUpdaterComponent, { injector });registerCustomElement('opce-modal-single-date-picker', OpModalSingleDatePickerComponent, { injector });- registerCustomElement('opce-basic-single-date-picker', OpBasicSingleDatePickerComponent, { injector });registerCustomElement('opce-spot-drop-modal-portal', SpotDropModalPortalComponent, { injector });registerCustomElement('opce-spot-switch', SpotSwitchComponent, { injector });registerCustomElement('opce-modal-overlay', OpModalOverlayComponent, { injector });diff --git a/frontend/src/app/shared/components/datepicker/banner/datepicker-banner.component.html b/frontend/src/app/shared/components/datepicker/banner/datepicker-banner.component.htmldeleted file mode 100644index 25530634cc5..00000000000--- a/frontend/src/app/shared/components/datepicker/banner/datepicker-banner.component.html+++ /dev/null@@ -1,39 +0,0 @@-<op-modal-banner- *ngIf="scheduleManually && (hasRelations$ | async)"- type="warning"- [title]="text.manually_scheduled"- [subtitle]="text.click_on_show_relations_to_open_gantt"- [actionButton]="text.show_relations_button"- actionButtonClasses="icon-view-timeline"- (buttonClicked)="openGantt($event)"-></op-modal-banner>-<op-modal-banner- *ngIf="!scheduleManually && isParent"- type="info"- [title]="text.automatically_scheduled_parent"- [subtitle]="text.click_on_show_relations_to_open_gantt"- [actionButton]="text.show_relations_button"- actionButtonClasses="icon-view-timeline"- (buttonClicked)="openGantt($event)"-></op-modal-banner>-<ng-container *ngIf="!scheduleManually && !isParent">- <op-modal-banner- *ngIf="(hasPrecedingRelations$ | async) === true && (hasFollowingRelations$ | async) === false && !isChild"- type="info"- [title]="text.start_date_limited_by_relations"- [subtitle]="text.click_on_show_relations_to_open_gantt"- [actionButton]="text.show_relations_button"- actionButtonClasses="icon-view-timeline"- (buttonClicked)="openGantt($event)"- ></op-modal-banner>-- <op-modal-banner- *ngIf="(hasFollowingRelations$ | async) === true || isChild"- type="warning"- [title]="text.changing_dates_affects_follow_relations"- [subtitle]="text.click_on_show_relations_to_open_gantt"- [actionButton]="text.show_relations_button"- actionButtonClasses="icon-view-timeline"- (buttonClicked)="openGantt($event)"- ></op-modal-banner>-</ng-container>diff --git a/frontend/src/app/shared/components/datepicker/banner/datepicker-banner.component.ts b/frontend/src/app/shared/components/datepicker/banner/datepicker-banner.component.tsdeleted file mode 100644index 81d299f1133..00000000000--- a/frontend/src/app/shared/components/datepicker/banner/datepicker-banner.component.ts+++ /dev/null@@ -1,124 +0,0 @@-//-- copyright-// OpenProject is an open source project management software.-// Copyright (C) the OpenProject GmbH-//-// This program is free software; you can redistribute it and/or-// modify it under the terms of the GNU General Public License version 3.-//-// OpenProject is a fork of ChiliProject, which is a fork of Redmine. The copyright follows:-// Copyright (C) 2006-2013 Jean-Philippe Lang-// Copyright (C) 2010-2013 the ChiliProject Team-//-// This program is free software; you can redistribute it and/or-// modify it under the terms of the GNU General Public License-// as published by the Free Software Foundation; either version 2-// of the License, or (at your option) any later version.-//-// This program is distributed in the hope that it will be useful,-// but WITHOUT ANY WARRANTY; without even the implied warranty of-// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the-// GNU General Public License for more details.-//-// You should have received a copy of the GNU General Public License-// along with this program; if not, write to the Free Software-// Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.-//-// See COPYRIGHT and LICENSE files for more details.-//++--import {- ChangeDetectionStrategy,- Component,- Injector,- Input,-} from '@angular/core';-import { I18nService } from 'core-app/core/i18n/i18n.service';-import {- map,- take,-} from 'rxjs/operators';-import { StateService } from '@uirouter/core';-import { DateModalRelationsService } from 'core-app/shared/components/datepicker/services/date-modal-relations.service';--@Component({- selector: 'op-datepicker-banner',- templateUrl: './datepicker-banner.component.html',- changeDetection: ChangeDetectionStrategy.OnPush,-})-export class OpDatePickerBannerComponent {- @Input() scheduleManually = false;-- hasRelations$ = this.dateModalRelations.hasRelations$;-- hasPrecedingRelations$ = this- .dateModalRelations- .precedingWorkPackages$- .pipe(- map((relations) => relations?.length > 0),- );-- hasFollowingRelations$ = this- .dateModalRelations- .followingWorkPackages$- .pipe(- map((relations) => relations?.length > 0),- );-- get isParent() {- return this.dateModalRelations.isParent;- }-- get isChild() {- return this.dateModalRelations.isChild;- }-- text = {- automatically_scheduled_parent: this.I18n.t('js.work_packages.datepicker_modal.automatically_scheduled_parent'),- manually_scheduled: this.I18n.t('js.work_packages.datepicker_modal.manually_scheduled'),- start_date_limited_by_relations: this.I18n.t('js.work_packages.datepicker_modal.start_date_limited_by_relations'),- changing_dates_affects_follow_relations: this.I18n.t('js.work_packages.datepicker_modal.changing_dates_affects_follow_relations'),- click_on_show_relations_to_open_gantt: this.I18n.t(- 'js.work_packages.datepicker_modal.click_on_show_relations_to_open_gantt',- { button_name: this.I18n.t('js.work_packages.datepicker_modal.show_relations') },- ),- show_relations_button: this.I18n.t('js.work_packages.datepicker_modal.show_relations'),- };-- constructor(- readonly dateModalRelations:DateModalRelationsService,- readonly injector:Injector,- readonly I18n:I18nService,- readonly state:StateService,- ) {}-- openGantt(evt:MouseEvent):void {- evt.preventDefault();-- this- .dateModalRelations- .getInvolvedWorkPackageIds()- .pipe(- take(1),- )- .subscribe((ids) => {- const props = {- c: ['id', 'subject', 'type', 'status', 'assignee', 'project', 'startDate', 'dueDate'],- t: 'id:asc',- tv: true,- hi: true,- f: [{ n: 'id', o: '=', v: ids }],- };-- const href = this.state.href(- 'gantt.partitioned.list',- {- query_id: null,- projects: null,- projectPath: null,- query_props: JSON.stringify(props),- },- );- window.open(href, '_blank');- });- }-}diff --git a/frontend/src/app/shared/components/datepicker/datepicker.module.ts b/frontend/src/app/shared/components/datepicker/datepicker.module.tsindex 25f56ca82c2..dfe83bc5ce2 100644--- a/frontend/src/app/shared/components/datepicker/datepicker.module.ts+++ b/frontend/src/app/shared/components/datepicker/datepicker.module.ts@@ -10,9 +10,6 @@ import { I18nService } from 'core-app/core/i18n/i18n.service';import { OpModalSingleDatePickerComponent } from './modal-single-date-picker/modal-single-date-picker.component';import { OpWpMultiDateFormComponent } from './wp-multi-date-form/wp-multi-date-form.component';import { OpWpSingleDateFormComponent } from './wp-single-date-form/wp-single-date-form.component';-import { OpDatePickerBannerComponent } from './banner/datepicker-banner.component';-import { OpDatePickerSchedulingToggleComponent } from './scheduling-mode/datepicker-scheduling-toggle.component';-import { OpDatePickerWorkingDaysToggleComponent } from './toggle/datepicker-working-days-toggle.component';import { OpBasicDatePickerModule } from './basic-datepicker.module';import { OpSpotModule } from 'core-app/spot/spot.module';import { OpenprojectModalModule } from '../modal/modal.module';@@ -36,10 +33,6 @@ import { OpenprojectContentLoaderModule } from 'core-app/shared/components/op-co],declarations: [- OpDatePickerBannerComponent,- OpDatePickerSchedulingToggleComponent,- OpDatePickerWorkingDaysToggleComponent,-OpModalSingleDatePickerComponent,OpWpMultiDateFormComponent,OpWpSingleDateFormComponent,diff --git a/frontend/src/app/shared/components/datepicker/multi-date-picker/multi-date-picker.component.html b/frontend/src/app/shared/components/datepicker/multi-date-picker/multi-date-picker.component.htmldeleted file mode 100644index 94987fef937..00000000000--- a/frontend/src/app/shared/components/datepicker/multi-date-picker/multi-date-picker.component.html+++ /dev/null@@ -1,107 +0,0 @@-<spot-drop-modal- [opened]="opened"- (closed)="close()"- data-test-selector="op-multi-date-picker"->- <input- slot="trigger"- type="text"- class="spot-input"- [attr.data-value]="value"- [id]="id"- [value]="datesString"- (click)="onInputClick($event)"- (focus)="opened = true"- />-- <form- slot="body"- class="op-datepicker-modal op-datepicker-modal_wide"- data-test-selector="op-datepicker-modal"- tabindex="0"- cdkFocusInitial- cdkTrapFocus- [cdkTrapFocusAutoCapture]="true"- (submit)="save($event)"- >- <div class="spot-container op-datepicker-modal--stretch-content">- <div class="op-datepicker-modal--dates-container">- <spot-form-field- [label]="text.startDate"- >- <spot-text-field- slot="input"- name="startDate"- class="op-datepicker-modal--date-field"- [attr.data-qa-highlighted]="showFieldAsActive('start') || undefined"- [ngClass]="{'op-datepicker-modal--date-field_current' : showFieldAsActive('start')}"- [ngModel]="dates.start"- (ngModelChange)="startDateChanged$.next($event)"- [showClearButton]="currentlyActivatedDateField === 'start'"- (focusin)="setCurrentActivatedField('start')"- ></spot-text-field>- <button- slot="action"- type="button"- class="spot-link"- (click)="setToday('start')"- [textContent]="text.today">- </button>- </spot-form-field>-- <spot-form-field- [label]="text.endDate"- >- <spot-text-field- slot="input"- name="endDate"- class="op-datepicker-modal--date-field"- [attr.data-qa-highlighted]="showFieldAsActive('end') || undefined"- [ngClass]="{'op-datepicker-modal--date-field_current' : showFieldAsActive('end')}"- [ngModel]="dates.end"- (ngModelChange)="endDateChanged$.next($event)"- [showClearButton]="currentlyActivatedDateField === 'end'"- (focusin)="setCurrentActivatedField('end')"- ></spot-text-field>- <button- slot="action"- type="button"- class="spot-link"- (click)="setToday('end')"- [textContent]="text.today">- </button>- </spot-form-field>- </div>-- <input- id="flatpickr-input"- #flatpickrTarget- hidden>- </div>-- <div class="spot-action-bar">- <div class="spot-action-bar--right">- <button- type="button"- (click)="close()"- class="spot-modal--cancel-button button spot-action-bar--action"- data-test-selector="op-datepicker-modal--action"- [textContent]="text.cancel"- ></button>- <button- type="submit"- class="button -primary spot-action-bar--action"- data-test-selector="op-datepicker-modal--action"- [textContent]="applyLabel"- ></button>- </div>- </div>- </form>-</spot-drop-modal>--<input- [id]="id"- [name]="name"- [value]="value"- hidden->diff --git a/frontend/src/app/shared/components/datepicker/multi-date-picker/multi-date-picker.component.ts b/frontend/src/app/shared/components/datepicker/multi-date-picker/multi-date-picker.component.tsdeleted file mode 100644index 989274d3cbb..00000000000--- a/frontend/src/app/shared/components/datepicker/multi-date-picker/multi-date-picker.component.ts+++ /dev/null@@ -1,501 +0,0 @@-//-- copyright-// OpenProject is an open source project management software.-// Copyright (C) the OpenProject GmbH-//-// This program is free software; you can redistribute it and/or-// modify it under the terms of the GNU General Public License version 3.-//-// OpenProject is a fork of ChiliProject, which is a fork of Redmine. The copyright follows:-// Copyright (C) 2006-2013 Jean-Philippe Lang-// Copyright (C) 2010-2013 the ChiliProject Team-//-// This program is free software; you can redistribute it and/or-// modify it under the terms of the GNU General Public License-// as published by the Free Software Foundation; either version 2-// of the License, or (at your option) any later version.-//-// This program is distributed in the hope that it will be useful,-// but WITHOUT ANY WARRANTY; without even the implied warranty of-// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the-// GNU General Public License for more details.-//-// You should have received a copy of the GNU General Public License-// along with this program; if not, write to the Free Software-// Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.-//-// See COPYRIGHT and LICENSE files for more details.-//++--import {- ChangeDetectionStrategy,- ChangeDetectorRef,- Component,- ElementRef,- EventEmitter,- forwardRef,- Injector,- Input,- OnInit,- Output,- ViewChild,- ViewEncapsulation,-} from '@angular/core';-import { I18nService } from 'core-app/core/i18n/i18n.service';-import {- ControlValueAccessor,- NG_VALUE_ACCESSOR,-} from '@angular/forms';-import {- areDatesEqual,- mappedDate,- onDayCreate,- parseDate,- setDates,- validDate,-} from 'core-app/shared/components/datepicker/helpers/date-modal.helpers';-import { TimezoneService } from 'core-app/core/datetime/timezone.service';-import { DatePicker } from '../datepicker';-import flatpickr from 'flatpickr';-import { DayElement } from 'flatpickr/dist/types/instance';-import {- ActiveDateChange,- DateFields,- DateKeys,-} from '../wp-multi-date-form/wp-multi-date-form.component';-import {- fromEvent,- merge,- Observable,- Subject,-} from 'rxjs';-import { UntilDestroyedMixin } from 'core-app/shared/helpers/angular/until-destroyed.mixin';-import {- debounceTime,- filter,- map,-} from 'rxjs/operators';-import { DeviceService } from 'core-app/core/browser/device.service';-import { DateOption } from 'flatpickr/dist/types/options';-import { WeekdayService } from 'core-app/core/days/weekday.service';-import { FocusHelperService } from 'core-app/shared/directives/focus/focus-helper';-import { SpotDropModalTeleportationService } from 'core-app/spot/components/drop-modal/drop-modal-teleportation.service';--@Component({- selector: 'op-multi-date-picker',- templateUrl: './multi-date-picker.component.html',- styleUrls: ['../styles/datepicker.modal.sass'],- changeDetection: ChangeDetectionStrategy.OnPush,- encapsulation: ViewEncapsulation.None,- providers: [- {- provide: NG_VALUE_ACCESSOR,- useExisting: forwardRef(() => OpMultiDatePickerComponent),- multi: true,- },- ],-})-export class OpMultiDatePickerComponent extends UntilDestroyedMixin implements OnInit, ControlValueAccessor {- @ViewChild('modalContainer') modalContainer:ElementRef<HTMLElement>;-- @ViewChild('flatpickrTarget') flatpickrTarget:ElementRef;-- @Input() id = `flatpickr-input-${+(new Date())}`;-- @Input() name = '';-- @Input() fieldName = '';-- @Input() value:string[] = [];-- @Input() applyLabel:string;-- private _opened = false;-- @Input() set opened(opened:boolean) {- if (this._opened === !!opened) {- return;- }-- this._opened = !!opened;-- if (this._opened) {- this.initializeDatepickerAfterOpen();- } else {- this.datePickerInstance?.destroy();- this.closed.emit();- }- }-- get opened() {- return this._opened;- }-- @Output() valueChange = new EventEmitter();-- @Output('closed') closed = new EventEmitter();-- text = {- apply: this.I18n.t('js.modals.button_apply'),- cancel: this.I18n.t('js.button_cancel'),- startDate: this.I18n.t('js.work_packages.properties.startDate'),- endDate: this.I18n.t('js.work_packages.properties.dueDate'),- placeholder: this.I18n.t('js.placeholders.default'),- today: this.I18n.t('js.label_today'),- days: (count:number):string => this.I18n.t('js.units.day', { count }),- ignoreNonWorkingDays: {- title: this.I18n.t('js.work_packages.datepicker_modal.ignore_non_working_days.title'),- },- };-- get datesString():string {- if (this.value?.[0] && this.value?.[1]) {- return `${this.value[0]} - ${this.value[1]}`;- }-- return this.text.placeholder;- }-- ignoreNonWorkingDays = true;-- currentlyActivatedDateField:DateFields;-- htmlId = '';-- dates:{ [key in DateKeys]:string|null } = {- start: null,- end: null,- };-- // Manual changes from the inputs to start and end dates- startDateChanged$ = new Subject<string>();-- startDateDebounced$:Observable<ActiveDateChange> = this.debouncedInput(this.startDateChanged$, 'start');-- endDateChanged$ = new Subject<string>();-- endDateDebounced$:Observable<ActiveDateChange> = this.debouncedInput(this.endDateChanged$, 'end');-- // Manual changes to the datepicker, with information which field was active- datepickerChanged$ = new Subject<ActiveDateChange>();-- ignoreNonWorkingDaysWritable = true;-- private datePickerInstance:DatePicker;-- constructor(- readonly injector:Injector,- readonly cdRef:ChangeDetectorRef,- readonly I18n:I18nService,- readonly timezoneService:TimezoneService,- readonly deviceService:DeviceService,- readonly weekdayService:WeekdayService,- readonly focusHelper:FocusHelperService,- readonly spotDropModalTeleportationService:SpotDropModalTeleportationService,- ) {- super();-- merge(- this.startDateDebounced$,- this.endDateDebounced$,- this.datepickerChanged$,- )- .pipe(- this.untilDestroyed(),- filter(() => !!this.datePickerInstance),- )- .subscribe(([field, update]) => {- // When clearing the one date, clear the others as well- if (update !== null) {- this.handleSingleDateUpdate(field, update);- }-- this.cdRef.detectChanges();- });- }-- ngOnInit():void {- this.applyLabel = this.applyLabel || this.text.apply;- this.htmlId = `wp-datepicker-${this.fieldName}`;- this.dates.start = this.value?.[0];- this.dates.end = this.value?.[1];-- this.setCurrentActivatedField(this.initialActivatedField);- }-- onInputClick(event:MouseEvent) {- event.stopPropagation();- }-- close():void {- this.opened = false;- }-- changeNonWorkingDays():void {- this.initializeDatepicker();- this.cdRef.detectChanges();- }-- save($event:Event):void {- $event.preventDefault();- const value = [- this.dates.start || '',- this.dates.end || '',- ];- this.value = value;- this.valueChange.emit(value);- this.onChange(value);- this.close();- }-- updateDate(key:DateKeys, val:string|null):void {- if ((val === null || validDate(val)) && this.datePickerInstance) {- this.dates[key] = mappedDate(val);- const dateValue = parseDate(val || '') || undefined;- this.enforceManualChangesToDatepicker(dateValue);- this.cdRef.detectChanges();- }- }-- setCurrentActivatedField(val:DateFields):void {- this.currentlyActivatedDateField = val;- }-- toggleCurrentActivatedField():void {- this.currentlyActivatedDateField = this.currentlyActivatedDateField === 'start' ? 'end' : 'start';- }-- isStateOfCurrentActivatedField(val:DateFields):boolean {- return this.currentlyActivatedDateField === val;- }-- setToday(key:DateKeys):void {- this.datepickerChanged$.next([key, new Date()]);-- const nextActive = key === 'start' ? 'end' : 'start';- this.setCurrentActivatedField(nextActive);- }-- showFieldAsActive(field:DateFields):boolean {- return this.isStateOfCurrentActivatedField(field);- }-- private initializeDatepickerAfterOpen():void {- this.spotDropModalTeleportationService- .afterRenderOnce$(true)- .subscribe(() => {- this.initializeDatepicker();- });- }-- private initializeDatepicker(minimalDate?:Date|null) {- this.datePickerInstance?.destroy();- this.datePickerInstance = new DatePicker(- this.injector,- this.id,- [this.dates.start || '', this.dates.end || ''],- {- mode: 'range',- showMonths: this.deviceService.isMobile ? 1 : 2,- inline: true,- onReady: (_date, _datestr, instance) => {- instance.calendarContainer.classList.add('op-datepicker-modal--flatpickr-instance');-- this.ensureHoveredSelection(instance.calendarContainer);- },- onChange: (dates:Date[], _datestr, instance) => {- this.onTouched();-- if (dates.length === 2) {- this.setDates(dates[0], dates[1]);- this.toggleCurrentActivatedField();- this.cdRef.detectChanges();- return;- }-- // Update with the same flow as entering a value- const { latestSelectedDateObj } = instance as { latestSelectedDateObj:Date };- const activeField = this.currentlyActivatedDateField;- this.handleSingleDateUpdate(activeField, latestSelectedDateObj);- this.cdRef.detectChanges();- },- onDayCreate: async (dObj:Date[], dStr:string, fp:flatpickr.Instance, dayElem:DayElement) => {- onDayCreate(- dayElem,- this.ignoreNonWorkingDays,- await this.datePickerInstance?.isNonWorkingDay(dayElem.dateObj),- this.isDayDisabled(dayElem, minimalDate),- );- },- },- this.flatpickrTarget.nativeElement as HTMLElement,- );- }-- private enforceManualChangesToDatepicker(enforceDate?:Date) {- let startDate = parseDate(this.dates.start || '');- let endDate = parseDate(this.dates.end || '');-- if (startDate && endDate) {- // If the start date is manually changed to be after the end date,- // we adjust the end date to be at least the same as the newly entered start date.- // Same applies if the end date is set manually before the current start date- if (startDate > endDate && this.isStateOfCurrentActivatedField('start')) {- endDate = startDate;- this.dates.end = this.timezoneService.formattedISODate(endDate);- } else if (endDate < startDate && this.isStateOfCurrentActivatedField('end')) {- startDate = endDate;- this.dates.start = this.timezoneService.formattedISODate(startDate);- }- }-- const dates = [startDate, endDate];- setDates(dates, this.datePickerInstance, enforceDate);- }-- private setDates(newStart:Date, newEnd:Date) {- this.dates.start = this.timezoneService.formattedISODate(newStart);- this.dates.end = this.timezoneService.formattedISODate(newEnd);- }-- private handleSingleDateUpdate(activeField:DateFields, selectedDate:Date) {- if (activeField === 'duration') {- return;- }-- this.replaceDatesWithNewSelection(activeField, selectedDate);-- // Set the selected date on the datepicker- this.enforceManualChangesToDatepicker(selectedDate);- }-- private replaceDatesWithNewSelection(activeField:DateFields, selectedDate:Date) {- /**- Overwrite flatpickr default behavior by not starting a new date range everytime but preserving either start or end date.- There are three cases to cover.- 1. Everything before the current start date will become the new start date (independent of the active field)- 2. Everything after the current end date will become the new end date if that is the currently active field.- If the active field is the start date, the selected date becomes the new start date and the end date is cleared.- 3. Everything in between the current start and end date is dependent on the currently activated field.- * */-- const parsedStartDate = parseDate(this.dates.start || '') as Date;- const parsedEndDate = parseDate(this.dates.end || '') as Date;-- if (selectedDate < parsedStartDate) {- if (activeField === 'start') {- // Set start, derive end from- this.applyNewDates([selectedDate]);- } else {- // Reset and end date- this.applyNewDates(['', selectedDate]);- }- } else if (selectedDate > parsedEndDate) {- if (activeField === 'end') {- this.applyNewDates([parsedStartDate, selectedDate]);- } else {- // Reset and end date- this.applyNewDates([selectedDate]);- }- } else if (areDatesEqual(selectedDate, parsedStartDate) || areDatesEqual(selectedDate, parsedEndDate)) {- this.applyNewDates([selectedDate, selectedDate]);- } else {- const newDates = activeField === 'start' ? [selectedDate, parsedEndDate] : [parsedStartDate, selectedDate];- this.applyNewDates(newDates);- }- }-- private applyNewDates([start, end]:DateOption[]) {- this.dates.start = start ? this.timezoneService.formattedISODate(start) : null;- this.dates.end = end ? this.timezoneService.formattedISODate(end) : null;-- // Apply the dates to the datepicker- setDates([start, end], this.datePickerInstance);- }-- private get initialActivatedField():DateFields {- switch (this.fieldName) {- case 'startDate':- return 'start';- case 'dueDate':- return 'end';- case 'duration':- return 'duration';- default:- return (this.dates.start && !this.dates.end) ? 'end' : 'start';- }- }-- private isDayDisabled(dayElement:DayElement, minimalDate?:Date|null):boolean {- return !!minimalDate && dayElement.dateObj <= minimalDate;- }-- private debouncedInput(input$:Subject<string>, key:DateKeys):Observable<ActiveDateChange> {- return input$- .pipe(- this.untilDestroyed(),- // Skip values that are already set as the current model- filter((value) => value !== this.dates[key]),- // Avoid that the manual changes are moved to the datepicker too early.- // The debounce is chosen quite large on purpose to catch the following case:- // 1. Start date is for example 2022-07-15. The user wants to set the end date to the 19th.- // 2. So he/she starts entering the finish date 2022-07-1 .- // 3. This is already a valid date. Since it is before the start date,the start date would be changed automatically to the first without the debounce.- // 4. The debounce gives the user enough time to type the last number "9" before the changes are converted to the datepicker and the start date would be affected.- debounceTime(500),- filter((date) => validDate(date)),- map((date) => {- if (date === '') {- return null;- }-- return parseDate(date) as Date;- }),- map((date) => [key, date]),- );- }-- /**- * When hovering selections in the range datepicker, the range usually- * stays active no matter where the cursor is.- *- * We want to hide any hovered selection preview when we leave the datepicker.- * @param calendarContainer- * @private- */- private ensureHoveredSelection(calendarContainer:HTMLDivElement) {- fromEvent(calendarContainer, 'mouseenter')- .pipe(- this.untilDestroyed(),- )- .subscribe(() => calendarContainer.classList.remove('flatpickr-container-suppress-hover'));-- fromEvent(calendarContainer, 'mouseleave')- .pipe(- this.untilDestroyed(),- filter(() => !(!!this.dates.start && !!this.dates.end)),- )- .subscribe(() => calendarContainer.classList.add('flatpickr-container-suppress-hover'));- }-- writeValue(newValue:string[]|null):void {- const value = (newValue || []).map((d) => this.timezoneService.formattedISODate(d));- if (value[0] === this.dates.start && value[1] === this.dates.end) {- return;- }- this.value = value;- this.dates.start = this.value[0];- this.dates.end = this.value[1];- }-- onChange = (_:string[]):void => {};-- onTouched = ():void => {};-- registerOnChange(fn:(_:string[]) => void):void {- this.onChange = fn;- }-- registerOnTouched(fn:() => void):void {- this.onTouched = fn;- }-}diff --git a/frontend/src/app/shared/components/datepicker/scheduling-mode/datepicker-scheduling-toggle.component.html b/frontend/src/app/shared/components/datepicker/scheduling-mode/datepicker-scheduling-toggle.component.htmldeleted file mode 100644index b3c3b6eb1d9..00000000000--- a/frontend/src/app/shared/components/datepicker/scheduling-mode/datepicker-scheduling-toggle.component.html+++ /dev/null@@ -1,12 +0,0 @@-<spot-selector-field- [reverseLabel]="true"- [label]="text.scheduling.title"->- <spot-switch- slot="input"- name="scheduling"- [ngModel]="scheduleManually"- (ngModelChange)="onToggle($event)"- data-test-selector="op-datepicker-modal--scheduling-action"- ></spot-switch>-</spot-selector-field>diff --git a/frontend/src/app/shared/components/datepicker/scheduling-mode/datepicker-scheduling-toggle.component.ts b/frontend/src/app/shared/components/datepicker/scheduling-mode/datepicker-scheduling-toggle.component.tsdeleted file mode 100644index d0aa89cdf95..00000000000--- a/frontend/src/app/shared/components/datepicker/scheduling-mode/datepicker-scheduling-toggle.component.ts+++ /dev/null@@ -1,60 +0,0 @@-import {- ChangeDetectionStrategy,- ChangeDetectorRef,- Component,- forwardRef,- Input,-} from '@angular/core';-import { I18nService } from 'core-app/core/i18n/i18n.service';-import {- ControlValueAccessor,- NG_VALUE_ACCESSOR,-} from '@angular/forms';--@Component({- selector: 'op-datepicker-scheduling-toggle',- templateUrl: './datepicker-scheduling-toggle.component.html',- changeDetection: ChangeDetectionStrategy.OnPush,- providers: [{- provide: NG_VALUE_ACCESSOR,- useExisting: forwardRef(() => OpDatePickerSchedulingToggleComponent),- multi: true,- }],-})-export class OpDatePickerSchedulingToggleComponent implements ControlValueAccessor {- text = {- scheduling: {- title: this.I18n.t('js.scheduling.manual'),- },- };-- @Input() scheduleManually:boolean;-- constructor(- private I18n:I18nService,- private cdRef:ChangeDetectorRef,- ) { }-- onChange = (_:boolean):void => {};-- onTouched = (_:boolean):void => {};-- registerOnChange(fn:(_:boolean) => void):void {- this.onChange = fn;- }-- registerOnTouched(fn:(_:boolean) => void):void {- this.onTouched = fn;- }-- writeValue(val:boolean):void {- this.scheduleManually = val;- this.cdRef.markForCheck();- }-- onToggle(value:boolean):void {- this.writeValue(value);- this.onChange(value);- this.onTouched(value);- }-}diff --git a/frontend/src/app/shared/components/datepicker/toggle/datepicker-working-days-toggle.component.html b/frontend/src/app/shared/components/datepicker/toggle/datepicker-working-days-toggle.component.htmldeleted file mode 100644index d17768ba5f1..00000000000--- a/frontend/src/app/shared/components/datepicker/toggle/datepicker-working-days-toggle.component.html+++ /dev/null@@ -1,13 +0,0 @@-<spot-selector-field- [reverseLabel]="true"- [label]="text.ignoreNonWorkingDays.title"->- <spot-switch- slot="input"- name="weekdays_only"- [disabled]="disabled"- [ngModel]="!ignoreNonWorkingDays"- (ngModelChange)="onToggle($event)"- data-test-selector="op-datepicker-modal--include-non-working-days"- ></spot-switch>-</spot-selector-field>diff --git a/frontend/src/app/shared/components/datepicker/toggle/datepicker-working-days-toggle.component.ts b/frontend/src/app/shared/components/datepicker/toggle/datepicker-working-days-toggle.component.tsdeleted file mode 100644index 36f50d08ddd..00000000000--- a/frontend/src/app/shared/components/datepicker/toggle/datepicker-working-days-toggle.component.ts+++ /dev/null@@ -1,63 +0,0 @@-import {- ChangeDetectionStrategy,- ChangeDetectorRef,- Component,- forwardRef,- Input,-} from '@angular/core';-import { I18nService } from 'core-app/core/i18n/i18n.service';-import {- ControlValueAccessor,- NG_VALUE_ACCESSOR,-} from '@angular/forms';--@Component({- selector: 'op-datepicker-working-days-toggle',- templateUrl: './datepicker-working-days-toggle.component.html',- changeDetection: ChangeDetectionStrategy.OnPush,- providers: [{- provide: NG_VALUE_ACCESSOR,- useExisting: forwardRef(() => OpDatePickerWorkingDaysToggleComponent),- multi: true,- }],-})-export class OpDatePickerWorkingDaysToggleComponent implements ControlValueAccessor {- @Input() ignoreNonWorkingDays:boolean;-- @Input() disabled = false;-- text = {- ignoreNonWorkingDays: {- title: this.I18n.t('js.work_packages.datepicker_modal.ignore_non_working_days.title'),- },- };-- constructor(- private I18n:I18nService,- private cdRef:ChangeDetectorRef,- ) {}-- onChange = (_:boolean):void => {};-- onTouched = (_:boolean):void => {};-- registerOnChange(fn:(_:boolean) => void):void {- this.onChange = fn;- }-- registerOnTouched(fn:(_:boolean) => void):void {- this.onTouched = fn;- }-- onToggle(value:boolean):void {- const ignoreNonWorkingDays = !value;- this.writeValue(ignoreNonWorkingDays);- this.onChange(ignoreNonWorkingDays);- this.onTouched(ignoreNonWorkingDays);- }-- writeValue(val:boolean):void {- this.ignoreNonWorkingDays = val;- this.cdRef.markForCheck();- }-}diff --git a/frontend/src/app/shared/components/datepicker/wp-single-date-form/wp-single-date-form.component.html b/frontend/src/app/shared/components/datepicker/wp-single-date-form/wp-single-date-form.component.htmlindex dc89ece75d0..78876389694 100644--- a/frontend/src/app/shared/components/datepicker/wp-single-date-form/wp-single-date-form.component.html+++ b/frontend/src/app/shared/components/datepicker/wp-single-date-form/wp-single-date-form.component.html@@ -7,18 +7,20 @@(submit)="doSave($event)"tabindex="0">- <op-datepicker-banner+<!-- TODO <op-datepicker-banner[scheduleManually]="scheduleManually"- class="op-datepicker-modal--banner"- ></op-datepicker-banner>+ class="op-datepicker-modal--banner"+ ></op-datepicker-banner>--><div class="spot-container op-datepicker-modal--stretch-content">+<!-- TODO<op-datepicker-scheduling-toggleclass="spot-form-field"name="scheduleManually"[(ngModel)]="scheduleManually"(ngModelChange)="changeSchedulingMode()"></op-datepicker-scheduling-toggle>+--><op-datepicker-working-days-toggleclass="spot-form-field"diff --git a/frontend/src/app/shared/shared.module.ts b/frontend/src/app/shared/shared.module.tsindex 00be06fa227..2fd5edc8b05 100644--- a/frontend/src/app/shared/shared.module.ts+++ b/frontend/src/app/shared/shared.module.ts@@ -67,12 +67,6 @@ import { CopyToClipboardService } from './components/copy-to-clipboard/copy-to-cimport { CopyToClipboardComponent } from './components/copy-to-clipboard/copy-to-clipboard.component';import { OpDateTimeComponent } from './components/date/op-date-time.component';import { ToastComponent } from './components/toaster/toast.component';--// Old datepickers-import {- OpMultiDatePickerComponent,-} from 'core-app/shared/components/datepicker/multi-date-picker/multi-date-picker.component';-import { ToastsContainerComponent } from './components/toaster/toasts-container.component';import { UploadProgressComponent } from './components/toaster/upload-progress.component';import { ResizerComponent } from './components/resizer/resizer.component';@@ -197,9 +191,6 @@ export function bootstrapModule(injector:Injector):void {OpProjectIncludeListComponent,OpLoadingProjectListComponent,- // Old datepickers- OpMultiDatePickerComponent,-OpNonWorkingDaysListComponent,],providers: [@@ -251,9 +242,6 @@ export function bootstrapModule(injector:Injector):void {OpNonWorkingDaysListComponent,- // Old datepickers- OpMultiDatePickerComponent,-ShareUpsaleComponent,],})diff --git a/lib/primer/open_project/forms/dsl/single_date_picker_input.rb b/lib/primer/open_project/forms/dsl/single_date_picker_input.rbindex 7a356bdfba4..1337102b571 100644--- a/lib/primer/open_project/forms/dsl/single_date_picker_input.rb+++ b/lib/primer/open_project/forms/dsl/single_date_picker_input.rb@@ -43,7 +43,7 @@ module Primerdef derive_datepicker_options(options)options.reverse_merge(- component: "opce-single-date-picker"+ component: "opce-basic-single-date-picker")end