Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Plugin API feature: added getInfo method to context.app #3975

Merged
merged 13 commits into from Sep 15, 2021

Conversation

monrax
Copy link
Contributor

@monrax monrax commented Aug 30, 2021

Copy link
Contributor

@develohpanda develohpanda left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for the PR! One small update, please 🙌🏽

Looks like there are a couple of lint errors too, they can be auto-fixed by running npm run lint:fix from the root of the repository

packages/insomnia-app/app/plugins/context/app.tsx Outdated Show resolved Hide resolved
@develohpanda develohpanda added the A-plugin-api Area: Plugin API / System label Aug 31, 2021
Copy link
Contributor

@develohpanda develohpanda left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🚀 tested with the following example plugin

module.exports.workspaceActions = [
  {
    action: async (context) => {
      const info = context.app.getInfo();
      await context.app.alert('Info', JSON.stringify(info));
    },
    label: 'Show info',
  },
]

2021-09-03 16 24 06

@vercel vercel bot temporarily deployed to Preview September 3, 2021 04:25 Inactive
Copy link
Contributor

@develohpanda develohpanda left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Strange how there were some additional lint changes that went in; how did you run lint fix? Was it npm run lint:fix from the root directory of this project?

Anyway that's okay, I reverted those. Thank you for adding tests! LGTM

@monrax
Copy link
Contributor Author

monrax commented Sep 7, 2021

Yes, I ran it like that but I also thought it was strange how it changed functions into arrow functions and just not accepting them otherwise. Maybe there's something wrong with my setup. Sorry about that, and glad I could help!

@develohpanda
Copy link
Contributor

That's all good! I'll have a look at it 😊

dimitropoulos added a commit that referenced this pull request Sep 15, 2021
while making a plugin to test #3975 I happened to just randomly select `insomnia-plugin-file`'s package.json and noticed this typo.
Copy link
Contributor

@dimitropoulos dimitropoulos left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think this is ready to go!

I noticed there is a z-index problem, but that isn't related to what this PR implements:

2021-09-15.15-51-06.mp4

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-plugin-api Area: Plugin API / System
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Add getInfo to context.app on the Plugin API
3 participants