mirror of
https://github.com/datahub-project/datahub.git
synced 2025-08-22 16:18:10 +00:00
Merge pull request #709 from theseyi/new-field-modification-indicator
displays the new field indicator if the field has not been modified i…
This commit is contained in:
commit
cf6cd75b13
@ -7,7 +7,7 @@ import {
|
||||
logicalTypesForGeneric
|
||||
} from 'wherehows-web/components/dataset-compliance';
|
||||
|
||||
const { computed, get, getProperties } = Ember;
|
||||
const { computed, get, getProperties, set } = Ember;
|
||||
/**
|
||||
* String indicating that the user affirms a suggestion
|
||||
* @type {string}
|
||||
@ -105,6 +105,16 @@ export default DatasetTableRow.extend({
|
||||
*/
|
||||
suggestionAuthority: computed.alias('field.suggestionAuthority'),
|
||||
|
||||
/**
|
||||
* Checks that the field does not have a recently input value
|
||||
* @type {Ember.computed}
|
||||
* @return {boolean}
|
||||
*/
|
||||
isNewField: computed('isNewComplianceInfo', 'isModified', function() {
|
||||
const { isNewComplianceInfo, isModified } = getProperties(this, ['isNewComplianceInfo', 'isModified']);
|
||||
return isNewComplianceInfo && !isModified;
|
||||
}),
|
||||
|
||||
/**
|
||||
* Maps the suggestion response to a string resolution
|
||||
* @type {Ember.computed}
|
||||
@ -225,6 +235,7 @@ export default DatasetTableRow.extend({
|
||||
const { onFieldIdentifierTypeChange } = this.attrs;
|
||||
if (typeof onFieldIdentifierTypeChange === 'function') {
|
||||
onFieldIdentifierTypeChange(get(this, 'field'), { value });
|
||||
set(this, 'isModified', true);
|
||||
}
|
||||
},
|
||||
|
||||
@ -237,6 +248,7 @@ export default DatasetTableRow.extend({
|
||||
const { onFieldLogicalTypeChange } = this.attrs;
|
||||
if (typeof onFieldLogicalTypeChange === 'function') {
|
||||
onFieldLogicalTypeChange(get(this, 'field'), { value });
|
||||
set(this, 'isModified', true);
|
||||
}
|
||||
},
|
||||
|
||||
@ -248,6 +260,7 @@ export default DatasetTableRow.extend({
|
||||
const { onFieldClassificationChange } = this.attrs;
|
||||
if (typeof onFieldClassificationChange === 'function') {
|
||||
onFieldClassificationChange(get(this, 'field'), { value });
|
||||
set(this, 'isModified', true);
|
||||
}
|
||||
},
|
||||
|
||||
|
@ -10,6 +10,7 @@
|
||||
suggestionAuthority=suggestionAuthority
|
||||
suggestionResolution=suggestionResolution
|
||||
suggestion=prediction
|
||||
isNewField=isNewField
|
||||
onFieldIdentifierTypeChange=(action 'onFieldIdentifierTypeChange')
|
||||
onFieldClassificationChange=(action 'onFieldClassificationChange')
|
||||
onFieldLogicalTypeChange=(action 'onFieldLogicalTypeChange')
|
||||
|
@ -99,6 +99,7 @@
|
||||
{{#each (sort-by table.sortBy table.data) as |field|}}
|
||||
{{#body.row
|
||||
field=field
|
||||
isNewComplianceInfo=isNewComplianceInfo
|
||||
class=(if (and hasRecentSuggestions field.suggestion) "dataset-compliance-fields__has-suggestions")
|
||||
hasRecentSuggestions=hasRecentSuggestions
|
||||
onFieldLogicalTypeChange=(action 'onFieldLogicalTypeChange')
|
||||
|
Loading…
x
Reference in New Issue
Block a user