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

Record plugin versions in DB and show in Shop panel #4895

Merged
merged 7 commits into from
Jan 10, 2019
Merged

Conversation

brent-hoover
Copy link
Collaborator

Resolves #4874
Impact: minor
Type: feature

Issue

Have some standard way to record versions of plugins and make them visible to an admin so that you know what code is deployed

Solution

Plugins can add a "version" key to register.js and they will be stored in the db and displayed in the shop panel

Breaking changes

None

Testing

  1. Add a new plugin with a register.js that looks like this:
import Reaction from "/imports/plugins/core/core/server/Reaction";

Reaction.registerPackage({
  label: "Plugin-Versions",
  name: "reaction-plugin-versions",
  version: "1.0",
  icon: "fa fa-vines",
  autoEnable: true,
  registry: [{
    provides: ["dashboard"],
    label: "Plugin Versions",
    description: "Plugin Versions",
    icon: "fa fa-vines",
    template: "PluginVersionsSettings"
  }]
});
  1. Restart reaction
  2. Go to the dashboard. shop settings and click on "plugin version" and observe that the version number is available there.

@brent-hoover brent-hoover requested a review from aldeed January 4, 2019 00:58
Copy link
Contributor

@aldeed aldeed left a comment

Choose a reason for hiding this comment

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

See some minor comments

import PropTypes from "prop-types";
import PluginVersion from "../components/plugin-versions";

class PluginVersionsContainer extends Component {
Copy link
Contributor

Choose a reason for hiding this comment

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

In new code we name the file the same as the component, in the same case: PluginVersionsContainer.js

@aldeed
Copy link
Contributor

aldeed commented Jan 9, 2019

Also there is one eslint error in plugin-versions.js

@brent-hoover
Copy link
Collaborator Author

@aldeed That "block style" rule totally bothers me as I feel like it forces me to make the code more difficult to read.

C'est la vie. All changes addressed.

@aldeed
Copy link
Contributor

aldeed commented Jan 10, 2019

Added a version to a plugin and it showed up. 👍

@aldeed aldeed merged commit b1c58f2 into develop Jan 10, 2019
@aldeed aldeed deleted the brent-fix-4874 branch January 10, 2019 22:51
@spencern spencern mentioned this pull request Jan 18, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants