alphanodes / additionals

Redmine plugin for easy customization of settings, text and content display by using personal or role-based dashboards (drag&drop), providing wiki macros and act as library for other plugins.
https://www.redmine.org/plugins/additionals
GNU General Public License v2.0
131 stars 43 forks source link

New plugins with new dashboard blocks #95

Closed skalimer0 closed 3 years ago

skalimer0 commented 3 years ago

Hello,

I want create new block in my plugin. I watch GitHosting example and i have something to execute. OK 👍

But, now, i must put my methods in dashboards_helper.rb of Additionals plugins to execute action like your feed's block with dashboard_feed_catcher or dashboard_feed_title.

How can i put my method in my own plugins ? how patch dashboards_helper ?

thanks and good job.

skalimer0 commented 3 years ago

I tried to patch projects_controller and dashboard_async_blocks_controller to include my own Helper... i tried to call my own Helper in html.slim file.... I tried to patch DashboardsHelper by different way... but nothing worked.

On each test, the result is the same : "undefined method"

For information... I'm rails and ruby newbie... and i don't find solution for now.

skalimer0 commented 3 years ago

Yes !!! I found, sorry for the issue.

I make a patch this all my methods and add this to the patch

ProjectsController.send :helper, MyPlugin::Patches::DashboardsHelperPatch
WelcomeController.send :helper, MyPlugin::Patches::DashboardsHelperPatch
DashboardAsyncBlocksController.send :helper, MyPlugin::Patches::DashboardsHelperPatch
alexandermeindl commented 3 years ago

Hi @skalimer0, I am glad you found your solution. Just for info: