truncates field names on double click, shows full text by default

This commit is contained in:
Seyi Adebajo 2018-04-20 12:49:25 -07:00
parent b6fa7c4660
commit efac87a519
5 changed files with 44 additions and 7 deletions

View File

@ -27,6 +27,11 @@ import { IComplianceEntity } from 'wherehows-web/typings/api/datasets/compliance
export default class DatasetComplianceRollupRow extends Component.extend({
tagName: ''
}) {
/**
* References the parent external action to handle double click events on the field name
* @memberof DatasetComplianceRollupRow
*/
onFieldDblClick: () => void;
/**
* References the parent external action to add a tag to the list of change sets
* @memberof DatasetComplianceRollupRow
@ -247,6 +252,15 @@ export default class DatasetComplianceRollupRow extends Component.extend({
return false;
});
/**
* Mouse double click event handler invokes parent action
* @memberof DatasetComplianceRollupRow
*/
@action
onFragmentDblClick() {
get(this, 'onFieldDblClick')();
}
/**
* Toggles the expansion / collapse of the row expansion flag
* @memberof DatasetComplianceRollupRow

View File

@ -137,6 +137,12 @@ export default class DatasetCompliance extends Component {
*/
notifications: ComputedProperty<Notifications> = inject();
/**
* Flag indicating that the field names in each compliance row is truncated or rendered in full
* @type {boolean}
*/
isShowingFullFieldNames = true;
/**
* Flag indicating that the related dataset is schemaless or has a schema
* @type {boolean}
@ -941,6 +947,13 @@ export default class DatasetCompliance extends Component {
this.updateStep(initialStepIndex);
},
/**
* Toggles the flag isShowingFullFieldNames when invoked
*/
onFieldDblClick() {
this.toggleProperty('isShowingFullFieldNames');
},
/**
* Adds a new field tag to the list of compliance change set items
* @param {IComplianceChangeSet} tag properties for new field tag

View File

@ -15,6 +15,7 @@
isReviewRequested=isReviewRequested
suggestionResolution=suggestionResolution
suggestionMatchesCurrentValue=suggestionMatchesCurrentValue
onFragmentDblClick=(action "onFragmentDblClick")
onSuggestionClick=(action "onSuggestionClick")
onToggleRowExpansion=(action "onToggleRowExpansion")
onAddFieldTag=(action "onAddFieldTag")

View File

@ -75,12 +75,13 @@
field=field
isNewComplianceInfo=isNewComplianceInfo
complianceDataTypes=complianceDataTypes
onFieldDblClick=(action "onFieldDblClick")
onFieldTagAdded=(action "onFieldTagAdded")
onFieldTagRemoved=(action "onFieldTagRemoved")
onTagIdentifierTypeChange=(action "tagIdentifierChanged")
onSuggestionIntent=(action "onFieldSuggestionIntentChange") as |row|
}}
<tr class="{{if row.isReadonly 'dataset-compliance-fields--readonly'}}">
<tr class="{{if row.isReadonly 'dataset-compliance-fields--readonly'}}" ondblclick={{action row.onFragmentDblClick}}>
{{#row.cell}}
{{#if row.isReadonly}}
@ -147,12 +148,12 @@
<div>
<div title="{{row.identifierField}}">
<strong>
{{split-text row.identifierField 23}}
{{if isShowingFullFieldNames row.identifierField (split-text row.identifierField 23)}}
</strong>
</div>
<div title="{{row.dataType}}">
{{split-text row.dataType 23}}
{{if isShowingFullFieldNames row.dataType (split-text row.dataType 23)}}
</div>
</div>
</div>

View File

@ -17,15 +17,23 @@ const mockFieldChangeSets = [
isDirty: true,
privacyPolicyExists: false,
suggestionAuthority: true,
__requiresReview__: false,
__msg__: 'NO suggestion, and policy does NOT exist and user has made changes to local working copy'
__requiresReview__: true,
__msg__:
'No suggestion, and policy does NOT exist and user has made changes to local working copy, but no identifierType'
},
{
isDirty: false,
privacyPolicyExists: false,
suggestionAuthority: false,
__requiresReview__: true,
__msg__: 'No identifierType present'
},
{
isDirty: false,
privacyPolicyExists: false,
suggestionAuthority: true,
__requiresReview__: true,
__msg__: 'NO suggestion, and policy does NOT exist but user has NOT made changes to local working copy'
__msg__: 'No suggestion, and policy does NOT exist but user has NOT made changes to local working copy'
},
{
isDirty: true,
@ -34,7 +42,7 @@ const mockFieldChangeSets = [
suggestion,
identifierType: 'same',
__requiresReview__: false,
__msg__: 'NO suggestion, and policy does NOT exist but user has NOT made changes to local working copy'
__msg__: 'Suggestion exists, and policy does NOT exist but user has made changes to local working copy'
}
];