This is making the interface of BaseCallable more consistent.
Previously it was unclear, whether the params passed to perform
should be used to reference parameters or whether the attribute accessor
should be used. Different code used different approaches.
To apply this change more consistently, BaseContracted also removed
params from the methods called inside its own perform method, e.g.
before_perform or after_validate.
At a later point we might consider removing this argument from other large
inheritors as well, for example `BaseServices::SetAttributes#set_attributes`.
When a work package no longer have any predecessors (direct or indirect)
nor children, then it must switch to manual scheduling mode to keep its
dates.
This is now handled directly by the `WorkPackages::SetScheduleService`.
This simplifies the logic of `Relations::DeleteService` which no longer
has to switch a successor to manual by itself. It's all handled in the
ScheduleService.
When there are multiple predecessors for one work package, and one of
them is deleted, the successor must be rescheduled.
Common rescheduling code with `CreateService` and `UpdateService` has
been moved to `Relations::Concerns::Rescheduling` module.
When a work package becomes a successor of another work package, its
scheduling mode is switched to automatic if it has no children so that
it can be scheduled as soon as possible automatically.
Similarly, when a work package is no longer a successor of any other
work package, its scheduling mode is switched to manual if it has no
children and no dates so that it can keep its current dates.
When calling a service with `send_notifications: false`, the
`Journal::NotificationConfiguration.active?` will be set to `false` and
subsequent calls to set it to `true` will have no effect and log a
warning.
For this reason, it's better to use `nil` as default value for
`send_notifications` so that
`Journal::NotificationConfiguration.active?` is changed only when the
value is explicitly `true` or `false`, and ignored when the value is
`nil`.
* Create copy project endpoint
* Add representers
* Add _meta representer for copy module information
* Add Meta payload representer
* Extract parsing of copy attributes into service
* Extract enqueue job for projects copy
* Keep request object available in the bodied endpoint
this allows us to access grape (e.g., for redirecting)
* Add DelayedModify endpoint that redirects to job status
* Use DelayedModify endpoint for copying projects
* Add api paths for form/copy
* Disable cache on ProjectCopyPayload
* Add spec
* Add resource spec
* Extend schema for meta
* Extend docs
* Don't pass service result, but state as meta to forms
* Use copy dependencies for naming copy options in API
* Add description property for counting
* Remove unused action attribute
* Skip writable checks on meta property for payloads
* Use prepend to allow create(...) usage with meta
* Extend copy spec with custom fields usage
* Add spec for copy flags
* Add todos
* Pass errors correctly to copy settings
* Remove invalid parameters to copy that are now caught through project service
* Remove duplicated validation
* Linting
* Make count a human readable, formattable description string
* Make source count string readable
* Provide the source project for generating the counts
* Extract copying of attachments into sepearate dependent services
This will allow the API to dynamically generate a copy association schema from each dependent service
* Add spec for copy schema representer
* Add payload representer spec
* Also validate the model to pass the validations when copying
* Make description optional and add note to schemas.apib
* Add send_notifications to representer
* Allow to configure sendNotifications
* Allow bodied to receive a state process callback
That allows us to manage the meta state on the API level, not on the service level
* Make other services compatible with BaseCallable
* Fix params passing from BaseCallable
Wrapping a single hash into kwargs obviously loses their key indifference
and we can't expect all services to use a single params object. Older services use kwargs
* Copy wiki page with parent_id
This will save some memory instead of memoizing the entire wiki page
* Fix typo
* Default to true for all copy associations
That means if only a true value is passed, all other options will still be true
* Do not try to copy attachments if the base dependency wasnt copied
* Ensure null identifier gets rendered
* Fix paths to the form and commit
* Change redirect to an URL
* Extend documentation on meta properties as table
* Ensure we pass a default params if incoming params are nil
Now that SetAttributes needs to splat params, they do no longer
correctly get the no-param-default behavior of Ruby, so we need to
explictly assign a default params hash
* Fix expect for trailing path
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
- Lookup existing relation with ID and relation_type not nil (some
relation column > 0)
If you access in this order:
- Get `relation.attributes` -> relation_type is nil
- Get `relation.relaton_type` -> nil always after that
If you access the other way around, everything's okay:
- Get `relation.relaton_type` -> expected value
- Get `relation.attributes` -> expecte dvalue
* bump reform and roar -> bumps representer
* adapt to changed validation interface
* disable initializer patch for now
* adapt to changed representable attr interface
* can no longer have private methods inside a representer
* private no longer possible for representer
* bump reform
* wip - restyle validation
* remove commented out patch
* apply injection as prescribed
* reactivate reform error symbols patch
* remove patch to Hash superfluous wit ruby 2.3
* remove outdated human_attribute_name patch
* whitespace fixes
* adapt filter name after removal of human_attribute_name patch
* adapt filter specs to no longer rely on human_attribute_name patch
* fix version filter name
* remove reliance on no longer existing human_attribute_name patch
* use correct key in journal formatter
* remove private from representer
* adapt to altered setter interface
* reenable i18n for error messages in contracts
* no private methods in representer
* defined model for contracts
* fix validaton
* instantiate correct Object
* define model for contract
* circumvent now existing render method on reform
* replace deprecated constant
* patch correct reform class - not the module - via prepend
* refactor too complex method
* replace deprations
* remove remnants of parentId
* prevent error symbols from existing twice
* adapt user representer to altered setter interface
* adapt watcher representer to altered setter interface
* remove now unnessary patch
* adapt setter to altered interface
* adapt spec
* fix custom field setters
* remove parentId from wp representer
As the parent is a wp resource, clients should use the parent link instead
* adapt spec to changed valid? interface
* remove parentId from wp schema
* replace references of parentId in frontend
* remove TODO
[ci skip]