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
|
logicalTypesForGeneric
|
||||||
} from 'wherehows-web/components/dataset-compliance';
|
} 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
|
* String indicating that the user affirms a suggestion
|
||||||
* @type {string}
|
* @type {string}
|
||||||
@ -105,6 +105,16 @@ export default DatasetTableRow.extend({
|
|||||||
*/
|
*/
|
||||||
suggestionAuthority: computed.alias('field.suggestionAuthority'),
|
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
|
* Maps the suggestion response to a string resolution
|
||||||
* @type {Ember.computed}
|
* @type {Ember.computed}
|
||||||
@ -225,6 +235,7 @@ export default DatasetTableRow.extend({
|
|||||||
const { onFieldIdentifierTypeChange } = this.attrs;
|
const { onFieldIdentifierTypeChange } = this.attrs;
|
||||||
if (typeof onFieldIdentifierTypeChange === 'function') {
|
if (typeof onFieldIdentifierTypeChange === 'function') {
|
||||||
onFieldIdentifierTypeChange(get(this, 'field'), { value });
|
onFieldIdentifierTypeChange(get(this, 'field'), { value });
|
||||||
|
set(this, 'isModified', true);
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
|
||||||
@ -237,6 +248,7 @@ export default DatasetTableRow.extend({
|
|||||||
const { onFieldLogicalTypeChange } = this.attrs;
|
const { onFieldLogicalTypeChange } = this.attrs;
|
||||||
if (typeof onFieldLogicalTypeChange === 'function') {
|
if (typeof onFieldLogicalTypeChange === 'function') {
|
||||||
onFieldLogicalTypeChange(get(this, 'field'), { value });
|
onFieldLogicalTypeChange(get(this, 'field'), { value });
|
||||||
|
set(this, 'isModified', true);
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
|
||||||
@ -248,6 +260,7 @@ export default DatasetTableRow.extend({
|
|||||||
const { onFieldClassificationChange } = this.attrs;
|
const { onFieldClassificationChange } = this.attrs;
|
||||||
if (typeof onFieldClassificationChange === 'function') {
|
if (typeof onFieldClassificationChange === 'function') {
|
||||||
onFieldClassificationChange(get(this, 'field'), { value });
|
onFieldClassificationChange(get(this, 'field'), { value });
|
||||||
|
set(this, 'isModified', true);
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
|
||||||
|
@ -10,6 +10,7 @@
|
|||||||
suggestionAuthority=suggestionAuthority
|
suggestionAuthority=suggestionAuthority
|
||||||
suggestionResolution=suggestionResolution
|
suggestionResolution=suggestionResolution
|
||||||
suggestion=prediction
|
suggestion=prediction
|
||||||
|
isNewField=isNewField
|
||||||
onFieldIdentifierTypeChange=(action 'onFieldIdentifierTypeChange')
|
onFieldIdentifierTypeChange=(action 'onFieldIdentifierTypeChange')
|
||||||
onFieldClassificationChange=(action 'onFieldClassificationChange')
|
onFieldClassificationChange=(action 'onFieldClassificationChange')
|
||||||
onFieldLogicalTypeChange=(action 'onFieldLogicalTypeChange')
|
onFieldLogicalTypeChange=(action 'onFieldLogicalTypeChange')
|
||||||
|
@ -99,6 +99,7 @@
|
|||||||
{{#each (sort-by table.sortBy table.data) as |field|}}
|
{{#each (sort-by table.sortBy table.data) as |field|}}
|
||||||
{{#body.row
|
{{#body.row
|
||||||
field=field
|
field=field
|
||||||
|
isNewComplianceInfo=isNewComplianceInfo
|
||||||
class=(if (and hasRecentSuggestions field.suggestion) "dataset-compliance-fields__has-suggestions")
|
class=(if (and hasRecentSuggestions field.suggestion) "dataset-compliance-fields__has-suggestions")
|
||||||
hasRecentSuggestions=hasRecentSuggestions
|
hasRecentSuggestions=hasRecentSuggestions
|
||||||
onFieldLogicalTypeChange=(action 'onFieldLogicalTypeChange')
|
onFieldLogicalTypeChange=(action 'onFieldLogicalTypeChange')
|
||||||
|
Loading…
x
Reference in New Issue
Block a user