stable

Clone or download

Read-only

Group commit references by section

Functional changes ================== Make sure that an artifact is referenced by (or is referencing) two or more git commits, in different repositories. On the cross reference field, the list of commits are grouped by sections with the title of the section being the path of the repository. Implementation details ====================== Previous implementation of cross references display in trackers was based on the legacy way that merely didn't change for a decade. Now that we want to display cross references in a structured manner, our objects naming must map for what they are used. So the proposal here is to have the following architecture: ``` +--------+ | Nature | |--------| | Label | | Icon | +--------+ | | | n +---------+ | Section | |---------| | Label | +---------+ | | | n +----------------+ | CrossReference | |----------------| | title | | url | | delete_url | +----------------+ ``` …knowing that we are starting from a flat array of cross references. So we need to ask to all "owners" to organize their own cross references into sections/nature. For now, only git plugin is involved, but in next commits tracker, pullrequest will join the party. In order to not be biaised by the existing goofy structure brought by CrossReferenceFactory (which are doing sql calls directly, and are providing unwanted semi-organized cross references collection), we are starting from the ground up. Therefore this reorganization produces a huge changeset. I tried to split the commit, but didn't find a way to produce something small AND understandable without losing my mind :/ For my defense, it should be noted that nearly two thirds of the added lines in this changeset are unit tests :) --- Part of story #17180 take into account gitlab commits Change-Id: Ibdab459f5a3ca5e8e22a427687ff2f2ad4c74d4b

Modified Files

Name
A plugins/git/include/Git/Reference/CrossReferenceGitOrganizer.php +65 βˆ’0 Go to diff View file
M plugins/git/include/Git/ReferenceManager.class.php +18 βˆ’9 Go to diff View file
M plugins/git/include/gitPlugin.php +17 βˆ’1 Go to diff View file
A plugins/git/tests/unit/Git/Reference/CrossReferenceGitOrganizerTest.php +170 βˆ’0 Go to diff View file
M plugins/git/tests/unit/Git/ReferenceManagerTest.php +14 βˆ’0 Go to diff View file
M plugins/tracker/include/Tracker/FormElement/Field/CrossReference/CrossReferenceFieldRenderer.php +1 βˆ’12 Go to diff View file
M plugins/tracker/include/Tracker/FormElement/Tracker_FormElement_Field_CrossReferences.php +13 βˆ’6 Go to diff View file
D plugins/tracker/include/Tracker/FormElement/View/Reference/CrossReferenceByNaturePresenterBuilder.php +0 βˆ’63 Go to diff View file
M plugins/tracker/include/Tracker/FormElement/View/Reference/CrossReferenceFieldPresenter.php +10 βˆ’29 Go to diff View file
M plugins/tracker/include/Tracker/FormElement/View/Reference/CrossReferenceFieldPresenterBuilder.php +11 βˆ’30 Go to diff View file
D plugins/tracker/include/Tracker/FormElement/View/Reference/CrossReferenceLinkPresenter.php +0 βˆ’90 Go to diff View file
D plugins/tracker/include/Tracker/FormElement/View/Reference/CrossReferenceLinkPresenterCollectionBuilder.php +0 βˆ’60 Go to diff View file
M plugins/tracker/templates/form-element/reference/cross_reference.mustache +15 βˆ’13 Go to diff View file
M plugins/tracker/templates/form-element/reference/cross_reference_section.mustache +24 βˆ’22 Go to diff View file
D plugins/tracker/tests/unit/Tracker/FormElement/View/Reference/CrossReferenceByNaturePresenterBuilderTest.php +0 βˆ’169 Go to diff View file
M plugins/tracker/tests/unit/Tracker/FormElement/View/Reference/CrossReferenceFieldPresenterBuilderTest.php +29 βˆ’135 Go to diff View file
D plugins/tracker/tests/unit/Tracker/FormElement/View/Reference/CrossReferenceLinkPresenterCollectionBuilderTest.php +0 βˆ’150 Go to diff View file
R plugins/tracker/include/Tracker/FormElement/View/Reference/CrossReferenceByNaturePresenter.php Go to diff View file
A src/common/Reference/CrossReferenceByDirectionPresenterBuilder.php +82 βˆ’0 Go to diff View file
A src/common/Reference/CrossReferenceByNatureOrganizer.php +157 βˆ’0 Go to diff View file
A src/common/Reference/CrossReferenceNaturePresenter.php +80 βˆ’0 Go to diff View file
A src/common/Reference/CrossReferencePresenter.php +76 βˆ’0 Go to diff View file
A src/common/Reference/CrossReferencePresenterFactory.php +116 βˆ’0 Go to diff View file
R plugins/tracker/include/Tracker/FormElement/View/Reference/CrossReferenceLinkListPresenter.php Go to diff View file
A src/common/Reference/CrossReferencesDao.php +48 βˆ’0 Go to diff View file
D src/common/reference/CrossReferenceByDirectionCollection.php +0 βˆ’183 Go to diff View file
M src/common/reference/CrossReferenceFactory.class.php +0 βˆ’9 Go to diff View file
M src/themes/tlp/src/scss/components/_cards.scss +4 βˆ’0 Go to diff View file
A tests/unit/common/Reference/CrossReferenceByDirectionPresenterBuilderTest.php +104 βˆ’0 Go to diff View file
A tests/unit/common/Reference/CrossReferenceByNatureOrganizerTest.php +219 βˆ’0 Go to diff View file
A tests/unit/common/Reference/CrossReferenceNaturePresenterTest.php +47 βˆ’0 Go to diff View file
A tests/unit/common/Reference/CrossReferencePresenterFactoryTest.php +152 βˆ’0 Go to diff View file
A tests/unit/common/Reference/CrossReferenceSectionPresenterTest.php +46 βˆ’0 Go to diff View file