Skip to content

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

Add field for duration and checkbox for including non-working days

Henriette Dargeebf0f0e44508
diff --git a/config/locales/js-en.yml b/config/locales/js-en.yml
index 13db9336db5..93cd9acedf7 100644
--- a/config/locales/js-en.yml
+++ b/config/locales/js-en.yml
@@ -917,6 +917,7 @@ en:
changing_dates_affects_follow_relations: "Changing these dates will affect dates of related work packages."
click_on_show_relations_to_open_gantt: 'Click on "%{button_name}" for GANTT overview.'
show_relations: 'Show relations'
+ include_non_working_days: 'Include non-working days'
description_filter: "Filter"
description_enter_text: "Enter text"
description_options_hide: "Hide options"
@@ -973,6 +974,7 @@ en:
description: "Description"
date: "Date"
dueDate: "Finish date"
+ duration: "Duration"
estimatedTime: "Estimated time"
spentTime: "Spent time"
category: "Category"
diff --git a/frontend/src/app/shared/components/datepicker/datepicker.modal.html b/frontend/src/app/shared/components/datepicker/datepicker.modal.html
index 9a8a47dc84e..0ff9be814eb 100644
--- a/frontend/src/app/shared/components/datepicker/datepicker.modal.html
+++ b/frontend/src/app/shared/components/datepicker/datepicker.modal.html
@@ -108,6 +108,23 @@
</a>
</div>
</div>
+ <div class="form--field op-datepicker-modal--date-form"
+ data-qa-selector="datepicker-duration"
+ >
+ <label class="form--label"
+ [textContent]="text.duration">
+ </label>
+ <div class="form--field-container">
+ <div class="form--text-field-container op-datepicker-modal--date-container">
+ <spot-text-field
+ name="duration"
+ data-qa-selector="op-datepicker-modal--duration-field"
+ class="op-datepicker-modal--date-field"
+ [disabled]="!isSchedulable"
+ ></spot-text-field>
+ </div>
+ </div>
+ </div>
</ng-container>
</div>
@@ -115,17 +132,38 @@
hidden>
</div>
- <div class="op-modal--footer">
- <button
- (click)="cancel()"
- class="op-datepicker-modal--action button"
- data-qa-selector="op-datepicker-modal--action"
- [textContent]="text.cancel"
- ></button>
- <button
- class="op-datepicker-modal--action button -highlight"
- data-qa-selector="op-datepicker-modal--action"
- [textContent]="text.save"
- ></button>
+ <div class="op-modal--footer op-modal--footer_split-actions">
+ <div>
+ <div class="form--field -no-margin op-datepicker-modal--scheduling-action-container">
+ <div class="form--field-container">
+ <label class="form--label-with-check-box">
+ <div class="form--check-box-container">
+ <input type="checkbox"
+ name="include-non-working-days"
+ class="form--check-box"
+ data-qa-selector="op-datepicker-modal--include-non-working-days"
+ [ngModel]="includeNonWorkingDays"
+ (ngModelChange)="changeNonWorkingDays()">
+ </div>
+ {{ text.includeNonWorkingDays }}
+ </label>
+ </div>
+ </div>
+ </div>
+
+ <div>
+ <button
+ (click)="cancel()"
+ class="op-datepicker-modal--action button"
+ data-qa-selector="op-datepicker-modal--action"
+ [textContent]="text.cancel"
+ ></button>
+ <button
+ class="op-datepicker-modal--action button -highlight"
+ data-qa-selector="op-datepicker-modal--action"
+ [textContent]="text.save"
+ ></button>
+ </div>
+
</div>
</form>
diff --git a/frontend/src/app/shared/components/datepicker/datepicker.modal.ts b/frontend/src/app/shared/components/datepicker/datepicker.modal.ts
index d64d556448f..21ddc0b0ab6 100644
--- a/frontend/src/app/shared/components/datepicker/datepicker.modal.ts
+++ b/frontend/src/app/shared/components/datepicker/datepicker.modal.ts
@@ -93,6 +93,8 @@ export class DatePickerModalComponent extends OpModalComponent implements AfterV
date: this.I18n.t('js.work_packages.properties.date'),
startDate: this.I18n.t('js.work_packages.properties.startDate'),
endDate: this.I18n.t('js.work_packages.properties.dueDate'),
+ duration: this.I18n.t('js.work_packages.properties.duration'),
+ includeNonWorkingDays: this.I18n.t('js.work_packages.datepicker_modal.include_non_working_days'),
placeholder: this.I18n.t('js.placeholders.default'),
today: this.I18n.t('js.label_today'),
};
@@ -103,6 +105,8 @@ export class DatePickerModalComponent extends OpModalComponent implements AfterV
scheduleManually = false;
+ includeNonWorkingDays = false;
+
htmlId = '';
dates:{ [key in DateKeys]:string } = {
@@ -190,6 +194,12 @@ export class DatePickerModalComponent extends OpModalComponent implements AfterV
this.cdRef.detectChanges();
}
+ changeNonWorkingDays():void {
+ this.includeNonWorkingDays = !this.includeNonWorkingDays;
+ this.initializeDatepicker();
+ this.cdRef.detectChanges();
+ }
+
save($event:Event):void {
$event.preventDefault();
// Apply the changed scheduling mode if any
diff --git a/frontend/src/app/shared/components/modal/modal.sass b/frontend/src/app/shared/components/modal/modal.sass
index 0d86dc01f67..e415e76fc51 100644
--- a/frontend/src/app/shared/components/modal/modal.sass
+++ b/frontend/src/app/shared/components/modal/modal.sass
@@ -82,6 +82,7 @@
&_split-actions
justify-content: space-between
+ align-items: baseline
.button
margin-bottom: 0