https://community.openproject.org/wp/63831
When bulk deleting work packages, successors of descendants are
rescheduled, because as they have one less predecessor, they may need to
be switched to manual scheduling mode.
Problem: if one of these successor to reschedule is also a child of the
deleted work package, then it cannot be rescheduled: it's deleted. When
trying to rescheduled and save it, the error
`ActiveRecord::StaleObjectError` is raised.
Solution: only reschedule successors that are not descendants of the
deleted work package.
From the deleted work package, its parent, its successors, and the
successors of its descendants are rescheduled and switched to manual
scheduling if appropriate.
The `schedule_manually` column is also non-nullable now.
This includes the following changes:
- Automatically scheduled parent dates are and `ignore_non_working_days`
attributes are now always derived from children's values, even if the
children are scheduled manually.
It's more natural. Without that, adding a child to a work package
would not change the parent's dates.
As a consequence, the parent can start on a non-working day if one of
its children is manually scheduled, ignores non-working days, and
starts on a non-working day. That's why the parent's
`ignore_non_working_days` attribute is now also derived from all its
children regardless of the scheduling mode.
If the parent is manually scheduled, its dates and it's ability to
ignore non-working days will still be defined independently from its
children.
- Fix tests broken by scheduling mode being manual by default.
The tests had to be adapted to explicitly set scheduling mode to
automatic for followers and parents, and sometimes even follower's
children. Without it, work packages would not be rescheduled
automatically.
- Replace schedule helpers with table helpers.
Schedule helpers helped well, but table helpers are more flexible and
support more column types.
- Add "days counting" and "scheduling mode" columns to table helpers.
"days counting" to set `ignore_non_working_days` attribute.
- "all days" value maps to `ignore_non_working_days: true`.
- "working days" value maps to `ignore_non_working_days: false`.
"scheduling mode" to set `schedule_manually` attribute.
- "manual" value maps to `schedule_manually: true`.
- "automatic" value maps to `schedule_manually: false`.
* Fix argument alignment since f08bea3467
The FactoryBot.* prefix has been removed in f08bea3467. Since then
rubocop complains about Layout/ArgumentAlignment. This commit fixes it.
* do not fix alignments for modules/*/spec yet
hoping to be under the limit of 65535 characters for reviewdog to report on rubocop errors
* aggregate journals on write - simple implementation
* remove references to aggregated journals on read
* rewrite existing journals to be aggregated
* remove aggregated journal reference
* only delete predecessor if it can be aggregated
* fix aggregation condition
* adapt specs
* remove aggregated journal functionality from production code
The code is still necessary in a migration for the time being
* adapt specs
* use polymorphic belongs_to for journal data
The association can then be employed for eager loading
* eager load for activity rendering
Updates the copyright to 2021 for all files that have a copyright. Files in our source code without the copyright header still do not receive one automatically. Additionally, backlisted files are also excluded.
Previously the copyright of chiliproject which references redmine stated a copyright of redmine up to and including 2017 which is not true for the code we have in here. Because of that I changed that to 2013
* rename costs, introduce budgets
* move files from costs to budgets
* rename cost_object to budget
* remove unused code
* move hook - should be turned into standard code in the long run
* move type attributes change over to budgets
* move patch to work_package proper
* move budget menu item up
* combine reporting, time and cost module
* remove rails based time_entries & reports code
* rename cost object filter
* adapt menu spec expectations
* use cost project module name in administration
* include timeline labels in migration
* properly place budget linking method
* fix permitted params
* remove outdated routing spec
* adapt budget request specs
* ensure order of descendent updates
* remove outdated specs
* fix checking for reporting to be enabled
* fix displaying spent units
* fix time entries activity event url
* reenable current rate tab
* fix path on budget page
* allow bulk editing of budgets only in one project scenario
* fix sanitizing reference in controller
* include module required for format_date
* fix reference to correct units from work package spent units
* linting
* remove outdated spec
* remove outdated views and permission references
* remove acts_as_event from time_entries
There is no atom link for time entries
* remove acts_as_event from projects
There are no atom links for projects
* introduce budget filter for cost reports
* remove actions added to removed controller
* move time entries to the costs module
* factor in view_own permission when calculating time entry visibility
* linting
* move mounting of time entries
* include budgets into api v3 documentation
* basic members collection response
* complete member index end point
* document versions#index
* remove user association from members
There is already a more generic principals association. Having both causes confusion and leads to duplicate loading of models
* linting
* remove disabled test
* add members#show api end point
* add project and principal to member representer
* replace member.user reference with principal
* use principal reference in project members association
* modernize roles api
* complete member representer rendering
* replace remnants of user association
* add member schema api endpoint
* have dedicated available projects end point for versions
* linting
* limit roles to assignable ones in schema
* rename member to membership in api
* remove remnants of user in member
* spec fixes
* use available_projects endpoint in versions board
* add eager loading to memberships#index
* members create form api endpoint
* ensure role exists for default assignment
* extract switch for users/groups to work_packages representer
* document membership create form
* add l10n expected in specs
* strengthen the usage of a delete base service
* use base class for set attributes service
* fix alias in service
* add create endpoint to members api
* document members create endpoint
* linting
* adapt to altered service signature
* use default endpoint for wp#get
* use CF infused representer
[ci skip]