Altair: Action Button Setup

Created on 8 Apr 2020  ·  8Comments  ·  Source: imolorhe/altair

Describe the bug
I don't see my action button plugin in Altair after I register it.

To Reproduce
Steps to reproduce the behavior:

  1. Clone altair repo and run the app within packages/altair-app
  2. Enable experimental features in settings
  3. Add altair-graphql-plugin-json-to-csv to the list of enabled plugins in settings.
  4. Add this.pluginRegistry.fetchPlugin('altair-graphql-plugin-json-to-csv', { version: '0.0.4' }); to /src/app/containers/app/app.component.ts on line 131
  5. Restart the app

Expected behavior
Honestly, I'm not sure what to expect, but I think I expected to see a button next to the "Download" button in the bottom right corner.

Desktop (please complete the following information):

  • OS: MacOS Catalina
  • Browser: Chrome 80.0.3987.149
  • Platform: web app
  • Version: 2.4.6

Additional context
Trying to figure out how to get a simple plugin working.

Using this package: https://github.com/isaachvazquez/altair-graphql-plugin-json-to-csv

The plugin appears to be loading, but I don't know how to get the button to show up.
Screen Shot 2020-04-08 at 10 02 07 AM

All 8 comments

Hey @isaachvazquez :wave:,

Thank you for opening an issue. We will get back to you as soon as we can.
Also, check out our Open Collective and consider backing us - every little help counts!

Hey @isaachvazquez,

I'll check the package and get back to you.

@isaachvazquez You were very close 🙂 You just missed adding the script to the manifest.json file:

diff --git a/manifest.json b/manifest.json
index e3381b1..effd545 100644
--- a/manifest.json
+++ b/manifest.json
@@ -10,5 +10,8 @@
   "action_button_opts": {
     "class_name": "ActionButtonJsonToCSV",
     "location": "result_pane"
-  }
+  },
+  "scripts": [
+    "index.js"
+  ]
 }

With that, you will have the screenshot like below:

Screenshot 2020-04-08 at 5 20 58 PM

@imolorhe Thanks!

@imolorhe Can I access the output from the query via the props in the action button somehow?

Ouch! Just realized that the query result isn't exposed to plugins at the moment. I can make the necessary changes to enable that.

You could also make the changes and send create an MR if you want 🙂

I would, but I'm not sure how to do that. What file would I need to change?

Primarily here: https://github.com/imolorhe/altair/blob/staging/packages/altair-app/src/app/services/plugin/plugin-props-factory.ts#L35-L81

You would need to update the interfaces in plugins.ts file else you would have type errors.

GitHub
✨⚡️ A beautiful feature-rich GraphQL Client for all platforms. - imolorhe/altair
Was this page helpful?
0 / 5 - 0 ratings