From b0fbafd3d84727d0a564373b8cd23b88fe54a1da Mon Sep 17 00:00:00 2001 From: Seyi Adebajo Date: Thu, 30 Aug 2018 10:49:20 -0700 Subject: [PATCH 1/2] updates visual hint for dataset compliance annotations. updates wording for hints --- .../app/components/dataset-compliance.ts | 25 ++++++++----------- .../dataset-compliance/_compliance-table.scss | 17 +++++++++++++ .../-dataset-compliance-entities.hbs | 15 ++++++----- 3 files changed, 37 insertions(+), 20 deletions(-) diff --git a/wherehows-web/app/components/dataset-compliance.ts b/wherehows-web/app/components/dataset-compliance.ts index b4b4aed95b..fb9766723f 100644 --- a/wherehows-web/app/components/dataset-compliance.ts +++ b/wherehows-web/app/components/dataset-compliance.ts @@ -71,7 +71,6 @@ import { notificationDialogActionFactory } from 'wherehows-web/utils/notificatio import { isMetadataObject, jsonValuesMatch } from 'wherehows-web/utils/datasets/compliance/metadata-schema'; import { typeOf } from '@ember/utils'; import { pick } from 'wherehows-web/utils/object'; -import { pluralize } from 'ember-inflector'; import { service } from '@ember-decorators/service'; const { @@ -295,23 +294,21 @@ export default class DatasetCompliance extends Component { * @type {ComputedProperty} * @memberof DatasetCompliance */ - fieldReviewHint: ComputedProperty = computed('fieldReviewOption', 'changeSetReviewCount', function( + fieldReviewHint: ComputedProperty = computed('fieldReviewOption', 'foldedChangeSet.length', function( this: DatasetCompliance ): string { type TagFilterHint = { [K in TagFilter]: string }; - const { fieldReviewOption, changeSetReviewCount } = getProperties(this, [ - 'fieldReviewOption', - 'changeSetReviewCount' - ]); + const { fieldReviewOption, foldedChangeSet = [] } = getProperties(this, ['fieldReviewOption', 'foldedChangeSet']); const hint = ({ - [TagFilter.showAll]: `${pluralize(changeSetReviewCount, 'field')} to be reviewed`, - [TagFilter.showReview]: 'It is required to select compliance info for all fields', - [TagFilter.showSuggested]: 'Please review suggestions and provide feedback' + [TagFilter.showAll]: '', + [TagFilter.showReview]: '? Please select at least one type for each field', + [TagFilter.showSuggested]: + '! Please review suggestions and click thumbs up or down, based on the accuracy of the suggestion' })[fieldReviewOption]; - return changeSetReviewCount ? hint : ''; + return foldedChangeSet.length ? hint : ''; }); /** @@ -519,9 +516,9 @@ export default class DatasetCompliance extends Component { * @memberof DatasetCompliance */ fieldReviewOptions: Array<{ value: DatasetCompliance['fieldReviewOption']; label: string }> = [ - { value: TagFilter.showAll, label: 'Show all fields' }, - { value: TagFilter.showReview, label: 'Show required fields' }, - { value: TagFilter.showSuggested, label: 'Show suggested fields' } + { value: TagFilter.showAll, label: ' Show all fields' }, + { value: TagFilter.showReview, label: '? Show fields missing a data type' }, + { value: TagFilter.showSuggested, label: '! Show fields that need review' } ]; didReceiveAttrs(): void { @@ -887,7 +884,7 @@ export default class DatasetCompliance extends Component { * @type {Array} * @memberof DatasetCompliance */ - foldedChangeSet: Array; + foldedChangeSet: Array | void; /** * Task to retrieve platform policies and set supported policies for the current platform diff --git a/wherehows-web/app/styles/components/dataset-compliance/_compliance-table.scss b/wherehows-web/app/styles/components/dataset-compliance/_compliance-table.scss index cb216e8ba2..fd9a127d80 100644 --- a/wherehows-web/app/styles/components/dataset-compliance/_compliance-table.scss +++ b/wherehows-web/app/styles/components/dataset-compliance/_compliance-table.scss @@ -29,6 +29,23 @@ } } + &__filter-count { + color: $compliance-suggestion-color; + margin-left: item-spacing(2); + } + + &__subtitle { + display: flex; + align-items: center; + padding: item-spacing(2 0); + } + + &__review-hint { + color: $compliance-suggestion-color; + height: item-spacing(5); + padding-left: item-spacing(5); + } + &__has-suggestions { color: $compliance-suggestion-color; margin-left: item-spacing(2); 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 d215432ea0..452fa41b30 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 @@ -44,11 +44,9 @@ selectionDidChange=(action "onFieldReviewChange") }} - {{#if fieldReviewHint}} - - {{fieldReviewHint}} - - {{/if}} + + {{pluralize foldedChangeSet.length "field"}} + {{/if}} {{#if isEditing}} @@ -89,6 +87,11 @@ {{/if}} +
+
+ {{fieldReviewHint}} +
+
{{#if showGuidedComplianceEditMode}} {{#if foldedChangeSet.length}} {{#dataset-table @@ -151,7 +154,7 @@ {{#if (and row.suggestion (and (not row.suggestionMatchesCurrentValue) (not row.suggestionResolution)))}} - + From 779dd3aecb4d5ab3fdf5bf8927fe8f98b8c6abf6 Mon Sep 17 00:00:00 2001 From: Seyi Adebajo Date: Thu, 30 Aug 2018 13:27:32 -0700 Subject: [PATCH 2/2] updates annotation indicator for suggestion value conflict to exclude scenarios without a current identifierType --- wherehows-web/app/components/dataset-compliance.ts | 2 +- .../dataset-compliance/-dataset-compliance-entities.hbs | 4 +++- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/wherehows-web/app/components/dataset-compliance.ts b/wherehows-web/app/components/dataset-compliance.ts index fb9766723f..ee7f84b72a 100644 --- a/wherehows-web/app/components/dataset-compliance.ts +++ b/wherehows-web/app/components/dataset-compliance.ts @@ -193,7 +193,7 @@ export default class DatasetCompliance extends Component { }); /** - * Indicates if the first step does not need further user review to advance + * Indicates if the compliance annotation does not need further user review to advance * @type {ComputedProperty} * @memberof DatasetCompliance */ 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 452fa41b30..a6c0822557 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 @@ -92,6 +92,7 @@ {{fieldReviewHint}} + {{#if showGuidedComplianceEditMode}} {{#if foldedChangeSet.length}} {{#dataset-table @@ -151,8 +152,9 @@ {{#row.cell}} + {{! primary tag has an identifierType, field has a suggestion that does not match the identifierType, and suggestion resolution}} {{#if - (and row.suggestion (and (not row.suggestionMatchesCurrentValue) (not row.suggestionResolution)))}} + (and row.fieldProps.identifierType (and row.suggestion (and (not row.suggestionMatchesCurrentValue) (not row.suggestionResolution))))}}