Migrate the main mail store to Pinia
Fix https://github.com/nextcloud/mail/issues/9237
This is going to be a big one...
Splitting stores into multiple files isn't very common in Pinia, but I really wanted to do so in this case, I took my inspiration for how to do it from these guys https://github.com/vuejs/pinia/issues/802
A little overview of how this was done:
- Created a subfolder in
/storefor all the main mail store stuff - Migrate all the getters and remove now useless ones (the ones that just point to a piece of state without modifying it)
- Migrate the actions file
- Rename all the mutations to
[previous name]+Mutation - Migrate
dispatchandcommitusages in components to the correct Pinia usage - Move the renamed mutations into the actions file, hence making them actions (and this time I didn't inline anything, at least yet)
- Realized that a lot of the getters had parameters, which you can't have in Pinia, so those become actions as well (not renamed)
- Lots of bugfixing
- Migrate the tests (the component ones are easy, just updating references, however the ones that actually test the store itself require pretty significant modification)
Not opening the PR yet as I still have the tests to migrate, but mail is useable (as far as it seems)
Thanks so much for finishing the hardest parts Richard <3
needs a rebase, I wish you luck 🍀
Let's get this in
Waiting for https://github.com/nextcloud/mail/pull/10453
EDIT: Merged
Oh shoot I'm sorry I didn't see that you wanted to finish this too @st3iny. I hope I didn't step on your feet here, everything should work now though, if you could just give a final review.
No no, all good. I didn't do anything yet, just assigned myself to not forget about the PR.
Thanks for the final rebase :)