In-between commit

feature/42358-standardise-date-pickers
Benjamin Bädorf 2 years ago
parent 3fc36bda26
commit 9a923edc36
No known key found for this signature in database
GPG Key ID: 069CA2D117AB5CCF
  1. 6
      frontend/src/app/shared/components/datepicker/services/date-modal-relations.service.ts
  2. 9
      frontend/src/app/shared/components/datepicker/services/date-modal-scheduling.service.ts
  3. 7
      frontend/src/app/shared/components/fields/edit/field-types/date-picker-edit-field.component.ts

@ -55,7 +55,11 @@ import { parseDate } from 'core-app/shared/components/datepicker/helpers/date-mo
@Injectable()
export class DateModalRelationsService {
private changeset:WorkPackageChangeset = this.locals.changeset as WorkPackageChangeset;
private changeset:WorkPackageChangeset;
setChangeset(changeset:WorkPackageChangeset) {
this.changeset = changeset;
}
precedingWorkPackages$:Observable<{ id:string, dueDate?:string, date?:string }[]> = of(this.changeset)
.pipe(

@ -38,15 +38,20 @@ import { DayElement } from 'flatpickr/dist/types/instance';
@Injectable()
export class DateModalSchedulingService {
private changeset:WorkPackageChangeset = this.locals.changeset as WorkPackageChangeset;
private changeset:WorkPackageChangeset;
scheduleManually = !!this.changeset.value('scheduleManually');
scheduleManually = false;
constructor(
@Inject(OpModalLocalsToken) public locals:OpModalLocalsMap,
readonly dateModalRelations:DateModalRelationsService,
) {}
setChangeset(changeset:WorkPackageChangeset) {
this.changeset = changeset;
this.scheduleManually = !!this.changeset.value('scheduleManually');
}
/**
* Returns whether the user can alter the dates of the work package.
*/

@ -30,6 +30,7 @@ import {
Directive,
OnDestroy,
OnInit,
Injector,
} from '@angular/core';
import { InjectField } from 'core-app/shared/helpers/angular/inject-field.decorator';
import { TimezoneService } from 'core-app/core/datetime/timezone.service';
@ -48,6 +49,8 @@ export abstract class DatePickerEditFieldComponent extends EditFieldComponent im
@InjectField() dateModalRelations:DateModalRelationsService;
@InjectField() injector:Injector;
ngOnInit():void {
super.ngOnInit();
@ -65,8 +68,8 @@ export abstract class DatePickerEditFieldComponent extends EditFieldComponent im
super.ngOnDestroy();
}
public set():void {
// { changeset: this.change, fieldName: this.name },
public showDatePickerModal():void {
this.injector.set({ changeset: this.change, fieldName: this.name },
/*
const component = this.change.schema.isMilestone ? SingleDateModalComponent : MultiDateModalComponent;
this.opModalService.show<SingleDateModalComponent|MultiDateModalComponent>(

Loading…
Cancel
Save