Skip to content

Commit

Permalink
Rename property for AttributesTable
Browse files Browse the repository at this point in the history
There was a conflict between this being called attributes
and the splattributes that are available for Glimmer
components.
  • Loading branch information
backspace committed Jul 10, 2020
1 parent ed29e5e commit 6fec3f2
Show file tree
Hide file tree
Showing 4 changed files with 8 additions and 8 deletions.
6 changes: 3 additions & 3 deletions ui/app/templates/clients/client/index.hbs
Original file line number Diff line number Diff line change
Expand Up @@ -431,7 +431,7 @@
{{#if a.item.attributes.attributesStructured}}
<div class="boxed-section-body is-full-bleed">
<AttributesTable
@attributes={{a.item.attributesShort}}
@attributePairs={{a.item.attributesShort}}
@class="attributes-table" />
</div>
{{else}}
Expand All @@ -454,7 +454,7 @@
<div class="boxed-section-body is-full-bleed">
<AttributesTable
data-test-attributes
@attributes={{this.model.attributes.attributesStructured}}
@attributePairs={{this.model.attributes.attributesStructured}}
@class="attributes-table" />
</div>
<div class="boxed-section-head">
Expand All @@ -464,7 +464,7 @@
<div class="boxed-section-body is-full-bleed">
<AttributesTable
data-test-meta
@attributes={{this.model.meta.attributesStructured}}
@attributePairs={{this.model.meta.attributesStructured}}
@class="attributes-table" />
</div>
{{else}}
Expand Down
2 changes: 1 addition & 1 deletion ui/app/templates/components/attributes-table.hbs
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,6 @@
</tr>
</thead>
<tbody>
<AttributesSection @attributes={{this.attributes}} />
<AttributesSection @attributes={{@attributePairs}} />
</tbody>
</table>
2 changes: 1 addition & 1 deletion ui/stories/components/table-configuration.stories.js
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ export let TableConfiguration = () => {
return {
template: hbs`
<h5 class="title is-5">Table, configuration</h5>
<AttributesTable @attributes={{attributes}} @class="attributes-table" />
<AttributesTable @attributePairs={{attributes}} @class="attributes-table" />
`,
context: {
attributes: {
Expand Down
6 changes: 3 additions & 3 deletions ui/tests/integration/attributes-table-test.js
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ module('Integration | Component | attributes table', function(hooks) {

test('should render a row for each key/value pair in a deep object', async function(assert) {
this.set('attributes', commonAttributes);
await render(hbs`<AttributesTable @attributes={{attributes}} />`);
await render(hbs`<AttributesTable @attributePairs={{attributes}} />`);

const rowsCount = Object.keys(flatten(commonAttributes)).length;
assert.equal(
Expand All @@ -40,7 +40,7 @@ module('Integration | Component | attributes table', function(hooks) {

test('should render the full path of key/value pair from the root of the object', async function(assert) {
this.set('attributes', commonAttributes);
await render(hbs`<AttributesTable @attributes={{attributes}} />`);
await render(hbs`<AttributesTable @attributePairs={{attributes}} />`);

assert.equal(find('[data-test-key]').textContent.trim(), 'key', 'Row renders the key');
assert.equal(find('[data-test-value]').textContent.trim(), 'value', 'Row renders the value');
Expand All @@ -61,7 +61,7 @@ module('Integration | Component | attributes table', function(hooks) {

test('should render a row for key/value pairs even when the value is another object', async function(assert) {
this.set('attributes', commonAttributes);
await render(hbs`<AttributesTable @attributes={{attributes}} />`);
await render(hbs`<AttributesTable @attributePairs={{attributes}} />`);

const countOfParentRows = countOfParentKeys(commonAttributes);
assert.equal(
Expand Down

0 comments on commit 6fec3f2

Please sign in to comment.