bihealth / sodar-server

SODAR: System for Omics Data Access and Retrieval

Home Page:https://github.com/bihealth/sodar-server

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Refactor IrodsStatisticsAjaxView and related JQuery

mikkonie opened this issue · comments

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 used get()
  • We should query once per project and have the project UUID in stats
  • ..come to think of it, is get() even used anymore? Yes, by the Vue app
  • 403 and 500 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 the md5 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
  • Verify get() usage, remove if no longer needed
  • Handle 403 and 500 status
  • Fix break spaghetti
  • Remove unnecessary stats
  • Return HTTP status as int instead of string
  • Update tests