diff --git a/wherehows-web/app/components/dataset-compliance.ts b/wherehows-web/app/components/dataset-compliance.ts index b4b4aed95b..7e475e0624 100644 --- a/wherehows-web/app/components/dataset-compliance.ts +++ b/wherehows-web/app/components/dataset-compliance.ts @@ -40,8 +40,7 @@ import { tagSuggestionNeedsReview, ComplianceEdit } from 'wherehows-web/constants'; -import { getTagsSuggestions } from 'wherehows-web/utils/datasets/compliance-suggestions'; -import { arrayFilter, arrayMap, compact, isListUnique, iterateArrayAsync } from 'wherehows-web/utils/array'; +import { arrayFilter, arrayMap, isListUnique, iterateArrayAsync } from 'wherehows-web/utils/array'; import { identity, noop } from 'wherehows-web/utils/helpers/functions'; import { IComplianceDataType } from 'wherehows-web/typings/api/list/compliance-datatypes'; import Notifications, { NotificationEvent } from 'wherehows-web/services/notifications'; @@ -237,7 +236,7 @@ export default class DatasetCompliance extends Component { * External action to handle manual compliance entity metadata entry */ onComplianceJsonUpdate: (jsonString: string) => Promise; - notifyOnChangeSetSuggestions: (hasSuggestions: boolean) => void; + notifyOnChangeSetRequiresReview: (hasChangeSetDrift: boolean) => void; classNames = ['compliance-container']; @@ -779,7 +778,6 @@ export default class DatasetCompliance extends Component { const suggestionThreshold = get(this, 'suggestionConfidenceThreshold'); // pass current changeSet state to parent handlers - run(() => next(this, 'notifyHandlerOfSuggestions', suggestionThreshold, changeSet)); run(() => next( this, @@ -936,19 +934,6 @@ export default class DatasetCompliance extends Component { }); }).drop(); - /** - * Invokes external action with flag indicating that at least 1 suggestion exists for a field in the changeSet - * @param {number} suggestionConfidenceThreshold confidence threshold for filtering out higher quality suggestions - * @param {Array} changeSet - */ - notifyHandlerOfSuggestions = ( - suggestionConfidenceThreshold: number, - changeSet: Array - ): void => { - const hasChangeSetSuggestions = !!compact(getTagsSuggestions({ suggestionConfidenceThreshold })(changeSet)).length; - this.notifyOnChangeSetSuggestions(hasChangeSetSuggestions); - }; - /** * Invokes external action with flag indicating that a field in the tags requires user review * @param {number} suggestionConfidenceThreshold confidence threshold for filtering out higher quality suggestions diff --git a/wherehows-web/app/components/datasets/containers/dataset-compliance.ts b/wherehows-web/app/components/datasets/containers/dataset-compliance.ts index 6043ca050b..bf905e0cb3 100644 --- a/wherehows-web/app/components/datasets/containers/dataset-compliance.ts +++ b/wherehows-web/app/components/datasets/containers/dataset-compliance.ts @@ -62,11 +62,6 @@ type BatchContainerDataResult = Pick< const { successUpdating, failedUpdating, successUploading, invalidPolicyData } = compliancePolicyStrings; export default class DatasetComplianceContainer extends Component { - /** - * External action on parent - */ - setOnChangeSetChange: (hasSuggestions: boolean) => void; - /** * External action to capture changes to dataset pii status */ @@ -325,15 +320,6 @@ export default class DatasetComplianceContainer extends Component { get(this, 'getComplianceTask').perform(); } - /** - * Invokes external action if field suggestions change - * @param {boolean} hasSuggestions - */ - @action - onSuggestionsChanged(hasSuggestions: boolean) { - this.setOnChangeSetChange(hasSuggestions); - } - /** * Invokes external action if compliance info is new or otherwise * @param {boolean} isNewComplianceInfo flag indicating the policy does not exist remotely diff --git a/wherehows-web/app/controllers/datasets/dataset.ts b/wherehows-web/app/controllers/datasets/dataset.ts index 3f90772ef6..7422355cc4 100644 --- a/wherehows-web/app/controllers/datasets/dataset.ts +++ b/wherehows-web/app/controllers/datasets/dataset.ts @@ -46,13 +46,6 @@ export default class DatasetController extends Controller { */ isNewComplianceInfo: boolean; - /** - * Flag indicating is there are suggestions that have not been accepted or ignored - * @type {boolean} - * @memberof DatasetController - */ - hasSuggestions: boolean; - /** * Flag indicating there are fields in the compliance policy that have not been updated by a user * @type {boolean} @@ -126,11 +119,7 @@ export default class DatasetController extends Controller { * Flag indicating that the compliance policy needs user attention * @type {ComputedProperty} */ - requiresUserAction: ComputedProperty = or( - 'isNewComplianceInfo', - 'hasSuggestions', - 'compliancePolicyHasDrift' - ); + requiresUserAction: ComputedProperty = or('isNewComplianceInfo', 'compliancePolicyHasDrift'); /** * Converts the uri on a model to a usable URN format @@ -190,17 +179,6 @@ export default class DatasetController extends Controller { : this.transitionToRoute(`datasets.dataset.${tabSelected}`, get(this, 'encodedUrn')); } - /** - * Updates the hasSuggestions flag if the policy is not from an upstream dataset, otherwise set to false - * @param {boolean} hasSuggestions - * @memberof DatasetController - */ - @action - setOnChangeSetChange(hasSuggestions: boolean) { - const fromUpstream = get(this, 'isPolicyFromUpstream'); - set(this, 'hasSuggestions', !fromUpstream && hasSuggestions); - } - /** * Updates the isNewComplianceInfo flag if the policy is not from an upstream dataset, otherwise set to false * Also sets the isPolicyFromUpstream attribute @@ -227,7 +205,6 @@ export default class DatasetController extends Controller { }); if (fromUpstream) { - this.setOnChangeSetChange(false); this.setOnChangeSetDrift(false); } } diff --git a/wherehows-web/app/templates/components/datasets/containers/dataset-compliance.hbs b/wherehows-web/app/templates/components/datasets/containers/dataset-compliance.hbs index 1553f7f6ba..7654510d4e 100644 --- a/wherehows-web/app/templates/components/datasets/containers/dataset-compliance.hbs +++ b/wherehows-web/app/templates/components/datasets/containers/dataset-compliance.hbs @@ -32,7 +32,6 @@ schemaFieldNamesMappedToDataTypes=schemaFieldNamesMappedToDataTypes complianceDataTypes=complianceDataTypes notifyOnComplianceSuggestionFeedback=(action "onSuggestionsComplianceFeedback") - notifyOnChangeSetSuggestions=(action "onSuggestionsChanged") notifyOnChangeSetRequiresReview=(action "onCompliancePolicyChangeSetDrift") onSave=(action "savePrivacyCompliancePolicy") onReset=(action "resetPrivacyCompliancePolicy") diff --git a/wherehows-web/app/templates/datasets/dataset.hbs b/wherehows-web/app/templates/datasets/dataset.hbs index 3e69bc0cf3..4c39d319de 100644 --- a/wherehows-web/app/templates/datasets/dataset.hbs +++ b/wherehows-web/app/templates/datasets/dataset.hbs @@ -154,7 +154,6 @@ wikiLinks=wikiLinks datasetName=model.nativeName notifyPiiStatus=(action "onNotifyPiiStatus") - setOnChangeSetChange=(action "setOnChangeSetChange") setOnChangeSetDrift=(action "setOnChangeSetDrift") setOnComplianceType=(action "setOnComplianceTypeChange") }}