feat(ui) : Add changelogs for license pages #2084
Merged
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Issue: #2008
Suggest Reviewer
How To Test?
GUI
License detail page
License detail page -Changelog list
License detail page -License difference page
(As an existing problem, if "Is checked" is switched when to update the license, an update error will occur. Therefore "Is checked" will not be edited.)
Also, check the following.
License detail page -LicenseObligationList difference page
Also, check the following.
Rest API
The outline of changes
Add "Change Log" to menu.
The change of frontend(Internal specifications)
Set LicenseID to docid from request scope.
Add Changelog menu to detailOverview.jspf of License.
The Changelog page transitions to elementView.jsp which is the common processing of Changelog.
Return the data to display on the ChangeLog page by serveResource() of LicensesPortlet.java.
The change of data class
This has License Obligation information in Map format (linkedObligations), and output it to Changelog as Obligation difference.
(Refer to existing Project's Obligation data structure.)
License already has "obligations" as Obligation information, but when outputting the difference in Changelog, the difference cannot be displayed due to a problem with the data format.
To solve this problem, this data class was added for Changelog.
This has the LicenseObligationList id above.
The change of backend
LicenseObligationList's Repository class
Add LicenseObligationListRepository.java, and perform database operations on LicenseObligationList.
Existing license addition/update process
Create License/LicenseObligationList object for Changelog.
After LicenseDatabaseHandler's License addition/update processing, perform database registration of LicenseObligationList and registration process for each Changelog.
About existing addition/update process of license's shortname
Since unsetShortname() is executed when registering the License in the database, the shortname is not registered in the database when adding a new license.
However, when updating, the update process is executed twice by the method below.
Execute unsetShortname() as when adding a license, and the shortname is not registered in the database.
Process for adding obligation information to license.
Shortname is registered in the database without executing unsetShortname().
*This method is executed even if Obligation link is not operated.
As mentioned above, shortname might or might not be registered in the database, so there was a problem that the shortname was output as a difference.
Since shortname cannot be edited, it is a policy not to output it as a difference.
Existing license delete process
After deleting the License, register the Changelog for deletion.
If the deleted License has Obligations, delete the LicenseObligationList and register the Changelog.
JSON serialization
Add properties to DatabaseMixInForChangeLog's ObligationMixin.
(Add properties that are excluded from output in Obligation's Changelog.)
Add LicenseTypeMixin to DatabaseMixInForChangeLog.
(Add properties that are excluded from output in LicenseType's Changelog.)
Checklist
Must: