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

feat(environments): Add group events environment filtering #7366

Merged
merged 5 commits into from
Feb 27, 2018

Conversation

lynnagara
Copy link
Member

Add ability to filter group events by environment

@lynnagara lynnagara requested a review from a team February 26, 2018 21:32
@ghost
Copy link

ghost commented Feb 26, 2018

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

Generated by 🚫 danger

@lynnagara lynnagara force-pushed the group-events-env-filtering branch from ac6c882 to 45194dc Compare February 26, 2018 22:04
{
query: newQueryString,
},
this.handleSearch(newQueryString)
Copy link
Member

Choose a reason for hiding this comment

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

Why setState here if handleSearch is going to navigate to a diff route. Also why call handleSearch in callback if it doesn't depend on 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.

Good catch, that's not necessary

@@ -25,7 +25,7 @@ import StreamFilters from './stream/filters';
import StreamSidebar from './stream/sidebar';
import TimeSince from '../components/timeSince';
import utils from '../utils';
import streamUtils from './stream/utils';
import qsUtils from '../utils/queryString';
Copy link
Member

Choose a reason for hiding this comment

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

nit: let's try to keep import name the same as module name

Copy link
Contributor

@benvinegar benvinegar left a comment

Choose a reason for hiding this comment

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

See comments, specifically around handling groupId changes. It feels like this should include at least snapshot tests; these are sensitive pages, and introducing changes feels like we should add coverage.

placeholder: PropTypes.string,
};

static defaultProps = {
defaultQuery: '',
query: '',
onSearch: function() {},
onQueryChange: function() {},
Copy link
Contributor

Choose a reason for hiding this comment

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

What about the component passing onQueryChange to this? Was it not being passed?

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 wasn't passed or used anywhere

nextProps.location.search !== this.props.location.search
) {
let queryParams = nextProps.location.query;
// If query has changed, update the environment with the query environment
Copy link
Contributor

Choose a reason for hiding this comment

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

Is it intentional that this is no longer handling the case where groupId is changed?

Copy link
Member Author

Choose a reason for hiding this comment

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

Yes, it's guarding against a situation that I can't see ever arising. We don't change group ID within the group details view. To change group ID you'd have to navigate to a different route and the component will be remounted.

Copy link
Contributor

Choose a reason for hiding this comment

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

Seems I added it when upgrading to react-router 1.0 here. I don't really remember what I was doing; maybe I wasn't using routes correctly. I agree it should be re-mounted.

@lynnagara lynnagara merged commit d585906 into master Feb 27, 2018
@lynnagara lynnagara deleted the group-events-env-filtering branch February 27, 2018 18:51
@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