Sensetif / sensetif-app-plugin

The Grafana Application Plugin for the Sensetif platform.
Apache License 2.0
0 stars 0 forks source link

Edit Datapoint doesn't work #25

Closed niclash closed 2 years ago

niclash commented 2 years ago

Adding a Datapoint works and gets registered correctly.

When going back to edit such datapoint, it is correctly populated in the form. But when saving it, only part of the data is sent. Many things missing. And that is saved and then next round of "Edit Datapoint" it will be mostly empty form.

Edit Project doesn't have this problem.

niclash commented 2 years ago

I have now tried far too much and possibly breaking more than I am fixing. I think I need to ask @grzegorekb for help.

niclash commented 2 years ago

Please look into this. I have exhausted my understanding of what is happening (and don't have a local system set up) and console.log() or logInfo() don't work when running Grafana on prod (don't know if it works when running locally).

Feel free to charge/invoice me for work done, or put it up on a "work done" list and invoice later when a bit more...

grzegorekb commented 2 years ago

Sorry for the timing. Things has changed since when I changed job. Will take a look this week and let you know.

On Tue, Nov 2, 2021, 2:17 PM Niclas Hedhman @.***> wrote:

Please look into this. I have exhausted my understanding of what is happening (and don't have a local system set up) and console.log() or logInfo() don't work when running Grafana on prod (don't know if it works when running locally).

Feel free to charge/invoice me for work done.

— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub https://github.com/Sensetif/sensetif-app-plugin/issues/25#issuecomment-957550876, or unsubscribe https://github.com/notifications/unsubscribe-auth/AB53AGRGFADWWA5VLFMTS33UJ7QGXANCNFSM5HGMDAHA . Triage notifications on the go with GitHub Mobile for iOS https://apps.apple.com/app/apple-store/id1477376905?ct=notification-email&mt=8&pt=524675 or Android https://play.google.com/store/apps/details?id=com.github.android&referrer=utm_campaign%3Dnotification-email%26utm_medium%3Demail%26utm_source%3Dgithub.

grzegorekb commented 2 years ago

As I switched from linux to macos, I experience a similar issue with building backend plugin code: https://github.com/confluentinc/confluent-kafka-go/issues/523 Need more time to set up dev environment

grzegorekb commented 2 years ago

update: managed to build it in linux-based container; docker ftw

grzegorekb commented 2 years ago

@niclash I've made 2 commits; the first one only upgrades grafana's libraries <- should also work without it, didn't check.;

second commit with the actual fix: https://github.com/Sensetif/sensetif-app-plugin/commit/066856102c5d9a8ed89892a43758eedb5a465131 Please verify on your environment if it works; if it does I will propagate the change to other affected places.

grzegorekb commented 2 years ago

btw. it worked before; maybe it's some issue with the newest Grafana / or Form library it uses underneath. That's interesting. I will check on that when have some free time

niclash commented 2 years ago

I don't know when it stopped working, but you are right that it worked at some point in the past. I made the assumption that it happened when you refactored things into more modularity.

I will try to test it today.

grzegorekb commented 2 years ago

Also, once we have some working version I would merge these branches (datasource & app plugins) to master; create some release in Github and delete these branches. I think it will be more convenient to work once a new issue comes in. I would go with trunk-based / short-lived branches so we always have the latest working version on master.

Additionally, I would suggest writing unit-tests for backend (as I'm more familiar with golang, I could start work on this when having some time). The sooner the better I think because it might be that the code requires some/lot of refactoring to be properly unit-tested. @niclash