Details
-
New Feature
-
Status: Closed (View Workflow)
-
TBD
-
Resolution: Won't Do
-
None
-
None
-
None
-
-
Small < 3 days
-
Small < 3 days
-
-
Prokopovych
-
-
97
-
-
R2
-
R1
-
R2
-
R3
-
R2
Description
Purpose: The scope of this work is to display the rounded result counts in "core" apps using the SearchAndSort component (i.e. Inventory and Requests). Other apps that use SearchAndSort (e.g. Courses, Licenses and Agreements etc) will be able to make use of the work done in the component BUT they will need to their own RMB upgrades first.
A separate feature will be created for apps using the SearchAndSortQuery component: UXPROD-2702
This work will be done by Core Functional after Core Platform has developed the infrastructure as part of UXPROD-2623
Description of work:
The totalRecords search result hit count number returned by RMB is precise if totalRecords is below 1000 and it is only an estimation if totalRecords >= 1000 (details).
The front-end currently displays "8081 records found" for estimations.
This is misleading (false precision).
"about" should be prepended for >= 1000.
The number should be rounded for >= 1000.
Algorithm for the front-end:
if totalRecordsEstimated is true print "about " + totalRecordsRounded else if totalRecordsEstimated is false print totalRecords // totalRecordsEstimated is undefined until all back-ends have upgraded RMB, // handle this gracefully for folio-testing: else if totalRecords < 1000 print totalRecords else print "about " + totalRecords + " (upgrade back-end for rounding)"
Story outline:
- Upgrade Inventory to RMB containing fix
- Upgrade Requests to RMB contsining fix
- Display rounded result counts in SearchAndSort
Scenarios:
- Scenario
- Given a result count is estimated (current understanding is that result counts above 1,000 are estimates)
- When displayed in FOLIO
- Then:
- Result count should be preceded by "about"
- Result count should be rounded using the "Rounded to first digit" method
- For example:
- Estimated result count from Postgres = 32351
- Displays in FOLIO as "about 30,000 records found"
- Scenario
- Given a result count is NOT estimated (current understanding is that result counts under 1,000 are exact)
- When displayed in FOLIO
- Then:
- Result count should NOT be preceded by "about"
- Result count should NOT be rounded
- For example:
- Exact result count from Postgres = 845
- Displays in FOLIO as "845 records found"
Story outline:
- Upgrade Core modules using SearchAnndSortQuery to latest RMB
- Display rounded result counts in SearchAndSortQuery
Background Discussion:
- Three rounding proposals were considered
- Option B, "Round to first digit" was selected
Details on Rounding Options Considered:
3 rounding proposals are in the comments of MODINVSTOR-468:
A) Round to magnitude:
about 10,000 | (3,000-29,999) |
about 100,000 | (30,000-299,999) |
about 1,000,000 | (300,000-2,999,999) |
about 10,000,000 | (3,000,000-29,999,999) |
B) Round to first digit:
about 2,000 | (1,500-2,499) |
about 3,000 | (2,500-3,499) |
about 4,000 | (3,500-4,499) |
about 5,000 | (4,500-5,499) |
about 6,000 | (5,500-6,499) |
about 7,000 | (6,500-7,499) |
about 8,000 | (7,500-8,499) |
about 9,000 | (8,500-9,499) |
about 10,000 | (9,500-14,999) |
about 20,000 | (15,000-24,999) |
about 30,000 | (25,000-34,999) |
C) Round first digit to 1, 2 or 5:
about 2,000 | (1,500-3,999) |
about 5,000 | (4,000-7,999) |
about 10,000 | (8,000-14,999) |
about 20,000 | (15,000-39,999) |
about 50,000 | (40,000-79,999) |
This issue is about deciding whether there should be a FOLIO standard for rounding, and if yes, which to choose, and whether the front-end or the back-end should round the number.
Proposed API as of July 28, 2020
If the back-end rounds it should also provide to original (non-rounded) estimate, for example
totalRecords: 1431
totalRecordsRounded: 1000
totalRecordsEstimated: true
No rounding is needed for an exact number:
totalRecords: 1509
totalRecordsEstimated: false
https://github.com/folio-org/raml/blob/raml1.0/schemas/resultInfo.schema needs to be extended accordingly.
TestRail: Results
Attachments
Issue Links
- is blocked by
-
UXPROD-2623 Wait for POC of Elastic Search - Round estimated search result hit count (totalRecords)
-
- Closed
-
- is cloned by
-
UXPROD-2702 Display Rounded Result Counts in Apps Using SearchAndSortQuery (i.e. Users)
-
- Closed
-