removes ability to specify security classification in ui

This commit is contained in:
Seyi Adebajo 2018-04-19 14:54:24 -07:00
parent 2b533dbb3f
commit 83cac663bd
5 changed files with 11 additions and 116 deletions

View File

@ -1304,20 +1304,6 @@ export default class DatasetCompliance extends Component {
return complianceInfo ? set(complianceInfo, 'containingPersonalData', containsPersonalData) : null;
},
/**
* Updates the confidentiality flag on the dataset compliance
* @param {IComplianceInfo.confidentiality} [securityClassification=null]
* @returns {IComplianceInfo.confidentiality}
*/
onDatasetSecurityClassificationChange(
this: DatasetCompliance,
securityClassification: IComplianceInfo['confidentiality'] = null
): IComplianceInfo['confidentiality'] {
const complianceInfo = get(this, 'complianceInfo');
return complianceInfo ? set(complianceInfo, 'confidentiality', securityClassification) : null;
},
/**
* If all validity checks are passed, invoke onSave action on controller
*/

View File

@ -1,7 +1,6 @@
import Component from '@ember/component';
import { get, computed } from '@ember/object';
import { ISecurityClassificationOption } from 'wherehows-web/typings/app/dataset-compliance';
import { getSecurityClassificationDropDownOptions } from 'wherehows-web/constants';
import { get } from '@ember/object';
import { action } from 'ember-decorators/object';
export default class SchemalessTagging extends Component {
classNames = ['schemaless-tagging'];
@ -12,14 +11,6 @@ export default class SchemalessTagging extends Component {
*/
onPersonalDataChange: (containsPersonalData: boolean) => boolean;
/**
* Interface for parent supplied onClassificationChange action
* @memberof SchemalessTagging
*/
onClassificationChange: (
securityClassification: ISecurityClassificationOption['value']
) => ISecurityClassificationOption['value'];
/**
* Flag indicating that the dataset contains personally identifiable data
* @type {boolean}
@ -27,17 +18,6 @@ export default class SchemalessTagging extends Component {
*/
containsPersonalData: boolean;
/**
* List of drop down options for classifying the dataset
* @type {Array<ISecurityClassificationOption>}
* @memberof SchemalessTagging
*/
classifiers = computed('containsPersonalData', function(
this: SchemalessTagging
): Array<ISecurityClassificationOption> {
return getSecurityClassificationDropDownOptions(get(this, 'containsPersonalData'));
});
/**
* Flag indicating if this component should be in edit mode or readonly
* @type {boolean}
@ -46,37 +26,12 @@ export default class SchemalessTagging extends Component {
isEditable: boolean;
/**
* The current dataset classification value
* @type { ISecurityClassificationOption.value}
* @memberof SchemalessTagging
* Invokes the closure action onPersonaDataChange when the flag is toggled
* @param {boolean} containsPersonalDataTag flag indicating that the dataset contains personal data
* @returns boolean
*/
classification: ISecurityClassificationOption['value'];
actions = {
/**
* Invokes the closure action onPersonaDataChange when the flag is toggled
* @param {boolean} containsPersonalDataTag flag indicating that the dataset contains personal data
* @returns boolean
*/
onPersonalDataToggle(this: SchemalessTagging, containsPersonalDataTag: boolean) {
if (containsPersonalDataTag) {
this.actions.onSecurityClassificationChange.call(this, { value: null });
}
return get(this, 'onPersonalDataChange')(containsPersonalDataTag);
},
/**
* Updates the dataset security classification via the closure action onClassificationChange
* @param {ISecurityClassificationOption} { value } security Classification value for the dataset
* @returns null | Classification
*/
onSecurityClassificationChange(
this: SchemalessTagging,
{ value }: { value: ISecurityClassificationOption['value'] }
) {
const securityClassification = value || null;
return get(this, 'onClassificationChange')(securityClassification);
}
};
@action
onPersonalDataToggle(this: SchemalessTagging, containsPersonalDataTag: boolean) {
return get(this, 'onPersonalDataChange')(containsPersonalDataTag);
}
}

View File

@ -154,9 +154,7 @@
{{#if (or isReadOnly (eq editStep.name editSteps.0.name))}}
{{datasets/schemaless-tagging
isEditable=(not isReadOnly)
classification=(readonly complianceInfo.confidentiality)
containsPersonalData=(readonly complianceInfo.containingPersonalData)
onClassificationChange=(action "onDatasetSecurityClassificationChange")
onPersonalDataChange=(action "onDatasetLevelPolicyChange")
}}
{{/if}}

View File

@ -24,23 +24,3 @@
</label>
</div>
</div>
<div class="schemaless-tagging__tag">
<h4 class="schemaless-tagging__prompt">
Dataset security classification
{{more-info
link="http://go/dht"
tooltip="information dataset security classification"
}}
</h4>
<div class="schemaless-tagging__input">
{{ember-selector
values=classifiers
selected=classification
disabled=(not isEditable)
selectionDidChange=(action "onSecurityClassificationChange")
}}
</div>
</div>

View File

@ -1,4 +1,4 @@
import { moduleForComponent, test } from 'ember-qunit';
import { moduleForComponent, test, skip } from 'ember-qunit';
import hbs from 'htmlbars-inline-precompile';
import { Classification } from 'wherehows-web/constants';
@ -9,36 +9,12 @@ moduleForComponent('datasets/schemaless-tagging', 'Integration | Component | dat
});
test('it renders', function(assert) {
assert.expect(2);
assert.expect(1);
const elementId = 'test-schemaless-component-1337';
this.set('elementId', elementId);
this.render(hbs`{{datasets/schemaless-tagging elementId=elementId}}`);
assert.ok(document.querySelector(`#${elementId}-schemaless-checkbox`), 'it renders a checkbox component');
assert.ok(document.querySelector(`#${elementId} select`), 'it renders a select drop down');
});
test('it shows the current classification', function(assert) {
assert.expect(3);
this.render(hbs`{{datasets/schemaless-tagging classification=classification}}`);
assert.equal(document.querySelector(`select`).value, 'Unspecified', "displays 'Unspecified' when not set");
this.set('classification', Classification.LimitedDistribution);
assert.equal(
document.querySelector(`select`).value,
Classification.LimitedDistribution,
`displays ${Classification.LimitedDistribution} when set`
);
this.set('classification', Classification.Confidential);
assert.equal(
document.querySelector('select').value,
Classification.Confidential,
`displays ${Classification.Confidential} when changed`
);
});
test('it correctly indicates if the dataset has pii', function(assert) {