Skip to content

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

Merged
lynnagara merged 5 commits into
masterfrom
group-events-env-filtering
Feb 27, 2018
Merged

feat(environments): Add group events environment filtering#7366
lynnagara merged 5 commits into
masterfrom
group-events-env-filtering

Conversation

@lynnagara

Copy link
Copy Markdown
Member

Add ability to filter group events by environment

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

ghost commented Feb 26, 2018

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

import TimeSince from '../components/timeSince';
import utils from '../utils';
import streamUtils from './stream/utils';
import qsUtils from '../utils/queryString';

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

@benvinegar benvinegar left a comment

Copy link
Copy Markdown
Contributor

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.

defaultQuery: '',
query: '',
onSearch: function() {},
onQueryChange: function() {},

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