stable

Clone or download

Read-only

fix: Warn user when artifacts deletion is blocked in tracker admin

Implements request #38642 Warn user when artifacts deletion is blocked in tracker admin How to test: - As site admin, set the artifacts deletion limit to 0 - As a tracker admin, go to the tracker admin > artifacts deletion --> An error message says "Artifacts deletion is disabled" --> The form is disabled - As site admin, set the limit to 1 - As tracker admin, go back to the deletion UI --> Assuming you did not delete any artifacts yet, the form should not be disabled --> Only a warning "This operation should be an exception" is displayed - Enter the id of an artifact which does NOT belong to the current tracker --> Feedback error - Enter the id of an artifact belonging to the tracker and submit --> You are being asked to confirm the action - Confirm --> Success, you are redirected to the tracker fields admin - Go back to the artifacts deletion UI --> An error message says "Limit exceeded". --> The form is disabled - As a project member, go to the artifacts deletion UI --> Not found error Change-Id: Id2865cc7d0cb483b6befff6ade055f650c2db829

Modified Files

Name
A plugins/tracker/include/Tracker/Admin/ArtifactsDeletion/ArtifactsConfirmDeletionInTrackerAdminUrlBuilder.php +54 −0 Go to diff View file
A plugins/tracker/include/Tracker/Admin/ArtifactsDeletion/ArtifactsDeletionInTrackerAdminController.php +72 −0 Go to diff View file
A plugins/tracker/include/Tracker/Admin/ArtifactsDeletion/ArtifactsDeletionInTrackerAdminPresenter.php +57 −0 Go to diff View file
A plugins/tracker/include/Tracker/Admin/ArtifactsDeletion/ArtifactsDeletionInTrackerAdminUrlBuilder.php +33 −0 Go to diff View file
M plugins/tracker/include/Tracker/Admin/HeaderPresenter.php +12 −31 Go to diff View file
M plugins/tracker/include/Tracker/Tracker.class.php +4 −26 Go to diff View file
M plugins/tracker/include/trackerPlugin.php +15 −0 Go to diff View file
M plugins/tracker/site-content/fr_FR/LC_MESSAGES/tuleap-tracker.po +31 −12 Go to diff View file
M plugins/tracker/site-content/pt_BR/LC_MESSAGES/tuleap-tracker.po +21 −6 Go to diff View file
M plugins/tracker/templates/admin-header-bp.mustache +1 −1 Go to diff View file
M plugins/tracker/templates/admin-header.mustache +1 −1 Go to diff View file
A plugins/tracker/templates/admin/admin-artifacts-deletion.mustache +54 −0 Go to diff View file
M plugins/tracker/templates/siteadmin-config/artifacts-deletion.mustache +1 −1 Go to diff View file
A plugins/tracker/tests/unit/Tracker/Admin/ArtifactDeletion/ArtifactsConfirmDeletionInTrackerAdminUrlBuilderTest.php +36 −0 Go to diff View file
A plugins/tracker/tests/unit/Tracker/Admin/ArtifactDeletion/ArtifactsDeletionInTrackerAdminControllerTest.php +129 −0 Go to diff View file
A plugins/tracker/tests/unit/Tracker/Admin/ArtifactDeletion/ArtifactsDeletionInTrackerAdminPresenterTest.php +89 −0 Go to diff View file
A plugins/tracker/tests/unit/Tracker/Admin/ArtifactDeletion/ArtifactsDeletionInTrackerAdminUrlBuilderTest.php +40 −0 Go to diff View file