-
-
Notifications
You must be signed in to change notification settings - Fork 208
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
Modify error color for Running tab when a job has 1 attempt #1518
Comments
good catch, that makes sense to me to not have the error color. I imagine we'd have to thread down the context into that row which sounds messy, but probably worth it. |
oh good, it's much easier than that 👍🏻 This logic with the job state just needs to be a little more complex: Is that a PR you'd be able to make? |
@bensheldon I am wondering if we have any guarantees from good_job that would make the implementation cleaner. Specifically, will there always be data inside of <% if job.recent_error && job.status != :finished %>
# Show span If there isn't something simple like that, this slightly-messy logic would work to do the following:
<% show_error = (job.status == :running && job.executions_count > 1) || (![:finished, :running].include?(job.status) && job.executions_count > 0) %>
<% if show_error %>
<%= tag.span job.executions_count, class: "badge rounded-pill bg-danger",
data: {
bs_toggle: "popover",
bs_trigger: "hover focus click",
bs_placement: "bottom",
bs_content: job.recent_error,
}
%>
<% else %>
<span class="badge bg-secondary rounded-pill"><%= job.executions_count %></span>
<% end %>
|
Good call! Yes, I think you're correct that this could more simply be (use <% if job.error && job.status != :finished %>
# Show span ...also just fyi, I think |
Problem
When a job is running and has 1 attempt, the badge with Attempts has an error color
![Screenshot 2024-10-14 at 7 45 38 AM](https://private-user-images.githubusercontent.com/30442914/376289608-885f1cce-3c06-49a3-91f1-64f8fad70092.png?jwt=eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJnaXRodWIuY29tIiwiYXVkIjoicmF3LmdpdGh1YnVzZXJjb250ZW50LmNvbSIsImtleSI6ImtleTUiLCJleHAiOjE3MzkxODMzNjcsIm5iZiI6MTczOTE4MzA2NywicGF0aCI6Ii8zMDQ0MjkxNC8zNzYyODk2MDgtODg1ZjFjY2UtM2MwNi00OWEzLTkxZjEtNjRmOGZhZDcwMDkyLnBuZz9YLUFtei1BbGdvcml0aG09QVdTNC1ITUFDLVNIQTI1NiZYLUFtei1DcmVkZW50aWFsPUFLSUFWQ09EWUxTQTUzUFFLNFpBJTJGMjAyNTAyMTAlMkZ1cy1lYXN0LTElMkZzMyUyRmF3czRfcmVxdWVzdCZYLUFtei1EYXRlPTIwMjUwMjEwVDEwMjQyN1omWC1BbXotRXhwaXJlcz0zMDAmWC1BbXotU2lnbmF0dXJlPTRhMGYxNmRlOTVlNDg5NTIwM2JkMzZkMzA1MDQzOTQzYjVjMTdjYjZhYzcxNzhkNmNjMjc4NmM0ZTQ5N2NlODEmWC1BbXotU2lnbmVkSGVhZGVycz1ob3N0In0.O9d7PlRZW4HmSsyHyE1muD9lw8eMr63A8ieIlGKrIaU)
Proposed Solution
For this tab when the attempt count is equal to 1, show a neutral gray color like the Succeeded tab
The text was updated successfully, but these errors were encountered: