From 83cac663bdf7abb8c70d1336aafb43bf1a1a2232 Mon Sep 17 00:00:00 2001 From: Seyi Adebajo Date: Thu, 19 Apr 2018 14:54:24 -0700 Subject: [PATCH] removes ability to specify security classification in ui --- .../app/components/dataset-compliance.ts | 14 ----- .../components/datasets/schemaless-tagging.ts | 63 +++---------------- .../components/dataset-compliance.hbs | 2 - .../datasets/schemaless-tagging.hbs | 20 ------ .../datasets/schemaless-tagging-test.js | 28 +-------- 5 files changed, 11 insertions(+), 116 deletions(-) diff --git a/wherehows-web/app/components/dataset-compliance.ts b/wherehows-web/app/components/dataset-compliance.ts index d2cc629954..e01f8382d4 100644 --- a/wherehows-web/app/components/dataset-compliance.ts +++ b/wherehows-web/app/components/dataset-compliance.ts @@ -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 */ diff --git a/wherehows-web/app/components/datasets/schemaless-tagging.ts b/wherehows-web/app/components/datasets/schemaless-tagging.ts index c87998b16b..c0971f3fb6 100644 --- a/wherehows-web/app/components/datasets/schemaless-tagging.ts +++ b/wherehows-web/app/components/datasets/schemaless-tagging.ts @@ -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} - * @memberof SchemalessTagging - */ - classifiers = computed('containsPersonalData', function( - this: SchemalessTagging - ): Array { - 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); + } } diff --git a/wherehows-web/app/templates/components/dataset-compliance.hbs b/wherehows-web/app/templates/components/dataset-compliance.hbs index 74351d297b..1020afca29 100644 --- a/wherehows-web/app/templates/components/dataset-compliance.hbs +++ b/wherehows-web/app/templates/components/dataset-compliance.hbs @@ -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}} diff --git a/wherehows-web/app/templates/components/datasets/schemaless-tagging.hbs b/wherehows-web/app/templates/components/datasets/schemaless-tagging.hbs index 6ce18cbd64..50c1a9b58c 100644 --- a/wherehows-web/app/templates/components/datasets/schemaless-tagging.hbs +++ b/wherehows-web/app/templates/components/datasets/schemaless-tagging.hbs @@ -24,23 +24,3 @@ - -
-

- Dataset security classification - - {{more-info - link="http://go/dht" - tooltip="information dataset security classification" - }} -

- -
- {{ember-selector - values=classifiers - selected=classification - disabled=(not isEditable) - selectionDidChange=(action "onSecurityClassificationChange") - }} -
-
diff --git a/wherehows-web/tests/integration/components/datasets/schemaless-tagging-test.js b/wherehows-web/tests/integration/components/datasets/schemaless-tagging-test.js index 3f6820c44b..b6d4ef1556 100644 --- a/wherehows-web/tests/integration/components/datasets/schemaless-tagging-test.js +++ b/wherehows-web/tests/integration/components/datasets/schemaless-tagging-test.js @@ -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) {