mirror of
https://github.com/datahub-project/datahub.git
synced 2025-08-29 19:46:00 +00:00
removes ability to specify security classification in ui
This commit is contained in:
parent
2b533dbb3f
commit
83cac663bd
@ -1304,20 +1304,6 @@ export default class DatasetCompliance extends Component {
|
|||||||
return complianceInfo ? set(complianceInfo, 'containingPersonalData', containsPersonalData) : null;
|
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
|
* If all validity checks are passed, invoke onSave action on controller
|
||||||
*/
|
*/
|
||||||
|
@ -1,7 +1,6 @@
|
|||||||
import Component from '@ember/component';
|
import Component from '@ember/component';
|
||||||
import { get, computed } from '@ember/object';
|
import { get } from '@ember/object';
|
||||||
import { ISecurityClassificationOption } from 'wherehows-web/typings/app/dataset-compliance';
|
import { action } from 'ember-decorators/object';
|
||||||
import { getSecurityClassificationDropDownOptions } from 'wherehows-web/constants';
|
|
||||||
|
|
||||||
export default class SchemalessTagging extends Component {
|
export default class SchemalessTagging extends Component {
|
||||||
classNames = ['schemaless-tagging'];
|
classNames = ['schemaless-tagging'];
|
||||||
@ -12,14 +11,6 @@ export default class SchemalessTagging extends Component {
|
|||||||
*/
|
*/
|
||||||
onPersonalDataChange: (containsPersonalData: boolean) => boolean;
|
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
|
* Flag indicating that the dataset contains personally identifiable data
|
||||||
* @type {boolean}
|
* @type {boolean}
|
||||||
@ -27,17 +18,6 @@ export default class SchemalessTagging extends Component {
|
|||||||
*/
|
*/
|
||||||
containsPersonalData: boolean;
|
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
|
* Flag indicating if this component should be in edit mode or readonly
|
||||||
* @type {boolean}
|
* @type {boolean}
|
||||||
@ -46,37 +26,12 @@ export default class SchemalessTagging extends Component {
|
|||||||
isEditable: boolean;
|
isEditable: boolean;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* The current dataset classification value
|
* Invokes the closure action onPersonaDataChange when the flag is toggled
|
||||||
* @type { ISecurityClassificationOption.value}
|
* @param {boolean} containsPersonalDataTag flag indicating that the dataset contains personal data
|
||||||
* @memberof SchemalessTagging
|
* @returns boolean
|
||||||
*/
|
*/
|
||||||
classification: ISecurityClassificationOption['value'];
|
@action
|
||||||
|
onPersonalDataToggle(this: SchemalessTagging, containsPersonalDataTag: boolean) {
|
||||||
actions = {
|
return get(this, 'onPersonalDataChange')(containsPersonalDataTag);
|
||||||
/**
|
}
|
||||||
* 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);
|
|
||||||
}
|
|
||||||
};
|
|
||||||
}
|
}
|
||||||
|
@ -154,9 +154,7 @@
|
|||||||
{{#if (or isReadOnly (eq editStep.name editSteps.0.name))}}
|
{{#if (or isReadOnly (eq editStep.name editSteps.0.name))}}
|
||||||
{{datasets/schemaless-tagging
|
{{datasets/schemaless-tagging
|
||||||
isEditable=(not isReadOnly)
|
isEditable=(not isReadOnly)
|
||||||
classification=(readonly complianceInfo.confidentiality)
|
|
||||||
containsPersonalData=(readonly complianceInfo.containingPersonalData)
|
containsPersonalData=(readonly complianceInfo.containingPersonalData)
|
||||||
onClassificationChange=(action "onDatasetSecurityClassificationChange")
|
|
||||||
onPersonalDataChange=(action "onDatasetLevelPolicyChange")
|
onPersonalDataChange=(action "onDatasetLevelPolicyChange")
|
||||||
}}
|
}}
|
||||||
{{/if}}
|
{{/if}}
|
||||||
|
@ -24,23 +24,3 @@
|
|||||||
</label>
|
</label>
|
||||||
</div>
|
</div>
|
||||||
</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>
|
|
||||||
|
@ -1,4 +1,4 @@
|
|||||||
import { moduleForComponent, test } from 'ember-qunit';
|
import { moduleForComponent, test, skip } from 'ember-qunit';
|
||||||
import hbs from 'htmlbars-inline-precompile';
|
import hbs from 'htmlbars-inline-precompile';
|
||||||
|
|
||||||
import { Classification } from 'wherehows-web/constants';
|
import { Classification } from 'wherehows-web/constants';
|
||||||
@ -9,36 +9,12 @@ moduleForComponent('datasets/schemaless-tagging', 'Integration | Component | dat
|
|||||||
});
|
});
|
||||||
|
|
||||||
test('it renders', function(assert) {
|
test('it renders', function(assert) {
|
||||||
assert.expect(2);
|
assert.expect(1);
|
||||||
const elementId = 'test-schemaless-component-1337';
|
const elementId = 'test-schemaless-component-1337';
|
||||||
this.set('elementId', elementId);
|
this.set('elementId', elementId);
|
||||||
this.render(hbs`{{datasets/schemaless-tagging 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}-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) {
|
test('it correctly indicates if the dataset has pii', function(assert) {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user