adds feature to show all potential member data fields in readonly mode, filters to contained member data fields by default.

This commit is contained in:
Seyi Adebajo 2017-08-20 18:53:01 -07:00
parent ef1c1df63b
commit 9bbf77fe99
2 changed files with 63 additions and 34 deletions

View File

@ -293,6 +293,12 @@ export default Component.extend({
.every(({ value }) => [true, false].includes(value));
}),
/**
* Determines if all member data fields should be shown in the member data table i.e. show only fields contained in
* this dataset or otherwise
*/
isShowingAllMemberData: computed.or('showAllDatasetMemberData', 'isEditing'),
/**
* Determines if the save feature is allowed for the current dataset, otherwise e.g. interface should be disabled
* @type {Ember.computed}
@ -650,6 +656,13 @@ export default Component.extend({
);
},
/**
* Sets the flag to show all member potential member data fields that may be contained in this dataset
*/
onShowAllDatasetMemberData() {
return set(this, 'showAllDatasetMemberData', true);
},
/**
* Handle the user intent to place this compliance component in edit mode
*/

View File

@ -101,19 +101,22 @@
</header>
</section>
<table class="nacho-table nacho-table--bordered nacho-table--stripped">
<thead>
<tr>
<th>Types of member data</th>
<th class="dataset-field-content__header">
{{#dataset-table
class="nacho-table nacho-table--bordered nacho-table--stripped"
fields=datasetClassification as |table|}}
{{#table.head as |head|}}
{{#head.column}}Types of member data{{/head.column}}
{{#head.column class="dataset-field-content__header"}}
<span class="dataset-field-value">Is this type of member data contained in this dataset?</span>
</th>
</tr>
</thead>
<tbody>
{{#each datasetClassification as |classification|}}
<tr>
<td class="dataset-field-content__prompt">
{{/head.column}}
{{/table.head}}
{{#table.body as |body|}}
{{#each (if isShowingAllMemberData table.data (filter-by "value" true table.data)) as |classification|}}
{{#body.row as |row|}}
{{#row.cell class="dataset-field-content__prompt"}}
<span class="dataset-tag-container">
{{#if (eq classification.value true)}}
@ -143,8 +146,9 @@
{{classification.label}}
</span>
</td>
<td class="dataset-field-content__input">
{{/row.cell}}
{{#row.cell class="dataset-field-content__input"}}
<span class="dataset-field-value">
{{#radio-button-composer
value=true
@ -160,12 +164,24 @@
changed=(action "onChangeDatasetClassification")}}
No
{{/radio-button-composer}}
</span>
</td>
</tr>
</span>{{/row.cell}}
{{/body.row}}
{{/each}}
</tbody>
</table>
{{/table.body}}
{{#unless isShowingAllMemberData}}
{{#table.foot}}
<td colspan="2" class="text-center">
<button
{{action "onShowAllDatasetMemberData"}}
class="nacho-button--large nacho-button--tertiary">
See More <span class="caret" aria-label="See More Dataset Member Data"></span>
</button>
</td>
{{/table.foot}}
{{/unless}}
{{/dataset-table}}
<section class="metadata-prompt">
<header class="metadata-prompt__header">