integreat-cms
integreat-cms copied to clipboard
CSV export of statistics has missmatching columns on weekly reports
Describe the Bug
When a user creates a CSV export for a weekly report, we add a new column that is not included in the CSV format (see screenshot). Normally, the upper columns should slide one further.
I would like to work on this issue. Which are the files I should work with?
@svojtkova Awesome! I guess this is a very good issue to start with. I guess you only have to take a look at https://github.com/digitalfabrik/integreat-cms/blob/develop/integreat_cms/static/src/js/analytics/statistics-charts.ts and find a good way of dealing with the special case of weekly exports and adjust the matrix accordingly :)
@svojtkova Hey there, Do you know when you'll find time for the issue? Otherwise, we would probably solve it ourselves. :)
Hello @ulliholtgrave do you have deadline till when it is needed to be done? I had hard time to run it but now it works. I have one more question how can I get to the page where I can download the report? I searched on the web but I cannot find it anywhere.
Hey @svojtkova We don't have any urgent need right now, but it would be good if this would be ready in the next 1-2 weeks. Unfortunately, our Matomo server for the reports is strictly internal and we would have to provide you with an API key for that. However, the reports used will be compiled into a JSON here https://github.com/digitalfabrik/integreat-cms/blob/develop/integreat_cms/cms/views/statistics/statistics_actions.py . Does that help you already?
Otherwise you can open a draft PR with your changes, then we could have a look at them.
@ulliholtgrave That didnt help me. But what could help is how does constant chart output look like in line 180 (const chart = Chart.instances[0]) It is inside function exportStatisticsData in file statistics-charts.ts.
@ulliholtgrave Peter and me couldn't reproduce the error. We got properly formatted csv (region 29=Augsburg). Please can you post in which cases exactly the bug occurs?
@Gaston69 you have to select "weekly" in the evaluation select box. Then, two columns are used by the date, but the first line only has one leading empty box, so the label for the first language is in the column of the last date of the week.
Ah, now I saw, that I didn't click 'Ansicht aktualisieren' before clicking export. Got it.