creecros / MetaMagik

Custom Fields for Kanboard - Plugin MetaMagik
MIT License
98 stars 16 forks source link

Hooking to Task/Creation/Modification #1

Closed creecros closed 6 years ago

creecros commented 6 years ago

After playing with this, I determined, it is beyond my capabilities to easily hook this to Task Creation/Modification. Why? A lot of reasons, but mainly, once you open the task edit modal, you are playing with Task Table and Task related controllers. I don't know how to build relationships in the TaskModels to a dynamic set of Key's that could exist in the Metadata Table. Simply put, once you hit "Save", I have no idea how to update the values for the Metadata since it doesn't exist in the TaskModel. Pretty sure there is another solution, or even a better one, but I am just a novice here to be honest.

Solution would be to hook to task layout, just above "Description" and use a seperate Modal to edit metadata. This would be similiar to curren plugin, but i would add it to the main layout when you view a task, and it would be editable via a Modal, like how "Edit Task" currently is.

creecros commented 6 years ago

well, maybe i can figure this out.

TheCloud commented 6 years ago

These days I was over-charged and I couldn't check the code, anyway we can ask for help :-)

creecros commented 6 years ago

I got them on there as editable fields, now I just need to figure out how to save them, pretty sure it will require me to replace the Models for Task Creation/Modification/Duplication. Using "Tags" as a reference on how to do it, as I notice that each model has an "UpdateTags" function, so I'll just need to do the same for the MetaData. Currently it doesn't know where to save the data, but it can read it.

image

creecros commented 6 years ago

also, i'm working under the "test" branch

creecros commented 6 years ago

Success, I got it.

TheCloud commented 6 years ago

Wow I will test it today for sure! But where do you define which fields are added ? From the admin console ?

creecros commented 6 years ago

That wil be the idea, but not implmented yet. Baby steps, 1 issue at a time.

creecros commented 6 years ago

If you check the project board, you'll see where I am at on the to do list and what I'm still working on. Although I solved this, I still need to implement this principle into task create and duplication, followed by a whole slew of other things.