-
Notifications
You must be signed in to change notification settings - Fork 105
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
refactor: Trial Balance #1233
refactor: Trial Balance #1233
Conversation
a19e1d2
to
30f2c97
Compare
Interested in @imawh's feedback as well. |
Received feedback from @imawh. He proposes the following changes:
|
We should also ask Patrick, what he is thinking. |
@sfount, can you see if Patrick has any feedback? |
Patrick is not at the office right now. I understand that he is not in good health. |
The following changes have landed: This commit incorporates feedback from our accountant.
|
585fc82
to
41a17c0
Compare
This commit improves the Trial Balance UI and UX in the following ways: 1. The submit button now disables and enters a loading state after posting to the GL. 2. The grid now right aligns the currency amounts. 3. The grid now uses currency rendering for all amounts. 4. The buttons now behave responsively. 5. The labels no longer bleed into the headercrumb. There are also some performance improvements: 1. Use flat entity access on the grids 2. Use fastWatch 3. Use translate directive where possible Addresses some of the points in Third-Culture-Software#1163. Closes Third-Culture-Software#1171.
This commit fixes a bug in the totals calculation for the trial balance due to an incorrect LEFT JOIN. This has been broken out into multiple subqueries. The performance of these queries should be investigated, but there are no obvious optimizations to make.
This commit encorporates feedback from our accountant. 1. Grid Footer is only shown when there are imbalances. 2. Totals are only ever shown for debit/credit and not for before/after. 3. The grid is no longer padded - slightly more screen real estate for users. 4. The account now includes the account text. 5. Removed Group By Transaction
41a17c0
to
2ca505b
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The code here LGTM. The changes to the SQL will make this a very robust procedure.
I have made a few comments however I don't think any of these things should be blocking.
I also have a number of comments on the UX experience for this module:
- Is there a reason that a different blue/ red colour is used for primary and error states? We have no other grids that have a blue header so when and where we use this should be considered. If these should have colours we should use the standard primary and danger colours used throughout the application.
- The submit button turns red if there are errors. A red button is used throughout the application for a serious action (usually deleting an entity) however this button can never be pressed and won't delete anything - I think this is misleading.
- The view errors button is also red, this is the same point as (2.)
@jniles the code here looks to me like it can be merged into master. If you would like to make any comments/ changes based on this review there is no problem. If this has to be in as soon as possible let me know and we can address the additional comments in an issue thread.
treeRowHeaderAlwaysVisible : false, | ||
appScopeProvider : vm, | ||
columnDefs : columns, | ||
flatEntityAccess : true, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
👍
id="main-grid" | ||
ui-grid="TrialBalanceMainBodyCtrl.gridOptions" | ||
ui-grid-auto-resize | ||
ui-grid-grouping> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Does this UI grid still need ui-grid-grouping
?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes to make the uiGridGroupingConstants
tree aggregation work. I might be able to migrate this to uiGridConstants
instead, but for the moment, that's the way it was set up. The grouping aggregation doesn't work without the ui-grid-grouping
directive.
'SessionService', 'TrialBalanceService', 'GridGroupingService', 'GridColumnService', | ||
'NotifyService', '$state', '$timeout', 'uiGridConstants', | ||
'SessionService', 'TrialBalanceService', 'NotifyService', | ||
'$state', 'uiGridConstants', 'uiGridGroupingConstants', '$filter', |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Are grouping constants used any more? I think that functionality was removed with the view as transaction button. If they're no longer used all of these imports can be removed.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
They are used in the aggregation functions.
fetchDataByAccount() | ||
.then(function (data) { | ||
vm.gridOptions.data = data; | ||
cssClass = TrialBalance.getCSSClass(vm.feedBack); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is there a reason these CSS classes can't be assigned in the template like in many other modules using ng-class
? I haven't looked into the specifics but this logic is very specific and unknown to me. If it is required it would be a good thing to standardise for these cases.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It would be fairly straightforward. You just have to make a header row template and switch the color based on that.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
ui-grid="TrialBalanceMainBodyCtrl.gridOptions" | ||
ui-grid-auto-resize | ||
ui-grid-grouping> | ||
<bh-grid-loading-indicator |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
👍 🎉
@sfount, let's just get this in. It will be useful to teach the team here without the previous bugs and with a loading button. The others will just be UI issues and/or performance that we can address through more training when we make the upgrades. Note: Travis CI isn't reporting it, but these tests pass. |
|
|
Okay, LGTM. We'll make issues to track UX improvements. |
EDIT See #1233 (comment) for the most recent changes.
This PR refactors the Trial Balance to improve stability and usability. It addresses a few of the issues cited in multiple issues. It also fixes a bug with the Trial Balance calculation of account balance changes.
Details
This commit improves the Trial Balance UI and UX in the following ways:
posting to the GL.
There are also some performance improvements:
Addresses some of the points in #1163. Closes #1171. Addresses some of the points in #1042.
Bug Fix
This commit fixes a bug in the totals calculation for the trial balance
due to an incorrect LEFT JOIN. This has been broken out into multiple
subqueries. The performance of these queries should be investigated,
but there are no obvious optimizations to make.
Bug Fix
The
$timeout
hacks have been removed fromui-grid
and replaced with events that redraw the grid when grouping changes. These sometimes caused flaky behavior in rendering.Closes #868.
Feature
Finally, this PR includes a grid footer on the Trial Balance to give an overview of the changes. This is how the bug was discovered. See below on Vanga's dataset.
Closes #1189.
Feature
The Trial Balance finally has a loading indicator!
Fig 1: Trial Balance Improvements
Thank you for contributing!
Before submitting this pull request, please verify that you have:
For a more detailed checklist, see the official review checklist that this PR will be evaluated against.
Ensuring that the above checkboxes are completed will help speed the review process and help build a stronger application. Thanks!