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

Fixed Service Reconfigure Form and Request Summary Pages #8953

Merged
merged 1 commit into from
Nov 22, 2023

Conversation

DavidResende0
Copy link
Member

Continuation Of: #8428

Returns the reconfigure service functionality accidentally removed in #8229. Also fixes an issue with the reconfigure service request summary page that was preventing the "Dialog Options" section from displaying correctly.

Preview:
Service Summary Page:
image
Reconfigure Page:
image
Request Summary Page:
image

Note: #8951 will eventually convert these pages over to react

@jeffibm
Copy link
Member

jeffibm commented Nov 7, 2023

Hey @DavidResende0 , any idea why most of these fields are disabled?

I have all fields disabled.
image

In your screenshots, you have one enabled.

However I was able to hit the submit button to reconfigure. Seems good.

@DavidResende0
Copy link
Member Author

DavidResende0 commented Nov 7, 2023

Hey @DavidResende0 , any idea why most of these fields are disabled?

I have all fields disabled. image

In your screenshots, you have one enabled.

However I was able to hit the submit button to reconfigure. Seems good.

There's a setting when creating the dialog fields that determines whether the field can be reconfigured or not. If I was guessing, I would say you have that setting set to false.

@GilbertCherrie
Copy link
Member

GilbertCherrie commented Nov 7, 2023

@DavidResende0 @jeffibm I can't find any services with this reconfigure button but if @jeffibm already reviewed and approved it should be fine.

@jeffibm
Copy link
Member

jeffibm commented Nov 8, 2023

@DavidResende0 @jeffibm I can't find any services with this reconfigure button but if @jeffibm already reviewed and approved it should be fine.

Hey @gilbert, I guess you need to select the Reconfigure Entry Point in the catalog item
image

@@ -33,6 +33,8 @@ def button
service_retire
when 'service_retire_now'
service_retire_now
when 'service_reconfigure'
javascript_redirect(:action => 'service_reconfigure', :id => params[:id])
Copy link
Member

Choose a reason for hiding this comment

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

Same question as #8930 (comment)

Should we raise here in an else case with a generic "not supported" warning? I assume before this change, it didn't do anything when you clicked the button. What's the best way to handle a button with no defined action?

Copy link
Member Author

Choose a reason for hiding this comment

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

Well I'm pretty sure the button won't appear if the service can't be reconfigured but #8930 (comment) should cover this as well right?

Copy link
Member

Choose a reason for hiding this comment

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

Yes, that would cover it.

I don't know if that's the best solution but could help us if we extend this case statement in the future. So, instead of the case statement, it would just instantiate the correct service button class and call "press" on it. Ideally, the case statement could be methods called on service button classes instead. The different button classes could implement the body of each branch of the case statement and ultimately inherent from the base service button class which could be "the else case" and could decide to raise, alert, or silently do nothing as it could be treated as an abstract class.

Copy link
Member

Choose a reason for hiding this comment

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

Note, that could be the wrong abstraction but case statements that grow in length usually have an abstraction we can do so we can "hide" the implementation in those classes.

Copy link
Member

Choose a reason for hiding this comment

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

@DavidResende0 I'm not suggesting we abstract classes for the service button classes in this PR, just that it's something I see the moment I see the growing case statements based on "pseudo-classlike" objects. For now, the fix + a "unsupported button action" prompt is more than enough

@miq-bot
Copy link
Member

miq-bot commented Nov 14, 2023

Checked commit DavidResende0@c036814 with ruby 2.6.10, rubocop 1.28.2, haml-lint 0.35.0, and yamllint
5 files checked, 3 offenses detected

app/views/miq_request/_service_reconfigure_show.html.haml

  • ⚠️ - Line 14 - id attribute must be in lisp-case
  • ⚠️ - Line 26 - Style/RedundantInterpolation: Prefer to_s over string interpolation.

app/views/service/service_reconfigure.html.haml

  • ⚠️ - Line 1 - Layout/TrailingEmptyLines: Final newline missing.

@jeffibm jeffibm merged commit 4ade64e into ManageIQ:master Nov 22, 2023
8 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

6 participants