stable

Clone or download

Read-only

feat: error when artifact is already present in the doc

If a user tries to insert a new section based on an artifact that is already present in the document, we should prevent the addition. You can test by doing to subsequent same REST call: POST /api/artidoc/:id/sections {"artifact":{"id":123},"position":null} POST /api/artidoc/:id/sections {"artifact":{"id":123},"position":null} Took the opportunity to add missing REST tests on the corresponding route. Part of story #38288: add a new section Change-Id: I9b2175943c8bc146e2e04ccccac31e17071f4a64

Modified Files

Name
M plugins/artidoc/include/Artidoc/Document/ArtidocDao.php +19 −1 Go to diff View file
M plugins/artidoc/include/Artidoc/Document/SaveOneSection.php +7 −0 Go to diff View file
A plugins/artidoc/include/Artidoc/Document/Section/AlreadyExistingSectionWithSameArtifactException.php +27 −0 Go to diff View file
A plugins/artidoc/include/Artidoc/REST/v1/AlreadyExistingSectionWithSameArtifactFault.php +36 −0 Go to diff View file
M plugins/artidoc/include/Artidoc/REST/v1/ArtidocPOSTSectionRepresentation.php +4 −2 Go to diff View file
M plugins/artidoc/include/Artidoc/REST/v1/ArtidocResource.php +5 −1 Go to diff View file
M plugins/artidoc/include/Artidoc/REST/v1/POSTSectionHandler.php +4 −0 Go to diff View file
M plugins/artidoc/site-content/fr_FR/LC_MESSAGES/tuleap-artidoc.po +5 −0 Go to diff View file
M plugins/artidoc/tests/integration/Artidoc/Document/ArtidocDaoTest.php +37 −2 Go to diff View file
M plugins/artidoc/tests/rest/Artidoc/ArtidocTest.php +76 −4 Go to diff View file
M plugins/artidoc/tests/unit/Artidoc/REST/v1/POSTSectionHandlerTest.php +58 −0 Go to diff View file
M plugins/artidoc/tests/unit/Artidoc/Stubs/Document/SaveOneSectionStub.php +15 −1 Go to diff View file