-
Notifications
You must be signed in to change notification settings - Fork 358
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
storage service endpoint #8617
storage service endpoint #8617
Conversation
89eb2d1
to
e65fb54
Compare
3f63ab5
to
66af393
Compare
these errors refer to formats I copied from existing files https://github.com/ManageIQ/manageiq-ui-classic/actions/runs/4037650069/jobs/6941095157 |
1623955
to
a1ad580
Compare
app/javascript/components/storage-service-form/storage-service-form.schema.js
Outdated
Show resolved
Hide resolved
app/javascript/components/storage-service-form/storage-service-form.schema.js
Outdated
Show resolved
Hide resolved
app/javascript/components/storage-service-form/storage-service-form.schema.js
Outdated
Show resolved
Hide resolved
app/javascript/components/storage-service-form/storage-service-form.schema.js
Outdated
Show resolved
Hide resolved
app/javascript/components/storage-service-form/storage-service-form.schema.js
Outdated
Show resolved
Hide resolved
app/javascript/components/storage-service-form/storage-service-form.schema.js
Outdated
Show resolved
Hide resolved
Hey @OrGur1987 , could you also have a look into the failing specs.. |
a1ad580
to
31b75b5
Compare
hi, could u please re-run the cross repo checks? |
8d399cf
to
8d167ad
Compare
hi @jeffibm, |
@jeffibm |
ohh, we have a branch in core to be merged right? I just re-run all the jobs before. |
yes, I've added |
ok, I am not sure how to run the jobs without the core branch being merged. @agrare , could you please help.. |
@jeffibm that is what cross-repo-tests does. See https://github.com/ManageIQ/miq_bot for examples |
@miq-bot cross-repo-tests ManageIQ/manageiq#22331 |
From Pull Request: ManageIQ/manageiq-ui-classic#8617
73d782d
to
8b9e4d6
Compare
@@ -251,7 +251,7 @@ def view_to_url(view, parent = nil) | |||
if controller == "ems_storage" && action == "show" | |||
return ems_storages_path | |||
end | |||
|
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.
Oooo good find
# Else disable button if no active providers support create action | ||
def disabled? | ||
if @view_context.params["id"] | ||
current_ems = ExtManagementSystem.where(:id => @view_context.params["id"]).first |
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.
current_ems = ExtManagementSystem.where(:id => @view_context.params["id"]).first | |
current_ems = ExtManagementSystem.find(@view_context.params["id"]) |
or If you don't want to raise an exception if we can't find by ID
current_ems = ExtManagementSystem.where(:id => @view_context.params["id"]).first | |
current_ems = ExtManagementSystem.find_by(:id => @view_context.params["id"]) |
but based on the next line I think you want to raise if it can't find one since you're not checking for nil
ExtManagementSystem.none? do |ems| | ||
ems.class_by_ems("StorageService")&.supports?(:create) | ||
end |
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.
Double-check me on this but I think StorageService.providers_supporting(:create).none?
would work better (it filters EMS by type-supporting first so more performant)
@@ -61,6 +61,12 @@ def textual_storage_resource | |||
nil | |||
end | |||
|
|||
def textual_storage_service | |||
@record.ext_management_system.storage_services.find(@record.storage_service_id) |
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.
If you have an ID can't you just do StorageService.find(@record.storage_service_id)
or better yet do you have @record.storage_service
?
"#{capability['name']}: #{capability['value']}" | ||
def textual_group_cloud_volumes | ||
volumes = @record.cloud_volumes.map do |v| | ||
storage_service = @record.ext_management_system.storage_services.find(v.storage_service_id) |
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.
Similar question, can you just do StorageService.find(v.storage_service_id)
or use v.storage_service
?
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.
btw, we notices that the textual_link
don't work in the resulting tables.
it looks like a link (blue) but clicking it gets no response.
I suspect the map function somehow disables it..
opened a bug-ticket in our next sprint to try and fix this throughout our provider.
|
||
def textual_group_storage_resources | ||
resources = @record.storage_resources.map do |r| | ||
free_space = number_to_percentage(r.logical_free.to_f * 100 / r.logical_total.to_f, :precision => 1) |
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.
Shouldn't we check that r.logical_total.to_f
isn't 0
? Technically N/0.0
float is Infinity
but not sure how number_to_percentage
handles that ;)
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.
|
||
def textual_group_cloud_volumes | ||
volumes = @record.cloud_volumes.map do |v| | ||
storage_resource = @record.ext_management_system.storage_resources.find(v.storage_resource_id) |
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.
8b9e4d6
to
b58043a
Compare
Checked commit Autosde@b58043a with ruby 2.6.10, rubocop 1.28.2, haml-lint 0.35.0, and yamllint app/helpers/application_helper/button/storage_service_new.rb
app/helpers/cloud_volume_helper/textual_summary.rb
app/helpers/ems_storage_helper/textual_summary.rb
app/helpers/storage_resource_helper/textual_summary.rb
app/helpers/storage_service_helper/textual_summary.rb
app/views/storage_service/show.html.haml
app/views/storage_service/show_list.html.haml |
see issue #8616
also, this PR includes changes based on enhancements from PR #8631, and adds service_storage related enhancements.
this will probably require a rebase once #8631 is merged