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

Editing a draft Order causes formatting issue if the first paragraph in the Order is indented #10323

Closed
11 tasks
ttlenard opened this issue Mar 25, 2024 · 4 comments
Closed
11 tasks
Assignees
Labels

Comments

@ttlenard
Copy link
Collaborator

ttlenard commented Mar 25, 2024

Describe the Bug
A clear and concise description of what the bug is.
This was reported to us by a Court user. If you have an Order that has the first paragraph indented, and you edit the Order, when the generate screen is displayed, the first paragraph's indentation is no longer present, and the user has to tab the first sentence over again.

Note: This is a duplicate bug report copied over from #10264 which ended causing issues when copying/pasting from a Word document. See associated bug #10321. We will want to relook at this bug and be sure that copying/pasting from Word documents doesn't cause issues when we address this bug.

Business Impact/Reason for Severity
low

In which environment did you see this bug?
Prod, Test

Who were you logged in as?
Court user

What were you doing when you discovered this bug? (Using the application, demoing, smoke tests, testing other functionality, etc.)
Testing other functionality

To Reproduce
Steps to reproduce the behavior:

  1. Log in as a Judge
  2. Navigate to a case
  3. Click on the Create button
  4. Select Order
  5. Begin drafting some text in the Order, making sure that the first paragraph is tabbed once so that it is indented.
  6. Save the draft
  7. Sign the Order
  8. Remove the signature
  9. Edit the Order
  10. Notice that the first paragraph is no longer indented, and you have to tab it so that the indentation is appropriate again.

Expected Behavior
A clear and concise description of what you expected to happen.
Formatting of text should not change if you edit an order

Actual Behavior
A clear and concise description of what actually happened.
The first paragraph indentation is getting removed when you edit an order.

Screenshots
If applicable, add screenshots to help explain your problem.

Desktop (please complete the following information):

  • OS: [e.g. iOS]
  • Browser [e.g. chrome, safari]
  • Version [e.g. 22]

Smartphone (please complete the following information):

  • Device: [e.g. iPhone6]
  • OS: [e.g. iOS8.1]
  • Browser [e.g. stock browser, safari]
  • Version [e.g. 22]

Cause of Bug, If Known

Process for Logging a Bug:

  • Complete the above information
  • Add a severity tag (Critical, High Severity, Medium Severity or Low Severity). See below for priority definition.

Severity Definition:

  • Critical Defect
    Blocks entire system's or module’s functionality
    No workarounds available
    Testing cannot proceed further without bug being fixed.

  • High-severity Defect
    Affects key functionality of an application
    There's a workaround, but not obvious or easy
    App behaves in a way that is strongly different from the one stated in the requirements

  • Medium-severity Defect
    A minor function does not behave in a way stated in the requirements.
    Workaround is available and easy

  • Low-severity Defect
    Mostly related to an application’s UI
    Doesn't need a workaround, because it doesn't impact functionality

Definition of Ready for Bugs(Created 10-4-21)

Definition used: A failure or flaw in the system which produces an incorrect or undesired result that deviates from the expected result or behavior. (Note: Expected results are use cases that have been documented in past user stories as acceptance criteria and test cases, and do not include strange behavior unrelated to use cases.)

The following criteria must be met in order for the development team to begin work on the bug.

The bug must:

  • Be focused on solving a user problem
  • Contain data for all fields in the bug template, so the team can pick it up and begin working immediately

Process: If the unexpected results are new use cases that have been identified, but not yet built, new acceptance criteria and test cases should be captured in a new user story and prioritized by the product owner.

If the Court is not able to reproduce the bug, add the “Unable to reproduce” tag. This will provide visibility into the type of support that may be needed by the Court. In the event that the Court cannot reproduce the bug, the Court will work with Flexion to communicate what type of troubleshooting help may be needed.

Definition of Done (Updated 4-14-21)

Product Owner

  • Bug fix has been validated in the Court's test environment

Engineering

  • Automated test scripts have been written
  • Field level and page level validation errors (front-end and server-side) integrated and functioning
  • Verify that language for docket record for internal users and external users is identical
  • New screens have been added to pa11y scripts
  • All new functionality verified to work with keyboard and macOS voiceover https://www.apple.com/voiceover/info/guide/_1124.html
  • READMEs, other appropriate docs and swagger/APIs fully updated
  • UI should be touch optimized and responsive for external only (functions on supported mobile devices and optimized for screen sizes as required)
  • Interactors should validate entities before calling persistence methods
  • Code refactored for clarity and to remove any known technical debt
  • Deployed to the Court's test environment if prod-like data is required. Otherwise, deployed to any experimental environment for review.
@ttlenard ttlenard added bug Something isn't working Low Severity labels Mar 25, 2024
@ttlenard ttlenard changed the title Copy of BUG: Editing a draft Order causes formatting issue if the first paragraph in the Order is indented Editing a draft Order causes formatting issue if the first paragraph in the Order is indented Mar 25, 2024
@Mwindo
Copy link
Collaborator

Mwindo commented Jul 16, 2024

Note: This seems to be an issue with quill. The richText going into TextEditor as defaultValue is correct, but editor.getText() removes the tab/space formatting next to html tags (like, in our case <p>). So we will likely need to handle this case in the TextEditor.

@Mwindo Mwindo self-assigned this Jul 16, 2024
@ttlenard
Copy link
Collaborator Author

Please note that the critical bug that ultimately caused us to revert the original bug fix had to do with copying/pasting out of a word document. Here is a sample Order in a word document that we can use for testing.

Order 21070-21 v4 JB.docx

@Mwindo
Copy link
Collaborator

Mwindo commented Jul 30, 2024

I have a minimal change in place that fixes only the initial tab of the text editor. After discussing with @ttlenard and finding a few other places where tabs are not preserved and probably should be, I've decided to investigate a little more.

Inspired vaguely by https://stackoverflow.com/questions/61861976/how-to-preserve-white-space-on-quill-js-while-maintaining-format-of-copy-paste, I think the following code in TextEditor.tsx might solve the issue more broadly (where customCssStyles is new):

            const converter = new QuillDeltaToHtmlConverter(fullDelta.ops, {
              customCssStyles: () => {
                return 'white-space: pre-wrap !important;';
              },
              inlineStyles: {
                size: inlineStylesFontSizes,
              },
            });
            const html = converter.convert();

That said, I want to proceed with caution. Any changes I make I will push to an experimental branch to confirm behavior is as expected.

EDIT: I have verified that pdf tests still pass and that this is not "the same" solution "under the hood" as the problematic fix in #10321.

@Mwindo
Copy link
Collaborator

Mwindo commented Aug 8, 2024

Updates: I have changed the editor so that it should maintain both tabs and indentations across saving/reloading orders. @ttlenard has done some testing in experimental1 (thank you!).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
Status: Closed
Development

No branches or pull requests

5 participants