EASOL / easol

EASOL - A New Way to Open Learning with Ed-Tech
http://easol.org
GNU Affero General Public License v3.0
1 stars 4 forks source link

.CSV Export problem #295

Closed edgarf closed 8 years ago

edgarf commented 8 years ago

We need to update the download CSV functionality so it would add " " chars around string values. The current problem is that if a string value has "," inside, then the row structure breaks. That "," inside of a string is held as a separator.

regiscamimura commented 8 years ago

@edgarf I got that done, but there are more to say and adjust here. I replaced the previous feature with the updated and native one, which offers much more options for customization.

So it's a completely new button, and we have layout issues to handle:

  1. After adding the column visibility button (#292), a top section for buttons was added. By default, the download csv button will appear in a group of buttons inside that section. Previously, it was added to the bottom of the table. But well, if we need to have a group of buttons at the top to hold at least the column visibility button, should we let the download csv button to stay on top, or keep moving it to the bottom?
  2. The button definitions are not playing well. The buttons are green by default and gets really light when you hover it. I think it's weird and it's like the button is disappearing. Also, the group of buttons should look like this: http://getbootstrap.com/components/#btn-groups-single. But the colors definitions make the border between buttons to disappear and so it gets weird, like if the buttons got merged. Do we have any clear direction on such layout issues?

And an issue regarding the document title:

  1. When you click the Download CSV button, it will create a CSV file with the name matching the title of the page by default. Should we add some dynamic title feature to the system so things gets more semantic, or should we just hard code a file name properly?
edgarf commented 8 years ago

Hi @regiscamimura,

I have been reviewing the updates and found some issues (will also reply to your concerns):

  1. Seems like DOWNLOAD CSV button got removed from many pages. It was existing on simple views like "Sections", "Attendance" etc.
  2. Can we move both "Visibility" and "Download" buttons to the bottom for now?
  3. Can you show me a screenshot of how does it look for you when hovering the button?
regiscamimura commented 8 years ago

@edgarf Just got the buttons to work all over the place. FYI, I have removed a lot of JavaScript that was being used here and there to create the datatables with a single piece of JS that will read html attributes to set up the tables properly, so we also improved good maintainability in the process. You might want to take a look over all the sections and let me know if there are tables where you don't want the column visibility, search, and download csv features.

Attached is the screenshot about the button colors. buttons

edgarf commented 8 years ago

@regiscamimura, thank you. I agree regarding colors, let's convert it as you offer. Regarding the .CSV export itself, there's one thing I noticed: image That first character is appearing on all exports.

regiscamimura commented 8 years ago

@edgarf Regarding the CSV issue, that's because the encode used is UTF-8 with BOM. BOM means Byte Mark Order, it's a magic hidden char that can be used to retrieve info on the doc.

I did a small hack to the CSV exporter -- there was no config option for that -- to remove the BOM. Not the best approach though, cause an eventual update on database library extensions will override the change. Anyway, the quickiest and simple solution. But well, you can also adjust your CSV editor (microsoft excel?) to open with UTF-8 encoding and it would be fine, and we would avoid the hack. Well, let me know if you prefer to set the encoding in the CSV editor or if you're ok with the hack.

edgarf commented 8 years ago

Hi Regis, I understood. I think adjusting spreadsheet tool is a good option, let's stick with it for now.