Refactor IrodsStatisticsAjaxView and related JQuery
mikkonie opened this issue · comments
Mikko Nieminen commented
Yay, found more yak shaving when fixing #1886. Certain things seem to require refactoring in the class and its usage:
- We return a list instead of a dict based on the iRODS path. The latter would make it much simpler to handle the data in JQuery instead of needlessly iterating through a list
coll_objects
term should be renamed. What even is that- Same with
data
for return data within the view - We set
data-stats-url
in template, but always just use the path substring from the URL. Should probably just use the iRODS path instead. I guess this is residue from the old implementation which mostly usedget()
- We should query once per project and have the project UUID in stats
..come to think of it, isYes, by the Vue appget()
even used anymore?403
and500
statuses is not handled in the JQuery- Unnecessary
break
structures in view stats
unnecessarily returned in Ajax view even with non-200 status (it never gets used)- HTTP status fields are returned as strings instead of integers for some weird reason
POST
tests for the view contain themd5
attribute even though it's no longer used- Taskflow and regular view tests are in the same
test_views
module, that isn't according to conventions
Tasks
- Return dict instead of path from view, update usage
- Rename odd variables
- Use
data-stats-path
instead of URL - Group queries per project
-
Verifyget()
usage, remove if no longer needed - Handle
403
and500
status - Fix
break
spaghetti - Remove unnecessary
stats
- Return HTTP status as int instead of string
- Update tests
Mikko Nieminen commented
Done.