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

Hide "Hide Deprecated" checkbox and remove "Deprecated" column when provisioning infra VM #3615

Merged

Conversation

hstastna
Copy link

@hstastna hstastna commented Mar 13, 2018

Fixes: https://bugzilla.redhat.com/show_bug.cgi?id=1399378

On pre provisioning screen, hide "Hide Deprecated" checkbox and remove "Deprecated" column from the table when user is submitting a provisioning request for Infrastructure VM, as those (the checkbox and the column) apply only to cloud provisioning. Cloud provisioning remains unchanged.


Before:
infra_prov_before1
infra_prov_before2

After:
infra_prov1
infra_prov2

@hstastna
Copy link
Author

@miq-bot add_label bug

@hstastna hstastna changed the title [WIP] Hide "Hide Deprecated" checkbox and remove "Deprecated" column when provisioning infra VM Hide "Hide Deprecated" checkbox and remove "Deprecated" column when provisioning infra VM Mar 13, 2018
@hstastna
Copy link
Author

@miq-bot remove_label wip

@miq-bot miq-bot removed wip labels Mar 13, 2018
:onclick => "miqAjax('" + url_for_only_path({:action => "vm_pre_prov", :id => id.to_s, :hide_deprecated_templates => !@edit[:hide_deprecated_templates]}) + "')",
:checked => @edit[:hide_deprecated_templates]}
= _('Hide deprecated')
- if request.parameters[:controller] == "vm_cloud"
Copy link
Member

Choose a reason for hiding this comment

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

Here you can test against @edit[:hide_deprecated_templates] instead.

@@ -17,8 +17,9 @@
= h(number_to_human_size(row.mem_cpu.to_i * 1024 * 1024))
%td
= h(number_to_human_size(row.allocated_disk_storage))
%td
= h(row.deprecated ? _("true") : _("false"))
- if @edit[:vm_headers].key? 'deprecated'
Copy link
Member

Choose a reason for hiding this comment

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

Please use parentheses around the argument.

@@ -52,8 +52,9 @@
= h(number_to_human_size(row.mem_cpu.to_i * 1024 * 1024))
%td
= h(number_to_human_size(row.allocated_disk_storage))
%td
= h(row.deprecated ? _("true") : _("false"))
- if @edit[:vm_headers].key? 'deprecated'
Copy link
Member

Choose a reason for hiding this comment

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

same here...

@@ -85,8 +86,9 @@
= h(number_to_human_size(@vm.mem_cpu.to_i * 1024 * 1024))
%td
= h(number_to_human_size(@vm.allocated_disk_storage))
%td
= h(@vm.deprecated ? _("true") : _("false"))
- if @edit[:vm_headers].key? 'deprecated'
Copy link
Member

Choose a reason for hiding this comment

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

You should omit parentheses only when you're using a DSL and here you're clearly not.

@hstastna hstastna force-pushed the Infra_provisio_template_deprecated_checkbox branch from cd1ed41 to 936da9f Compare April 17, 2018 10:56
Hilda Stastna added 3 commits April 17, 2018 13:49
On pre provisioning screen, hide "Hide Deprecated" checkbox when
user is submitting a provisioning request for Infrastructure VM.
Also set @edit[:hide_deprecated_templates] to true only if cloud provisioning.
Remove 'Deprecated' column from the grid after a template is selected,
when Infrastructure provisioning.
@hstastna hstastna force-pushed the Infra_provisio_template_deprecated_checkbox branch from 936da9f to 13620b3 Compare April 17, 2018 11:49
@hstastna
Copy link
Author

hstastna commented Apr 17, 2018

@skateman I think the changes should be done ;)
Note: I used unless.. .nil? in the haml because nothing or present? returned false also for false value, not just for nil, and this would lead to another bug (the checkbox would disappear in cloud instances, after unchecking it, when provisioning instances)

@miq-bot
Copy link
Member

miq-bot commented Apr 17, 2018

Checked commits hstastna/manageiq-ui-classic@8050114~...13620b3 with ruby 2.3.3, rubocop 0.52.1, haml-lint 0.20.0, and yamllint 1.10.0
4 files checked, 1 offense detected

**

  • 💣 💥 🔥 🚒 - Linter/Haml - Linter::Haml STDERR:
warning: parser/current is loading parser/ruby23, which recognizes
warning: 2.3.6-compliant syntax, but you are running 2.3.3.
warning: please see https://github.com/whitequark/parser#compatibility-with-ruby-mri.

Copy link
Member

@skateman skateman left a comment

Choose a reason for hiding this comment

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

The Seal of Approval

@hstastna
Copy link
Author

@miq-bot add_label gaprindashvili/yes

@hstastna
Copy link
Author

@martinpovolny @mzazrivec Could you please look at this PR? Any comment appreciated. Thanks!

@mzazrivec mzazrivec self-assigned this May 23, 2018
@mzazrivec mzazrivec added this to the Sprint 87 Ending Jun 4, 2018 milestone May 23, 2018
@mzazrivec mzazrivec merged commit 98ac39a into ManageIQ:master May 23, 2018
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.

4 participants