Skip to content

Commit 0d6c1f2

Browse files
authored
Merge pull request #8803 from amalvijayan03/first-user-summary-conversion
Automate first user summary conversion from Haml to React
2 parents 291b8e0 + f586fd6 commit 0d6c1f2

File tree

2 files changed

+23
-13
lines changed

2 files changed

+23
-13
lines changed

app/helpers/miq_ae_class_helper.rb

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -324,4 +324,26 @@ def datastore_form(ae_ns, sb_data, type)
324324
:nameReadOnly => domain && !ae_ns.editable_property?(:name),
325325
:descReadOnly => domain && !ae_ns.editable_property?(:description)})
326326
end
327+
328+
def first_user_summary(ae_method, sb_data)
329+
rows = [
330+
row_data(_('Type'), ae_method.location),
331+
row_data(_('Fully Qualified Name'), sb_data[:namespace_path]),
332+
row_data(_('Name'), ae_method.name),
333+
row_data(_('Display Name'), ae_method.display_name),
334+
row_data(_('Created On'), format_timezone(ae_method.created_on, Time.zone, "gtl")),
335+
]
336+
337+
miq_structured_list({
338+
:title => _('Main Info'),
339+
:mode => "first_user_summary",
340+
:rows => rows
341+
})
342+
end
343+
344+
private
345+
346+
def row_data(label, value)
347+
{:cells => {:label => label, :value => value}}
348+
end
327349
end

app/views/miq_ae_class/_method_inputs.html.haml

Lines changed: 1 addition & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -7,19 +7,7 @@
77
- else
88
= render :partial => "method_form", :locals => {:prefix => ""}
99
- else
10-
%h3
11-
= _('Main Info')
12-
.form-horizontal
13-
.form-group
14-
= format_form_group(_('Type'), location_fancy_name(@ae_method.location))
15-
.form-group
16-
= format_form_group(_('Fully Qualified Name'), @sb[:namespace_path])
17-
.form-group
18-
= format_form_group(_('Name'), @ae_method.name)
19-
.form-group
20-
= format_form_group(_('Display Name'), @ae_method.display_name)
21-
.form-group
22-
= format_form_group(_('Created On'), format_timezone(@ae_method.created_on, Time.zone, "gtl"))
10+
= first_user_summary(@ae_method, @sb)
2311
- if @ae_method.location == 'inline'
2412
= render :partial => "embedded_methods"
2513
= render :partial => "domain_overrides", :locals => {:node_prefix => "aem", :model => "Method"}

0 commit comments

Comments
 (0)