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

(proposal) Move Journal editing into a discrete modal #1832

Closed
sfount opened this issue Jul 9, 2017 · 1 comment · Fixed by #2085
Closed

(proposal) Move Journal editing into a discrete modal #1832

sfount opened this issue Jul 9, 2017 · 1 comment · Fixed by #2085
Assignees

Comments

@sfount
Copy link
Contributor

sfount commented Jul 9, 2017

Currently our posting journal allows you to edit transactions in place. In transaction view you can click edit in a transaction, it will be highlighted blue with a number of editing functions (save, add line, remove line etc.) presented at the top. All rows in a transaction are downloaded whatever the data set to ensure you are not editing without context.

The reason for this decision is to allow the user to watch the totals of their current query (journal data) change as they edit.

However there are many UX issues with the current implementation, if a user has filtered on any values, the filter will be removed scrolling the view unpredictably.

My proposal is that the edit button is removed from in line transaction and is instead placed as a function in the menu or the toolbar. The flow would be:

  1. User selects one or more rows from a transaction
  2. User selects 'Edit' from the menu
  3. A modal is presented with all of the rows in that transaction in a UI grid, the experience for editing is the same as now. User can add, remove lines, save or cancel.
  4. Once the user has saved they are returned to the exact same view they had before, with the underlying values updated

The same code for editing lines in a UI grid would be used however it would be a discrete action that happens aside from the main grid.

Pros

  • No requirement on being in a certain view
  • Far fewer corner cases with in line scrolling and downloading of data and custom editing / rendering (this constitutes thousands of lines in the journal code)
  • discrete states, no ambiguous mode or rendering
  • No concerns about current filters or queries

Cons

  • This method would not be suited for editing many transactions at once. Editing would be limited to 1 transaction by 1.
  • Significant development time transitioning system

Watching users use the current system with changes of filters and scrolling beyond their control it is clear that it would take a long time to master and also has some required fixes - potentially now is a good time to make a call on if we think the number of corner cases here is ever worth the convenience of in line editing.

Potentially this would also allow other modules like the account statement to request a transaction for editing. This might be a very convenient tool if you are using other modules to validate data.

@jniles
Copy link
Collaborator

jniles commented Jul 11, 2017

I think that using a modal is a decent idea ... it would certainly make the editing process faster. Then the Journal would only need to be a view of the data, rather than a dynamic view.

Here is an (old) blog post by one of the UI-Grid maintainers demonstrating the same concept.

In my mind, the design questions are:

  1. What columns are available to edit? Only the visible ones or every column? I can see pros and cons to either.
  2. Can we just have a "click to edit" instead of a "select than click edit" button? It might make things faster.

It would be a hard transition though.

@sfount sfount self-assigned this Aug 9, 2017
bors bot added a commit that referenced this issue Sep 25, 2017
2085: refactor: Posting Journal and Associated Tools r=mbayopanda a=jniles

This Pull Request finalizes the refactor of the Posting Journal and associated modules.  The commit history contains a full list of changes.  In brief:
 1. Editing has been moved out into a modal.  By breaking out the editing code, the complexity of the Posting Journal is reduced.  It also enforces editing a single transaction at a time.
 2. The Trial Balance has moved into Stored Procedures.  This separates the JS code from the SQL code and speeds up the execution of the Trail Balance slightly.
 3. The Trial Balance no longer reloads data between `$state` changes.  The modal is much more snappy than previous.
 4. Links to the receipts/documents/patients associated with each transaction are embedded in the Posting Journal.  This makes it easy to find the details associated with a given transaction.
 5. The Posting Journal is able to load "posted" transactions.  To accommodate this, the Posting Journal footer has been improved to show the number of unposted or posted transactions.  Additionally, the "Posted Journal" module has been removed.

There have been a number of miscellaneous bug fixes addressed as well.  As with any change, this may introduce new bugs specific to the changes listed above.

Partially addresses #1432.

Closes #1034.
Closes #1163.
Closes #1402.
Closes #1500.
Closes #1640.
Closes #1659.
Closes #1716.
Closes #1717.
Closes #1724.
Closes #1832.
Closes #1839.
Closes #1921.
Closes #1928.
Closes #1934.
Closes #1943.
Closes #1944.
Closes #1948.
Closes #1950.
Closes #1961.
Closes #2031.
Closes #2041.

---

### TODO Before Merge
 - [x] Ensure all keys are translated into both French and English
 - [x] Ensure tests pass
 - [x] Make sure all filters/links work on Posting Journal page.
 - [x] Make sure all filters/links work on the Trial Balance
 - [x] Ensure all editors work as expected.
 - [x] Ensure that new code passes lint checks.
@bors bors bot closed this as completed in #2085 Sep 25, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants