removes tab indicator (red-dot) for compliance annotation suggestions

This commit is contained in:
Seyi Adebajo 2018-08-29 15:08:04 -07:00
parent 05a1b6eb0a
commit a05dd208ec
5 changed files with 3 additions and 57 deletions

View File

@ -40,8 +40,7 @@ import {
tagSuggestionNeedsReview, tagSuggestionNeedsReview,
ComplianceEdit ComplianceEdit
} from 'wherehows-web/constants'; } from 'wherehows-web/constants';
import { getTagsSuggestions } from 'wherehows-web/utils/datasets/compliance-suggestions'; import { arrayFilter, arrayMap, isListUnique, iterateArrayAsync } from 'wherehows-web/utils/array';
import { arrayFilter, arrayMap, compact, isListUnique, iterateArrayAsync } from 'wherehows-web/utils/array';
import { identity, noop } from 'wherehows-web/utils/helpers/functions'; import { identity, noop } from 'wherehows-web/utils/helpers/functions';
import { IComplianceDataType } from 'wherehows-web/typings/api/list/compliance-datatypes'; import { IComplianceDataType } from 'wherehows-web/typings/api/list/compliance-datatypes';
import Notifications, { NotificationEvent } from 'wherehows-web/services/notifications'; 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 * External action to handle manual compliance entity metadata entry
*/ */
onComplianceJsonUpdate: (jsonString: string) => Promise<void>; onComplianceJsonUpdate: (jsonString: string) => Promise<void>;
notifyOnChangeSetSuggestions: (hasSuggestions: boolean) => void;
notifyOnChangeSetRequiresReview: (hasChangeSetDrift: boolean) => void; notifyOnChangeSetRequiresReview: (hasChangeSetDrift: boolean) => void;
classNames = ['compliance-container']; classNames = ['compliance-container'];
@ -779,7 +778,6 @@ export default class DatasetCompliance extends Component {
const suggestionThreshold = get(this, 'suggestionConfidenceThreshold'); const suggestionThreshold = get(this, 'suggestionConfidenceThreshold');
// pass current changeSet state to parent handlers // pass current changeSet state to parent handlers
run(() => next(this, 'notifyHandlerOfSuggestions', suggestionThreshold, changeSet));
run(() => run(() =>
next( next(
this, this,
@ -936,19 +934,6 @@ export default class DatasetCompliance extends Component {
}); });
}).drop(); }).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<IComplianceChangeSet>} changeSet
*/
notifyHandlerOfSuggestions = (
suggestionConfidenceThreshold: number,
changeSet: Array<IComplianceChangeSet>
): 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 * 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 * @param {number} suggestionConfidenceThreshold confidence threshold for filtering out higher quality suggestions

View File

@ -62,11 +62,6 @@ type BatchContainerDataResult = Pick<
const { successUpdating, failedUpdating, successUploading, invalidPolicyData } = compliancePolicyStrings; const { successUpdating, failedUpdating, successUploading, invalidPolicyData } = compliancePolicyStrings;
export default class DatasetComplianceContainer extends Component { export default class DatasetComplianceContainer extends Component {
/**
* External action on parent
*/
setOnChangeSetChange: (hasSuggestions: boolean) => void;
/** /**
* External action to capture changes to dataset pii status * External action to capture changes to dataset pii status
*/ */
@ -325,15 +320,6 @@ export default class DatasetComplianceContainer extends Component {
get(this, 'getComplianceTask').perform(); 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 * Invokes external action if compliance info is new or otherwise
* @param {boolean} isNewComplianceInfo flag indicating the policy does not exist remotely * @param {boolean} isNewComplianceInfo flag indicating the policy does not exist remotely

View File

@ -46,13 +46,6 @@ export default class DatasetController extends Controller {
*/ */
isNewComplianceInfo: boolean; 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 * Flag indicating there are fields in the compliance policy that have not been updated by a user
* @type {boolean} * @type {boolean}
@ -126,11 +119,7 @@ export default class DatasetController extends Controller {
* Flag indicating that the compliance policy needs user attention * Flag indicating that the compliance policy needs user attention
* @type {ComputedProperty<boolean>} * @type {ComputedProperty<boolean>}
*/ */
requiresUserAction: ComputedProperty<boolean> = or( requiresUserAction: ComputedProperty<boolean> = or('isNewComplianceInfo', 'compliancePolicyHasDrift');
'isNewComplianceInfo',
'hasSuggestions',
'compliancePolicyHasDrift'
);
/** /**
* Converts the uri on a model to a usable URN format * 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')); : 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 * Updates the isNewComplianceInfo flag if the policy is not from an upstream dataset, otherwise set to false
* Also sets the isPolicyFromUpstream attribute * Also sets the isPolicyFromUpstream attribute
@ -227,7 +205,6 @@ export default class DatasetController extends Controller {
}); });
if (fromUpstream) { if (fromUpstream) {
this.setOnChangeSetChange(false);
this.setOnChangeSetDrift(false); this.setOnChangeSetDrift(false);
} }
} }

View File

@ -32,7 +32,6 @@
schemaFieldNamesMappedToDataTypes=schemaFieldNamesMappedToDataTypes schemaFieldNamesMappedToDataTypes=schemaFieldNamesMappedToDataTypes
complianceDataTypes=complianceDataTypes complianceDataTypes=complianceDataTypes
notifyOnComplianceSuggestionFeedback=(action "onSuggestionsComplianceFeedback") notifyOnComplianceSuggestionFeedback=(action "onSuggestionsComplianceFeedback")
notifyOnChangeSetSuggestions=(action "onSuggestionsChanged")
notifyOnChangeSetRequiresReview=(action "onCompliancePolicyChangeSetDrift") notifyOnChangeSetRequiresReview=(action "onCompliancePolicyChangeSetDrift")
onSave=(action "savePrivacyCompliancePolicy") onSave=(action "savePrivacyCompliancePolicy")
onReset=(action "resetPrivacyCompliancePolicy") onReset=(action "resetPrivacyCompliancePolicy")

View File

@ -154,7 +154,6 @@
wikiLinks=wikiLinks wikiLinks=wikiLinks
datasetName=model.nativeName datasetName=model.nativeName
notifyPiiStatus=(action "onNotifyPiiStatus") notifyPiiStatus=(action "onNotifyPiiStatus")
setOnChangeSetChange=(action "setOnChangeSetChange")
setOnChangeSetDrift=(action "setOnChangeSetDrift") setOnChangeSetDrift=(action "setOnChangeSetDrift")
setOnComplianceType=(action "setOnComplianceTypeChange") setOnComplianceType=(action "setOnComplianceTypeChange")
}} }}