cozy / cozy-drive

Cozy Drive Web App for Cozy Cloud
GNU Affero General Public License v3.0
170 stars 65 forks source link

Add photo to album from drive app #1781

Open fdelayen opened 5 years ago

fdelayen commented 5 years ago

Hello,

That would be nice if we could add pictures to albums from the drive app. I have too many photos (50 000+) to be able to easily select those from the photos app so I organized my photos into many folders in drive but then I can't use albums which is a very nice feature :)

In case it's not on your roadmap I could help, I'm a react/redux dev at ovh ;)

Any clue on how you would like to achieve this ? I'm new to cozy, and it seems drive and photos are 2 very separate apps. A simple solution could be to select a few photos from the drive app and have an "Add to Album" button which would redirect to the photos app with parameters to trigger the Album selection ?

Florent

Crash-- commented 5 years ago

Hi florent,

This is something we have in mind since a few months, but this feature is not in our current backlog ATM.

You're right, Photos and Drive are both applications. Let me see if the product team has something specific in mind about this feature and I'll come back with a few leads. (We can imagine giving to Drive the rights to create an album, and in this case, it can be pretty straightforward to implement. Or maybe we want to keep separate both, and calling Photos with a few args can be the solution).

fdelayen commented 5 years ago

Hey @Crash-- any insight about this one ? As I'm done with the thumbnail, I'd like to work on this one if your team isn't and that's something doable :)

Florent

Crash-- commented 5 years ago

Hey @fdelayen you'll be contacted by @joel-costa on the email you used to sign your commit. He has a few questions for you ;)

Crash-- commented 5 years ago

Hi @fdelayen, are you still motivated to add this feature to Drive? I can help you with the implementation.

fdelayen commented 5 years ago

Hey !

Yep of course, if I can help you on this one I will :)

Florent

fdelayen commented 5 years ago

@Crash-- Any updates / insights on which strategy you would prefer to do this ? :)

Crash-- commented 5 years ago

Hello @fdelayen !

After that, I think we are good for the configuration, and we can start coding. As @joel-costa told you, we'll add this action in the selection bar. (This is not the best part of Drive sorry about that).

To add an action there, we need to edit our Container file and add here https://github.com/cozy/cozy-drive/blob/master/src/drive/web/modules/drive/Container.jsx#L80 our new action album-create or something. This action will result in : opening a Modale asking for the album's name with a confirm button. Let's use a Modal component from cozy-ui https://docs.cozy.io/cozy-ui/react/#modal

Then we should call cozy-client to create the entry in the DB. Here is an exemple : https://docs.cozy.io/en/cozy-client/react-integration/#3-mutating-data

We already have this request here : https://github.com/cozy/cozy-drive/blob/master/src/photos/ducks/albums/index.jsx#L71 . We can use the same and even deleting the updateQueries callback since we do not need it here :)

If you have any question, don't hesitate ;). You can join us on IRC if you want