[WIP] create a separate substate for editing (.edit) and create (.create)#41
[WIP] create a separate substate for editing (.edit) and create (.create)#41mangei wants to merge 1 commit intoCatalysts:masterfrom
Conversation
cleanup and better splitting of detail and edit mode
create state has to be registered before (!) the detail state, because it has a more specific url:
/new vs. /{:id}
|
Currently the Detail and Edit views share the same state and same controller. The goal is to separate these into different states. Even the create can have its own state. The views would be more specific and would not contain view and edit code. The switch would just be a simple state change. The create can be a special form of the edit state, so it would also use the EditController, but with an empty entity. We already made this work at our customer project and it worked fine. The code would in addition be more maintainable and easier to understand (no checks where am I, no detail copies, no view flags,...) |
|
i completely support this change and would appreciate splitting the states / controllers / templates one point for discussion though: the detail and edit state both have to load the exact same data during there resolve, so basically they should probably have a common parent state proposal: |
|
in addition i would like to change the current implementation of the tabs, which should should be modeled as child states of the show state, but this is definitely a separate change, i just want to provide it as a note here |
|
Thanks you for your input. I appreciate your support and will try to continue and finalize the implementation of it. One simple remark: instead of |
|
i know what you mean with the keywords but the states are only strings, so there shouldn't be an issue but i would even go a step further again and maybe resolve #44 first, which would allow users to configure all this by themselfes |
cleanup and better splitting of detail and edit mode
create state has to be registered before (!) the detail state, because it has a more specific url:
/new vs. /{:id}
THIS IS NOT READY TO BE MERGED, SOME PARTS ARE LOST DURING MIGRATION
OPEN FOR DISCUSSION