Details

    • Type: Bug Fix Bug Fix
    • Status: Closed Closed
    • Priority: Critical Critical
    • Resolution: Fixed
    • Affects Version/s: 0.9.2, KNS - 0.9.2
    • Fix Version/s: 0.9.3-kra, KRA Release 1.0, 0.9.3
    • Component/s: Development
    • Labels:
      None
    • Environment:
      kra-reg
    • Similar issues:
      KULRICE-7521Notes and Attachments: Attachment Type Codes Rice 2.x Bug
      KULRICE-2343deleting attachments doesn't work (was: Notes and attachments deletion doesn't work on maintenance documents)
      KULRICE-891Refactor annotations/notes/attachments
      KULRICE-10011Cannot download note attachments on documents
      KULRICE-4335port iu bug-fixes for 0.9.1.4 to rice 1.0.2.1
      KULRICE-9092Bug is RoleDaoOjb
      KULRICE-7280After downloading an attachment, exception is thrown on any action
      KULRICE-10166Adding an attachment or note to a people flow maintenance doc doesn't add the attachment
      KULRICE-1881can't associate attachments with notes
      KULRICE-7646On BO notes, the attachment can not be opened.
    • Rice Module:
      KNS
    • Application Requirement:
      KC

      Description

      Our KRA testing has uncovered a few things that look like bugs with the KNS Notes & Attachments feature:

      1. 'Note topic' is required, but user can add with empty 'note topic' - looks like it has an '*' in the title, but isn't required

      2. When note text has error, the 'red' box is missing to indicate that it is an error field.

        Issue Links

          Activity

          Hide
          Chi-Thanh Dang (Inactive) added a comment -

          There were three separate problems in this JIRA:
          1. Requirement field "Note Topic" was defined required in data dictionary and in GUI, but user was able to add note with empty "Note Topic"

          PROBLEM
          The attribute "displayTopicFieldInNotes" was defined in both data dictionary and notes.tag file. This allowed the "Note Topic" to be dynamically displayed. Since the validation of this field was done based on the data dictionary of a document. That means this attribute must be declared in the xml dictionary of a document.

          SOLUTION:
          Unless the implementing logic of this attribute is required to change, the solution for this is documenting that a data dictionary of a document must include the following line:
          <displayTopicFieldInNotes>true</displayTopicFieldInNotes>

          2. When there was error thrown, such as empty "Note Topic" or "Note Text", the GUI failed to redraw the GUI component with red color

          PROBLEM
          The errors returned from the validation were checked and displayed in two separate ways: "tabErrorKeys" for error messaging and checkErrors.tag for each htmlControlAttribute.tag
          a - Displaying error messages - When an error occurred, the error was registered to GlobalVariables by the following:
          GlobalVariables.getErrorMap().addToErrorPath(RiceConstants.NEW_DOCUMENT_NOTE_PROPERTY_NAME);
          This had no issue since the displaying error was defined by the following,
          tabErrorKey="$

          {Constants.NEW_DOCUMENT_NOTE_PROPERTY_NAME}

          *"

          b - Displaying html component in red color - This was an issue because the checking was done by checkErrors.tag using the defined htmlControlAttribute property,
          property="newNote.noteTopicText"
          and the error list from the GlobalVariables described in a. The error was never detected because NEW_DOCUMENT_NOTE_PROPERTY_NAME was defined as "newDocumentNote", not "newNode". Therefore, the text box was never colored to red.

          SOLUTION:
          Note1: One of basic fundamentals in writing maintainable code is never hard code a value, such as, GlobalVariables.getErrorMap().putError("newDocumentNote.financialDocumentNoteTopicText", RiceKeyConstants.ERROR_REQUIRED, "Note Topic (Note Topic)"); and the property described in b. above, "newNote.noteTopicText"
          Note2: The hard coded property, "newNote.noteTopicText" was correlated to a class member, newNode for resolving parameters in Struts.

          Comparing the dependencies of the RiceConstants.NEW_DOCUMENT_NOTE_PROPERTY_NAME in all Rice code and the Note2 above, the solution was the following:

          The easiest way was to modify NEW_DOCUMENT_NOTE_PROPERTY_NAME to "newNode" from "newDocumentNode" and all hard coded "newDocumentNote.*" to the following
          putError(Spring.format("%s.%s", RiceConstants.NEW_DOCUMENT_NOTE_PROPERTY_NAME, RiceConstants.NOTE_TEXT_PROPERTY_NAME (or RiceConstants.NOTE_TOPIC_PROPERTY_NAME, etc.);

          3. "Note Text" failed to limit user input more than max length defined by data dictionary. Note: This was removed. See notes above.

          PROBLEM:
          The following code did not provide a way to limit user entering more than the specified length defined in data dictionary
          <c:when test="$

          {attributeEntry.control.textarea == true}">
          <html:textarea property="${property}" style="${textStyle}" tabindex="${tabindex}"
          rows="${attributeEntry.control.rows}" cols="${attributeEntry.control.cols}"
          styleId="${property}" disabled="${disableField}" styleClass="${styleClass}"/>
          </c:when>

          SOLUTION:
          A Javascript was written and tested (coming from infrastructure back end background, this was one the hardest code to write).
          <%-- textarea --%>
          <c:when test="${attributeEntry.control.textarea == true}

          ">
          <html:textarea property="$

          {property}" style="${textStyle}" tabindex="${tabindex}"
          rows="${attributeEntry.control.rows}" cols="${attributeEntry.control.cols}"
          styleId="${property}

          " disabled="$

          {disableField}

          " styleClass="$

          {styleClass}

          "
          onkeyup="textLimit($

          {attributeEntry.maxLength}

          );" />
          <script type="text/javascript">
          function textLimit(maxlen) {
          var field=window.document.forms[0].elements['$

          {property}

          '];
          if (field.value.length > maxlen)

          { field.value = field.value.substr(0, maxlen); }


          };
          </script>
          </c:when>

          Note: Without the checking for user input text length, the validation still threw an error if the input exceeded 800 characters as specified in the data dictionary.

          Show
          Chi-Thanh Dang (Inactive) added a comment - There were three separate problems in this JIRA: 1. Requirement field "Note Topic" was defined required in data dictionary and in GUI, but user was able to add note with empty "Note Topic" PROBLEM The attribute "displayTopicFieldInNotes" was defined in both data dictionary and notes.tag file. This allowed the "Note Topic" to be dynamically displayed. Since the validation of this field was done based on the data dictionary of a document. That means this attribute must be declared in the xml dictionary of a document. SOLUTION: Unless the implementing logic of this attribute is required to change, the solution for this is documenting that a data dictionary of a document must include the following line: <displayTopicFieldInNotes>true</displayTopicFieldInNotes> 2. When there was error thrown, such as empty "Note Topic" or "Note Text", the GUI failed to redraw the GUI component with red color PROBLEM The errors returned from the validation were checked and displayed in two separate ways: "tabErrorKeys" for error messaging and checkErrors.tag for each htmlControlAttribute.tag a - Displaying error messages - When an error occurred, the error was registered to GlobalVariables by the following: GlobalVariables.getErrorMap().addToErrorPath(RiceConstants.NEW_DOCUMENT_NOTE_PROPERTY_NAME); This had no issue since the displaying error was defined by the following, tabErrorKey="$ {Constants.NEW_DOCUMENT_NOTE_PROPERTY_NAME} *" b - Displaying html component in red color - This was an issue because the checking was done by checkErrors.tag using the defined htmlControlAttribute property, property="newNote.noteTopicText" and the error list from the GlobalVariables described in a. The error was never detected because NEW_DOCUMENT_NOTE_PROPERTY_NAME was defined as "newDocumentNote", not "newNode". Therefore, the text box was never colored to red. SOLUTION: Note1: One of basic fundamentals in writing maintainable code is never hard code a value, such as, GlobalVariables.getErrorMap().putError("newDocumentNote.financialDocumentNoteTopicText", RiceKeyConstants.ERROR_REQUIRED, "Note Topic (Note Topic)"); and the property described in b. above, "newNote.noteTopicText" Note2: The hard coded property, "newNote.noteTopicText" was correlated to a class member, newNode for resolving parameters in Struts. Comparing the dependencies of the RiceConstants.NEW_DOCUMENT_NOTE_PROPERTY_NAME in all Rice code and the Note2 above, the solution was the following: The easiest way was to modify NEW_DOCUMENT_NOTE_PROPERTY_NAME to "newNode" from "newDocumentNode" and all hard coded "newDocumentNote.*" to the following putError(Spring.format("%s.%s", RiceConstants.NEW_DOCUMENT_NOTE_PROPERTY_NAME, RiceConstants.NOTE_TEXT_PROPERTY_NAME (or RiceConstants.NOTE_TOPIC_PROPERTY_NAME, etc.); 3. "Note Text" failed to limit user input more than max length defined by data dictionary. Note: This was removed. See notes above. PROBLEM: The following code did not provide a way to limit user entering more than the specified length defined in data dictionary <c:when test="$ {attributeEntry.control.textarea == true}"> <html:textarea property="${property}" style="${textStyle}" tabindex="${tabindex}" rows="${attributeEntry.control.rows}" cols="${attributeEntry.control.cols}" styleId="${property}" disabled="${disableField}" styleClass="${styleClass}"/> </c:when> SOLUTION: A Javascript was written and tested (coming from infrastructure back end background, this was one the hardest code to write). <%-- textarea --%> <c:when test="${attributeEntry.control.textarea == true} "> <html:textarea property="$ {property}" style="${textStyle}" tabindex="${tabindex}" rows="${attributeEntry.control.rows}" cols="${attributeEntry.control.cols}" styleId="${property} " disabled="$ {disableField} " styleClass="$ {styleClass} " onkeyup="textLimit($ {attributeEntry.maxLength} );" /> <script type="text/javascript"> function textLimit(maxlen) { var field=window.document.forms [0] .elements['$ {property} ']; if (field.value.length > maxlen) { field.value = field.value.substr(0, maxlen); } }; </script> </c:when> Note: Without the checking for user input text length, the validation still threw an error if the input exceeded 800 characters as specified in the data dictionary.
          Hide
          Chi-Thanh Dang (Inactive) added a comment -

          Additional information: note.tag file must have the following added as the solution for problem 1. decribed above:
          <c:if test="$

          {empty displayTopicFieldInNotes}

          ">
          <c:set var="displayTopicFieldInNotes"
          value="$

          {travelAttributes.displayTopicFieldInNotes}

          " />
          </c:if>

          Note: A fourth problem was discovered during the regression testing.

          PROBLEM: When there was an error in attaching file, it was not combined with other errors if "Note Topic" and/or "Note Text" were empty.
          SOLUTION: Removed the line "return mapping.findForward(RiceConstants.MAPPING_BASIC);" in KualiDocumentActionBase.java to continue for adding other errors.

          Show
          Chi-Thanh Dang (Inactive) added a comment - Additional information: note.tag file must have the following added as the solution for problem 1. decribed above: <c:if test="$ {empty displayTopicFieldInNotes} "> <c:set var="displayTopicFieldInNotes" value="$ {travelAttributes.displayTopicFieldInNotes} " /> </c:if> Note: A fourth problem was discovered during the regression testing. PROBLEM: When there was an error in attaching file, it was not combined with other errors if "Note Topic" and/or "Note Text" were empty. SOLUTION: Removed the line "return mapping.findForward(RiceConstants.MAPPING_BASIC);" in KualiDocumentActionBase.java to continue for adding other errors.
          Hide
          Ailish Byrne added a comment -

          just want to make sure the file upload link takes into account the work that was done on flexible file upload size limits. doesn't sound like there's an issue, but i wasn't sure if you were familiar with that functionality. thanks!

          Show
          Ailish Byrne added a comment - just want to make sure the file upload link takes into account the work that was done on flexible file upload size limits. doesn't sound like there's an issue, but i wasn't sure if you were familiar with that functionality. thanks!
          Hide
          Chi-Thanh Dang (Inactive) added a comment -

          Code was checked into both branches and tested with the following scenarios for both branches:
          Adding note with the following entries:
          1. Note Topic ON
          a. Empty note topic

          • Empty note text
          • Empty note attachment
          • Valid note attachment
          • Filled note text + empty note attachment
          • Empty note attachment
          • Valid note attachment
            b. Filled note topic
          • Empty note text
          • Empty note attachment
          • Valid note attachment
          • Filled note text + empty note attachment
          • Empty note attachment
          • Valid note attachment
            2. Note Topic OFF
          • Empty note text
          • Empty note attachment
          • Valid note attachment
          • Filled note text + empty note attachment
          • Empty note attachment
          • Valid note attachment
          Show
          Chi-Thanh Dang (Inactive) added a comment - Code was checked into both branches and tested with the following scenarios for both branches: Adding note with the following entries: 1. Note Topic ON a. Empty note topic Empty note text Empty note attachment Valid note attachment Filled note text + empty note attachment Empty note attachment Valid note attachment b. Filled note topic Empty note text Empty note attachment Valid note attachment Filled note text + empty note attachment Empty note attachment Valid note attachment 2. Note Topic OFF Empty note text Empty note attachment Valid note attachment Filled note text + empty note attachment Empty note attachment Valid note attachment
          Hide
          Aaron Godert (Inactive) added a comment -

          Chi, the javascript text limiting feature of this wasn't actually required anymore (see comment above); however, since you did it, can you please update issu KULRICE-1741 accordingly and close it out with you as the assignee then? Thanks!

          Show
          Aaron Godert (Inactive) added a comment - Chi, the javascript text limiting feature of this wasn't actually required anymore (see comment above); however, since you did it, can you please update issu KULRICE-1741 accordingly and close it out with you as the assignee then? Thanks!

            People

            • Assignee:
              Chi-Thanh Dang (Inactive)
              Reporter:
              Bryan Hutchinson
            • Votes:
              0 Vote for this issue
              Watchers:
              1 Start watching this issue

              Dates

              • Due:
                Created:
                Updated:
                Resolved:

                Structure Helper Panel