Skip to content

Commit

Permalink
1197 fixed table layout for detailed race and ethnicity
Browse files Browse the repository at this point in the history
  • Loading branch information
horatiorosa committed May 15, 2024
1 parent d9f81bc commit f19eade
Show file tree
Hide file tree
Showing 2 changed files with 35 additions and 17 deletions.
15 changes: 15 additions & 0 deletions app/components/data-table-row-current.js
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ export default Component.extend({
isSelected: false,
data: {}, // model object with specific properties
rowConfig: {}, // model's row configuration object
rowConfigKeysFound: [],

tagName: 'tr',
classNameBindings: ['getClassNames'],
Expand Down Expand Up @@ -43,6 +44,20 @@ export default Component.extend({
return false;
}),

displayEmptyCell: computed('rowConfig', 'pop', function () {
const rowConfig = this.get('rowConfig');

for (const key in rowConfig) {
if (rowConfig[key] === 'pop') {
this.rowConfigKeysFound.push(key);
}
}

if (this.rowConfigKeysFound.length) {
return true;
}
}),

actions: {
showData() {
window.logModel = this.get('data');
Expand Down
37 changes: 20 additions & 17 deletions app/templates/components/data-table-row-current.hbs
Original file line number Diff line number Diff line change
Expand Up @@ -149,28 +149,31 @@
<td>&nbsp;</td>
<td class="cell-border-left">&nbsp;</td>
{{/if}}


{{#if this.displayEmptyCell}}
<td class=>&nbsp;</td>
{{/if}}

{{#if this.reliability}}
<td>&nbsp;</td>
{{#if this.reliability}}
<td>&nbsp;</td>
<td>&nbsp;</td>
<td>&nbsp;</td>
{{/if}}

<td class="cell-border-left">&nbsp;</td>
<td>&nbsp;</td>
{{#if this.reliability}}
<td>&nbsp;</td>
<td>&nbsp;</td>
<td>&nbsp;</td>
{{/if}}

<td class="cell-border-left">&nbsp;</td>
<td>&nbsp;</td>
{{#if this.reliability}}
{{/if}}

<td class="cell-border-left">&nbsp;</td>
<td>&nbsp;</td>
{{#if this.reliability}}
<td>&nbsp;</td>
<td>&nbsp;</td>
{{/if}}
<td>&nbsp;</td>
{{/if}}

<td class="cell-border-left">&nbsp;</td>
<td>&nbsp;</td>
{{#if this.reliability}}
<td>&nbsp;</td>
<td>&nbsp;</td>
{{/if}}

{{/unless}}
{{yield}}

0 comments on commit f19eade

Please sign in to comment.