For GoodData plugins, is there a way to allow a us...
# gooddata-ui
e
For GoodData plugins, is there a way to allow a user to disable a plugin for a dashboard, other than us removing the plugin from the dashboard? Our GoodData integration is built to automatically link plugins to new dashboards. We’re adding a custom widget plugin that will replace the builtin GD table component with a different visualization, and we want this to be optional - so the users aren’t blocked from using GD tables when this plugin is linked to the dashboard. I know plugins can be parameterized so that’s one option to achieve this. Are there other options? Is there a property on a dashboard I can use to store arbitrary state data like this?
d
Hello! May I know if you are using React SDK or iframe?
e
Hello! We’re using an iframe to embed GoodData.
d
Thanks! and one more question (so I can understand better the use case) how are you currently linking the plugins? is it 1 customer = 1 workspace?
e
1 customer = 1 workspace, yes. We use the GoodData Python SDK for managing plugins. We first add a plugin to a workspace using the
sdk.client.entities_api.create_entity_dashboard_plugins
method. The plugin is linked to a dashboard via the following steps: 1. fetch the dashboard definition via
sdk.client.entities_api.get_entity_analytical_dashboards
2. Add the plugin reference to the dashboard’s current list of plugins 3. Update the via
sdk.client.entities_api.update_entity_analytical_dashboards
using this version modified to include the plugin For step 2, the plugin reference we build looks like this:
Copy code
{
    "plugin": {
        "identifier": {
            "id": plugin_id,
            "type": "dashboardPlugin"
        }
    },
    "version": "2"
}
i.e. it adheres to the GoodData API specification for plugins.
d
Thanks for your patience! Internally, we have not seen this use case. Therefore, currently we don’t have a built-in way to disable specific plugin by/per user. As this might not be wanted thing for every plugin. About it being able technically, yes, its possible to store any arbitrary data on the dashboard metadata object (there is no validation now, its free form), however, please keep in mind that we wouldn’t recommend it. (Due to the validation and this being a non tested scenario) Safest way to achieve this, would be to store disabled state in browser local storage (if its ok that if user opens it in different browser / device / anonymous window, it wont remember the latest setting state) - it will be remembered in the same browser only (for example, if you reload the page)
e
Thanks Daniela. This is basically what I thought was the case, i.e. one could add metadata to the dashboard but it’s not recommended. We’ll be able to meet the use case via other options, so no worries.
d
Thanks for letting me know Eoghan 🙂