learningequality / studio

Content curation tools for Kolibri
https://studio.learningequality.org/
MIT License
114 stars 163 forks source link

Unstable - Uploading multiple resources to a folder with metadata #4724

Closed pcenov closed 1 month ago

pcenov commented 1 month ago

Observed behavior

This issue is caused by the changes made in https://github.com/learningequality/studio/pull/4664 - when uploading multiple files in a folder with metadata I am seeing the "Apply details from folder" while in the background I am seeing only the first uploaded resource as selected but if I click "Continue" then I can see that the change is applied to all uploaded resources so it's a bit confusing. Also when I select both resources I can edit various other fields, but I can't bulk edit the categories, level and requirements and it's not clear why since I was just offered to do so in the modal. Lastly if I click the 'Upload more' button, when I upload a new resource I am not seeing the "Apply details from folder" modal.

Expected behavior

The expected behavior should be further discussed.

Steps to reproduce the issue

  1. Go to https://unstable.studio.learningequality.org/en/accounts/#/ and sign in
  2. Open a channel and create a folder with metadata
  3. Attempt to upload several resources

Additional information

https://github.com/user-attachments/assets/026bc4c8-0333-4126-b0e5-f6d43d0504de

Usage Details

pcenov commented 1 month ago

@radinamatic

akolson commented 1 month ago

@marcellamaki @AlexVelezLl any thoughts on this?

marcellamaki commented 1 month ago

Hi @pcenov @akolson -- I don't have any thoughts just yet but I can take this on and complete it with some of the other modal follow up tasks that I have. I'll work to get a PR for each (or both depending on the fix) in by tomorrow!

Once I have some more ideas I'll share them here. @AlexVelezLl i also welcome any suggestions!

AlexVelezLl commented 1 month ago

I was thinking on somehow explaining to users whats going on with this, but that would require more strings. So I think the best option here is to allow bulk edit categories, levels, and requirements in the edit modal. We left this a little bit extensible when developing the bulk editing project. The "options components" here are the same as in the quick edit modals (ResourcesNeededOptions, LearningActivityOptions, LevelsOptions, CategoriesOptions), and we already support these boolean maps as a map of array of nodeIds inside the EditModal, so I think we can give it a try, I think it wouldnt be hard having these as bulk editable fields for new resources, but I think it would me more complex to handle the edit of multiple resources, as we are going to have the same problem of the indeterminate state, and how to communicate the behaviour to the user. So I would suggest adding these fields as bulk editable just for new resources where its clear the behaviour, but not for editing already existing resources.

If we have this, we could select all resources in the background at least when suggesting the apply details from... so it would be clearer that this change applies for all of them