BCcampus / open-sage

Theme for open.bccampus.ca
MIT License
1 stars 0 forks source link

Download icons on files in collection all show as "website" #171

Closed josieg closed 5 years ago

josieg commented 5 years ago

Describe the bug When looking at the list of files available under some book, the icons are all showing up as "Website" icons, even for PDF, Word, and EPUB files. The print icons are appearing as expected.

However, some books are fine. Such as Health Case Studies.

To Reproduce Steps to reproduce the behavior:

  1. Go to any book in the collection. (For example, Word on College Reading and Writing)
  2. Expand file options under "Editable" "Readable" and "Ancillary" files.
  3. Look at the icons. They all say "Website"

Expected behavior I expect that the icons should match the file type that they are associated with.

Screenshots icons

Desktop (please complete the following information):

alex-418 commented 5 years ago

@josieg this has to do with the work you did in https://github.com/BCcampus/opentextbooks/issues/152 and explains the inconsistencies with the icons being displayed.

The way the icon was being generated can be seen in the screenshot below: icon_logic

So when you renamed "Digital PDF (.pdf)" and "Print PDF (.pdf)" it drops the .pdf which the icon generation logic was relying on... if that's the new logic, I can update this to search for "PDF" instead, and that should fix it for all uses cases. I'll let you know once it's done so you can verify.

josieg commented 5 years ago

Aww man. We removed .pdf .epub, .mobi .xml .html from file labels, so it's not just PDFs being affected. I didn't realize those labels were supporting that functionality.

alex-418 commented 5 years ago

@josieg Just caught those too, will update them as well... then you can verify that they still all work as expected.

And yea, really sucks this is the way it works lol, solution would be to add a field to equella with the correct filetypes, so that we could identify them that way.

alex-418 commented 5 years ago

Changes made via https://github.com/BCcampus/opentextbooks/commit/6c90b68479ac60fa3caff3bc5098ec0bbe99ea7d give it a whirl in a few minutes to ensure these still work as expected.

josieg commented 5 years ago

Thanks @alex-418 !

The only one that still has a problem is the XML file that we have labelled "Pressbooks file." (See editable files here.) If I edit that file so that it says "Pressbooks XML file" instead, will that fix the problem? Or i can edit to "Pressbooks file (.xml)." Whatever is easiest.

alex-418 commented 5 years ago

@josieg Sure, i've updated it via https://github.com/BCcampus/opentextbooks/commit/a5a6aa35036c6fc90efe5d01a7cca4ceb34424d1 so that it'll look for XML (not case sensitive, xml will work too)... so as along as that is somewhere in there, it'll add the correct icon.

ehbeattie commented 5 years ago

@josieg - is this all good?

josieg commented 5 years ago

I think so.