Skip to content

Interactive interface for browsing global, full-resolution satellite imagery

make sure collapse available label shows date

Jason Kentfe2d75959c2c
diff --git a/web/js/components/layer/product-picker/search/facets.js b/web/js/components/layer/product-picker/search/facets.js
index d57a2200d..c8d770225 100644
--- a/web/js/components/layer/product-picker/search/facets.js
+++ b/web/js/components/layer/product-picker/search/facets.js
@@ -44,12 +44,7 @@ function Facets(props) {
return (
<ProductFacet
key={config.field}
- field={config.field}
- label={config.label}
- filterType={config.filterType}
- tooltip={config.tooltip}
- show={config.show}
- view={config.view}
+ config={config}
data={data}
collapsed={collapsedFacets[config.field]}
toggleCollapse={toggleCollapseFacet}
diff --git a/web/js/components/layer/product-picker/search/product-facet.js b/web/js/components/layer/product-picker/search/product-facet.js
index ab4f90f9d..e9fe25424 100644
--- a/web/js/components/layer/product-picker/search/product-facet.js
+++ b/web/js/components/layer/product-picker/search/product-facet.js
@@ -12,17 +12,22 @@ import { Tooltip } from 'reactstrap';
function ProductFacet(props) {
const [tooltipVisible, toggleTooltip] = useState(false);
+ const {
+ config,
+ data,
+ collapsed,
+ toggleCollapse,
+ } = props;
+
const {
field,
+ booleanOptionLabel,
label,
filterType,
- show,
tooltip,
- data,
+ show,
view,
- collapsed,
- toggleCollapse,
- } = props;
+ } = config;
const renderHeaderIcons = () => (
<>
@@ -72,7 +77,7 @@ function ProductFacet(props) {
{!collapsed && (
<Facet
field={field}
- label={label}
+ label={booleanOptionLabel || label}
filterType={filterType}
show={show}
view={view}
@@ -83,15 +88,10 @@ function ProductFacet(props) {
}
ProductFacet.propTypes = {
+ config: PropTypes.object,
collapsed: PropTypes.bool,
data: PropTypes.array,
- field: PropTypes.string,
- filterType: PropTypes.string,
- label: PropTypes.string,
- show: PropTypes.number,
- tooltip: PropTypes.string,
toggleCollapse: PropTypes.func,
- view: PropTypes.func,
};
diff --git a/web/js/modules/product-picker/facetConfig.js b/web/js/modules/product-picker/facetConfig.js
index 188f56476..b4dfa6192 100644
--- a/web/js/modules/product-picker/facetConfig.js
+++ b/web/js/modules/product-picker/facetConfig.js
@@ -1,9 +1,19 @@
+import React from 'react';
import AvailableFacet from '../../components/layer/product-picker/search/available-facet';
+import SelectedDate from '../../components/selected-date';
+
+const AvailableLabel = (
+ <>
+ Visible on &nbsp;
+ <SelectedDate />
+ </>
+);
export default [
{
field: 'availableAtDate',
- label: 'Visible',
+ label: AvailableLabel,
+ booleanOptionLabel: 'Visible',
filterType: 'any',
tooltip: 'Layer has available imagery at currently selected date/time',
view: AvailableFacet,