mirror of
https://github.com/datahub-project/datahub.git
synced 2025-09-01 05:13:15 +00:00
Merge pull request #1038 from theseyi/more-info
creates more info component and refactors links
This commit is contained in:
commit
bd86a3501b
41
wherehows-web/app/components/more-info.ts
Normal file
41
wherehows-web/app/components/more-info.ts
Normal file
@ -0,0 +1,41 @@
|
|||||||
|
import Component from '@ember/component';
|
||||||
|
|
||||||
|
export default class MoreInfo extends Component {
|
||||||
|
tagName = 'span';
|
||||||
|
|
||||||
|
classNames = ['more-info'];
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Proxies to anchor element target attribute
|
||||||
|
* @type {string}
|
||||||
|
* @memberOf MoreInfo
|
||||||
|
*/
|
||||||
|
target: string;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Proxies to anchor element href attribute
|
||||||
|
* @type {string}
|
||||||
|
* @memberOf MoreInfo
|
||||||
|
*/
|
||||||
|
link: string;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Renders the tool tip component, if present
|
||||||
|
* @type {string}
|
||||||
|
* @memberOf MoreInfo
|
||||||
|
*/
|
||||||
|
tooltip: string;
|
||||||
|
|
||||||
|
constructor() {
|
||||||
|
super(...arguments);
|
||||||
|
|
||||||
|
this.target || (this.target = '_blank');
|
||||||
|
this.link || (this.link = '#');
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Disables DOM event propagation
|
||||||
|
* @return {boolean}
|
||||||
|
*/
|
||||||
|
click = () => false;
|
||||||
|
}
|
@ -29,16 +29,10 @@
|
|||||||
<h4 class="schemaless-tagging__prompt">
|
<h4 class="schemaless-tagging__prompt">
|
||||||
Dataset security classification
|
Dataset security classification
|
||||||
|
|
||||||
<a
|
{{more-info
|
||||||
target="_blank"
|
link="http://go/dht"
|
||||||
href="http://go/dht">
|
tooltip="information dataset security classification"
|
||||||
<sup>
|
}}
|
||||||
More Info
|
|
||||||
|
|
||||||
<span class="glyphicon glyphicon-question-sign"
|
|
||||||
title="More information dataset security classification"></span>
|
|
||||||
</sup>
|
|
||||||
</a>
|
|
||||||
</h4>
|
</h4>
|
||||||
|
|
||||||
<div class="schemaless-tagging__input">
|
<div class="schemaless-tagging__input">
|
||||||
|
14
wherehows-web/app/templates/components/more-info.hbs
Normal file
14
wherehows-web/app/templates/components/more-info.hbs
Normal file
@ -0,0 +1,14 @@
|
|||||||
|
<a {{action "click" preventDefault=false}} target={{target}} href={{link}}>
|
||||||
|
<sup>
|
||||||
|
{{#if tooltip}}
|
||||||
|
{{tooltip-on-element
|
||||||
|
text=tooltip
|
||||||
|
}}
|
||||||
|
{{/if}}
|
||||||
|
|
||||||
|
More Info
|
||||||
|
|
||||||
|
<span class="glyphicon glyphicon-question-sign"
|
||||||
|
title="Click for {{tooltip}}"></span>
|
||||||
|
</sup>
|
||||||
|
</a>
|
@ -3,16 +3,10 @@
|
|||||||
<p>
|
<p>
|
||||||
Compliance Purge Policy
|
Compliance Purge Policy
|
||||||
|
|
||||||
<a
|
{{more-info
|
||||||
target="_blank"
|
link="http://go/gdpr/deletions/purgePolicies"
|
||||||
href="http://go/gdpr/deletions/purgePolicies">
|
tooltip="more information Purge Policies"
|
||||||
<sup>
|
}}
|
||||||
More Info
|
|
||||||
|
|
||||||
<span class="glyphicon glyphicon-question-sign"
|
|
||||||
title="More information Purge Policies"></span>
|
|
||||||
</sup>
|
|
||||||
</a>
|
|
||||||
</p>
|
</p>
|
||||||
</header>
|
</header>
|
||||||
</section>
|
</section>
|
||||||
|
@ -5,18 +5,11 @@
|
|||||||
"Does this dataset contain the following types of data?"
|
"Does this dataset contain the following types of data?"
|
||||||
"Types of data contained in this dataset"}}
|
"Types of data contained in this dataset"}}
|
||||||
|
|
||||||
<!--TODO: DSS-6716-->
|
|
||||||
<!-- DRY out with wrapper component that takes the link as an attribute-->
|
|
||||||
<a
|
|
||||||
target="_blank"
|
|
||||||
href="http://go/gdpr-taxonomy#MetadataTaxonomyforDataSets-DatasetLevelTags">
|
|
||||||
<sup>
|
|
||||||
More Info
|
|
||||||
|
|
||||||
<span class="glyphicon glyphicon-question-sign"
|
{{more-info
|
||||||
title="More information on Dataset classification with examples"></span>
|
link="http://go/gdpr-taxonomy#MetadataTaxonomyforDataSets-DatasetLevelTags"
|
||||||
</sup>
|
tooltip="more information on Dataset classification with examples"
|
||||||
</a>
|
}}
|
||||||
</p>
|
</p>
|
||||||
|
|
||||||
{{#if isEditing}}
|
{{#if isEditing}}
|
||||||
|
@ -4,16 +4,12 @@
|
|||||||
{{if isEditing
|
{{if isEditing
|
||||||
"Does any field in the schema contain an IDs (e.g. Member ID, Enterprise Profile ID etc) or other PII information?"
|
"Does any field in the schema contain an IDs (e.g. Member ID, Enterprise Profile ID etc) or other PII information?"
|
||||||
"IDs and PII in the schema"}}
|
"IDs and PII in the schema"}}
|
||||||
<a
|
|
||||||
target="_blank"
|
|
||||||
href="http://go/gdpr-pii">
|
|
||||||
<sup>
|
|
||||||
More Info
|
|
||||||
|
|
||||||
<span class="glyphicon glyphicon-question-sign"
|
{{more-info
|
||||||
title="More information on Schema field format and types"></span>
|
link="http://go/gdpr-pii"
|
||||||
</sup>
|
tooltip="more information on Schema field format and types"
|
||||||
</a>
|
}}
|
||||||
|
|
||||||
</p>
|
</p>
|
||||||
</header>
|
</header>
|
||||||
</section>
|
</section>
|
||||||
@ -45,7 +41,16 @@
|
|||||||
|
|
||||||
{{#table.head as |head|}}
|
{{#table.head as |head|}}
|
||||||
{{#head.column class="dataset-compliance-fields__notification-column"}}{{/head.column}}
|
{{#head.column class="dataset-compliance-fields__notification-column"}}{{/head.column}}
|
||||||
{{#head.column columnName="identifierField"}}Field{{/head.column}}
|
{{#head.column columnName="identifierField"}}
|
||||||
|
|
||||||
|
Field
|
||||||
|
|
||||||
|
{{more-info
|
||||||
|
link="http://go/tms-schema"
|
||||||
|
tooltip="more information on Schema"
|
||||||
|
}}
|
||||||
|
|
||||||
|
{{/head.column}}
|
||||||
{{#head.column columnName="dataType"}}Data Type{{/head.column}}
|
{{#head.column columnName="dataType"}}Data Type{{/head.column}}
|
||||||
{{#head.column class="nacho-table-cell-wrapped" columnName="confidence"}}
|
{{#head.column class="nacho-table-cell-wrapped" columnName="confidence"}}
|
||||||
System Suggestion Confidence
|
System Suggestion Confidence
|
||||||
@ -151,16 +156,11 @@
|
|||||||
<section class="compliance-depends compliance-depends--visible">
|
<section class="compliance-depends compliance-depends--visible">
|
||||||
<div class="dataset-compliance-fields__form-input">
|
<div class="dataset-compliance-fields__form-input">
|
||||||
Field Type
|
Field Type
|
||||||
<a
|
|
||||||
target="_blank"
|
|
||||||
href="http://go/metadata_acquisition#ProjectOverview-compliance">
|
|
||||||
<sup>
|
|
||||||
More Info
|
|
||||||
|
|
||||||
<span class="glyphicon glyphicon-question-sign"
|
{{more-info
|
||||||
title="More information on various IDs"></span>
|
link="http://go/metadata_acquisition#ProjectOverview-compliance"
|
||||||
</sup>
|
tooltip="more information on various IDs"
|
||||||
</a>
|
}}
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
{{ember-selector
|
{{ember-selector
|
||||||
@ -178,16 +178,11 @@
|
|||||||
<section class="compliance-depends {{if row.isIdType 'compliance-depends--visible'}}">
|
<section class="compliance-depends {{if row.isIdType 'compliance-depends--visible'}}">
|
||||||
<div class="dataset-compliance-fields__form-input">
|
<div class="dataset-compliance-fields__form-input">
|
||||||
Field Format
|
Field Format
|
||||||
<a
|
|
||||||
target="_blank"
|
|
||||||
href="http://go/metadata_acquisition#ProjectOverview-compliance">
|
|
||||||
<sup>
|
|
||||||
More Info
|
|
||||||
|
|
||||||
<span class="glyphicon glyphicon-question-sign"
|
{{more-info
|
||||||
title="More information on Field Format"></span>
|
link="http://go/metadata_acquisition#ProjectOverview-compliance"
|
||||||
</sup>
|
tooltip="more information on Field Format"
|
||||||
</a>
|
}}
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
{{ember-selector
|
{{ember-selector
|
||||||
|
48
wherehows-web/tests/integration/components/more-info-test.js
Normal file
48
wherehows-web/tests/integration/components/more-info-test.js
Normal file
@ -0,0 +1,48 @@
|
|||||||
|
import { moduleForComponent, test } from 'ember-qunit';
|
||||||
|
import hbs from 'htmlbars-inline-precompile';
|
||||||
|
import { click } from 'ember-native-dom-helpers';
|
||||||
|
|
||||||
|
const elementQuery = '.more-info';
|
||||||
|
|
||||||
|
moduleForComponent('more-info', 'Integration | Component | more info', {
|
||||||
|
integration: true
|
||||||
|
});
|
||||||
|
|
||||||
|
test('it renders', function(assert) {
|
||||||
|
this.render(hbs`{{more-info}}`);
|
||||||
|
const element = document.querySelector(elementQuery);
|
||||||
|
|
||||||
|
assert.ok(element, 'component is rendered in the DOM');
|
||||||
|
assert.equal(
|
||||||
|
element.querySelector('a').getAttribute('target'),
|
||||||
|
'_blank',
|
||||||
|
'sets the default target attribute when none is provided'
|
||||||
|
);
|
||||||
|
assert.equal(
|
||||||
|
element.querySelector('a').getAttribute('href'),
|
||||||
|
'#',
|
||||||
|
'it sets a default href attribute when none is provided'
|
||||||
|
);
|
||||||
|
});
|
||||||
|
|
||||||
|
test('MoreInfo', function(assert) {
|
||||||
|
const externalUrl = 'https://www.linkedin.com';
|
||||||
|
const target = '_self';
|
||||||
|
|
||||||
|
this.set('href', externalUrl);
|
||||||
|
this.set('target', target);
|
||||||
|
|
||||||
|
this.render(hbs`{{more-info target=target link=href}}`);
|
||||||
|
const element = document.querySelector(elementQuery);
|
||||||
|
|
||||||
|
assert.equal(
|
||||||
|
element.querySelector('a').getAttribute('target'),
|
||||||
|
target,
|
||||||
|
'it sets the passed in target attribute when on is provided'
|
||||||
|
);
|
||||||
|
assert.equal(
|
||||||
|
element.querySelector('a').getAttribute('href'),
|
||||||
|
externalUrl,
|
||||||
|
'it sets the passed href attribute when a value is provided'
|
||||||
|
);
|
||||||
|
});
|
Loading…
x
Reference in New Issue
Block a user