Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat(ui) : Add changelogs for license pages #2084

Merged
merged 1 commit into from
Aug 23, 2023

Conversation

KoukiHama
Copy link
Member

@KoukiHama KoukiHama commented Aug 10, 2023

Please provide a summary of your changes here.

  • Which issue is this pull request belonging to and how is it solving it? (Refer to issue here)
  • Did you add or update any new dependencies that are required for your change?

Issue: #2008

Suggest Reviewer

You can suggest reviewers here with an @ag4ums

How To Test?

  • GUI

    • License detail page

      1. Create license.
      2. Open detail page of the created license.
      3. Confirm that "Change Log" menu has been added.
    • License detail page -Changelog list

      1. Set values for each attribute of License and link Obligation.
      2. Select "Change Log" menu.
      3. Confirm that two types of Changelogs, License and Obligation, have been added to the Changelog list.
    • License detail page -License difference page

      1. Add/update/delete License.
        (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.)
      2. Select "Change Log" menu, and click the Actions icon.
      3. Confirm that "license" is displayed in Document Type of Basic Info.
      4. Confirm that "CREATE", "UPDATE", or "DELETE" is displayed in Operation of Basic Info according to the operation.
      5. Confirm that the difference of the updated attributes are displayed for each Field Name.
        Also, check the following.
        • That the shortname is not displayed.
        • The difference of licensetype is only "licenseType".
    • License detail page -LicenseObligationList difference page

      1. Add, update (edit Obligation), and delete License linked to Obligation
      2. Select "Change Log" menu, and click the Actions icon.
      3. Confirm that "licenseObligationList" is displayed in Document Type of Basic Info.
      4. Confirm that "LICENSE_CREATE", "LICENSE_UPDATE", or "LICENSE_DELETE" is displayed in Info of Basic Info according to the license operation.
      5. Confirm that the Obligation difference is displayed in "linkedObligations".
        Also, check the following.
        • Only the difference of "text", "title", "obligationLevel", and "obligationaType" is displayed.
  • Rest API

    • Get Changelog by Document Id
      1. Add a new License linked to Obligation.
      2. Execute the ChangeLog GET API using the Changelog Document Id of the registered License and LicenseObligationList.
      3. Confirm that Changelog information of License and LicenseObligationList can be obtained by each Document Id.

The outline of changes

  • The change of frontend(GUI)
    • License detail page
      Add "Change Log" to menu.

image

Select the "Change Log" menu, and display Changelog list.  
Output License's Changelogs and Obligation's Changelogs seperately.  
- License : Attribute Changes  
- Obligation : Reference Doc Changes : licenseObligationList

image

Click the Actions icon in the Changelog list, and display the License difference page.  

image

The difference of License's "LicenseType" displays only information that the user sees on the GUI among the LicenseType information.

image

Obligations linked to License are output separately as "licenseObligationList".  
Display only the information that the user sees on the GUI among Obligation information.

image

  • The change of frontend(Internal specifications)

    • Add "Change Log" to menu
      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.
    • Display Changelog data
      Return the data to display on the ChangeLog page by serveResource() of LicensesPortlet.java.
  • The change of data class

    • Add "LicenseObligationList" data class to licenses.thrift.
      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.
      struct LicenseObligationList {
        1: optional string id,
        2: optional string revision,
        3: optional string type = "licenseObligationList",
        4: required string licenseId,
        5: optional map<string, Obligation> linkedObligations
      }
      
    • Add obligationListId member to License.
      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.

        1. updateLicense()
          Execute unsetShortname() as when adding a license, and the shortname is not registered in the database.
        2. addObligationsToLicense()
          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:

  • All related issues are referenced in commit messages and in PR

@KoukiHama KoukiHama requested a review from ag4ums August 10, 2023 04:23
@KoukiHama KoukiHama added needs code review needs general test This is general testing, meaning that there is no org specific issue to check for WIP work in progress and removed needs code review needs general test This is general testing, meaning that there is no org specific issue to check for labels Aug 10, 2023
@KoukiHama KoukiHama closed this Aug 10, 2023
@KoukiHama KoukiHama reopened this Aug 17, 2023
@KoukiHama KoukiHama added needs code review needs general test This is general testing, meaning that there is no org specific issue to check for and removed WIP work in progress labels Aug 18, 2023
@KoukiHama KoukiHama requested review from ag4ums and removed request for ag4ums August 18, 2023 03:03
@KoukiHama KoukiHama self-assigned this Aug 18, 2023
@ag4ums ag4ums self-assigned this Aug 18, 2023
Copy link
Contributor

@ag4ums ag4ums left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Working as expected

@KoukiHama KoukiHama removed the needs general test This is general testing, meaning that there is no org specific issue to check for label Aug 23, 2023
@ag4ums ag4ums added ready ready to merge and removed needs code review labels Aug 23, 2023
@ag4ums ag4ums merged commit 4db4c6e into eclipse-sw360:main Aug 23, 2023
1 check passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
ready ready to merge
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants