-
Notifications
You must be signed in to change notification settings - Fork 356
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
Added "Preserve owner?" checkbox on Import report screen #5060
Added "Preserve owner?" checkbox on Import report screen #5060
Conversation
…port. There is 'Preserve owner' checkbox added on Import report page, UI PR: ManageIQ/manageiq-ui-classic#5060 This checkbox controls if report will be imported in the old way: unconditionally override user_id and miq_group_id fields of imported report, OR in the new way: keep those fields untouched. Fixes https://bugzilla.redhat.com/show_bug.cgi?id=1638533
app/controllers/report_controller.rb
Outdated
@@ -72,8 +72,11 @@ def upload | |||
end | |||
if params[:upload] && params[:upload][:file] && params[:upload][:file].respond_to?(:read) | |||
@sb[:overwrite] = !params[:overwrite].nil? | |||
@sb[:preserve_owner] = !params[:preserve_owner].nil? |
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.
@sb[:preserve_owner] = params[:preserve_owner].present?
sounds better :)
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.
ok, I will change
it would look more easy to read, but will dissonance with the line above it...
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.
I'll take care of that in #5094 :)
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.
@ZitaNemeckova Ohh, I see, you have change that in PR
@@ -13,10 +13,14 @@ | |||
:multipart => true, | |||
:method => :post) do | |||
- overwrite = @sb[:overwrite] ? true : false | |||
- preserve_owner = @sb[:preserve_owner] ? true : false |
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.
This seems to be extra. Why not use @sb[:preserve_owner]
directly?
LGTM 👍 |
This pull request is not mergeable. Please rebase and repush. |
…ser_id and miq_group_id field of imported report with value for user who is doing import. After: owrk old way (ovverride) f Preserver Owner checkbox unchecked and do not override (keep original values) if this checkbox checked. After: owrk old way (ovverride) f Preserver Owner checkbox unchecked and do not override (keep original values) if this checkbox checked. Depends on ManageIQ/manageiq#18270 Fixes https://bugzilla.redhat.com/show_bug.cgi?id=1638533
062d75f
to
57fde20
Compare
57fde20
to
acd3826
Compare
Checked commits yrudman/manageiq-ui-classic@7a2e79f~...acd3826 with ruby 2.3.3, rubocop 0.52.1, haml-lint 0.20.0, and yamllint 1.10.0 |
…port. There is 'Preserve owner' checkbox added on Import report page, UI PR: ManageIQ/manageiq-ui-classic#5060 This checkbox controls if report will be imported in the old way: unconditionally override user_id and miq_group_id fields of imported report, OR in the new way: keep those fields untouched. Fixes https://bugzilla.redhat.com/show_bug.cgi?id=1638533
Travis was green but not shown here. Restarted. |
Good to merge once the core PR is merged. 👍 |
There is 'Preserve owner' checkbox added on Import report page, UI PR: ManageIQ/manageiq-ui-classic#5060 This checkbox controls if report will be imported in the old way: unconditionally override user_id and miq_group_id fields of imported report, OR in the new way: keep those fields untouched. In order to support report import in mutilregion environment: added 'userid' and 'group_description' attributes to exported report Fixes https://bugzilla.redhat.com/show_bug.cgi?id=1638533
There is 'Preserve owner' checkbox added on Import report page, UI PR: ManageIQ/manageiq-ui-classic#5060 This checkbox controls if report will be imported in the old way: unconditionally override user_id and miq_group_id fields of imported report, OR in the new way: keep those fields untouched. In order to support report import in mutilregion environment: added 'userid' and 'group_description' attributes to exported report Fixes https://bugzilla.redhat.com/show_bug.cgi?id=1638533
There is 'Preserve owner' checkbox added on Import report page, UI PR: ManageIQ/manageiq-ui-classic#5060 This checkbox controls if report will be imported in the old way: unconditionally override user_id and miq_group_id fields of imported report, OR in the new way: keep those fields untouched. In order to support report import in mutilregion environment: added 'userid' and 'group_description' attributes to exported report Fixes https://bugzilla.redhat.com/show_bug.cgi?id=1638533
@miq-bot remove-label pending core @martinpovolny core PR merged |
Added "Preserve owner?" checkbox on Import report screen (cherry picked from commit 738d133) Fixes https://bugzilla.redhat.com/show_bug.cgi?id=1693719
Hammer backport details:
|
Before:
![before](https://user-images.githubusercontent.com/6556758/49609821-a8e17e80-f96a-11e8-8998-7ee4c5bf27f9.png)
We unconditionally overrided
user_id
andmiq_group_id
fields of imported report with value for user who is doing import.After:
![after](https://user-images.githubusercontent.com/6556758/49659013-498a7980-fa11-11e8-9d1f-e75319414ca6.png)
Preserver owner?
checkbox is controlling if we need to work in old way (override) or preserveuser_id
andmiq_group_id
from imported reportDepends on ManageIQ/manageiq#18270
Fixes https://bugzilla.redhat.com/show_bug.cgi?id=1638533
@miq-bot add-label enhancement , cloud intel/reporting, pending core
\cc @gtanzillo