Page MenuHomePhabricator

Move setDefaultFunctionReference logic from store to component
Closed, ResolvedPublic

Description

Currently, the vuex store is trying to automatically fill in the z_implementation_function dusting the creation of the implementation in the addZObject.js module.
This is not wrong, but it is making the method very complex, and it is not as consistent as the other methods that just rely of data being passed in to create the object.

To make things more consistent, I suggest to move the method setDefaultFunctionReference and its functionality within the zImplementation.vue file. This could be run at mounted.

The main difference by moving it out, is that the implementation would be fully-loaded and its object fully defined before we try to assign inner values. This would make things so much easier to read and understand.

To provide more information on how to develop and the expectation of this ticket, using the following link should load a createZobjectPage with a zImplementation and the function should be preloaded (change z100030 with a function you created and NOT a build it function because they are already loaded and the issue does not occur).

http://localhost:8080/wiki/Special:CreateZObject?zid=Z14&Z14K1=Z100030&view=zobject-editor