CDR Tickets

Issue Number 4933
Summary Return users to previous section after save action
Created 2021-01-21 11:23:55
Issue Type New Feature
Submitted By Osei-Poku, William (NIH/NCI) [C]
Assigned To Kline, Bob (NIH/NCI) [C]
Status Closed
Resolved 2021-04-02 18:11:30
Resolution Fixed
Path /home/bkline/backups/jira/ocecdr/issue.283072
Description

Currently when a summary document is saved, the document display always returns to the top of the summary in XMetal and users have to scroll down to the exact location they were previously in. Would it be possible to modify this behavior so that users are always returned to the section of the document they were in before the save button was activated? This would be a huge time saver for users who work in very long summaries and also will encourage users to save frequently.

Comment entered 2021-03-29 11:47:04 by Kline, Bob (NIH/NCI) [C]

Because the DOM for the document which exists before the Save operation is no longer available after the Save operation (the Save operation closes the document and then re-opens it, assuming it was not checked back in), the solution will need to use the first enclosing element with a cdr:id attribute which is found by navigating back up toward the root of the document. If the current position's enclosing element has such an attribute, that's the element which will contain the restored current position. Otherwise, we look for the attribute in that element's parent, and we do that recursively until we hit an element with a cdr:id attribute. This means that in the case of a brand new document, the user will be positioned at the top of the document, as is currently done. Subsequent saves will then have cdr:id attributes available for more precise positioning after the save. Similarly, for a newly inserted element, which will not have a cdr:id until after the save (unless the attribute is explicitly set by the user, which rarely happens), the restored position will be in the closest ancestor which does have a cdr:id attribute.

Comment entered 2021-03-29 11:47:42 by Kline, Bob (NIH/NCI) [C]

Added  to the watcher list for this enhancement request.

Comment entered 2021-04-02 18:11:30 by Kline, Bob (NIH/NCI) [C]

This has been implemented and installed on CDR DEV.

Comment entered 2021-04-27 17:32:34 by Osei-Poku, William (NIH/NCI) [C]

This enhancement works quite well within the body of the summary. However, I am finding that, when you're at the end of the summary - within the Type of Change blocks or the Date Last Modified element for examples, a save takes you all the way back to the top of summary. I used CDR0000062697 and CDR0000062869 for testing on DEV.

Comment entered 2021-04-28 07:52:33 by Kline, Bob (NIH/NCI) [C]

In order for your position to be restored, your cursor must be inside a block which has a cdr::id attribute on one of the enclosing elements. Please re-read the explanation of how this works in the March 29 comment above. Also, bear in mind that if this happens when your cursor was at the end of the document, it's very easy to navigate back to the bottom (it's a single keystroke).

Comment entered 2021-04-29 10:32:56 by Osei-Poku, William (NIH/NCI) [C]

Understood. I was hoping that even if my cursor was not inside a block from with a cdr:id attribute, that it will take me to the closes one but I think that is trivial.   

 

Verified on DEV. Thanks!

Comment entered 2021-05-24 18:44:01 by Osei-Poku, William (NIH/NCI) [C]

Verified on QA. Thanks!

Comment entered 2021-06-16 10:27:14 by Osei-Poku, William (NIH/NCI) [C]

Verified on PROD. Thanks!

Elapsed: 0:00:00.001905