stable

Clone or download

Read-only

Get Mapping without cardwall config

Part of story #13626 Drag and drop cards This is a technical change. No functional change expected. The column mappings JSON should be identical. Why this refactoring? > "Which field values are mapped to this column for this tracker in this milestone's cardwall ?" Before this refactoring, the only way to answer that question was to go through the Cardwall_OnTop_Config for the milestone's tracker, which always instanciates ALL columns and ALL their mappings. It can only give us all mappings of a tracker, we then must filter it to get the mappings for the column we care about. This refactoring lets us be much more fine-grained and get the values mapped to a single column. It will be heavily used to change the value of cards for the REST route to move a card between columns. We must check whether the user can update the mapped field and get the value_ids mapped to the given column. Without it, I would have to go through a long chain to get the mappings: column_id => Cardwall_Column => Milestone => Planning => Config => Mappings => Mapping With it, I can shorten this chain to: column_id => Cardwall_Column => Mapping Change-Id: Ifda562e7308f63e47b99e34fe5ae6126ba469f5e

Modified Files

Name
M plugins/cardwall/include/OnTop/ColumnDao.class.php +12 −0 Go to diff View file
M plugins/cardwall/include/OnTop/Config/ColumnFactory.class.php +11 −3 Go to diff View file
M plugins/cardwall/phpunit/OnTop/Config/ColumnFactoryTest.php +36 −9 Go to diff View file
M plugins/taskboard/include/Column/ColumnPresenter.php +9 −5 Go to diff View file
M plugins/taskboard/include/Column/ColumnPresenterCollectionRetriever.php +24 −21 Go to diff View file
R plugins/taskboard/include/Column/FieldValuesToColumnMapping/MappedFieldValueRetriever.php Go to diff View file
A plugins/taskboard/include/Column/FieldValuesToColumnMapping/EmptyMappedValues.php +34 −0 Go to diff View file
A plugins/taskboard/include/Column/FieldValuesToColumnMapping/Freestyle/FreestyleMappingDao.php +61 −0 Go to diff View file
A plugins/taskboard/include/Column/FieldValuesToColumnMapping/Freestyle/FreestyleMappingFactory.php +79 −0 Go to diff View file
M plugins/taskboard/include/Column/FieldValuesToColumnMapping/MappedFieldRetriever.php +27 −14 Go to diff View file
A plugins/taskboard/include/Column/FieldValuesToColumnMapping/MappedValues.php +45 −0 Go to diff View file
A plugins/taskboard/include/Column/FieldValuesToColumnMapping/MappedValuesInterface.php +29 −0 Go to diff View file
A plugins/taskboard/include/Column/FieldValuesToColumnMapping/MappedValuesRetriever.php +78 −0 Go to diff View file
M plugins/taskboard/include/Column/FieldValuesToColumnMapping/TrackerMappingPresenterBuilder.php +47 −39 Go to diff View file
M plugins/taskboard/include/REST/v1/CardRepresentationBuilder.php +4 −11 Go to diff View file
M plugins/taskboard/include/taskboardPlugin.php +1 −14 Go to diff View file
M plugins/taskboard/phpunit/Column/ColumnPresenterCollectionRetrieverTest.php +60 −46 Go to diff View file
A plugins/taskboard/phpunit/Column/ColumnPresenterTest.php +52 −0 Go to diff View file
R plugins/taskboard/phpunit/Column/FieldValuesToColumnMapping/MappedFieldValueRetrieverTest.php Go to diff View file
A plugins/taskboard/phpunit/Column/FieldValuesToColumnMapping/Freestyle/FreestyleMappingFactoryTest.php +163 −0 Go to diff View file
M plugins/taskboard/phpunit/Column/FieldValuesToColumnMapping/MappedFieldRetrieverTest.php +26 −43 Go to diff View file
A plugins/taskboard/phpunit/Column/FieldValuesToColumnMapping/MappedValuesRetrieverTest.php +151 −0 Go to diff View file
M plugins/taskboard/phpunit/Column/FieldValuesToColumnMapping/TrackerMappingPresenterBuilderTest.php +90 −70 Go to diff View file
M plugins/tracker/include/Tracker/FormElement/Tracker_FormElement_Field_List.class.php +2 −2 Go to diff View file