Skip to content

Commit

Permalink
Merge pull request #8803 from amalvijayan03/first-user-summary-conver…
Browse files Browse the repository at this point in the history
…sion

Automate first user summary conversion from Haml to React
  • Loading branch information
jeffibm authored Aug 25, 2023
2 parents 291b8e0 + f586fd6 commit 0d6c1f2
Show file tree
Hide file tree
Showing 2 changed files with 23 additions and 13 deletions.
22 changes: 22 additions & 0 deletions app/helpers/miq_ae_class_helper.rb
Original file line number Diff line number Diff line change
Expand Up @@ -324,4 +324,26 @@ def datastore_form(ae_ns, sb_data, type)
:nameReadOnly => domain && !ae_ns.editable_property?(:name),
:descReadOnly => domain && !ae_ns.editable_property?(:description)})
end

def first_user_summary(ae_method, sb_data)
rows = [
row_data(_('Type'), ae_method.location),
row_data(_('Fully Qualified Name'), sb_data[:namespace_path]),
row_data(_('Name'), ae_method.name),
row_data(_('Display Name'), ae_method.display_name),
row_data(_('Created On'), format_timezone(ae_method.created_on, Time.zone, "gtl")),
]

miq_structured_list({
:title => _('Main Info'),
:mode => "first_user_summary",
:rows => rows
})
end

private

def row_data(label, value)
{:cells => {:label => label, :value => value}}
end
end
14 changes: 1 addition & 13 deletions app/views/miq_ae_class/_method_inputs.html.haml
Original file line number Diff line number Diff line change
Expand Up @@ -7,19 +7,7 @@
- else
= render :partial => "method_form", :locals => {:prefix => ""}
- else
%h3
= _('Main Info')
.form-horizontal
.form-group
= format_form_group(_('Type'), location_fancy_name(@ae_method.location))
.form-group
= format_form_group(_('Fully Qualified Name'), @sb[:namespace_path])
.form-group
= format_form_group(_('Name'), @ae_method.name)
.form-group
= format_form_group(_('Display Name'), @ae_method.display_name)
.form-group
= format_form_group(_('Created On'), format_timezone(@ae_method.created_on, Time.zone, "gtl"))
= first_user_summary(@ae_method, @sb)
- if @ae_method.location == 'inline'
= render :partial => "embedded_methods"
= render :partial => "domain_overrides", :locals => {:node_prefix => "aem", :model => "Method"}
Expand Down

0 comments on commit 0d6c1f2

Please sign in to comment.