stable

Clone or download

Read-only

Enforce default value for empty labels in backend

part of request #24994 : Javascript error in Iterations planning How to test: - Go to a Program administration and erase custom labels for Iterations (set them to empty). - Go to the "Plan iterations" app - You should not see a console error complaining about the "length property of null". - You should see the default labels "Iterations" and "iteration" Notes: The frontend should not be responsible for defaulting the custom labels, it is more consistent to do it in the backend. We should never have allowed empty string values in labels database, they were supposed to be <null> when left empty. The assumption was that null values better express the different business case for "empty => default value" because we usually forget that strings variables can be empty. Dealing with both null values and empty strings is a burden. There are two paths we can take here: 1. forbid empty values and convert them to null 2. forbid null values and convert them to empty strings. I've chosen the first option because it does not require a forgeupgrade. IterationsDAO will return null labels instead of empty strings. NewIterationTrackerConfiguration will enforce null values for empty labels. Change-Id: Ia5900f296003aa4017daf350fc230ee4fa3e3c3f

Modified Files

Name
M plugins/program_management/include/Adapter/Program/Backlog/Iteration/IterationsDAO.php +13 −2 Go to diff View file
R plugins/program_management/include/Adapter/Program/DisplayPlanIterationsPresenter.php Go to diff View file
A plugins/program_management/include/Adapter/Program/IterationView/IterationLabelsPresenter.php +42 −0 Go to diff View file
M plugins/program_management/include/DisplayPlanIterationsController.php +1 −1 Go to diff View file
M plugins/program_management/include/Domain/Program/Plan/NewIterationTrackerConfiguration.php +5 −2 Go to diff View file
M plugins/program_management/scripts/planned-iterations/po/fr_FR.po +2 −7 Go to diff View file
M plugins/program_management/scripts/planned-iterations/src/components/Backlog/Iteration/PlannedIterationsSection.test.ts +8 −28 Go to diff View file
M plugins/program_management/scripts/planned-iterations/src/components/Backlog/Iteration/PlannedIterationsSection.vue +2 −14 Go to diff View file
R plugins/program_management/tests/unit/Adapter/Program/DisplayPlanIterationsPresenterTest.php Go to diff View file
A plugins/program_management/tests/unit/Adapter/Program/IterationView/IterationLabelsPresenterTest.php +58 −0 Go to diff View file
R plugins/program_management/tests/unit/Builder/IterationsLabelsBuilder.php Go to diff View file
M plugins/program_management/tests/unit/DisplayPlanIterationsControllerTest.php +1 −1 Go to diff View file
M plugins/program_management/tests/unit/Domain/Program/Plan/NewIterationTrackerConfigurationTest.php +10 −1 Go to diff View file