-
Notifications
You must be signed in to change notification settings - Fork 31
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
Show number of datapoints assigned for a device #3496
Comments
This is a new requirement, right? In the previous state of assignments, the user also didn't know how many datapoints were assigned. Thinking on implementation, giving no numbers is better than reporting wrong numbers. IMHO We know we can't do a |
Unfortunately we can't use JDO with `KeysOnly` queries. The current documentation states the following: Query q = new Query("Person").setKeysOnly(); Translates to this query in JDO Query q = pm.newQuery("select id from " + Person.class.getName()); List<String> ids = (List<String>) q.execute(); When trying this approach DataNucleus fails with "Variable expression is not supported by this mapper" Since we're using the "low-level" API at the BaseDAO class, we implemented a generic countByFilterProperty as a way of doing an efficient Key-Only query.
* The endpoint expects a `surveyGroupId=<id>` as query parameter * Returns a JSON response with the usual `meta` key, plus a `surveyedLocaleCount` key with number of datapoints for that Survey
The previous state of the test only generated instances for the same surveyGroupId we were checking. So there was a bug in the test, the covered a bug in the code :/
The count of datapoints for a given Survey can be done by: FLOW.store.findById(FLOW.SurveyedLocaleCount, <surveyGroupId>) Response Example: {"surveyed_locale_count":{"count":167,"keyId":"152342023"}}
- Update the string used to have a "placeholder" and replace it with the actual number - We need to update the translations
This is a handy change. Works well as far as I can tell on uat2 |
If all is done, please close the issue |
Context
We introduced the new datapoints assignment functionality that, by default, assigns all datapoints in a monitoring survey to every device added to the assignment.
Problem or idea
When this "assign all datapoints" option is selected, we have no clue how many datapoints have been assigned to a device. We also do not want to download all the datapoints from the backend to handle that processing in the frontend, i.e .just to count how many of the datapoints are assigned.
Solution or next step
Have the backend return a count of the number of datapoints associated with a survey?
The text was updated successfully, but these errors were encountered: