stable

Clone or download

Read-only

Retrieve reverse links from DB

Part of story #24970 [modal] select type for links How to test: - Enable the feature flag: $ tuleap config-set feature_flag_allow_reverse_links 1 - Make a PUT request to an existing artifact (e.g 120) with the following payload: ``` { "values": [{ "field_id": 543, "all_links": [ {"id": 11, "direction": "reverse", "type": ""}, {"id": 11, "direction": "reverse", "type": "_is_child"} ] }] } ``` - you should get a return JSON like the following: ``` { "Reverse link stored from artifact 120 ": "Link from 18 with type ``", "Reverse links": "Link from 11 with type ``, Link from 12 with type `_is_child`" } ``` 18 = the ID of the reversed link artifact Change-Id: Ifb0d10b8670304e0ab8a431731fd8757d37de372

Modified Files

Name
M plugins/tracker/include/REST/Artifact/PUTHandler.php +9 −3 Go to diff View file
M plugins/tracker/include/REST/v1/ArtifactsResource.class.php +8 −1 Go to diff View file
A plugins/tracker/include/Tracker/Artifact/ChangesetValue/ArtifactLink/RetrieveReverseLinks.php +33 −0 Go to diff View file
A plugins/tracker/include/Tracker/Artifact/ChangesetValue/ArtifactLink/ReverseLinksDao.php +48 −0 Go to diff View file
A plugins/tracker/include/Tracker/Artifact/ChangesetValue/ArtifactLink/ReverseLinksRetriever.php +48 −0 Go to diff View file
A plugins/tracker/include/Tracker/Artifact/ChangesetValue/ArtifactLink/SearchReverseLinks.php +31 −0 Go to diff View file
A plugins/tracker/include/Tracker/Artifact/ChangesetValue/ArtifactLink/StoredLinkRow.php +46 −0 Go to diff View file
A plugins/tracker/include/Tracker/Artifact/ChangesetValue/ArtifactLink/StoredReverseLink.php +55 −0 Go to diff View file
M plugins/tracker/tests/unit/REST/Artifact/PUTHandlerTest.php +4 −1 Go to diff View file
A plugins/tracker/tests/unit/Stub/ArtifactUserCanViewStub.php +51 −0 Go to diff View file
A plugins/tracker/tests/unit/Stub/RetrieveReverseLinksStub.php +46 −0 Go to diff View file
A plugins/tracker/tests/unit/Stub/SearchReverseLinksStub.php +54 −0 Go to diff View file
A plugins/tracker/tests/unit/Tracker/Artifact/ChangesetValue/ArtifactLink/ReverseLinksRetrieverTest.php +64 −0 Go to diff View file
A plugins/tracker/tests/unit/Tracker/Artifact/ChangesetValue/ArtifactLink/StoredReverseLinkTest.php +69 −0 Go to diff View file