@hashicorp/hashi-alert-banner
Advanced tools
Comparing version 0.2.7-alpha.0 to 0.3.0-alpha.0
@@ -174,3 +174,3 @@ 'use strict'; | ||
text = _this$props.text, | ||
link_text = _this$props.link_text; | ||
linkText = _this$props.linkText; | ||
@@ -198,5 +198,5 @@ var classes = ['g-alert-banner']; // add theme class | ||
className: "text" | ||
}, React__default.createElement("span", null, text), ' ', link_text && React__default.createElement("span", { | ||
}, React__default.createElement("span", null, text), ' ', linkText && React__default.createElement("span", { | ||
className: "link-text" | ||
}, link_text)), React__default.createElement("span", { | ||
}, linkText)), React__default.createElement("span", { | ||
className: "close", | ||
@@ -240,7 +240,7 @@ onClick: function onClick() { | ||
text = _this$props2.text, | ||
link_text = _this$props2.link_text; | ||
linkText = _this$props2.linkText; | ||
window.analytics.track(type.charAt(0).toUpperCase() + type.slice(1), { | ||
category: 'Alert Banner', | ||
label: "".concat(text, " - ").concat(link_text, " | ").concat(type), | ||
label: "".concat(text, " - ").concat(linkText, " | ").concat(type), | ||
tag: tag, | ||
@@ -247,0 +247,0 @@ theme: theme |
@@ -16,3 +16,3 @@ import React, { Component } from 'react' | ||
render() { | ||
const { url, tag, theme, text, link_text } = { ...this.props } | ||
const { url, tag, theme, text, linkText } = { ...this.props } | ||
const classes = ['g-alert-banner'] | ||
@@ -43,3 +43,3 @@ | ||
<span>{text}</span>{' '} | ||
{link_text && <span className="link-text">{link_text}</span>} | ||
{linkText && <span className="link-text">{linkText}</span>} | ||
</div> | ||
@@ -81,7 +81,7 @@ <span | ||
if (window.analytics) { | ||
const { tag, theme, text, link_text } = { ...this.props } | ||
const { tag, theme, text, linkText } = { ...this.props } | ||
window.analytics.track(type.charAt(0).toUpperCase() + type.slice(1), { | ||
category: 'Alert Banner', | ||
label: `${text} - ${link_text} | ${type}`, | ||
label: `${text} - ${linkText} | ${type}`, | ||
tag: tag, | ||
@@ -88,0 +88,0 @@ theme: theme |
@@ -30,3 +30,3 @@ import React from 'react' | ||
.text() | ||
).to.equal(propValue('link_text')) | ||
).to.equal(propValue('linkText')) | ||
}) | ||
@@ -41,3 +41,3 @@ | ||
.text() | ||
).to.equal(propValue('text') + ' ' + propValue('link_text')) | ||
).to.equal(propValue('text') + ' ' + propValue('linkText')) | ||
}) | ||
@@ -72,3 +72,3 @@ | ||
expect(eventObject.label).to.equal( | ||
`${propValue('text')} - ${propValue('link_text')} | click` | ||
`${propValue('text')} - ${propValue('linkText')} | click` | ||
) | ||
@@ -86,3 +86,3 @@ expect(eventObject.tag).to.equal(propValue('tag')) | ||
expect(eventObject.label).to.equal( | ||
`${propValue('text')} - ${propValue('link_text')} | close` | ||
`${propValue('text')} - ${propValue('linkText')} | close` | ||
) | ||
@@ -89,0 +89,0 @@ expect(eventObject.tag).to.equal(propValue('tag')) |
{ | ||
"name": "@hashicorp/hashi-alert-banner", | ||
"description": "alert banner with text and a link", | ||
"version": "0.2.7-alpha.0", | ||
"version": "0.3.0-alpha.0", | ||
"license": "MPL-2.0", | ||
@@ -21,3 +21,3 @@ "main": "dist", | ||
}, | ||
"gitHead": "1e638c1f172f793462e02a9698d0936076dc2c08" | ||
"gitHead": "504d5214280f70cf5d70bd1028cbdd202ae86268" | ||
} |
@@ -29,3 +29,3 @@ const props = {} | ||
{ | ||
name: 'link_text', | ||
name: 'linkText', | ||
type: 'string', | ||
@@ -32,0 +32,0 @@ description: 'Faux link text of the alert', |
@@ -12,2 +12,2 @@ ### Alert Banner | ||
- `text` (str): text in the main area | ||
- `link-text` (str): secondary text styled as a link | ||
- `linkText` (str): secondary text styled as a link |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
New author
Supply chain riskA new npm collaborator published a version of the package for the first time. New collaborators are usually benign additions to a project, but do indicate a change to the security surface area of a package.
Found 1 instance in 1 package
19727
11
0