Uploaded image for project: 'ui-users'
  1. ui-users
  2. UIU-977

renewal failure messages are not internationalized

    XMLWordPrintable

Details

    • Volaris

    Description

      Overview:

      Renewal failure messages are not internationalized in src/withRenew.js::getMessage(). It may be necessary to update src/components/Loans/OpenLoans/helpers/isOverridePossible/overridePossibleMessages.js as well.

      Steps to Reproduce:

      1. Log into Snapshot
      2. Check out Item 1 to Patron 1
      3. In settings, modify the loan policy for the created loan to have a Number of Renewals Allowed of 1 
      4. Navigate to the Users app and open the record for Patron 1, and open the patron's open loans
      5. Select the newly created loan and renew the item twice

       

      Expected Results:

      When the second renewal is attempted an error popup is shown and the backend sends a 422 HTTP status code with JSON including the "code" property:

      {
        "errors" : [ {
          "code" : "[CODE HERE]"
          "message" : "loan at maximum renewal number",
          "parameters" : [ {
            "key" : "loanPolicyName",
            "value" : "Example Loan Policy"
          }, {
            "key" : "loanPolicyId",
            "value" : "d9cd0bed-1b49-4b5e-a7bd-064b8d177231"
          } ],
          "overridableBlock" : {
            "name" : "renewalBlock",
            "missingPermissions" : [ ]
          }
        } ]
      }

      Actual Results:

      The "code" property defined in the error.schema is missing:
      https://github.com/folio-org/raml/blob/raml1.0/schemas/error.schema

      {
        "errors" : [ {
          "message" : "loan at maximum renewal number",
          "parameters" : [ {
            "key" : "loanPolicyName",
            "value" : "Example Loan Policy"
          }, {
            "key" : "loanPolicyId",
            "value" : "d9cd0bed-1b49-4b5e-a7bd-064b8d177231"
          } ],
          "overridableBlock" : {
            "name" : "renewalBlock",
            "missingPermissions" : [ ]
          }
        } ]
      }

      Additional Information:

      • The code property is not included in any circulation/renew-by-barcode responses with a 422 status code. These other cases will likely need separate tickets created.  
      • I am not certain that there are existing error codes that should be included in these responses. 

      TestRail: Results

        Attachments

          Issue Links

            Activity

              People

                Unassigned Unassigned
                zburke Zak_Burke
                Votes:
                0 Vote for this issue
                Watchers:
                6 Start watching this issue

                Dates

                  Created:
                  Updated:

                  TestRail: Runs

                    TestRail: Cases