VolkovLabs / volkovlabs-dynamictext-panel

Business Text Panel for @grafana
https://docs.volkovlabs.io
Apache License 2.0
78 stars 14 forks source link

Migration script doesn't take exising context.* usage into account #329

Open i-mediasolutions opened 3 days ago

i-mediasolutions commented 3 days ago

When updating the panel to 5.0.0, the migration script does not take existing context.* usage into account, like in the 'Before content rendering', the following script:

context.handlebars.registerHelper("containerId", () => `container-${context.panelData.request.panelId}`);

is migrated to

context.handlebars.registerHelper("containerId", () => `container-${context.context.panelData.request.panelId}`);

therefore all panels will break after the migration. Please update the migration script to ignore existing usage of the new context.* structure.

mikhail-vl commented 3 days ago

@i-mediasolutions Thank you for opening the issue.

During the migration plugin verifies the pluginVersion property set for each panel in your dashboard. If it less then 5.0.0, then migration is performed. If you are already using context and migration is not required, please update pluginVersion to 5.0.0 manually to avoid migration.

Please let me know if it helps.

i-mediasolutions commented 3 days ago

Thank you for providing the workaround; however it will be a challenge manually updating the plugin version for 300+ dashboards, but I'll give it a try.