[RAINCATCH-1180] Hide Completed Workorders #131
Conversation
Changes Unknown when pulling a952d27 on RAINCATCH-1180-hide-completed into ** on master**. |
To verify:
|
Changes Unknown when pulling b2901c5 on RAINCATCH-1180-hide-completed into ** on master**. |
demo/server/config-prod.js
Outdated
@@ -55,7 +55,8 @@ var config = { | |||
}, | |||
"sync": { | |||
// Required to handle UI. | |||
"customDataHandlers": true | |||
"customDataHandlers": true, | |||
"excludeOldCompleteWorkOrders": 2 |
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.
Name may be better. Days to filter complete workorders.
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.
Also add comment
@@ -37,6 +38,10 @@ export function connect() { | |||
} | |||
if (config.sync.customDataHandlers) { | |||
const handler = new GlobalMongoDataHandler(mongo); | |||
const excludeDays = appConfig.getConfig().sync.excludeOldCompleteWorkOrders; | |||
if (excludeDays > 0) { | |||
handler.addListFilterModifier(excludeCompleteWorkOrders(excludeDays)); |
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.
Awesome way of doing that where users can decide if they want this!
This needs to be documented.
* 'Complete': 1506010024468 | ||
* } | ||
*/ | ||
statusHistory?: { |
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.
[Question] Do we really need that for this bug?
How about relaying on status='FINISHED' and updated< moment.daysFromNow(2)
IMHO after finished workorder is being accepted it should be in read only mode in portal.
No strong feelings against that, but I will prefer for us to relay on timestamps on results and overall workflow markers to be simple.
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.
I actually wanted this to be an array, since we might end up having workorders unassigned and reassigned to other users, they might hit the same status more than once in their lifetime and tracking all of that can lead to more detailed filtering and reporting. But the filter, while doable, could have some performance issues...
I know we don't expect workorders to be updated after they're complete, but there's always stuff like someone in the portal being able to update the workorder name, or maybe we add comments in the future that could also be added after it is complete, so relying on a separate timestamp is more future-proof too.
@wtrocki addressed comments, thanks for review! |
Motivation
Stop syncing old completed workorders to the mobile client to avoid data clutter and excess data flow.
Keep workorders available for the portal.
Description
Progress