10 Commits

Author SHA1 Message Date
Oliver Günther 32397da332 Drive-by relation fix 2025-04-25 10:33:20 +02:00
Christophe Bliard a0fdeceb1f Fix flaky unit test
Failing spec is ./spec/controllers/work_package_relations_controller_spec.rb:133
on job run https://github.com/opf/openproject/actions/runs/14646323170/job/41101314595

Reproduction command:

    rspec './spec/controllers/work_package_relations_controller_spec.rb[1:4:1,1:5:2]' --seed 37278

The `relation` instance is destroyed in a test, and reloaded for the
next test as we are using `shared_let`. But when reloading a destroyed
record, it remains destroyed. When updating it, it tries to save it
again, including the related work packages but they already exist in
database. This leads to the error "ActiveRecord::RecordInvalid:
Validation failed: Related work package has already been taken.".

To fix this, we use `refind: true` to reload the relation using a
database `find`.
2025-04-25 07:48:17 +02:00
Christophe Bliard cd7403932b [63521] Do nothing if relation to delete does not exist anymore
https://community.openproject.org/wp/63521

No need to delete something that does not exist anymore. This can happen
when the same relation is deleted in two different browser tabs.
2025-04-17 12:20:45 +02:00
Christophe Bliard 8937978432 refactor: introduce relations mediator
The mediator is responsible for providing the relations and children
from a work package for the relations tab. This moves the responsibility
of relations and children visibility in one central place.
2025-01-15 16:03:11 +01:00
ulferts 6486a34c47 improve expressiveness of scrolling to functionality 2025-01-10 08:28:44 +01:00
Behrokh Satarnejad 74abdc80f2 fix failing feature test 2024-12-10 18:03:46 +01:00
Behrokh Satarnejad 87755749ff fix failing test 2024-12-05 14:12:56 +01:00
Aaron Contreras bdad2afe8c Split Child vs Relation and Create vs Edit 2024-11-13 06:47:46 -05:00
Aaron Contreras 2d3d566720 Allow creating new relations from relations tab
* Create `new` controller action and tests to render modal with form.

* Render new relation form with tests.

* Plug in create service and form fields required for creating
  a relation with tests.

* Make description settable with tests.
2024-11-13 06:47:46 -05:00
Aaron Contreras b9e17bd46a Add spec for WorkPackageRelationsController 2024-11-13 06:47:46 -05:00