Skip to content

Commit fba36be

Browse files
Convert textualempty table to react
1 parent 94b2e7c commit fba36be

File tree

3 files changed

+13
-20
lines changed

3 files changed

+13
-20
lines changed

app/helpers/generic_object_helper/textual_summary.rb

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ def textual_updated
2020

2121
def textual_group_attribute_details_list
2222
if @record.property_attributes.count.zero?
23-
TextualEmpty.new(_('Attributes'), _('No Attributes defined'))
23+
TextualEmpty.new(_('Attributes'))
2424
else
2525
TextualMultilabel.new(
2626
_('Attributes'),
@@ -33,7 +33,7 @@ def textual_group_attribute_details_list
3333

3434
def textual_group_associations
3535
if @record.property_associations.count.zero?
36-
TextualEmpty.new(_('Associations'), _('No Associations defined'))
36+
TextualEmpty.new(_('Associations'))
3737
else
3838
TextualGroup.new(_("Associations"), associations)
3939
end
@@ -62,7 +62,7 @@ def textual_group_methods
6262
end
6363

6464
if methods.count.zero?
65-
TextualEmpty.new(_('Methods'), _('No Methods defined'))
65+
TextualEmpty.new(_('Methods'))
6666
else
6767
TextualGroup.new(_('Methods'), methods)
6868
end
Lines changed: 7 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -1,25 +1,18 @@
11
import * as React from 'react';
22
import PropTypes from 'prop-types';
3+
import MiqStructuredList from '../miq-structured-list';
34

45
export default function EmptyGroup(props) {
5-
const { title, text } = props;
6+
const { title } = props;
67
return (
7-
<table className="table table-bordered table-striped table-summary-screen">
8-
<thead>
9-
<tr>
10-
<th>{title}</th>
11-
</tr>
12-
</thead>
13-
<tbody>
14-
<tr>
15-
<td>{text}</td>
16-
</tr>
17-
</tbody>
18-
</table>
8+
<MiqStructuredList
9+
rows={[]}
10+
title={title}
11+
mode="generic_group"
12+
/>
1913
);
2014
}
2115

2216
EmptyGroup.propTypes = {
2317
title: PropTypes.string.isRequired,
24-
text: PropTypes.string.isRequired,
2518
};

spec/helpers/generic_object_helper/textual_summary_spec.rb

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@
3737
it "displays 'No Attributes defined' when Attributes do not exist" do
3838
@record = FactoryBot.create(:generic_object, :generic_object_definition_id => @generic_obj_defn.id)
3939

40-
expected = TextualEmpty.new('Attributes', 'No Attributes defined')
40+
expected = TextualEmpty.new('Attributes')
4141

4242
expect(textual_group_attribute_details_list).to eq(expected)
4343
end
@@ -59,7 +59,7 @@
5959
it "displays 'No Associations defined' when do not Associations exist" do
6060
@record = FactoryBot.create(:generic_object, :generic_object_definition_id => @generic_obj_defn_with_no_properties.id)
6161

62-
expected = TextualEmpty.new('Associations', 'No Associations defined')
62+
expected = TextualEmpty.new('Associations')
6363

6464
expect(textual_group_associations).to eq(expected)
6565
end
@@ -75,7 +75,7 @@
7575
it "displays 'No Methods defined' when do not Methods exist" do
7676
@record = FactoryBot.create(:generic_object, :generic_object_definition_id => @generic_obj_defn_with_no_properties.id)
7777

78-
expected = TextualEmpty.new('Methods', 'No Methods defined')
78+
expected = TextualEmpty.new('Methods')
7979

8080
expect(textual_group_methods).to eq(expected)
8181
end

0 commit comments

Comments
 (0)