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 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

cc @wolfd @kwm4385 @tpetr

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

@tpetr tpetr Aug 2, 2016

Choose a reason for hiding this comment

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

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

Copy link
Contributor Author

@Calvinp Calvinp Aug 2, 2016

Choose a reason for hiding this comment

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

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

@tpetr
Copy link
Contributor

tpetr commented Aug 2, 2016

LGTM

@Calvinp Calvinp merged commit f63ba0d into decaf Aug 2, 2016
0 of 2 checks passed
@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
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants