closup / process-xbrl

3 stars 1 forks source link

improve file uploads #37

Open kwheelan opened 1 month ago

kwheelan commented 1 month ago

Goal

Improve the process for uploading files on the app. We want to allow the user to upload files from multiple folders (right now they must all be in the same folder). We can either allow multiple upload rounds or allow the user to select files from different folders in the dialog box.

Background

lucakato commented 1 month ago

@kwheelan I don't think it's possible to select multiple folders according to this. Instead, it might make sense to add a delete button next to each file. This way if the user accidentally uploads 1 extra file they don't have to go through the re-selection process of all files again, but just delete the single file.

kwheelan commented 1 month ago

@lucakato That makes sense -- we'll just have to make sure the file request still includes all the files in the correct order.

lucakato commented 2 weeks ago

@kwheelan Should be done but please check whenever possible! I also changed the saving location of viewer.html to templates/site because I realized saving it to sessions specific folder was breaking the online viewer.

I added a delete button while keeping the ability to move around files. Also if you delete a file it should change the number of files displayed on the message "Convert X files"

kwheelan commented 2 weeks ago

@lucakato Thanks -- I'll take a look this weekend.

kwheelan commented 2 weeks ago

@lucakato

Thanks for your work on this. A few comments:

lucakato commented 1 week ago

@kwheelan thanks for the review. I'll try to re-create that error I got by reverting it to saving to the session specific folder.

I'll also just keep it to 'Convert X files' and then test it more.

kwheelan commented 2 days ago

@lucakato Let me know if/when you want me to review this

lucakato commented 2 days ago

@kwheelan thanks, I will let you know. I fixed the error message thing. I was working on this other bug where files weren't being shown when everything was deleted and then files were re-selected to be uploaded but now that's been fixed too. Then I'll probably try moving the saving location of viewer.html back to the session and see if I break anything again.

kwheelan commented 2 days ago

@lucakato Sounds good

lucakato commented 2 days ago

@kwheelan okay so here's the error message:

image

I think render_template only works on something stored in the /templates folder.

Do you think modifying the folder/code structure like this is okay?

project_root/
    app/
        templates/
            session_templates/
                sessions_data/
                    <session_id>/
                        viewer.html
            base.html
            other_template.html
        static/
            css/
            js/
        routes.py
        ...