stable

Clone or download

Read-only

feat: Allow configuration of artidoc

User can use REST API to configure the tracker of a document. This will be used later to create a new section. PUT artidoc/:id/configuration { selected_tracker_ids: [<tracker-id>] } One and only one tracker id is accepted for now: * We don't know yet if we want to allow to select "No tracker" for a document * In the future we might have more than one type of section (I could create a document with both Story and Bugs tracker) To anticipate the breaking change, we accept an array of tracker ids, but limited to 1 element. If the given tracker is not found, deleted, or not viewable by current user, then a 403 is raised. The document item must exist, and user must have write access. The selected tracker is given to the app mount point as data attribute. You can view source to see the result. part of story #38288: add a new section Change-Id: I48c97e8c96e6924fb2878b5762b9d1e636914fa2

Modified Files

Name
M plugins/artidoc/db/install.sql +7 −0 Go to diff View file
A plugins/artidoc/db/mysql/2024/202406061010_add_artidoc_document_tracker_table.php +44 −0 Go to diff View file
M plugins/artidoc/db/uninstall.sql +1 −0 Go to diff View file
M plugins/artidoc/include/Artidoc/ArtidocController.php +13 −5 Go to diff View file
A plugins/artidoc/include/Artidoc/ArtidocPresenter.php +34 −0 Go to diff View file
M plugins/artidoc/include/Artidoc/Document/ArtidocDao.php +35 −1 Go to diff View file
A plugins/artidoc/include/Artidoc/Document/ConfiguredTrackerRetriever.php +58 −0 Go to diff View file
A plugins/artidoc/include/Artidoc/Document/SaveConfiguredTracker.php +26 −0 Go to diff View file
A plugins/artidoc/include/Artidoc/Document/SearchConfiguredTracker.php +26 −0 Go to diff View file
A plugins/artidoc/include/Artidoc/REST/v1/ArtidocPUTConfigurationRepresentation.php +40 −0 Go to diff View file
M plugins/artidoc/include/Artidoc/REST/v1/ArtidocResource.php +74 −0 Go to diff View file
A plugins/artidoc/include/Artidoc/REST/v1/PUTConfigurationHandler.php +95 −0 Go to diff View file
A plugins/artidoc/include/Artidoc/REST/v1/TrackerNotFoundFault.php +36 −0 Go to diff View file
A plugins/artidoc/include/Artidoc/REST/v1/UserCannotWriteDocumentFault.php +36 −0 Go to diff View file
M plugins/artidoc/include/Artidoc/artidoc.mustache +1 −0 Go to diff View file
M plugins/artidoc/include/artidocPlugin.php +11 −2 Go to diff View file
M plugins/artidoc/site-content/fr_FR/LC_MESSAGES/tuleap-artidoc.po +6 −0 Go to diff View file
M plugins/artidoc/tests/integration/Artidoc/Document/ArtidocDaoTest.php +16 −0 Go to diff View file
M plugins/artidoc/tests/rest/Artidoc/ArtidocTest.php +33 −0 Go to diff View file
A plugins/artidoc/tests/unit/Artidoc/Document/ConfiguredTrackerRetrieverTest.php +98 −0 Go to diff View file
A plugins/artidoc/tests/unit/Artidoc/REST/v1/PUTConfigurationHandlerTest.php +242 −0 Go to diff View file
A plugins/artidoc/tests/unit/Artidoc/Stubs/Document/SaveConfiguredTrackerStub.php +57 −0 Go to diff View file
A plugins/artidoc/tests/unit/Artidoc/Stubs/Document/SearchConfiguredTrackerStub.php +47 −0 Go to diff View file
M plugins/tracker/tests/unit/Builders/TrackerTestBuilder.php +15 −0 Go to diff View file