{renderCellLegend('vertical')}
{selectionEnabled ? (
@@ -206,10 +289,12 @@ BasicAvailabilityKey.propTypes = {
orientation: PropTypes.string,
selectionEnabled: PropTypes.bool,
delineateRelease: PropTypes.bool,
+ availabilityStatusType: PropTypes.oneOf(['available', 'tombstoned']),
};
BasicAvailabilityKey.defaultProps = {
orientation: '',
selectionEnabled: false,
delineateRelease: false,
+ availabilityStatusType: null,
};
diff --git a/src/lib_components/components/DataProductAvailability/DataProductAvailability.jsx b/src/lib_components/components/DataProductAvailability/DataProductAvailability.jsx
index ec6b8202..1270797f 100644
--- a/src/lib_components/components/DataProductAvailability/DataProductAvailability.jsx
+++ b/src/lib_components/components/DataProductAvailability/DataProductAvailability.jsx
@@ -35,6 +35,7 @@ DataProductAvailability.propTypes = {
sortDirection: PropTypes.oneOf(['ASC', 'DESC']),
disableSelection: PropTypes.bool,
delineateRelease: PropTypes.bool,
+ availabilityStatusType: PropTypes.oneOf(['available', 'tombstoned']),
};
DataProductAvailability.defaultProps = {
@@ -46,6 +47,7 @@ DataProductAvailability.defaultProps = {
sortDirection: 'ASC',
disableSelection: false,
delineateRelease: false,
+ availabilityStatusType: null,
};
const WrappedDataProductAvailability = Theme.getWrappedComponent(
diff --git a/src/lib_components/components/DataProductAvailability/EnhancedAvailabilityInterface.jsx b/src/lib_components/components/DataProductAvailability/EnhancedAvailabilityInterface.jsx
index 4684e5bc..4d336fbb 100644
--- a/src/lib_components/components/DataProductAvailability/EnhancedAvailabilityInterface.jsx
+++ b/src/lib_components/components/DataProductAvailability/EnhancedAvailabilityInterface.jsx
@@ -4,7 +4,6 @@ import React, {
useCallback,
useEffect,
useRef,
- useState,
} from 'react';
import PropTypes from 'prop-types';
@@ -14,12 +13,8 @@ import { makeStyles } from '@material-ui/core/styles';
import useMediaQuery from '@material-ui/core/useMediaQuery';
import FormControl from '@material-ui/core/FormControl';
-import FormControlLabel from '@material-ui/core/FormControlLabel';
-import Hidden from '@material-ui/core/Hidden';
import MenuItem from '@material-ui/core/MenuItem';
-import OutlinedInput from '@material-ui/core/OutlinedInput';
import Select from '@material-ui/core/Select';
-import Switch from '@material-ui/core/Switch';
import ToggleButton from '@material-ui/lab/ToggleButton';
import ToggleButtonGroup from '@material-ui/lab/ToggleButtonGroup';
import Typography from '@material-ui/core/Typography';
@@ -30,13 +25,12 @@ import DescIcon from '@material-ui/icons/KeyboardArrowUp';
import AvailabilityContext from './AvailabilityContext';
import AvailabilityPending from './AvailabilityPending';
import FullWidthVisualization from '../FullWidthVisualization/FullWidthVisualization';
-import DownloadDataContext from '../DownloadDataContext/DownloadDataContext';
import NeonContext from '../NeonContext/NeonContext';
import Theme from '../Theme/Theme';
import EnhancedAvailabilityKey from './EnhancedAvailabilityKey';
import EnhancedAvailabilityGrid from './EnhancedAvailabilityGrid';
-import { SVG, TIME, AvailabilityPropTypes } from './AvailabilityUtils';
+import { SVG, AvailabilityPropTypes } from './AvailabilityUtils';
import { SvgDefs } from './AvailabilitySvgComponents';
const preStyle = {
@@ -83,14 +77,10 @@ const EnhancedAvailabilityInterface = (props) => {
const { sites: availabilitySites, ...other } = props;
const classes = useStyles(Theme);
- const atXs = useMediaQuery(Theme.breakpoints.only('xs'));
- const atSm = useMediaQuery(Theme.breakpoints.only('sm'));
const [
- { data: neonContextData, isFinal: neonContextIsFinal, hasError: neonContextHasError },
+ { isFinal: neonContextIsFinal, hasError: neonContextHasError },
] = NeonContext.useNeonContextState();
- const { sites: allSites, states: allStates, domains: allDomains } = neonContextData;
-
const { SORT_DIRECTIONS, useAvailabilityState } = AvailabilityContext;
const [availabilityState, availabilityDispatch] = useAvailabilityState();
const {
@@ -106,7 +96,6 @@ const EnhancedAvailabilityInterface = (props) => {
/**
Context-Derived Stuff
*/
- const downloadContextIsActive = false;
const selectionEnabled = false;
/**
diff --git a/src/lib_components/components/DataProductAvailability/StyleGuide.jsx b/src/lib_components/components/DataProductAvailability/StyleGuide.jsx
index 60da1855..b954bbd9 100644
--- a/src/lib_components/components/DataProductAvailability/StyleGuide.jsx
+++ b/src/lib_components/components/DataProductAvailability/StyleGuide.jsx
@@ -412,6 +412,47 @@ const productData = {...};
`}
+
+
Availability Status Types
+
+
+ The DataProductAvailability visualization can show various status types
+ to adapt to different kinds of availability displays.
+
+
+ Valid status types: available, tombstoned
+
+
+ Default view: available
+
+
+ The availability status type shown below is tombstoned
+
+
+
+
+
+ {`
+import DataProductAvailability from 'portal-core-components/lib/components/DataProductAvailability';
+
+const siteCodes = [...];
+
+
+ `}
+
+
Enhanced Data Product Availability Chart
diff --git a/src/lib_components/components/DataProductAvailability/__tests__/__snapshots__/AvailabilitySvgComponents.jsx.snap b/src/lib_components/components/DataProductAvailability/__tests__/__snapshots__/AvailabilitySvgComponents.jsx.snap
index b4e3edb2..4774d249 100644
--- a/src/lib_components/components/DataProductAvailability/__tests__/__snapshots__/AvailabilitySvgComponents.jsx.snap
+++ b/src/lib_components/components/DataProductAvailability/__tests__/__snapshots__/AvailabilitySvgComponents.jsx.snap
@@ -143,6 +143,19 @@ exports[`DataProductAvailability - AvailabilitySvgComponents renders JsxCell cor
/>
`;
+exports[`DataProductAvailability - AvailabilitySvgComponents renders JsxCell correctly for every status JsxCell for status: tombstoned 1`] = `
+
+`;
+
exports[`DataProductAvailability - AvailabilitySvgComponents renders SvgDefs correctly 1`] = `
} customFooter={