Closed ttlenard closed 3 months ago
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
.
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.
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 https://github.com/flexion/ef-cms/issues/10321.
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!).
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:
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):
Smartphone (please complete the following information):
Cause of Bug, If Known
Process for Logging a Bug:
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:
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
Engineering
test
environment if prod-like data is required. Otherwise, deployed to anyexperimental
environment for review.