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

Replace dashes with underscores when searching for matching hosts #1178

Merged
merged 2 commits into from Aug 2, 2016

Conversation

@Calvinp
Copy link
Contributor

Calvinp commented Jul 28, 2016

Sometimes hostnames are presented with dashes, sometimes with underscores. On the tasks page they are presented with underscores. Because of this, when linked from a page where they're presented with dashes, no match would be found. This fixes that.

@Calvinp
Copy link
Contributor Author

Calvinp commented Jul 28, 2016

@@ -68,7 +68,7 @@ export const getFilteredTasks = createSelector(
_.each(tasks, (t) => {
t.id = id.extract(t);
});
const hostMatch = fuzzy.filter(filter.filterText, tasks, host);
const hostMatch = fuzzy.filter(filter.filterText.split('-').join('_'), tasks, host);

This comment has been minimized.

Copy link
@tpetr

tpetr Aug 2, 2016

Member

why split() and join() vs. replace()?

This comment has been minimized.

Copy link
@Calvinp

Calvinp Aug 2, 2016

Author Contributor

Because I didn't realize I could use a /g flag to make the replacement global.

@tpetr
Copy link
Member

tpetr commented Aug 2, 2016

LGTM

@Calvinp Calvinp merged commit f63ba0d into decaf Aug 2, 2016
0 of 2 checks passed
0 of 2 checks passed
continuous-integration/travis-ci/push The Travis CI build could not complete due to an error
Details
continuous-integration/travis-ci/pr The Travis CI build is in progress
Details
@Calvinp Calvinp deleted the tasks_page_dashes_count_as_underscores_for_hosts branch Aug 2, 2016
@tpetr tpetr modified the milestone: 0.10.0 Aug 18, 2016
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Linked issues

Successfully merging this pull request may close these issues.

None yet

2 participants
You can’t perform that action at this time.