stable
Clone or download
How to test: - Enable the feature flag: $ tuleap config-set feature_flag_allow_reverse_links 1 - Make a PUT request to an existing artifact with the following payload: ``` { "values": [{ "field_id": 543, "all_links": [ {"id": 11, "direction": "reverse", "type": ""}, {"id": 12, "direction": "reverse", "type": "_is_child"} ] }] } ``` - you should get a return JSON like the following: ``` { "Reverse links": "Link from 11 with type ``, Link from 12 with type `_is_child`" } ``` - Links without "direction" key will be rejected with 400 Bad Request - Links without "type" key, with "type" null or not string will be rejected with 400 Bad Request Notes: I wondered whether to allow omitting "type" key or to allow "type" = null. Relaxing constraints is not a breaking change, whereas making them stricter is, so let's be as strict as possible now and we can think about relaxing later. part of story #24970 [modal] select type for links Change-Id: Ic90317306fd1d827d60eb5a335d48612cab3189f
Modified Files
Name | ||||
---|---|---|---|---|
M | plugins/tracker/include/REST/Artifact/ChangesetValue/ArtifactLink/AllLinkPayloadParser.php | +3 | −3 | Go to diff View file |
M | plugins/tracker/include/REST/Artifact/ChangesetValue/ArtifactLink/NewArtifactLinkChangesetValueBuilder.php | +21 | −26 | Go to diff View file |
M | plugins/tracker/include/REST/Artifact/ChangesetValue/ArtifactLink/RESTReverseLinkProxy.php | +18 | −17 | Go to diff View file |
M | plugins/tracker/include/REST/Artifact/ChangesetValue/FieldsDataBuilder.php | +1 | −1 | Go to diff View file |
M | plugins/tracker/include/REST/Artifact/PUTHandler.php | +7 | −2 | Go to diff View file |
M | plugins/tracker/include/REST/v1/ArtifactValuesRepresentation.class.php | +3 | −6 | Go to diff View file |
M | plugins/tracker/include/REST/v1/ArtifactsResource.class.php | +1 | −0 | Go to diff View file |
R | plugins/tracker/include/REST/v1/LinkToUpdateRepresentation.php | Go to diff View file | ||
M | plugins/tracker/include/Tracker/Artifact/ChangesetValue/ArtifactLink/ReverseLink.php | +6 | −0 | Go to diff View file |
A | plugins/tracker/tests/unit/Builders/LinkWithDirectionRepresentationBuilder.php | +65 | −0 | Go to diff View file |
M | plugins/tracker/tests/unit/REST/Artifact/ChangesetValue/ArtifactLink/AllLinkPayloadParserTest.php | +4 | −3 | Go to diff View file |
M | plugins/tracker/tests/unit/REST/Artifact/ChangesetValue/ArtifactLink/NewArtifactLinkChangesetValueBuilderTest.php | +35 | −54 | Go to diff View file |
M | plugins/tracker/tests/unit/REST/Artifact/ChangesetValue/ArtifactLink/RESTReverseLinkProxyTest.php | +13 | −24 | Go to diff View file |
M | plugins/tracker/tests/unit/Stub/ReverseLinkStub.php | +13 | −3 | Go to diff View file |
M | plugins/tracker/tests/unit/Tracker/Artifact/ChangesetValue/ArtifactLink/NewArtifactLinkChangesetValueTest.php | +1 | −1 | Go to diff View file |
M | plugins/tracker/tests/unit/Tracker/Artifact/ChangesetValue/ChangesetValuesContainerTest.php | +2 | −2 | Go to diff View file |