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 multiselection #940

Merged
merged 19 commits into from
Jul 11, 2023
Merged

Feat/add multiselection #940

merged 19 commits into from
Jul 11, 2023

Conversation

Merkur39
Copy link
Member

@Merkur39 Merkur39 commented Jul 10, 2023

  • Ajout de la multi-sélection de contact (via la SelectionBar)
  • Ajout d'une nouvelle modale lors de la suppression d'un groupe, qui propose de supprimer également tous les contacts associés à ce groupe.
### ✨ Features

* Update cozy-ui from 81.1.0 to 88.1.1 (cca9655)
* Add **Select all** action (821ae9b / 6d2f512)
* Add new modal for delete contact group, allowing the choice to delete associated contacts.

### 🐛 Bug Fixes

* on mobile, back button should not return to modal url (e00ba18)

### 🔧 Tech

* Fixed flags not working for some time (55f7010)
* Update `eslint-config-cozy-app`, in order to be able to take advantage of the latest rules (715e55f)

And review the initialization of flags in the app
In order to be able to take advantage
of the latest rules of `eslint-config-cozy-app`.
behind `select-all-contacts` flag
@Merkur39 Merkur39 requested a review from JF-Cozy as a code owner July 10, 2023 16:40
@bundlemon
Copy link

bundlemon bot commented Jul 10, 2023

BundleMon

Files updated (5)
Status Path Size Limits
vendors/contacts.(hash).js
598.47KB (+4.76KB +0.8%) -
services/keepIndexFullNameAndDisplayNameUpToD
ate/contacts.js
307.84KB (+3.96KB +1.3%) -
app-contacts.(hash).min.css
28.17KB (+716B +2.55%) -
intents/contacts.(hash).js
28.37KB (+517B +1.81%) -
app/contacts.(hash).js
282.81KB (-39B -0.01%) -
Unchanged files (2)
Status Path Size Limits
public/contacts.(hash).js
44.54KB -
img/icon.(hash).svg
453B -

Total files change +9.89KB +0.77%

Groups updated (2)
Status Path Size Limits
**/*.js
2.07MB (+9.19KB +0.44%) -
**/*.css
102.39KB (-799B -0.76%) -
Unchanged groups (1)
Status Path Size Limits
img/.
453B -

Final result: ✅

View report in BundleMon website ➡️


Current branch size history | Target branch size history

@@ -72,7 +74,8 @@ export const ContentResult = ({ contacts, allGroups }) => {
searchValue
)
setFilteredContacts(filteredContactsBySearch)
}, [contacts, searchValue, selectedGroup, setFilteredContacts])
setContactsDisplayed(filteredContactsBySearch)
}, [contacts, searchValue, selectedGroup, setContactsDisplayed])
Copy link
Contributor

Choose a reason for hiding this comment

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

What is the difference between filteredContacts and ContactsDisplayed?

Copy link
Member Author

Choose a reason for hiding this comment

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

Aucune, si ce n'est que ContactsDisplayed est accessible pour tous les composants (ContactsSelectionBar aujourd'hui)

Copy link
Contributor

Choose a reason for hiding this comment

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

Dans ce cas, pourquoi en créer un nouveau ? On devrait rendre accessible ce ContactsDisplayed partout, non ?

Copy link
Member Author

@Merkur39 Merkur39 Jul 11, 2023

Choose a reason for hiding this comment

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

setFilteredContacts est un état local déjà présent et surtout initialisé avec les contacts traités par son parent.
De part l'archi actuelle, le remplacer ici par le contexte ContactsDisplayed, fait apparaitre un instant le composant ContactsEmptyList (même problème en utilisant le contexte dans le parent)

Je n'ai pas de solution viable rapide, et je dois reprendre d'autres développements, mais à l'écoute si jamais !

Copy link
Contributor

Choose a reason for hiding this comment

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

Je valide pour avancer, mais ça me dérange fortement cette duplication.

src/queries/queries.js Outdated Show resolved Hide resolved
src/locales/fr.json Outdated Show resolved Hide resolved
@Merkur39 Merkur39 force-pushed the feat/Add-multiselection branch 2 times, most recently from c505a81 to 76f3c02 Compare July 11, 2023 08:04
This context is useful to keep in memory the contacts displayed,
this will allow for example to select only these,
because they could be filtered beforehand.
And use `queryAll` instead `query`
Ad add option parameter
And removed the use of react-redux because it's not used,
and is no longer relevant.
We want to offer the choice to delete the contacts associated
with the group that we want to delete.
@Merkur39
Copy link
Member Author

@Crash-- Retours effectués 👍

@Merkur39 Merkur39 merged commit 36e6fef into master Jul 11, 2023
@delete-merged-branch delete-merged-branch bot deleted the feat/Add-multiselection branch July 11, 2023 14:10
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants