-
Notifications
You must be signed in to change notification settings - Fork 357
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
Add severity to Alerts #2280
Add severity to Alerts #2280
Conversation
001d8a3
to
5d07211
Compare
@miq-bot add_label pending core |
5d07211
to
783f290
Compare
@miq-bot remove_label wip |
783f290
to
5e84e48
Compare
@miq-bot remove_label wip |
All core dependencies are merged :) |
@h-kataria please review. Thanks :) |
@@ -1168,7 +1168,8 @@ def view_to_hash(view) | |||
when "result" | |||
new_row[:cells] << {:span => result_span_class(row[col]), :text => row[col].titleize} | |||
when "severity" | |||
new_row[:cells] << {:span => severity_span_class(row[col]), :text => row[col].titleize} | |||
value = row[col].nil? ? ' ' : row[col] |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
row[col] || ' '
maybe?
@@ -1220,6 +1221,14 @@ def severity_span_class(value) | |||
end | |||
end | |||
|
|||
def severity_title(value) | |||
if self.class == MiqPolicyController |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
instance_of?
or ===
probably
@@ -1,6 +1,7 @@ | |||
describe "miq_policy/_alert_details.html.haml" do | |||
before do | |||
@alert = FactoryGirl.create(:miq_alert) | |||
SEVERITIES = {"info" => _('Info'), "warning" => _('Warning'), "error" => _('Error')}.freeze |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
why is this constant here?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Without it I'm getting this error:
ActionView::Template::Error:
uninitialized constant ActionView::TestCase::TestController::SEVERITIES
bc8a6d7
to
28ffe77
Compare
28ffe77
to
5a01dea
Compare
Checked commits ZitaNemeckova/manageiq-ui-classic@d276118~...5a01dea with ruby 2.3.3, rubocop 0.47.1, and haml-lint 0.20.0 |
Control -> Explorer -> Alerts
https://www.pivotaltracker.com/story/show/151340254
Depends on ManageIQ/manageiq#16040 (Merged)
TODO:
After:
Fix for select picker is out of scope of this PR.
@miq-bot add_label wip, pending core