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

Add timeline to physical server #2272

Merged
merged 3 commits into from
Oct 31, 2017
Merged

Conversation

lucashsilva
Copy link
Contributor

@lucashsilva lucashsilva commented Oct 2, 2017

This PR consists in adding the monitoring button group with timelines button to the physical server page and making the timeline page available when this button is clicked.

Physical server page with monitoring button group
Physical server page with monitoring button group

Disabled when there are no events for the physical server
Disabled when there are no events for the physical server

Enabled when there are events for the physical server
Enabled when there are events for the physical server

Timeline page before filtering
Timeline page before filtering

Timeline page after filtering
Timeline page after filtering

This PR depends on core PR 16084.

@miq-bot miq-bot added the wip label Oct 2, 2017
@lucashsilva lucashsilva changed the title [WIP] Adds timeline to physical server Adds timeline to physical server Oct 4, 2017
@miq-bot miq-bot removed the wip label Oct 4, 2017
@lucashsilva
Copy link
Contributor Author

@miq-bot add_label enhancement

@AndreyMenezes
Copy link
Member

@juliancheal @AparnaKarve

@juliancheal
Copy link
Member

Looks like just a couple of tests need passing.

@lucashsilva
Copy link
Contributor Author

@juliancheal this PR depends on core PR 16084, and that's why the tests are failing. I saw your restarted its build, which had failed, and everything looks fine now.

@juliancheal
Copy link
Member

@lucashsilva ah thanks, I'd missed that in the first comment that it relied on another PR, thanks!

@lucashsilva
Copy link
Contributor Author

lucashsilva commented Oct 10, 2017

@juliancheal @AparnaKarve everything looks fine now :)

@miq-bot
Copy link
Member

miq-bot commented Oct 10, 2017

This pull request is not mergeable. Please rebase and repush.

@lucashsilva
Copy link
Contributor Author

@agrare could you please take a look at this?

@agrare
Copy link
Member

agrare commented Oct 17, 2017

ping @AparnaKarve

tl_build_timeline
drop_breadcrumb(:name => _("Timelines"), :url => show_link(@record, :refresh => "n", :display => "timeline"))
session[:tl_record_id] = @record.id
javascript_redirect(polymorphic_path(@record, :display => 'timeline').sub!('.', '/show/'))
Copy link
Contributor

Choose a reason for hiding this comment

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

@lucashsilva Since you have defined the mixin Mixins::MoreShowActions at the top, could you simply call the method show_timeline instead of writing this block?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

@AparnaKarve I figured out I didn't use anything from this mixin and that the model I followed didn't either. Sorry for that. I also tried to do what you said but the user is not redirected to the timelines page and nothing is shown. If you look at this, you'll see a similar code, which was the way I found to redirect the user to the timelines page. How should I proceed?

Is it necessary to execute the lines 51 to 57 if the user will be redirected to a new page?
I could get the button to work and redirect correctly with lines 52 and 58 only and without the mixin.

Copy link
Contributor

Choose a reason for hiding this comment

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

@lucashsilva I think it would be better to use the mixin.
The eventual goal would be to make use of the mixin in the entire app and remove duplication.

Can you give this a try -

if params[:pressed] == "physical_server_timeline"
  @record = find_record_with_rbac(ManageIQ::Providers::PhysicalInfraManager::PhysicalServer, params[:id])
  show_timeline
  javascript_redirect :action => 'show', :id => @record.id, :display => 'timeline'
end

Copy link
Contributor Author

Choose a reason for hiding this comment

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

@AparnaKarve I tried it and it works. I already pushed the change.

@AparnaKarve
Copy link
Contributor

@lucashsilva Overall the code looks good.
Per my above comment, if you could leverage the mixin method, that would be great.

@lucashsilva lucashsilva changed the title Adds timeline to physical server Add timeline to physical server Oct 19, 2017
@miq-bot
Copy link
Member

miq-bot commented Oct 19, 2017

Checked commits lucashsilva/manageiq-ui-classic@287a65b~...dabe446 with ruby 2.3.3, rubocop 0.47.1, and haml-lint 0.20.0
5 files checked, 0 offenses detected
Everything looks fine. 🍪

@agrare
Copy link
Member

agrare commented Oct 24, 2017

@AparnaKarve can you give it another look? Thanks!

@chessbyte chessbyte assigned chessbyte and unassigned dclarizio Oct 31, 2017
@chessbyte
Copy link
Member

Reviewed by @Fryguy and @blomquisg -- merging.

@chessbyte chessbyte merged commit 76881d4 into ManageIQ:master Oct 31, 2017
@chessbyte chessbyte added this to the Sprint 72 Ending Oct 30, 2017 milestone Oct 31, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

8 participants