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
UI for orderable orchestration templates #7822
UI for orderable orchestration templates #7822
Conversation
6eb6c9b
to
3e1b38c
Compare
2b7f83c
to
a6970c1
Compare
@bzwei @h-kataria @martinpovolny Review? |
<pr_mergeability_checker />This pull request is not mergeable. Please rebase and repush. |
@bzwei can you try this in UI, tested in my environment LGTM. |
@@ -56,11 +56,12 @@ def textual_ems_cloud | |||
def textual_orchestration_template | |||
template = @record.orchestration_template | |||
return nil if template.nil? | |||
return nil unless template.orderable |
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.
@mzazrivec i think we don't need this check anymore, we do want to show a link for both types of Orchestartion Templates from Stack summary screen,
@mzazrivec from the stack summary page I don't see the template appears in the Relationships table when the template is not orderable. So I cannot test the feature to convert or copy to orderable. |
@bzwei once @mzazrivec removes the check on #7822 (diff), it should show links to both orderable & non-orderable templates. |
a6970c1
to
7d72ed7
Compare
@bzwei @h-kataria I removed the check preventing from displaying non-orderable Regarding the new screen -- the requirements, as they were described in the ticket -- were mentioning |
@bzwei please re-test |
@mzazrivec Tested the make template orderable feature. I saw message "Orchestration Template is now orderable". But the configuration menu does not change. It still looks as if the template is not orderable. Even worse the template got deleted from the database. I am doing some debugging too to see whether this is a backend problem. |
@mzazrivec I confirmed there is a backend bug causing the template being deleted. Please do not merge this PR until the backend issue is cleared. At the mean time please take a look at the other problems that I reported. |
marking it WIP until back end issue is fixed. |
@bzwei So what probably happened with the OT copy you described above was that a new template (the copy) was created and the old one was deleted. |
@mzazrivec no, I verified from database that the stack still referenced to the old template but it got renamed and flagged. |
@bzwei That's strange, because this is the controller code doing the copy: ot = OrchestrationTemplate.new(
:name => params[:templateName],
:description => params[:templateDescription],
:type => original_template.type,
:content => params[:templateContent],
:draft => params[:templateDraft] == "true",
)
begin
ot.save_as_orderable!
rescue StandardError => bang
...
else
...
end I'm not sure how this can create the results you're describing. |
@mzazrivec then it must be caused by the same backend bug. I am able to create a PR. Will update here. |
@mzazrivec I understand the problem now. For a copied template, if the user modifies the content before save, a new template will be generated. If the user only renames, all the changes (name and orderable flag) will be applied to the existing template. This is according to design. So this is not a real problem. The reasoning behind it is we don't allow two templates to have the same content. |
7d72ed7
to
3959903
Compare
<pr_mergeability_checker />This pull request is not mergeable. Please rebase and repush. |
fc290dc
to
ecd475f
Compare
@bzwei I fixed the problem with re-rendering the screen after making a non-orderable template orderable. |
@mzazrivec The problem still exists. After the template gets converted to orderable, the view in a catalog menu is gray out, and the other two menus are enabled. Also I suggested change the text to |
ecd475f
to
e1a1886
Compare
e1a1886
to
43639e1
Compare
@bzwei Fixed. |
Checked commits mzazrivec/manageiq@cf577d3~...43639e1 with ruby 2.2.3, rubocop 0.37.2, and haml-lint 0.16.1 app/controllers/orchestration_stack_controller.rb
app/helpers/application_helper/toolbar/stack_orchestration_template_center.rb
app/views/orchestration_stack/_copy_orchestration_template.html.haml
app/views/orchestration_stack/_stack_orchestration_template.html.haml
spec/factories/orchestration_stack.rb
|
Tested and looks good now. 👍 |
Implemented:
Fixes: #6600
https://bugzilla.redhat.com/show_bug.cgi?id=1302810