Skip to content

Conversation

@billyvg
Copy link
Member

@billyvg billyvg commented Dec 30, 2017

Changes the following views:

  • Issue tracking
  • Plugin Details
  • Release Tracking

Will make sep PR to clean up other project settings views that fetch plugins list

@billyvg billyvg force-pushed the fix/ui/issue-tracking-use-store branch from 158e0bc to a0119c0 Compare January 2, 2018 19:15
@billyvg billyvg requested a review from a team January 2, 2018 19:18
@billyvg billyvg self-assigned this Jan 2, 2018
@ghost
Copy link

ghost commented Jan 2, 2018

1 Warning
⚠️ You should update CHANGES due to the size of this PR

Generated by 🚫 danger

Copy link
Contributor

@MaxBittker MaxBittker left a 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({
Copy link
Contributor

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;
Copy link
Contributor

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?

Copy link
Member Author

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
Copy link
Contributor

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
Copy link
Contributor

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

Copy link
Member Author

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 {
Copy link
Contributor

Choose a reason for hiding this comment

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

👍

@billyvg billyvg merged commit 65bdd37 into master Jan 5, 2018
@billyvg billyvg deleted the fix/ui/issue-tracking-use-store branch January 5, 2018 21:00
@github-actions github-actions bot locked and limited conversation to collaborators Dec 22, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants