-
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
Enable new dialog-user feature for more custom buttons #2671
Enable new dialog-user feature for more custom buttons #2671
Conversation
917684a
to
6a7230f
Compare
WIP-ing until the API code gets merged that supports custom actions for these objects. |
@eclarizio Perfect, nice to see this happening :) .. @ZitaNemeckova is working on enabling custom buttons/custom buttons with dialogs in a few more screens - most notably in #1912 (continued in #2269, #2439, #2593 and #2679) .. so most likely you'll have a few more on the todo ;) EDIT: also #3263 |
@himdel Yeah, that's ok, those should by default use the old dialog-user code. This new class will just need to be updated to support all of the other possible classes that can utilize custom buttons. |
6a7230f
to
5b9bd53
Compare
This pull request is not mergeable. Please rebase and repush. |
5b9bd53
to
5032ed2
Compare
Un WIP-ing now that the API code has been merged. The only potential issue here is the API performance concerns around custom buttons. @abellotti Do you have any input there? |
5032ed2
to
8b20ad7
Compare
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 really looks good to me - though - I don't have context on the performance issues question brought up by @eclarizio - so other than that - 👍
|
||
return dialog_locals unless NEW_DIALOG_USERS.include?(obj.class.name.demodulize) | ||
|
||
submit_endpoint, cancel_endpoint = determine_api_endpoints(obj) |
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 like how this is much easier to read.
8b20ad7
to
9619b9a
Compare
@dclarizio changes look good to me, it can be merged if API Performance is not an issue here, @abellotti any thoughts? |
def determine_api_endpoints(obj) | ||
case obj.class.name.demodulize | ||
when /CloudTenant/ | ||
api_collection_name = "cloud_tenants" |
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.
Optionally, the api_collection_name could be obtained via:
api_collection_name = Api::CollectionConfig.new.name_for_klass(obj.class)
perf wise should be good in api. The fixes went into g/yes so that collection searches do not expand custom actions, and this PR seems to act upon resources so I'm ok here. |
This pull request is not mergeable. Please rebase and repush. |
9619b9a
to
3f35e39
Compare
https://www.pivotaltracker.com/story/show/152449649 Custom buttons supported in this commit: CloudTenant CloudVolume ContainerNode EmsCluster Host InfraManager (Provider) MiqTemplate Storage
3f35e39
to
0f4d24f
Compare
Checked commit eclarizio@0f4d24f with ruby 2.3.3, rubocop 0.47.1, haml-lint 0.20.0, and yamllint 1.10.0 |
Enable new dialog-user feature for more custom buttons (cherry picked from commit 30fa192)
Gaprindashvili backport details:
|
Related to #2562, it is a continuation for other objects. This one will make custom buttons for the following classes go through the new dialog-user ui-component:
CloudTenant
CloudVolume
ContainerNode
EmsCluster
Host
InfraManager
(Provider)MiqTemplate
Storage
https://www.pivotaltracker.com/story/show/152449649
/cc @gmcculloug
@d-m-u Can you review, please?
@himdel Can you also review or tag someone to review, please?
@miq-bot assign @h-kataria
@miq-bot add_label gaprindashvili/yes, enhancement, automation/automate