mirror of
https://github.com/opf/openproject.git
synced 2026-06-14 03:30:14 +00:00
[28446] Rename due date to finish date
https://community.openproject.com/wp/28446
This commit is contained in:
@@ -30,7 +30,7 @@ class AttributeHelpText::WorkPackage < AttributeHelpText
|
||||
def self.available_attributes
|
||||
attributes = ::Type.translated_work_package_form_attributes
|
||||
|
||||
# Start and due dates are joined into a single field for non-milestones
|
||||
# Start and finish dates are joined into a single field for non-milestones
|
||||
attributes.delete 'start_date'
|
||||
attributes.delete 'due_date'
|
||||
|
||||
|
||||
@@ -563,7 +563,7 @@ class Project < ActiveRecord::Base
|
||||
].flatten.compact.min
|
||||
end
|
||||
|
||||
# The latest due date of an issue or version
|
||||
# The latest finish date of an issue or version
|
||||
def due_date
|
||||
[
|
||||
work_packages.maximum('due_date'),
|
||||
|
||||
@@ -107,7 +107,7 @@ class Version < ActiveRecord::Base
|
||||
status == 'open'
|
||||
end
|
||||
|
||||
# Returns true if the version is completed: due date reached and no open issues
|
||||
# Returns true if the version is completed: finish date reached and no open issues
|
||||
def completed?
|
||||
effective_date && (effective_date <= Date.today) && open_issues_count.zero?
|
||||
end
|
||||
@@ -146,7 +146,7 @@ class Version < ActiveRecord::Base
|
||||
end
|
||||
deprecated_alias :closed_pourcent, :closed_percent
|
||||
|
||||
# Returns true if the version is overdue: due date reached and some open issues
|
||||
# Returns true if the version is overdue: finish date reached and some open issues
|
||||
def overdue?
|
||||
effective_date && (effective_date < Date.today) && (open_issues_count > 0)
|
||||
end
|
||||
|
||||
@@ -369,7 +369,7 @@ class WorkPackage < ActiveRecord::Base
|
||||
end
|
||||
end
|
||||
|
||||
# Is the amount of work done less than it should for the due date
|
||||
# Is the amount of work done less than it should for the finish date
|
||||
def behind_schedule?
|
||||
return false if start_date.nil? || due_date.nil?
|
||||
done_date = start_date + (duration * done_ratio / 100).floor
|
||||
|
||||
@@ -39,7 +39,7 @@ module WorkPackage::SchedulingRules
|
||||
end
|
||||
|
||||
# Calculates the minimum date that
|
||||
# will not violate the precedes relations (max(due date, start date) + delay)
|
||||
# will not violate the precedes relations (max(finish date, start date) + delay)
|
||||
# of this work package or its ancestors
|
||||
# e.g.
|
||||
# AP(due_date: 2017/07/24, delay: 1)-precedes-A
|
||||
@@ -74,10 +74,10 @@ module WorkPackage::SchedulingRules
|
||||
# Returns the time scheduled for this work package.
|
||||
#
|
||||
# Example:
|
||||
# Start Date: 2/26/09, Due Date: 3/04/09, duration => 7
|
||||
# Start Date: 2/26/09, Due Date: 2/26/09, duration => 1
|
||||
# Start Date: 2/26/09, Due Date: - , duration => 1
|
||||
# Start Date: - , Due Date: 2/26/09, duration => 1
|
||||
# Start Date: 2/26/09, Finish Date: 3/04/09, duration => 7
|
||||
# Start Date: 2/26/09, Finish Date: 2/26/09, duration => 1
|
||||
# Start Date: 2/26/09, Finish Date: - , duration => 1
|
||||
# Start Date: - , Finish Date: 2/26/09, duration => 1
|
||||
def duration
|
||||
if start_date && due_date
|
||||
due_date - start_date + 1
|
||||
|
||||
@@ -2710,7 +2710,7 @@ bg:
|
||||
validation:
|
||||
done_ratio: Done ratio cannot be set on parent work packages, when it is inferred
|
||||
by status or when it is disabled.
|
||||
due_date: Due date cannot be set on parent work packages.
|
||||
due_date: Finish date cannot be set on parent work packages.
|
||||
estimated_hours: Estimated hours cannot be set on parent work packages.
|
||||
invalid_user_assigned_to_work_package: The chosen user is not allowed to be
|
||||
'%{property}' for this work package.
|
||||
|
||||
@@ -224,7 +224,7 @@ en:
|
||||
**You can:**
|
||||
* create new phases and milestones by simply clicking in the project plan,
|
||||
* change phases and milestones with drag and drop,
|
||||
* add labels, such as start and due date, title, or assignee,
|
||||
* add labels, such as start and finish date, title, or assignee,
|
||||
* add dependencies by right clicking on a phase or milestone and choose pre-decessor or follower,
|
||||
* custom columns, group, filter and save timeline reports to have them at your fingertips.
|
||||
|
||||
@@ -248,7 +248,7 @@ en:
|
||||
* change title or description,
|
||||
* assign it to a team member,
|
||||
* comment on topics or notify team members with @-notifications,
|
||||
* set status, priority, due dates or other custom fields,
|
||||
* set status, priority, finish dates or other custom fields,
|
||||
* include documents or screenshots with copy & paste,
|
||||
* add relations to other work packages,
|
||||
* change forms in the Administration settings.
|
||||
|
||||
@@ -413,7 +413,7 @@ en:
|
||||
auto_hide_popups: "Auto-hide success notifications"
|
||||
warn_on_leaving_unsaved: "Warn me when leaving a work package with unsaved changes"
|
||||
version:
|
||||
effective_date: "Due date"
|
||||
effective_date: "Finish date"
|
||||
sharing: "Sharing"
|
||||
wiki_content:
|
||||
text: "Text"
|
||||
@@ -645,7 +645,7 @@ en:
|
||||
default_columns: "Default columns"
|
||||
description: "Description"
|
||||
display_sums: "Display Sums"
|
||||
due_date: "Due date"
|
||||
due_date: "Finish date"
|
||||
estimated_hours: "Estimated time"
|
||||
estimated_time: "Estimated time"
|
||||
firstname: "First name"
|
||||
@@ -2542,7 +2542,7 @@ en:
|
||||
context_object_not_found: "Cannot find the resource given as the context."
|
||||
validation:
|
||||
done_ratio: "Done ratio cannot be set on parent work packages, when it is inferred by status or when it is disabled."
|
||||
due_date: "Due date cannot be set on parent work packages."
|
||||
due_date: "Finish date cannot be set on parent work packages."
|
||||
estimated_hours: "Estimated hours cannot be set on parent work packages."
|
||||
invalid_user_assigned_to_work_package: "The chosen user is not allowed to be '%{property}' for this work package."
|
||||
start_date: "Start date cannot be set on parent work packages."
|
||||
|
||||
@@ -434,7 +434,7 @@ en:
|
||||
button_deactivate: 'Hide Gantt chart'
|
||||
cancel: Cancel
|
||||
change: "Change in planning"
|
||||
due_date: "Due date"
|
||||
due_date: "Finish date"
|
||||
empty: "(empty)"
|
||||
error: "An error has occurred."
|
||||
errors:
|
||||
@@ -569,7 +569,7 @@ en:
|
||||
createdAt: "Created on"
|
||||
description: "Description"
|
||||
date: "Date"
|
||||
dueDate: "Due date"
|
||||
dueDate: "Finish date"
|
||||
estimatedTime: "Estimated time"
|
||||
spentTime: "Spent time"
|
||||
category: "Category"
|
||||
|
||||
@@ -56,14 +56,14 @@ The list of values can either consist of a list of links or of a list of strings
|
||||
```
|
||||
{
|
||||
"_type": "DueDateQueryFilter",
|
||||
"name": "Due date",
|
||||
"name": "Finish date",
|
||||
"values": [
|
||||
"1"
|
||||
],
|
||||
"_links": {
|
||||
"filter": {
|
||||
"href": "/api/v3/queries/filters/dueDate",
|
||||
"title": "Due date"
|
||||
"title": "Finish date"
|
||||
},
|
||||
"operator": {
|
||||
"href": "/api/v3/queries/operators/<t+",
|
||||
@@ -134,14 +134,14 @@ If the values are nonprimitive (e.g. User, Project), they will be listed as obje
|
||||
},
|
||||
{
|
||||
"_type": "DueDateQueryFilter",
|
||||
"name": "Due date",
|
||||
"name": "Finish date",
|
||||
"values": [
|
||||
"1"
|
||||
],
|
||||
"_links": {
|
||||
"filter": {
|
||||
"href": "/api/v3/queries/filters/dueDate",
|
||||
"title": "Due date"
|
||||
"title": "Finish date"
|
||||
},
|
||||
"operator": {
|
||||
"href": "/api/v3/queries/operators/<t+",
|
||||
@@ -775,14 +775,14 @@ Same as [viewing an existing, persisted Query](#queries-query-get) in its respon
|
||||
},
|
||||
{
|
||||
"_type": "DueDateQueryFilter",
|
||||
"name": "Due date",
|
||||
"name": "Finish date",
|
||||
"values": [
|
||||
"1"
|
||||
],
|
||||
"_links": {
|
||||
"filter": {
|
||||
"href": "/api/v3/queries/filters/dueDate",
|
||||
"title": "Due date"
|
||||
"title": "Finish date"
|
||||
},
|
||||
"operator": {
|
||||
"href": "/api/v3/queries/operators/<t+",
|
||||
@@ -974,14 +974,14 @@ Same as [viewing an existing, persisted Query](#queries-query-get) in its respon
|
||||
},
|
||||
{
|
||||
"_type": "DueDateQueryFilter",
|
||||
"name": "Due date",
|
||||
"name": "Finish date",
|
||||
"values": [
|
||||
"1"
|
||||
],
|
||||
"_links": {
|
||||
"filter": {
|
||||
"href": "/api/v3/queries/filters/dueDate",
|
||||
"title": "Due date"
|
||||
"title": "Finish date"
|
||||
},
|
||||
"operator": {
|
||||
"href": "/api/v3/queries/operators/<t+",
|
||||
@@ -1187,14 +1187,14 @@ Same as [viewing an existing, persisted Query](#queries-query-get) in its respon
|
||||
},
|
||||
{
|
||||
"_type": "DueDateQueryFilter",
|
||||
"name": "Due date",
|
||||
"name": "Finish date",
|
||||
"values": [
|
||||
"1"
|
||||
],
|
||||
"_links": {
|
||||
"filter": {
|
||||
"href": "/api/v3/queries/filters/dueDate",
|
||||
"title": "Due date"
|
||||
"title": "Finish date"
|
||||
},
|
||||
"operator": {
|
||||
"href": "/api/v3/queries/operators/<t+",
|
||||
|
||||
@@ -71,11 +71,11 @@ the human readable name of custom fields.
|
||||
Properties that cannot be set directly on parent work packages are inferred from their children instead:
|
||||
|
||||
* `startDate` is the earliest start date from its children
|
||||
* `dueDate` is the latest due date from its children
|
||||
* `dueDate` is the latest finish date from its children
|
||||
* `estimatedTime` is the sum of estimated times from its children
|
||||
* `percentageDone` is the weighted average of the sum of its children percentages done. The weight is given by the average of its children estimatedHours. However, if the percentage done is given by a work package's status, then only the status matters and no value is inferred.
|
||||
|
||||
Start date can also not be earlier than a due date of any predecessor.
|
||||
Start date can also not be earlier than a finish date of any predecessor.
|
||||
|
||||
While attachments are returned as a link which's content is to be fetched separately, clients can choose to
|
||||
replace the work package's attachments by providing an array of already uploaded [Attachment resources](#attachments) on [create](#work-packages-work-packages-post)
|
||||
|
||||
@@ -127,7 +127,7 @@ Other available keys for the email are:
|
||||
| Type | sets the type | type:Milestone |
|
||||
| Version | sets the version | version:v4.1.0 |
|
||||
| Start date | sets the start date | start date:2015-02-28 |
|
||||
| Due date | sets the due date | |
|
||||
| Due date | sets the finish date | |
|
||||
| Done ratio | sets the done ratio. Use a number | Done ratio:40 |
|
||||
| Status | sets the status | Status:closed |
|
||||
| priority | sets the priority | priority:High |
|
||||
|
||||
@@ -95,7 +95,7 @@ export class TimelineCellRenderer {
|
||||
|
||||
/**
|
||||
* Assign changed dates to the work package.
|
||||
* For generic work packages, assigns start and due date.
|
||||
* For generic work packages, assigns start and finish date.
|
||||
*
|
||||
*/
|
||||
public assignDateValues(changeset:WorkPackageChangeset,
|
||||
@@ -227,7 +227,7 @@ export class TimelineCellRenderer {
|
||||
bar.style.backgroundImage = `linear-gradient(90deg, #F1F1F1 0%, rgba(255,255,255,0) 80%)`;
|
||||
}
|
||||
|
||||
// only due date, fade out bar to the left
|
||||
// only finish date, fade out bar to the left
|
||||
if (_.isNaN(start.valueOf()) && !_.isNaN(due.valueOf())) {
|
||||
start = due.clone();
|
||||
bar.style.backgroundImage = `linear-gradient(90deg, rgba(255,255,255,0) 0%, #F1F1F1 100%)`;
|
||||
@@ -306,7 +306,7 @@ export class TimelineCellRenderer {
|
||||
|
||||
/**
|
||||
* Render the generic cell element, a bar spanning from
|
||||
* start to due date.
|
||||
* start to finish date.
|
||||
*/
|
||||
public render(renderInfo:RenderInfo):HTMLDivElement {
|
||||
const bar = document.createElement('div');
|
||||
|
||||
+1
-1
@@ -58,7 +58,7 @@ export class TimelineMilestoneCellRenderer extends TimelineCellRenderer {
|
||||
|
||||
/**
|
||||
* Assign changed dates to the work package.
|
||||
* For generic work packages, assigns start and due date.
|
||||
* For generic work packages, assigns start and finish date .
|
||||
*
|
||||
*/
|
||||
public assignDateValues(changeset:WorkPackageChangeset,
|
||||
|
||||
+1
-1
@@ -372,7 +372,7 @@ export class WorkPackageTimelineTableController implements AfterViewInit, OnDest
|
||||
startDate,
|
||||
date);
|
||||
|
||||
// due date
|
||||
// finish date
|
||||
newParams.dateDisplayEnd = moment.max(
|
||||
newParams.dateDisplayEnd,
|
||||
currentParams.now,
|
||||
|
||||
@@ -85,7 +85,7 @@ export class DateEditField extends EditField {
|
||||
|
||||
/**
|
||||
* Return the default date for the datepicker instance.
|
||||
* If this field is the due date, we select the start date + 1 as the default.
|
||||
* If this field is the finish date, we select the start date + 1 as the default.
|
||||
*/
|
||||
public get defaultDate():String {
|
||||
const isDueDate = this.name === 'dueDate';
|
||||
|
||||
@@ -257,7 +257,7 @@ describe WorkPackages::BaseContract do
|
||||
end
|
||||
end
|
||||
|
||||
describe 'due date' do
|
||||
describe 'finish date' do
|
||||
it_behaves_like 'a parent unwritable property', :due_date
|
||||
it_behaves_like 'a date attribute', :due_date
|
||||
|
||||
|
||||
@@ -30,7 +30,7 @@ describe 'Inline editing milestones', js: true do
|
||||
wp_table.expect_work_package_listed work_package
|
||||
end
|
||||
|
||||
it 'mapping for start and due date in the table (regression #26044)' do
|
||||
it 'mapping for start and finish date in the table (regression #26044)' do
|
||||
start_date = wp_table.edit_field(work_package, :startDate)
|
||||
due_date = wp_table.edit_field(work_package, :dueDate)
|
||||
|
||||
|
||||
@@ -119,7 +119,7 @@ describe 'filter work packages', js: true do
|
||||
end
|
||||
end
|
||||
|
||||
context 'by due date outside of a project' do
|
||||
context 'by finish date outside of a project' do
|
||||
let(:work_package_with_due_date) { FactoryBot.create :work_package, project: project, due_date: Date.today }
|
||||
let(:work_package_without_due_date) { FactoryBot.create :work_package, project: project, due_date: Date.today + 5.days }
|
||||
let(:wp_table) { ::Pages::WorkPackagesTable.new }
|
||||
@@ -134,7 +134,7 @@ describe 'filter work packages', js: true do
|
||||
it 'allows filtering, saving and retrieving and altering the saved filter' do
|
||||
filters.open
|
||||
|
||||
filters.add_filter_by('Due date',
|
||||
filters.add_filter_by('Finish date',
|
||||
'between',
|
||||
[(Date.today - 1.day).strftime('%Y-%m-%d'), Date.today.strftime('%Y-%m-%d')],
|
||||
'dueDate')
|
||||
@@ -160,12 +160,12 @@ describe 'filter work packages', js: true do
|
||||
|
||||
filters.open
|
||||
|
||||
filters.expect_filter_by('Due date',
|
||||
filters.expect_filter_by('Finish date',
|
||||
'between',
|
||||
[(Date.today - 1.day).strftime('%Y-%m-%d'), Date.today.strftime('%Y-%m-%d')],
|
||||
'dueDate')
|
||||
|
||||
filters.set_filter 'Due date', 'in more than', '1', 'dueDate'
|
||||
filters.set_filter 'Finish date', 'in more than', '1', 'dueDate'
|
||||
|
||||
loading_indicator_saveguard
|
||||
wp_table.expect_work_package_listed work_package_without_due_date
|
||||
|
||||
@@ -163,7 +163,7 @@ RSpec.feature 'Work package timeline labels',
|
||||
farRight: 'Status'
|
||||
|
||||
config_modal.update_labels left: 'Start date',
|
||||
right: 'Due date',
|
||||
right: 'Finish date',
|
||||
farRight: 'Subject'
|
||||
|
||||
# Check overriden labels
|
||||
|
||||
@@ -220,7 +220,7 @@ describe ::API::V3::WorkPackages::Schema::SpecificWorkPackageSchema do
|
||||
end
|
||||
end
|
||||
|
||||
context 'due date' do
|
||||
context 'finish date' do
|
||||
it 'is not writable when the work package is a parent' do
|
||||
allow(work_package).to receive(:leaf?).and_return(false)
|
||||
expect(subject.writable?(:due_date)).to be false
|
||||
|
||||
@@ -64,7 +64,7 @@ describe ::API::V3::WorkPackages::Schema::TypedWorkPackageSchema do
|
||||
expect(subject.writable?(:start_date)).to be true
|
||||
end
|
||||
|
||||
it 'due date is writable' do
|
||||
it 'finish date is writable' do
|
||||
expect(subject.writable?(:due_date)).to be true
|
||||
end
|
||||
end
|
||||
|
||||
@@ -198,7 +198,7 @@ describe ::API::V3::WorkPackages::WorkPackagePayloadRepresenter do
|
||||
let(:json_path) { 'dueDate' }
|
||||
end
|
||||
|
||||
context 'no due date' do
|
||||
context 'no finish date' do
|
||||
let(:work_package) { FactoryBot.build(:work_package, due_date: nil) }
|
||||
|
||||
it 'renders as null' do
|
||||
@@ -235,7 +235,7 @@ describe ::API::V3::WorkPackages::WorkPackagePayloadRepresenter do
|
||||
let(:json_path) { 'date' }
|
||||
end
|
||||
|
||||
context 'no due date' do
|
||||
context 'no finish date' do
|
||||
let(:work_package) do
|
||||
FactoryBot.build_stubbed(:work_package,
|
||||
type: FactoryBot.build_stubbed(:type),
|
||||
|
||||
@@ -136,7 +136,7 @@ describe ::API::V3::WorkPackages::WorkPackageRepresenter do
|
||||
let(:json_path) { 'dueDate' }
|
||||
end
|
||||
|
||||
context 'no due date' do
|
||||
context 'no finish date' do
|
||||
let(:work_package) { FactoryBot.build(:work_package, id: 42, due_date: nil) }
|
||||
|
||||
it 'renders as null' do
|
||||
@@ -175,7 +175,7 @@ describe ::API::V3::WorkPackages::WorkPackageRepresenter do
|
||||
let(:json_path) { 'date' }
|
||||
end
|
||||
|
||||
context 'no due date' do
|
||||
context 'no finish date' do
|
||||
before do
|
||||
work_package.due_date = nil
|
||||
end
|
||||
|
||||
@@ -38,7 +38,7 @@ describe CustomActions::Actions::Date, type: :model do
|
||||
describe '#apply' do
|
||||
let(:work_package) { FactoryBot.build_stubbed(:stubbed_work_package) }
|
||||
|
||||
it 'sets both start and due date to the action\'s value' do
|
||||
it 'sets both start and finish date to the action\'s value' do
|
||||
instance.values = [Date.today]
|
||||
|
||||
instance.apply(work_package)
|
||||
|
||||
@@ -33,7 +33,7 @@ describe Version, type: :model do
|
||||
|
||||
it { is_expected.to be_valid }
|
||||
|
||||
it 'rejects a due date that is smaller than the start date' do
|
||||
it 'rejects a finish date that is smaller than the start date' do
|
||||
version.start_date = '2013-05-01'
|
||||
version.effective_date = '2012-01-01'
|
||||
|
||||
|
||||
@@ -51,7 +51,7 @@ describe WorkPackage, '#reschedule_after', type: :model do
|
||||
login_as(user)
|
||||
end
|
||||
|
||||
describe 'for a single node having start and due date' do
|
||||
describe 'for a single node having start and finish date' do
|
||||
before do
|
||||
instance.start_date = Date.today
|
||||
instance.due_date = Date.today + 7.days
|
||||
@@ -63,12 +63,12 @@ describe WorkPackage, '#reschedule_after', type: :model do
|
||||
expect(instance.start_date).to eq(Date.today + 3.days)
|
||||
end
|
||||
|
||||
it 'should set the set the due date plus the duration' do
|
||||
it 'should set the set the finish date plus the duration' do
|
||||
expect(instance.due_date).to eq(Date.today + 10.days)
|
||||
end
|
||||
end
|
||||
|
||||
describe 'for a single node having neither start nor due date' do
|
||||
describe 'for a single node having neither start nor finish date' do
|
||||
before do
|
||||
instance.start_date = nil
|
||||
instance.due_date = nil
|
||||
@@ -80,12 +80,12 @@ describe WorkPackage, '#reschedule_after', type: :model do
|
||||
expect(instance.start_date).to eq(Date.today + 3.days)
|
||||
end
|
||||
|
||||
it 'should set the set the due date plus the duration' do
|
||||
it 'should set the set the finish date plus the duration' do
|
||||
expect(instance.due_date).to eq(Date.today + 3.days)
|
||||
end
|
||||
end
|
||||
|
||||
describe 'for a single node having only a due date' do
|
||||
describe 'for a single node having only a finish date' do
|
||||
before do
|
||||
instance.start_date = nil
|
||||
instance.due_date = Date.today + 7.days
|
||||
@@ -97,7 +97,7 @@ describe WorkPackage, '#reschedule_after', type: :model do
|
||||
expect(instance.start_date).to eq(Date.today + 3.days)
|
||||
end
|
||||
|
||||
it 'should set the set the due date plus the duration' do
|
||||
it 'should set the set the finish date plus the duration' do
|
||||
expect(instance.due_date).to eq(Date.today + 3.days)
|
||||
end
|
||||
end
|
||||
@@ -117,7 +117,7 @@ describe WorkPackage, '#reschedule_after', type: :model do
|
||||
expect(instance.start_date).to eq(Date.today + 3.days)
|
||||
end
|
||||
|
||||
it "should set the set the due date to the provided date plus the child's duration" do
|
||||
it "should set the set the finish date to the provided date plus the child's duration" do
|
||||
instance.reload
|
||||
expect(instance.due_date).to eq(Date.today + 10.days)
|
||||
end
|
||||
@@ -127,14 +127,14 @@ describe WorkPackage, '#reschedule_after', type: :model do
|
||||
expect(child.start_date).to eq(Date.today + 3.days)
|
||||
end
|
||||
|
||||
it "should set the set child's due date to the provided date plus the child's duration" do
|
||||
it "should set the set child's finish date to the provided date plus the child's duration" do
|
||||
child.reload
|
||||
expect(child.due_date).to eq(Date.today + 10.days)
|
||||
end
|
||||
end
|
||||
|
||||
describe "with a child
|
||||
while the new date is set to be between the child's start and due date" do
|
||||
while the new date is set to be between the child's start and finish date" do
|
||||
before do
|
||||
child.start_date = Date.today + 1.day
|
||||
child.due_date = Date.today + 7.days
|
||||
@@ -153,7 +153,7 @@ describe WorkPackage, '#reschedule_after', type: :model do
|
||||
expect(instance.start_date).to eq(Date.today + 3.days)
|
||||
end
|
||||
|
||||
it "should set the set the due date to the provided date plus the child's duration" do
|
||||
it "should set the set the finish date to the provided date plus the child's duration" do
|
||||
instance.reload
|
||||
expect(instance.due_date).to eq(Date.today + 9.days)
|
||||
end
|
||||
@@ -163,7 +163,7 @@ describe WorkPackage, '#reschedule_after', type: :model do
|
||||
expect(child.start_date).to eq(Date.today + 3.days)
|
||||
end
|
||||
|
||||
it "should set the set child's due date to the provided date plus the child's duration" do
|
||||
it "should set the set child's finish date to the provided date plus the child's duration" do
|
||||
child.reload
|
||||
expect(child.due_date).to eq(Date.today + 9.days)
|
||||
end
|
||||
@@ -186,7 +186,7 @@ describe WorkPackage, '#reschedule_after', type: :model do
|
||||
expect(instance.start_date).to eq(Date.today + 3.days)
|
||||
end
|
||||
|
||||
it "should set the set the due date to the provided date plus the child's duration" do
|
||||
it "should set the set the finish date to the provided date plus the child's duration" do
|
||||
instance.reload
|
||||
expect(instance.due_date).to eq(Date.today + 10.days)
|
||||
end
|
||||
@@ -196,7 +196,7 @@ describe WorkPackage, '#reschedule_after', type: :model do
|
||||
expect(child.start_date).to eq(Date.today + 3.days)
|
||||
end
|
||||
|
||||
it "should set the set child's due date to the provided date plus the grandchild's duration" do
|
||||
it "should set the set child's finish date to the provided date plus the grandchild's duration" do
|
||||
child.reload
|
||||
expect(child.due_date).to eq(Date.today + 10.days)
|
||||
end
|
||||
@@ -206,7 +206,7 @@ describe WorkPackage, '#reschedule_after', type: :model do
|
||||
expect(grandchild.start_date).to eq(Date.today + 3.days)
|
||||
end
|
||||
|
||||
it "should set the set grandchild's due date to the provided date plus the grandchild's duration" do
|
||||
it "should set the set grandchild's finish date to the provided date plus the grandchild's duration" do
|
||||
grandchild.reload
|
||||
expect(grandchild.due_date).to eq(Date.today + 10.days)
|
||||
end
|
||||
|
||||
@@ -65,7 +65,7 @@ describe WorkPackage, type: :model do
|
||||
it_behaves_like 'on time'
|
||||
end
|
||||
|
||||
context 'no due date' do
|
||||
context 'no finish date' do
|
||||
let(:due_date) { nil }
|
||||
|
||||
it_behaves_like 'on time'
|
||||
|
||||
@@ -820,7 +820,7 @@ describe WorkPackage, type: :model do
|
||||
let(:instance) { send(subclass) }
|
||||
|
||||
describe "w/ today as start date
|
||||
w/ tomorrow as due date" do
|
||||
w/ tomorrow as finish date" do
|
||||
before do
|
||||
work_package.start_date = Date.today
|
||||
work_package.due_date = Date.today + 1.day
|
||||
@@ -832,7 +832,7 @@ describe WorkPackage, type: :model do
|
||||
end
|
||||
|
||||
describe "w/ today as start date
|
||||
w/ today as due date" do
|
||||
w/ today as finish date" do
|
||||
before do
|
||||
work_package.start_date = Date.today
|
||||
work_package.due_date = Date.today
|
||||
@@ -844,7 +844,7 @@ describe WorkPackage, type: :model do
|
||||
end
|
||||
|
||||
describe "w/ today as start date
|
||||
w/o a due date" do
|
||||
w/o a finish date" do
|
||||
before do
|
||||
work_package.start_date = Date.today
|
||||
work_package.due_date = nil
|
||||
@@ -856,7 +856,7 @@ describe WorkPackage, type: :model do
|
||||
end
|
||||
|
||||
describe "w/o a start date
|
||||
w today as due date" do
|
||||
w today as finish date" do
|
||||
before do
|
||||
work_package.start_date = nil
|
||||
work_package.due_date = Date.today
|
||||
|
||||
@@ -366,7 +366,7 @@ describe 'API v3 Work package resource', type: :request, content_type: :json do
|
||||
it_behaves_like 'lock version updated'
|
||||
end
|
||||
|
||||
context 'due date' do
|
||||
context 'finish date' do
|
||||
let(:dateString) { Date.today.to_date.iso8601 }
|
||||
let(:params) { valid_params.merge(dueDate: dateString) }
|
||||
|
||||
@@ -374,7 +374,7 @@ describe 'API v3 Work package resource', type: :request, content_type: :json do
|
||||
|
||||
it { expect(response.status).to eq(200) }
|
||||
|
||||
it 'should respond with updated due date' do
|
||||
it 'should respond with updated finish date' do
|
||||
expect(subject.body).to be_json_eql(dateString.to_json).at_path('dueDate')
|
||||
end
|
||||
|
||||
|
||||
@@ -279,7 +279,7 @@ describe 'API v3 Work package form resource', type: :request do
|
||||
end
|
||||
end
|
||||
|
||||
describe 'due date' do
|
||||
describe 'finish date' do
|
||||
include_context 'post request'
|
||||
|
||||
context 'valid date' do
|
||||
|
||||
@@ -361,13 +361,13 @@ describe WorkPackages::UpdateService, 'integration tests', type: :model do
|
||||
expect(subject)
|
||||
.to be_success
|
||||
|
||||
# receives the provided start/due date
|
||||
# receives the provided start/finish date
|
||||
expect(work_package.start_date)
|
||||
.to eql(attributes[:start_date])
|
||||
expect(work_package.due_date)
|
||||
.to eql(attributes[:due_date])
|
||||
|
||||
# receives the min/max of the children's start/due date
|
||||
# receives the min/max of the children's start/finish date
|
||||
[parent_work_package,
|
||||
grandparent_work_package].each do |wp|
|
||||
wp.reload
|
||||
@@ -651,7 +651,7 @@ describe WorkPackages::UpdateService, 'integration tests', type: :model do
|
||||
due_date: Date.today + 10.days }
|
||||
end
|
||||
|
||||
it 'propagates the changes to start/due date along' do
|
||||
it 'propagates the changes to start/finish date along' do
|
||||
expect(subject)
|
||||
.to be_success
|
||||
|
||||
@@ -821,7 +821,7 @@ describe WorkPackages::UpdateService, 'integration tests', type: :model do
|
||||
due_date: Date.today }
|
||||
end
|
||||
|
||||
it 'propagates the changes to start/due date along' do
|
||||
it 'propagates the changes to start/finish date along' do
|
||||
expect(subject)
|
||||
.to be_success
|
||||
|
||||
|
||||
@@ -1027,7 +1027,7 @@ describe Project, type: :model do
|
||||
assert_nil @project.due_date
|
||||
end
|
||||
|
||||
it "should be the latest due date of it's issues" do
|
||||
it "should be the latest finish date of it's issues" do
|
||||
future = 7.days.from_now.to_date
|
||||
FactoryBot.create(:work_package, project: @project, due_date: future)
|
||||
FactoryBot.create(:work_package, project: @project, due_date: Date.today)
|
||||
@@ -1035,7 +1035,7 @@ describe Project, type: :model do
|
||||
assert_equal future, @project.due_date
|
||||
end
|
||||
|
||||
it "should be the latest due date of it's versions" do
|
||||
it "should be the latest finish date of it's versions" do
|
||||
future = 7.days.from_now.to_date
|
||||
@project.versions << FactoryBot.create(:version, effective_date: future)
|
||||
@project.versions << FactoryBot.create(:version, effective_date: Date.today)
|
||||
|
||||
Reference in New Issue
Block a user