Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: Add FilePicker component #2000

Merged
merged 2 commits into from
Jan 20, 2022
Merged

feat: Add FilePicker component #2000

merged 2 commits into from
Jan 20, 2022

Conversation

Merkur39
Copy link
Member

@Merkur39 Merkur39 commented Dec 21, 2021

Inspired by MoveTo on Drive.
FilePicker allows to select a file or a folder in Drive a single or multiple way and returns an array of id of the selected items
In the case of a single selection, the selection does not need to be confirmed

Demo: https://merkur39.github.io/cozy-ui/react/#!/FilePicker/1

This will be a first operational version.
Future evolutions may follow:
#2017
#2018
...

@Merkur39 Merkur39 force-pushed the feat/FilePicker branch 2 times, most recently from 706d134 to 5191f01 Compare December 21, 2021 17:51
@Merkur39
Copy link
Member Author

FilePicker

@Merkur39 Merkur39 requested a review from JF-Cozy January 3, 2022 09:35
react/FilePicker/index.jsx Outdated Show resolved Hide resolved
react/FilePicker/index.jsx Outdated Show resolved Hide resolved
react/FilePicker/index.jsx Show resolved Hide resolved
react/FilePicker/index.jsx Outdated Show resolved Hide resolved
react/FilePicker/FilePickerBreadcrumb.jsx Outdated Show resolved Hide resolved
react/FilePicker/FilePickerBodyItem.jsx Outdated Show resolved Hide resolved
react/FilePicker/FilePickerBodyItem.jsx Outdated Show resolved Hide resolved
@Merkur39 Merkur39 force-pushed the feat/FilePicker branch 2 times, most recently from 2079362 to 5b50000 Compare January 6, 2022 11:32
@Crash--
Copy link
Contributor

Crash-- commented Jan 14, 2022

@Merkur39 is it ready to review? Do you still work to do on it?

@Merkur39 Merkur39 marked this pull request as draft January 14, 2022 13:47
@Merkur39
Copy link
Member Author

@Merkur39 is it ready to review? Do you still work to do on it?

Excuse me, there is still some work to be done :)

@Merkur39 Merkur39 force-pushed the feat/FilePicker branch 2 times, most recently from 5d5f0a3 to 7d23ff0 Compare January 17, 2022 11:14
@Merkur39 Merkur39 marked this pull request as ready for review January 17, 2022 11:29
@Merkur39 Merkur39 requested a review from Crash-- January 17, 2022 14:22
@JF-Cozy
Copy link
Collaborator

JF-Cozy commented Jan 17, 2022

  • quand on clique sur un fichier, ça le sélectionne, mais il n'y a pas le même comportement sur un folder (même avec la prop ACCEPTFOLDER à true), c'est voulu ?
  • on peut rajouter un fichier dans le dossier, histoire d'avoir un meilleur exemple je pense
  • on peut mettre 2 fichiers plutôt qu'un seul (à la racine, et dans le dossier) pour tester un peu mieux les comportements

@Merkur39
Copy link
Member Author

Merkur39 commented Jan 17, 2022

  • quand on clique sur un fichier, ça le sélectionne, mais il n'y a pas le même comportement sur un folder (même avec la prop ACCEPTFOLDER à true), c'est voulu ?

Oui, les dossiers on une zone de sélection défini par le Divider vertical, car il faut que l'on puisse toujours naviguer dans l'arborescence.
Le design a été vu avec @joel-costa

  • on peut rajouter un fichier dans le dossier, histoire d'avoir un meilleur exemple je pense
  • on peut mettre 2 fichiers plutôt qu'un seul (à la racine, et dans le dossier) pour tester un peu mieux les comportements

En effet, je vais creuser un peu, pas si simple qu'il n'y parait 😁

@JF-Cozy
Copy link
Collaborator

JF-Cozy commented Jan 17, 2022

En effet, je vais creuser un peu, pas si simple qu'il n'y parait 😁

Je m'en doutais :p j'ai failli mettre un "si pas trop compliqué" mais en fait ce serait quand même mieux pour tester et blinder la feature

@Merkur39 Merkur39 force-pushed the feat/FilePicker branch 2 times, most recently from 54a51cc to aeca351 Compare January 18, 2022 14:38
@Merkur39
Copy link
Member Author

Documentation enrichie 👍

Copy link
Collaborator

@JF-Cozy JF-Cozy left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ajouter également des React.memo() sur les export default :)

react/FilePicker/index.jsx Outdated Show resolved Hide resolved
react/FilePicker/index.jsx Show resolved Hide resolved
react/FilePicker/docs/DemoProvider.jsx Show resolved Hide resolved
react/FilePicker/docs/DemoProvider.jsx Show resolved Hide resolved
react/FilePicker/docs/DemoProvider.jsx Show resolved Hide resolved
react/FilePicker/FilePickerBreadcrumb.jsx Show resolved Hide resolved
react/FilePicker/FilePickerBreadcrumb.jsx Outdated Show resolved Hide resolved
react/FilePicker/FilePickerBreadcrumb.jsx Show resolved Hide resolved
react/FilePicker/FilePickerBodyItem.jsx Show resolved Hide resolved
react/FilePicker/FilePickerBodyItem.jsx Show resolved Hide resolved
react/FilePicker/queries.js Show resolved Hide resolved
react/FilePicker/index.jsx Outdated Show resolved Hide resolved
react/FilePicker/index.jsx Show resolved Hide resolved
react/FilePicker/index.jsx Outdated Show resolved Hide resolved
@Merkur39 Merkur39 force-pushed the feat/FilePicker branch 2 times, most recently from a932bc2 to 3f2de39 Compare January 19, 2022 16:19
@Merkur39 Merkur39 force-pushed the feat/FilePicker branch 2 times, most recently from 295d75b to 0b0c59b Compare January 19, 2022 18:31
Inspired by MoveTo on Drive.
FilePicker allows to select a file or a folder
in Drive a single or multiple way
and returns an array of id of the selected items
@Merkur39 Merkur39 merged commit 9286dcd into master Jan 20, 2022
@Merkur39 Merkur39 deleted the feat/FilePicker branch January 20, 2022 08:43
@cozy-bot
Copy link

🎉 This PR is included in version 60.5.0 🎉

The release is available on:

Your semantic-release bot 📦🚀

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

6 participants