cozy / cozy-emails

Email Client for Cozy
GNU Affero General Public License v3.0
66 stars 41 forks source link

Make routing easier #793

Closed misstick closed 8 years ago

misstick commented 8 years ago

Enhancement

Remove panels layout

Check new routes for :

frankrousseau commented 8 years ago

@misstick Is it possible to merge that PR and open a new one with the remaining of the todo-list?

misstick commented 8 years ago

@frankrousseau : no it is not finished yet, and it need to be reviewed

frankrousseau commented 8 years ago

Yep but I don't like huge PR. That one will be close to non reviewable because of its size.

misstick commented 8 years ago

@frankrousseau : yes it can't be split in other PR : this feature has too much consequences to be smaller

m4dz commented 8 years ago

@frankrousseau this PR concerns the core routing that also impacts stores, and I can't see a clean way to split it without side-effects. We made a meeting with @poupotte and @aenario this morning, we'll see what we can do to fix it :).

frankrousseau commented 8 years ago

Ok @misstick and @m4dz

frankrousseau commented 8 years ago

Thx for the info update.

m4dz commented 8 years ago

@frankrousseau no problem :). We'll merge it after pre-review (from me and @aenario) tomorrow, and then use it as a solid base structure for the rest of the app. It'll let us to see where app is broken and where it is stable, and the best practices to apply. Plus, we'll be able to work on dedicated parts each of us at the same time. It's on the right way!

aenario commented 8 years ago

Could you try to run

./node_modules/.bin/coffee-jshint --options browser,node,undef,unused client/app/**/*.coffee --globals t  > lint.log

Most of them are not your fault, but i see some in account_action_creator, which will crash the client on mailbox manipulation.

103:20: 'account' is not defined.
117:20: 'account' is not defined.
131:20: 'account' is not defined.
aenario commented 8 years ago

REMOVE_ACCOUNT_XXX actions are comented in AppConstants but used.

aenario commented 8 years ago

MAYBELATER

There is quite a few unused require in stores & action_creators (for instance the layout action creator requires but do not use XHRUtils, SocketUtils, MessageStore, AccountActionCreator & MessageActionCreator).

This is a sign that you've done a good job cleaning the mess in the dependencies graph :+1:

aenario commented 8 years ago

router_actioncreator.coffee#L28 Prefer for key, value of params instead of .each

aenario commented 8 years ago

MAYBELATER

router_action_creator.coffee#L46 French comment makes @clochix happy but we try to be welcoming to people who dont have the chance to speak french :-p (will be gone with #FIXME anyway)

aenario commented 8 years ago

components/application.coffee I would move the Router.getLayoutSettings to getStateFrom Stores and className = "" + "..." + to the render method in order to get rid of the whole props part.

aenario commented 8 years ago

panel.coffee this file is not used anymore ( :tada: thanks !) kill it :skull:

aenario commented 8 years ago

getters/routers.coffee You have a lot of if/unless (variable = condition) where you dont use the variable after. isFlags takes one argument, you use it with two

getters in general : Not sure if they should be a class or map of function, will probably depends on how we do memoization.

aenario commented 8 years ago

getters/selection Making it two functions instead of getProps avoid the strange _.extend in message_list

aenario commented 8 years ago

Could you explain your changes in store_watch_mixin ?

I find the new approach harder to read with the mix in getStateFromStores & getInitialState.

aenario commented 8 years ago

missing require AccountStore in NotificationStore

aenario commented 8 years ago

I see you added some logic in XHRUtils, IMHO, it should go back to action_creator.

aenario commented 8 years ago

MAYBELATER

I think we should move all the _current and _selected variables to the routerStore, and get rid of LayoutActionCreator.saveMessage but this can be part of another PR. The current state is already much cleaner !

frankrousseau commented 8 years ago

\o/

misstick commented 8 years ago

I thought that moment would never happen! https://c1.staticflickr.com/5/4025/4488876837_8d3da2423a_z.jpg image