Skip to content

Replace dashes with underscores when searching for matching hosts#1178

Merged
Calvinp merged 2 commits into
decaffrom
tasks_page_dashes_count_as_underscores_for_hosts
Aug 2, 2016
Merged

Replace dashes with underscores when searching for matching hosts#1178
Calvinp merged 2 commits into
decaffrom
tasks_page_dashes_count_as_underscores_for_hosts

Conversation

@Calvinp
Copy link
Copy Markdown
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
Copy Markdown
Contributor Author

Calvinp commented Jul 28, 2016

cc @wolfd @kwm4385 @tpetr

Comment thread SingularityUI/app/selectors/tasks.es6 Outdated
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
Copy Markdown
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
Copy Markdown
Contributor Author

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

tpetr commented Aug 2, 2016

LGTM

@Calvinp Calvinp merged commit f63ba0d into decaf Aug 2, 2016
@Calvinp Calvinp deleted the tasks_page_dashes_count_as_underscores_for_hosts branch August 2, 2016 16:57
@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.

2 participants