diff --git a/wherehows-web/app/components/dataset-compliance-rollup-row.ts b/wherehows-web/app/components/dataset-compliance-rollup-row.ts index 74263a40e3..7879c5e8e7 100644 --- a/wherehows-web/app/components/dataset-compliance-rollup-row.ts +++ b/wherehows-web/app/components/dataset-compliance-rollup-row.ts @@ -24,11 +24,13 @@ export default class DatasetComplianceRollupRow extends Component.extend({ }) { /** * References the parent external action to add a tag to the list of change sets + * @memberof DatasetComplianceRollupRow */ onFieldTagAdded: (tag: IComplianceChangeSet) => IComplianceChangeSet; /** * References the parent external action to add a tag to the list of change sets + * @memberof DatasetComplianceRollupRow */ onFieldTagRemoved: (tag: IComplianceChangeSet) => IComplianceChangeSet; @@ -233,15 +235,25 @@ export default class DatasetComplianceRollupRow extends Component.extend({ */ @action onAddFieldTag(this: DatasetComplianceRollupRow, { identifierType, logicalType }: Partial) { - const { identifierField, dataType, onFieldTagAdded, fieldChangeSet } = getProperties(this, [ + const { identifierField, dataType, onFieldTagAdded, fieldChangeSet, fieldProps } = getProperties(this, [ 'identifierField', 'dataType', 'onFieldTagAdded', - 'fieldChangeSet' + 'fieldChangeSet', + 'fieldProps' ]); if (isFieldTagged(fieldChangeSet)) { - onFieldTagAdded(complianceFieldTagFactory({ identifierField, dataType, identifierType, logicalType })); + onFieldTagAdded( + complianceFieldTagFactory({ + identifierField, + dataType, + identifierType, + logicalType, + suggestion: fieldProps.suggestion, + suggestionAuthority: fieldProps.suggestionAuthority + }) + ); } // expand row on click diff --git a/wherehows-web/app/components/dataset-compliance.ts b/wherehows-web/app/components/dataset-compliance.ts index f63829b9a0..febad8e8d6 100644 --- a/wherehows-web/app/components/dataset-compliance.ts +++ b/wherehows-web/app/components/dataset-compliance.ts @@ -30,7 +30,8 @@ import { changeSetFieldsRequiringReview, changeSetReviewableAttributeTriggers, mapSchemaColumnPropsToCurrentPrivacyPolicy, - foldComplianceChangeSets + foldComplianceChangeSets, + sortFoldedChangeSetTuples } from 'wherehows-web/constants'; import { isPolicyExpectedShape } from 'wherehows-web/utils/datasets/compliance-policy'; import scrollMonitor from 'scrollmonitor'; @@ -703,7 +704,7 @@ export default class DatasetCompliance extends Component { foldedChangeSet: ComputedProperty> = computed( 'filteredChangeSet', function(this: DatasetCompliance): Array { - return foldComplianceChangeSets(get(this, 'filteredChangeSet')); + return sortFoldedChangeSetTuples(foldComplianceChangeSets(get(this, 'filteredChangeSet'))); } ); diff --git a/wherehows-web/app/constants/dataset-compliance.ts b/wherehows-web/app/constants/dataset-compliance.ts index a6b45f85ba..54d7197e3c 100644 --- a/wherehows-web/app/constants/dataset-compliance.ts +++ b/wherehows-web/app/constants/dataset-compliance.ts @@ -12,8 +12,7 @@ import { IdentifierFieldWithFieldChangeSetTuple, IIdentifierFieldWithFieldChangeSetObject, ISchemaFieldsToPolicy, - ISchemaFieldsToSuggested, - SchemaFieldToPolicyValue + ISchemaFieldsToSuggested } from 'wherehows-web/typings/app/dataset-compliance'; import { IColumnFieldProps, @@ -377,18 +376,25 @@ const complianceFieldTagFactory = ({ identifierField, dataType, identifierType, - logicalType -}: IColumnFieldProps): SchemaFieldToPolicyValue => ({ - identifierField, - dataType, - identifierType: identifierType || null, - logicalType: logicalType || null, - securityClassification: null, - nonOwner: null, - readonly: false, - privacyPolicyExists: false, - isDirty: true -}); + logicalType, + suggestion, + suggestionAuthority +}: IColumnFieldProps): IComplianceChangeSet => + Object.assign( + { + identifierField, + dataType, + identifierType: identifierType || null, + logicalType: logicalType || null, + securityClassification: null, + nonOwner: null, + readonly: false, + privacyPolicyExists: false, + isDirty: true + }, + suggestion ? { suggestion } : void 0, + suggestionAuthority ? { suggestionAuthority } : void 0 + ); /** * Takes the current compliance entities, and mod time and returns a reducer that consumes a list of IColumnFieldProps @@ -422,6 +428,22 @@ const columnToPolicyReducingFn: ICompliancePolicyReducerFactory = ( }; }; +/** + * Sorts a list of change set tuples by identifierField + * @param {Array} tuples + * @return {Array} + */ +const sortFoldedChangeSetTuples = ( + tuples: Array +): Array => { + const tupleSortFn = ( + [fieldNameA]: IdentifierFieldWithFieldChangeSetTuple, + [fieldNameB]: IdentifierFieldWithFieldChangeSetTuple + ): number => fieldNameA.localeCompare(fieldNameB); + + return tuples.sort(tupleSortFn); +}; + export { compliancePolicyStrings, getFieldIdentifierOption, @@ -445,5 +467,6 @@ export { changeSetReviewableAttributeTriggers, mapSchemaColumnPropsToCurrentPrivacyPolicy, foldComplianceChangeSets, - complianceFieldTagFactory + complianceFieldTagFactory, + sortFoldedChangeSetTuples }; diff --git a/wherehows-web/app/styles/components/dataset-compliance/_compliance-prompts.scss b/wherehows-web/app/styles/components/dataset-compliance/_compliance-prompts.scss index 497a9c263b..dac7761fca 100644 --- a/wherehows-web/app/styles/components/dataset-compliance/_compliance-prompts.scss +++ b/wherehows-web/app/styles/components/dataset-compliance/_compliance-prompts.scss @@ -44,6 +44,7 @@ .policy-last-saved { margin-left: auto; text-align: right; + max-width: 300px; &__saved { font-weight: fw(normal, 6); diff --git a/wherehows-web/app/templates/components/dataset-compliance-rollup-row.hbs b/wherehows-web/app/templates/components/dataset-compliance-rollup-row.hbs index 432fa10e98..099ebedb53 100644 --- a/wherehows-web/app/templates/components/dataset-compliance-rollup-row.hbs +++ b/wherehows-web/app/templates/components/dataset-compliance-rollup-row.hbs @@ -9,6 +9,7 @@ fieldProps=fieldProps suggestion=suggestion isReadonly=isReadonlyField + hasSingleTag=hasSingleTag isReviewRequested=isReviewRequested suggestionResolution=suggestionResolution suggestionMatchesCurrentValue=suggestionMatchesCurrentValue diff --git a/wherehows-web/app/templates/components/dataset-compliance.hbs b/wherehows-web/app/templates/components/dataset-compliance.hbs index 51fd75d068..b18e1546a5 100644 --- a/wherehows-web/app/templates/components/dataset-compliance.hbs +++ b/wherehows-web/app/templates/components/dataset-compliance.hbs @@ -83,8 +83,9 @@ {{moment-from-now complianceInfo.modifiedTime}} by - - {{complianceInfo.modifiedBy}} + + {{tooltip-on-element text=complianceInfo.modifiedBy}} + {{split-text complianceInfo.modifiedBy 30}} {{/if}} diff --git a/wherehows-web/app/templates/datasets/dataset-compliance/-dataset-compliance-entities.hbs b/wherehows-web/app/templates/datasets/dataset-compliance/-dataset-compliance-entities.hbs index b8cb31e446..d0c512bbab 100644 --- a/wherehows-web/app/templates/datasets/dataset-compliance/-dataset-compliance-entities.hbs +++ b/wherehows-web/app/templates/datasets/dataset-compliance/-dataset-compliance-entities.hbs @@ -32,9 +32,7 @@ {{#dataset-table class="dataset-compliance-fields" fields=foldedChangeSet - sortColumnWithName=sortColumnWithName filterBy=filterBy - sortDirection=sortDirection tableRowComponent='dataset-compliance-rollup-row' searchTerm=searchTerm as |table| }} @@ -71,7 +69,7 @@ {{#table.body as |body|}} - {{#each (sort-by table.sortBy table.data) as |field|}} + {{#each table.data as |field|}} {{#body.row field=field isNewComplianceInfo=isNewComplianceInfo @@ -335,7 +333,7 @@ {{#row.cell}} - {{#if isEditing}} + {{#if (and isEditing (not row.hasSingleTag))}}