Content
View differences
Updated by Niels Lindenthal over 4 years ago
**As** an OpenProject user
**I want** to calculate the work package start and end dates based on the duration
**so** that I only have to set the duration.
# **Acceptance criteria:**
* In the date picker modal there is a form field `duration`.
* When entering a duration the dates are derived
* **\[open\]** The duration represents the amount of days between the start and the finish date with the day of the finish date included, e.g:
* Monday to Tuesday: 2
* Monday to Monday (same day): 1
* **\[open\]** Once non working days are implemented (#18416), days defined to be non working days do not count when calculating the duration or dates based on the duration, e.g:
* Friday to Monday: 2
* In the work packages list there is a column "duration". When clicking on this the date modal with the date picker is opened.
* In all cases the duration is consistent with the start and the finish date. It is not possible to create a duration of 8 days for a task that starts and finishes in the same week.
* The bar representing a work package has a width according to the work package's duration (if defined) while dragging a work package without start and end dates for placement on the gantt chart and planning board
* **\[open\]** If the user modifies the work package via the drag handles on the left/right border of the cards/strips representing the work package in Gantt chart/Team planner, both the start/finish date as well as the duration is altered in lockstep
* Filtering by duration is possible
* Sorting by duration is possible
* The duration as well as start and due dates can not be configured via the form configuration. They are always present at the same place within the work package show page and form.
* Work packages have an empty (not set) default duration
* Milestone typed work packages don't have a duration field
# Open
* Visuals for the rework of the dates & duration to be a fixed (not configurable) part of the work package show page and form (##40539)
* Inheritance of the duration between a work package and its children
* e.g. can a work package have a duration that is less than the duration of its child
# Examples
## Scenario 1:
* Setup
* Start date: Monday, February 8 2021
* Finish date: empty
* Duration: empty
* Change
* User enters a duration of 10 days
* Expected result:
* The finish date is changed to Friday, February 19 2021
## Scenario 2
* Setup
* Start date: empty
* Finish date: empty
* Duration: empty
* Change
* User enters a duration of 10 days
* Expected result:
* No date is added
## Scenario 3
* Setup
* Start date: empty
* Finish date: Friday, February 19, 2021
* Duration: empty
* Change
* User enters a duration of 10 days
* Expected result:
* The start date is changed to Monday, February 8, 2021
## Scenario 4
* Setup
* Start date: Monday, February 8, 2021
* Finish date: Friday, February 19, 2021
* Duration: 10
* Change
* User enters a duration of 11 days
* Expected result:
* The finish date is changed to Monday, February, 22 2021
## Scenario 5
* Setup
* Start date: Monday, February 8, 2021
* Finish date: Monday, February 22, 2021
* Duration: 11
* Change
* User enters a duration of 10 days
* Expected result:
* The finish date is changed to Friday, February, 19, 2021
## Scenario 6
* Setup
* Two work packages
* Task 1: Monday - Tuesday
* Task 2: no dates, no duration
* Change
* Task 2 follows Task 1
* Expected result
* Task 2: Starts Wednesday, Finish Date Wednesday, Duration = 1
## Scenario 7
* Setup
* Start date: Monday, February 9, 2021
* Finish date: Wednesday, February 11, 2021
* Duration: 3
* Change
* User alters the start date to Tuesday 10, 2021
* Expected result
* **\[open\]** Finish date is changed to Thursday, Feb 12, 2021
## Scenario 8
* Setup
* Start date: Tuesday, February 10, 2021
* Finish date: Thursday, Tuesday, February 12, 2021
* Duration: 3
* Change
* User alters the finish date to Feb 11, 2021
* Expected result
* **\[open\]** Start date is changed to Monday, Feb 9, 2021
## Scenario 9
* Setup
* Start date: Monday, February 9, 2021
* Finish date: Wednesday, February 11, 2021
* Duration: 3
* Change
* User moves the drag handle on the left border (start date) of the box representing the work package in Gantt chart and Team planner one day to the right (to Feb 10, 2021)
* Expected result
* **\[open\]** The duration is reduced to 2. The start date is set to Feb 10, 2021. The Finish date is left unchanged.
## Scenario 10
* Setup
* Start date: empty
* Finish date: Wednesday, February 11, 2021
* Duration: empty
* Change
* User enters the start date of Monday, February 09, 2021
* Expected result
* **\[open\]** Duration is set to 3
# Visuals
<figure class="image op-uc-figure"><div op-uc-figure" style="width:55.55%;"><div class="op-uc-figure--content"><img class="op-uc-image" src="/api/v3/attachments/27172/content"></div></figure> src="/api/v3/attachments/20507/content"></div></figure>
# Seed Data
**Static queries in section "Default data":**
* Gantt chart: Add duration column after column finish date:
**Queries in section favorite views**
* Project plan (Query ID 1): Add duration column after column finish date
* Project plan (Query ID 14): Add duration column after column finish date
# Full screen view
* Currently the status selection is below the subject at the same position for all work package types.
* We also move the dates and the curation to this area (visuals tbd).
* For milestones there is no duration by definition.
# Out-of-Scope
* Consider weekends and holidays (##18416)
* Summing durations
* Grouping by durations
# Implementation notes
* Frontend:
* include duration in date picker
* There is no duration form field for milestones.
* Restyling dates section (start & due date & duration) so that dates are always visible (no longer configurable via form configuration) similar to status
* Adapt specs that break by doing this
* Display longer bar in gantt chart and planning board while dragging a work package without start & end dates
* Backend:
* Introduce into data layer & contracts
* Disallow setting duration for milestone typed work packages
* Services
* **Open** inheritance within hierarchy
* Include in API
* Exclude for milestone typed work packages (should be covered by non writable property in contract)
* Calculates start/end dates on scheduling and on setting duration/start/end-dates
* Filter for duration ("Everything longer than")
* Sort
* Seeding and default configurations
* Migration for removing the dates from existing form configurations as they can no longer be configured.
* Migration for setting a duration for all work packages having start and end date set.
**I want** to calculate the work package start and end dates based on the duration
**so** that I only have to set the duration.
# **Acceptance criteria:**
* In the date picker modal there is a form field `duration`.
* When entering a duration the dates are derived
* **\[open\]** The duration represents the amount of days between the start and the finish date with the day of the finish date included, e.g:
* Monday to Tuesday: 2
* Monday to Monday (same day): 1
* **\[open\]** Once non working days are implemented (#18416), days defined to be non working days do not count when calculating the duration or dates based on the duration, e.g:
* Friday to Monday: 2
* In the work packages list there is a column "duration". When clicking on this the date modal with the date picker is opened.
* In all cases the duration is consistent with the start and the finish date. It is not possible to create a duration of 8 days for a task that starts and finishes in the same week.
* The bar representing a work package has a width according to the work package's duration (if defined) while dragging a work package without start and end dates for placement on the gantt chart and planning board
* **\[open\]** If the user modifies the work package via the drag handles on the left/right border of the cards/strips representing the work package in Gantt chart/Team planner, both the start/finish date as well as the duration is altered in lockstep
* Filtering by duration is possible
* Sorting by duration is possible
* The duration as well as start and due dates can not be configured via the form configuration. They are always present at the same place within the work package show page and form.
* Work packages have an empty (not set) default duration
* Milestone typed work packages don't have a duration field
# Open
* Visuals for the rework of the dates & duration to be a fixed (not configurable) part of the work package show page and form (##40539)
* Inheritance of the duration between a work package and its children
* e.g. can a work package have a duration that is less than the duration of its child
# Examples
## Scenario 1:
* Setup
* Start date: Monday, February 8 2021
* Finish date: empty
* Duration: empty
* Change
* User enters a duration of 10 days
* Expected result:
* The finish date is changed to Friday, February 19 2021
## Scenario 2
* Setup
* Start date: empty
* Finish date: empty
* Duration: empty
* Change
* User enters a duration of 10 days
* Expected result:
* No date is added
## Scenario 3
* Setup
* Start date: empty
* Finish date: Friday, February 19, 2021
* Duration: empty
* Change
* User enters a duration of 10 days
* Expected result:
* The start date is changed to Monday, February 8, 2021
## Scenario 4
* Setup
* Start date: Monday, February 8, 2021
* Finish date: Friday, February 19, 2021
* Duration: 10
* Change
* User enters a duration of 11 days
* Expected result:
* The finish date is changed to Monday, February, 22 2021
## Scenario 5
* Setup
* Start date: Monday, February 8, 2021
* Finish date: Monday, February 22, 2021
* Duration: 11
* Change
* User enters a duration of 10 days
* Expected result:
* The finish date is changed to Friday, February, 19, 2021
## Scenario 6
* Setup
* Two work packages
* Task 1: Monday - Tuesday
* Task 2: no dates, no duration
* Change
* Task 2 follows Task 1
* Expected result
* Task 2: Starts Wednesday, Finish Date Wednesday, Duration = 1
## Scenario 7
* Setup
* Start date: Monday, February 9, 2021
* Finish date: Wednesday, February 11, 2021
* Duration: 3
* Change
* User alters the start date to Tuesday 10, 2021
* Expected result
*
## Scenario 8
* Setup
* Start date: Tuesday, February 10, 2021
* Finish date: Thursday,
* Duration: 3
* Change
* User alters the finish date to Feb 11, 2021
* Expected result
*
## Scenario 9
* Setup
* Start date: Monday, February 9, 2021
* Finish date: Wednesday, February 11, 2021
* Duration: 3
* Change
* User moves the drag handle on the left border (start date) of the box representing the work package in Gantt chart and Team planner one day to the right (to Feb 10, 2021)
* Expected result
*
## Scenario 10
* Setup
* Start date: empty
* Finish date: Wednesday, February 11, 2021
* Duration: empty
* Change
* User enters the start date of Monday, February 09, 2021
* Expected result
* **\[open\]** Duration is set to 3
# Visuals
<figure class="image op-uc-figure"><div
# Seed Data
**Static queries in section "Default data":**
* Gantt chart: Add duration column after column finish date:
**Queries in section favorite views**
* Project plan (Query ID 1): Add duration column after column finish date
* Project plan (Query ID 14): Add duration column after column finish date
# Full screen view
* Currently the status selection is below the subject at the same position for all work package types.
* We also move the dates and the curation to this area (visuals tbd).
* For milestones there is no duration by definition.
# Out-of-Scope
* Consider weekends and holidays (##18416)
* Summing durations
* Grouping by durations
# Implementation notes
* Frontend:
* include duration in date picker
* There is no duration form field for milestones.
* Restyling dates section (start & due date & duration) so that dates are always visible (no longer configurable via form configuration) similar to status
* Adapt specs that break by doing this
* Display longer bar in gantt chart and planning board while dragging a work package without start & end dates
* Backend:
* Introduce into data layer & contracts
* Disallow setting duration for milestone typed work packages
* Services
* **Open** inheritance within hierarchy
* Include in API
* Exclude for milestone typed work packages (should be covered by non writable property in contract)
* Calculates start/end dates on scheduling and on setting duration/start/end-dates
* Filter for duration ("Everything longer than")
* Sort
* Seeding and default configurations
* Migration for removing the dates from existing form configurations as they can no longer be configured.
* Migration for setting a duration for all work packages having start and end date set.