integreat-cms icon indicating copy to clipboard operation
integreat-cms copied to clipboard

CSV export of statistics has missmatching columns on weekly reports

Open ulliholtgrave opened this issue 2 years ago • 6 comments

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.

grafik

ulliholtgrave avatar Sep 19 '22 09:09 ulliholtgrave

I would like to work on this issue. Which are the files I should work with?

ghost avatar Oct 05 '22 20:10 ghost

@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 :)

ulliholtgrave avatar Oct 05 '22 20:10 ulliholtgrave

@svojtkova Hey there, Do you know when you'll find time for the issue? Otherwise, we would probably solve it ourselves. :)

ulliholtgrave avatar Oct 17 '22 16:10 ulliholtgrave

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.

ghost avatar Oct 18 '22 18:10 ghost

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 avatar Oct 19 '22 12:10 ulliholtgrave

@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.

ghost avatar Oct 21 '22 13:10 ghost

@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 avatar Nov 25 '22 15:11 Gaston69

@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.

timobrembeck avatar Nov 25 '22 15:11 timobrembeck

Ah, now I saw, that I didn't click 'Ansicht aktualisieren' before clicking export. Got it.

Gaston69 avatar Nov 25 '22 18:11 Gaston69