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

Display richer status tooltips #2919

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open

Conversation

dasch
Copy link
Contributor

@dasch dasch commented Sep 3, 2018

Work in progress.

/cc @zendesk/samson

Tasks

  • 👍 from team

Risks

  • Level: Low

status_counts << "#{failed.count} failed" if failed.any?
status_counts << "#{succeeded.count} succeeded" if succeeded.any?
status_counts << "#{errored.count} errored" if errored.any?
status_counts << "#{pending.count} pending" if pending.any?
Copy link
Contributor

Choose a reason for hiding this comment

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

how about something like that to avoid duplication here and also having to add another 4 copy-pasty methods that need to stay in sync with this code

[:failed?, :errored?, :pending?, :succeeded?].map do |status|
  found = status.status.select(&status)
  "#{found} #{status.to_s.sub('?', '')}" if found.any?
end.compact

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I'll take repetition over cleverness any day of the week...

Copy link
Contributor

Choose a reason for hiding this comment

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

could use this to make it less clever/more repetitive but still dry, also solves all the 'missing test coverage' errors

[['failed, ':failed?], ['errored', :errored?], ['pending', :pending?], ['succeeded', :succeeded?]].map do |name, status|
  found = status.status.select(&status)
  "#{found} #{name}" if found.any?
end.compact

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