Skip to content

Interactive interface for browsing global, full-resolution satellite imagery

layer notice next to checkbox, e2e tests

Jason Kent53692912ff07
diff --git a/e2e/features/notifications/notify-test.js b/e2e/features/notifications/notify-test.js
index 23fdde704..96bd73adf 100644
--- a/e2e/features/notifications/notify-test.js
+++ b/e2e/features/notifications/notify-test.js
@@ -1,7 +1,7 @@
const TIME_LIMIT = 30000;
const mockParam = '?mockAlerts=';
const layerNoticesTestParams = '?l=Coastlines,MODIS_Aqua_CorrectedReflectance_TrueColor,MODIS_Terra_CorrectedReflectance_TrueColor';
-const { addLayers, categoriesNav } = require('../../reuseables/selectors.js');
+const { addLayers, layersSearchField, categoriesNav } = require('../../reuseables/selectors.js');
// Selectors
const infoButton = '#wv-info-button';
@@ -80,7 +80,7 @@ module.exports = {
c.waitForElementVisible(tooltipSelector, TIME_LIMIT);
c.assert.containsText(`${tooltipSelector} div`, aquaTerraNotice);
},
- 'Verify that warning shows in the product picker next to the layers which have notices': function(c) {
+ 'Verify that warning shows in the product picker category/measurement rows': function(c) {
c.click(addLayers);
c.waitForElementVisible(categoriesNav, TIME_LIMIT);
c.click('#layer-category-item-air-quality-corrected-reflectance');
@@ -95,6 +95,15 @@ module.exports = {
c.waitForElementVisible(tooltipSelector, TIME_LIMIT);
c.assert.containsText(`${tooltipSelector} div`, aquaTerraNotice);
},
+ 'Verify that warning shows in the product picker search results rows': function(c) {
+ c.setValue(layersSearchField, 'MODIS_Aqua_CorrectedReflectance_TrueColor');
+ c.waitForElementVisible('#MODIS_Aqua_CorrectedReflectance_TrueColor-search-row', TIME_LIMIT);
+ c.expect.element('#MODIS_Aqua_CorrectedReflectance_TrueColor-notice-info').present;
+ c.moveToElement('#MODIS_Aqua_CorrectedReflectance_TrueColor-notice-info', 5, 5);
+ c.waitForElementVisible(tooltipSelector, TIME_LIMIT);
+ c.assert.containsText(`${tooltipSelector} div:first-of-type`, aquaNotice);
+ c.assert.containsText(`${tooltipSelector} div:last-of-type`, aquaTerraNotice);
+ },
after(c) {
c.end();
},
diff --git a/web/css/layers.css b/web/css/layers.css
index 4cac7f2e5..7b42502c4 100644
--- a/web/css/layers.css
+++ b/web/css/layers.css
@@ -198,15 +198,20 @@
.layers-all-layer.search-row {
padding: 8px 5px;
+
.layer-notice-icon {
color: #eee;
+ height: 24px;
width: 24px;
- height: 18px;
+ display: inline;
position: absolute;
- right: 6px;
+ left: 40px;
}
.layers-all-header {
- padding: 0 35px 0 40px;
+ padding: 0 0 0 40px;
+ &.notice {
+ padding: 0 0 0 70px;
+ }
}
&:hover {
.wv-checkbox::before {
diff --git a/web/css/mobile.css b/web/css/mobile.css
index 0bf59c983..1a50ec2e5 100644
--- a/web/css/mobile.css
+++ b/web/css/mobile.css
@@ -116,7 +116,9 @@
position: relative;
left: 0;
height: 50px;
- font-size: 16px;
+ span {
+ font-size: 18px;
+ }
}
#selected-category .ui-tabs-panel {
diff --git a/web/js/components/layer/product-picker/search/search-layer-row.js b/web/js/components/layer/product-picker/search/search-layer-row.js
index 3429673c9..3ee730ee2 100644
--- a/web/js/components/layer/product-picker/search/search-layer-row.js
+++ b/web/js/components/layer/product-picker/search/search-layer-row.js
@@ -106,6 +106,9 @@ class SearchLayerRow extends React.Component {
: 'search-row layers-all-layer';
const checkboxClass = isEnabled ? 'wv-checkbox checked' : 'wv-checkbox';
const recentLayerMode = categoryType === 'recent';
+ const headerClassName = layerNotices
+ ? 'layers-all-header notice'
+ : 'layers-all-header';
return (
<div
@@ -115,8 +118,17 @@ class SearchLayerRow extends React.Component {
onMouseEnter={() => this.toggleDeleteIcon(true)}
onMouseLeave={() => this.toggleDeleteIcon(false)}
>
+ <div className={checkboxClass}>
+ <input
+ type="checkbox"
+ id={`${id}-checkbox`}
+ name={`${id}-checkbox`}
+ checked={isEnabled}
+ onChange={this.toggleEnabled}
+ />
+ </div>
{layerNotices && (
- <>
+ <div className="layer-notice-wrapper">
<FontAwesomeIcon
id={`${id}-notice-info`}
className="layer-notice-icon"
@@ -132,18 +144,9 @@ class SearchLayerRow extends React.Component {
>
<div dangerouslySetInnerHTML={{ __html: layerNotices }} />
</UncontrolledTooltip>
- </>
+ </div>
)}
- <div className={checkboxClass}>
- <input
- type="checkbox"
- id={`${id}-checkbox`}
- name={`${id}-checkbox`}
- checked={isEnabled}
- onChange={this.toggleEnabled}
- />
- </div>
- <div className="layers-all-header" onClick={this.toggleShowMetadata}>
+ <div className={headerClassName} onClick={this.toggleShowMetadata}>
<RenderSplitLayerTitle layer={layer} />
{recentLayerMode && showDeleteIcon && (
<Button