-
-
Notifications
You must be signed in to change notification settings - Fork 4.6k
feat(ui): Change to use PluginsStore #6848
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
Conversation
…tchPlugins actions
Changes the following views: * Issue tracking * Plugin Details * Release Tracking
158e0bc to
a0119c0
Compare
Generated by 🚫 danger |
MaxBittker
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
the split state thing is confusing, but the tests look good to help make up for that. 👍 Sorry for the slow review! this seems nice, I liked seeing your use of HOCs.
|
|
||
| export const PluginShape = PropTypes.shape(Plugin); | ||
|
|
||
| export const PluginsStore = PropTypes.shape({ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
👍
| let organization = this.props.organization || this.getOrganization(); | ||
| let project = this.props.project || this.getProject(); | ||
|
|
||
| if (!project || !organization) return; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
when would this mount without having these?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
hmm it shouldn't, would it be better to throw an error here?
| * 2) We fetch "plugin details" via API and save it to local state as `pluginDetails`. | ||
| * This is because "details" call contains form `config` and the "list" endpoint does not. | ||
| * The more correct way would be to pass `config` to PluginConfig and use plugin from | ||
| * PluginsStore |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
👍
|
|
||
| toggleEnable(shouldEnable) { | ||
| let method = shouldEnable ? 'POST' : 'DELETE'; | ||
| // Enabled state is handled via PluginsStore and not via plugins detail |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
this comment is slightly confusing, because the code seems like it sometimes defers to pluginDetails for enabled state
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It falls back to pluginDetails if for some reason it couldn't fetch the plugin from PluginsStore
| * | ||
| * This is made because some components (e.g. ProjectPluginDetail) takes project as prop | ||
| */ | ||
| class SettingsProjectProvider extends React.Component { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
👍
Changes the following views:
Will make sep PR to clean up other project settings views that fetch plugins list