Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

v2.7.0 #71

Merged
merged 4 commits into from
Jan 2, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions .env.development
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
PORT=3010
REACT_APP_NAME=$npm_package_name
REACT_APP_VERSION=$npm_package_version

#-------------------------------------------------------------------------------
Expand Down
1 change: 1 addition & 0 deletions .env.production
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
REACT_APP_NAME=$npm_package_name
REACT_APP_VERSION=$npm_package_version

#-------------------------------------------------------------------------------
Expand Down
601 changes: 270 additions & 331 deletions lib/components/AopDataViewer/AopDataViewer.js

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion lib/components/AopDataViewer/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ Object.defineProperty(exports, "__esModule", {
});
Object.defineProperty(exports, "default", {
enumerable: true,
get: function get() {
get: function () {
return _AopDataViewer.default;
}
});
Expand Down
56 changes: 24 additions & 32 deletions lib/components/Bundles/BundleContentBuilder.js
Original file line number Diff line number Diff line change
Expand Up @@ -11,51 +11,43 @@ var _Theme = _interopRequireDefault(require("../Theme/Theme"));
var _typeUtil = require("../../util/typeUtil");
var _ReleaseService = require("../../service/ReleaseService");
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
var BundleContentBuilder = {
getParentProductLink: function getParentProductLink(dataProduct, release) {
var isRelease = (0, _typeUtil.isStringNonEmpty)(release) && release !== _ReleaseService.LATEST_AND_PROVISIONAL;
var href = _RouteService.default.getProductDetailPath(dataProduct.productCode, isRelease ? release : undefined);
const BundleContentBuilder = {
getParentProductLink: (dataProduct, release) => {
const isRelease = (0, _typeUtil.isStringNonEmpty)(release) && release !== _ReleaseService.LATEST_AND_PROVISIONAL;
const href = _RouteService.default.getProductDetailPath(dataProduct.productCode, isRelease ? release : undefined);
return /*#__PURE__*/_react.default.createElement(_Link.default, {
href: href,
target: "_blank"
}, "".concat(dataProduct.productName, " (").concat(dataProduct.productCode, ")"));
},
getBundledLink: function getBundledLink() {
var href = _RouteService.default.getDataProductBundlesPath();
getBundledLink: () => {
const href = _RouteService.default.getDataProductBundlesPath();
return /*#__PURE__*/_react.default.createElement(_Link.default, {
href: href,
target: "_blank"
}, "bundled");
},
buildManyParentsMainContent: function buildManyParentsMainContent(dataProducts, release) {
return /*#__PURE__*/_react.default.createElement("ul", {
style: {
margin: _Theme.default.spacing(1, 0)
}
}, dataProducts.map(function (dataProduct) {
return /*#__PURE__*/_react.default.createElement("li", {
key: dataProduct.productCode
}, BundleContentBuilder.getParentProductLink(dataProduct, release));
}));
},
buildDefaultTitleContent: function buildDefaultTitleContent(dataProduct, release) {
var isRelease = (0, _typeUtil.isStringNonEmpty)(release) && release !== _ReleaseService.LATEST_AND_PROVISIONAL;
var bundleParentLink = BundleContentBuilder.getParentProductLink(dataProduct, isRelease ? release : undefined);
var bundledLink = BundleContentBuilder.getBundledLink();
buildManyParentsMainContent: (dataProducts, release) => /*#__PURE__*/_react.default.createElement("ul", {
style: {
margin: _Theme.default.spacing(1, 0)
}
}, dataProducts.map(dataProduct => /*#__PURE__*/_react.default.createElement("li", {
key: dataProduct.productCode
}, BundleContentBuilder.getParentProductLink(dataProduct, release)))),
buildDefaultTitleContent: (dataProduct, release) => {
const isRelease = (0, _typeUtil.isStringNonEmpty)(release) && release !== _ReleaseService.LATEST_AND_PROVISIONAL;
const bundleParentLink = BundleContentBuilder.getParentProductLink(dataProduct, isRelease ? release : undefined);
const bundledLink = BundleContentBuilder.getBundledLink();
return /*#__PURE__*/_react.default.createElement(_react.default.Fragment, null, "This data product ", isRelease ? 'release ' : '', "is ", bundledLink, " into ", bundleParentLink);
},
buildDefaultSplitTitleContent: function buildDefaultSplitTitleContent(isRelease, terminalChar) {
var bundledLink = BundleContentBuilder.getBundledLink();
buildDefaultSplitTitleContent: (isRelease, terminalChar) => {
const bundledLink = BundleContentBuilder.getBundledLink();
return /*#__PURE__*/_react.default.createElement(_react.default.Fragment, null, "This data product ", isRelease ? 'release ' : '', "is ", bundledLink, " into the following data product", isRelease ? ' releases' : 's', "".concat(terminalChar));
},
buildDefaultSubTitleContent: function buildDefaultSubTitleContent(forwardAvailability, hasManyParents) {
return (
/*#__PURE__*/
// eslint-disable-next-line react/jsx-no-useless-fragment
_react.default.createElement(_react.default.Fragment, null, forwardAvailability ? /*#__PURE__*/_react.default.createElement(_react.default.Fragment, null, "It is not available as a standalone download. Data availability shown below reflects availability of the entire bundle.") : /*#__PURE__*/_react.default.createElement(_react.default.Fragment, null, "It is not available as a standalone download. Data availability information and data product download is only available through the bundle data ", hasManyParents ? 'products' : 'product', "."))
);
}
buildDefaultSubTitleContent: (forwardAvailability, hasManyParents) =>
/*#__PURE__*/
// eslint-disable-next-line react/jsx-no-useless-fragment
_react.default.createElement(_react.default.Fragment, null, forwardAvailability ? /*#__PURE__*/_react.default.createElement(_react.default.Fragment, null, "It is not available as a standalone download. Data availability shown below reflects availability of the entire bundle.") : /*#__PURE__*/_react.default.createElement(_react.default.Fragment, null, "It is not available as a standalone download. Data availability information and data product download is only available through the bundle data ", hasManyParents ? 'products' : 'product', "."))
};
Object.freeze(BundleContentBuilder);
var _default = BundleContentBuilder;
exports.default = _default;
var _default = exports.default = BundleContentBuilder;
25 changes: 12 additions & 13 deletions lib/components/Bundles/BundleListItemIcon.js
Original file line number Diff line number Diff line change
Expand Up @@ -11,17 +11,17 @@ var _reactFontawesome = require("@fortawesome/react-fontawesome");
var _freeSolidSvgIcons = require("@fortawesome/free-solid-svg-icons");
var _Theme = _interopRequireDefault(require("../Theme/Theme"));
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
var useStyles = (0, _styles.makeStyles)(function (theme) {
return {
bundleIcon: {
padding: '5px',
marginRight: theme.spacing(2)
}
};
});
var BundleListItemIcon = function BundleListItemIcon(props) {
var classes = useStyles(_Theme.default);
var isSplit = props.isSplit;
const useStyles = (0, _styles.makeStyles)(theme => ({
bundleIcon: {
padding: '5px',
marginRight: theme.spacing(2)
}
}));
const BundleListItemIcon = props => {
const classes = useStyles(_Theme.default);
const {
isSplit
} = props;
return /*#__PURE__*/_react.default.createElement(_ListItemIcon.default, null, /*#__PURE__*/_react.default.createElement(_reactFontawesome.FontAwesomeIcon, {
icon: isSplit ? _freeSolidSvgIcons.faBoxesStacked : _freeSolidSvgIcons.faBox,
size: "2x",
Expand All @@ -31,5 +31,4 @@ var BundleListItemIcon = function BundleListItemIcon(props) {
BundleListItemIcon.defaultProps = {
isSplit: false
};
var _default = BundleListItemIcon;
exports.default = _default;
var _default = exports.default = BundleListItemIcon;
67 changes: 33 additions & 34 deletions lib/components/Bundles/DataProductBundleCard.js
Original file line number Diff line number Diff line change
Expand Up @@ -13,38 +13,38 @@ var _InfoMessageCard = _interopRequireDefault(require("../Card/InfoMessageCard")
var _Theme = _interopRequireDefault(require("../Theme/Theme"));
var _typeUtil = require("../../util/typeUtil");
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
var useStyles = (0, _styles.makeStyles)(function (theme) {
return {
cardIcon: {
color: 'rgba(0, 0, 0, 0.9)',
padding: '5px 0px',
fontSize: '1.5em',
marginRight: theme.spacing(2)
},
cardSecondaryIcon: {
color: 'rgba(138, 191, 236, 0.9)',
// theme.colors.LIGHT_BLUE[200] with 'a' value applied
marginLeft: theme.spacing(2),
fontSize: '1.5rem'
},
cardTitleContentContainer: {
padding: theme.spacing(2, 2.5, 0.5, 2.5)
},
cardMessageContentContainer: {
padding: theme.spacing(0.25, 2.5, 2, 2.5)
}
};
});
var DataProductBundleCard = function DataProductBundleCard(props) {
var classes = useStyles(_Theme.default);
var titleContent = props.titleContent,
subTitleContent = props.subTitleContent,
detailContent = props.detailContent,
customContent = props.customContent,
isSplit = props.isSplit,
customClasses = props.classes;
var customIconClass = customClasses ? customClasses.cardIcon : undefined;
var renderContent = function renderContent() {
const useStyles = (0, _styles.makeStyles)(theme => ({
cardIcon: {
color: 'rgba(0, 0, 0, 0.9)',
padding: '5px 0px',
fontSize: '1.5em',
marginRight: theme.spacing(2)
},
cardSecondaryIcon: {
color: 'rgba(138, 191, 236, 0.9)',
// theme.colors.LIGHT_BLUE[200] with 'a' value applied
marginLeft: theme.spacing(2),
fontSize: '1.5rem'
},
cardTitleContentContainer: {
padding: theme.spacing(2, 2.5, 0.5, 2.5)
},
cardMessageContentContainer: {
padding: theme.spacing(0.25, 2.5, 2, 2.5)
}
}));
const DataProductBundleCard = props => {
const classes = useStyles(_Theme.default);
const {
titleContent,
subTitleContent,
detailContent,
customContent,
isSplit,
classes: customClasses
} = props;
const customIconClass = customClasses ? customClasses.cardIcon : undefined;
const renderContent = () => {
if ((0, _typeUtil.exists)(customContent)) {
// eslint-disable-next-line react/jsx-no-useless-fragment
return /*#__PURE__*/_react.default.createElement(_react.default.Fragment, null, customContent);
Expand Down Expand Up @@ -81,5 +81,4 @@ DataProductBundleCard.defaultProps = {
isSplit: false,
classes: undefined
};
var _default = DataProductBundleCard;
exports.default = _default;
var _default = exports.default = DataProductBundleCard;
2 changes: 1 addition & 1 deletion lib/components/Bundles/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ Object.defineProperty(exports, "__esModule", {
});
Object.defineProperty(exports, "default", {
enumerable: true,
get: function get() {
get: function () {
return _DataProductBundleCard.default;
}
});
Expand Down
94 changes: 39 additions & 55 deletions lib/components/Button/SplitButton.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
"use strict";

function _typeof(obj) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (obj) { return typeof obj; } : function (obj) { return obj && "function" == typeof Symbol && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }, _typeof(obj); }
Object.defineProperty(exports, "__esModule", {
value: true
});
Expand All @@ -19,79 +18,67 @@ var _ArrowDropDown = _interopRequireDefault(require("@material-ui/icons/ArrowDro
var _Theme = _interopRequireDefault(require("../Theme/Theme"));
var _typeUtil = require("../../util/typeUtil");
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
function _getRequireWildcardCache(nodeInterop) { if (typeof WeakMap !== "function") return null; var cacheBabelInterop = new WeakMap(); var cacheNodeInterop = new WeakMap(); return (_getRequireWildcardCache = function _getRequireWildcardCache(nodeInterop) { return nodeInterop ? cacheNodeInterop : cacheBabelInterop; })(nodeInterop); }
function _interopRequireWildcard(obj, nodeInterop) { if (!nodeInterop && obj && obj.__esModule) { return obj; } if (obj === null || _typeof(obj) !== "object" && typeof obj !== "function") { return { default: obj }; } var cache = _getRequireWildcardCache(nodeInterop); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (key !== "default" && Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj.default = obj; if (cache) { cache.set(obj, newObj); } return newObj; }
function _getRequireWildcardCache(e) { if ("function" != typeof WeakMap) return null; var r = new WeakMap(), t = new WeakMap(); return (_getRequireWildcardCache = function (e) { return e ? t : r; })(e); }
function _interopRequireWildcard(e, r) { if (!r && e && e.__esModule) return e; if (null === e || "object" != typeof e && "function" != typeof e) return { default: e }; var t = _getRequireWildcardCache(r); if (t && t.has(e)) return t.get(e); var n = { __proto__: null }, a = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var u in e) if ("default" !== u && Object.prototype.hasOwnProperty.call(e, u)) { var i = a ? Object.getOwnPropertyDescriptor(e, u) : null; i && (i.get || i.set) ? Object.defineProperty(n, u, i) : n[u] = e[u]; } return n.default = e, t && t.set(e, n), n; }
function _extends() { _extends = Object.assign ? Object.assign.bind() : function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends.apply(this, arguments); }
function _slicedToArray(arr, i) { return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _unsupportedIterableToArray(arr, i) || _nonIterableRest(); }
function _nonIterableRest() { throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); }
function _unsupportedIterableToArray(o, minLen) { if (!o) return; if (typeof o === "string") return _arrayLikeToArray(o, minLen); var n = Object.prototype.toString.call(o).slice(8, -1); if (n === "Object" && o.constructor) n = o.constructor.name; if (n === "Map" || n === "Set") return Array.from(o); if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen); }
function _arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len = arr.length; for (var i = 0, arr2 = new Array(len); i < len; i++) arr2[i] = arr[i]; return arr2; }
function _iterableToArrayLimit(arr, i) { var _i = null == arr ? null : "undefined" != typeof Symbol && arr[Symbol.iterator] || arr["@@iterator"]; if (null != _i) { var _s, _e, _x, _r, _arr = [], _n = !0, _d = !1; try { if (_x = (_i = _i.call(arr)).next, 0 === i) { if (Object(_i) !== _i) return; _n = !1; } else for (; !(_n = (_s = _x.call(_i)).done) && (_arr.push(_s.value), _arr.length !== i); _n = !0); } catch (err) { _d = !0, _e = err; } finally { try { if (!_n && null != _i.return && (_r = _i.return(), Object(_r) !== _r)) return; } finally { if (_d) throw _e; } } return _arr; } }
function _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; }
var SplitButton = function SplitButton(props) {
var name = props.name,
options = props.options,
selectedOption = props.selectedOption,
selectedOptionDisplayCallback = props.selectedOptionDisplayCallback,
onClick = props.onClick,
onChange = props.onChange,
buttonGroupProps = props.buttonGroupProps,
buttonMenuProps = props.buttonMenuProps,
buttonProps = props.buttonProps;
var _useState = (0, _react.useState)(false),
_useState2 = _slicedToArray(_useState, 2),
open = _useState2[0],
setOpen = _useState2[1];
var _useState3 = (0, _react.useState)(selectedOption),
_useState4 = _slicedToArray(_useState3, 2),
stateSelectedOption = _useState4[0],
setStateSelectedOption = _useState4[1];
var anchorRef = (0, _react.useRef)(null);
var appliedButtonGroupProps = {
const SplitButton = props => {
const {
name,
options,
selectedOption,
selectedOptionDisplayCallback,
onClick,
onChange,
buttonGroupProps,
buttonMenuProps,
buttonProps
} = props;
const [open, setOpen] = (0, _react.useState)(false);
const [stateSelectedOption, setStateSelectedOption] = (0, _react.useState)(selectedOption);
const anchorRef = (0, _react.useRef)(null);
let appliedButtonGroupProps = {
variant: 'outlined',
color: 'primary'
};
if ((0, _typeUtil.exists)(buttonGroupProps)) {
appliedButtonGroupProps = buttonGroupProps;
}
var appliedButtonProps = {
let appliedButtonProps = {
color: 'primary',
size: 'small'
};
if ((0, _typeUtil.exists)(buttonProps)) {
appliedButtonProps = buttonProps;
}
var appliedButtonMenuProps = {
let appliedButtonMenuProps = {
color: 'primary',
size: 'small'
};
if ((0, _typeUtil.exists)(buttonMenuProps)) {
appliedButtonMenuProps = buttonMenuProps;
}
(0, _react.useEffect)(function () {
(0, _react.useEffect)(() => {
if (selectedOption === stateSelectedOption) return;
setStateSelectedOption(selectedOption);
}, [selectedOption, stateSelectedOption]);
var handleClick = function handleClick() {
const handleClick = () => {
onClick(stateSelectedOption);
};
var handleMenuItemClick = function handleMenuItemClick(event, index) {
const handleMenuItemClick = (event, index) => {
setStateSelectedOption(options[index]);
onChange(options[index]);
setOpen(false);
};
var handleToggle = function handleToggle() {
setOpen(function (prevOpen) {
return !prevOpen;
});
const handleToggle = () => {
setOpen(prevOpen => !prevOpen);
};
var handleClose = function handleClose(event) {
const handleClose = event => {
if (anchorRef.current && anchorRef.current.contains(event.target)) {
return;
}
setOpen(false);
};
var renderSelectedOption = function renderSelectedOption() {
const renderSelectedOption = () => {
if ((0, _typeUtil.exists)(selectedOptionDisplayCallback)) {
// eslint-disable-next-line max-len
return selectedOptionDisplayCallback(stateSelectedOption);
Expand Down Expand Up @@ -123,9 +110,11 @@ var SplitButton = function SplitButton(props) {
anchorEl: anchorRef.current,
open: open,
role: undefined
}, function (_ref) {
var TransitionProps = _ref.TransitionProps,
placement = _ref.placement;
}, _ref => {
let {
TransitionProps,
placement
} = _ref;
return /*#__PURE__*/_react.default.createElement(_Grow.default, _extends({}, TransitionProps, {
style: {
transformOrigin: placement === 'bottom' ? 'center top' : 'center bottom'
Expand All @@ -134,17 +123,12 @@ var SplitButton = function SplitButton(props) {
onClickAway: handleClose
}, /*#__PURE__*/_react.default.createElement(_MenuList.default, {
id: "".concat(name, "-split-button-menu")
}, options.map(function (option, index) {
return /*#__PURE__*/_react.default.createElement(_MenuItem.default, {
key: option,
selected: option === stateSelectedOption,
onClick: function onClick(event) {
return handleMenuItemClick(event, index);
}
}, option);
})))));
}, options.map((option, index) => /*#__PURE__*/_react.default.createElement(_MenuItem.default, {
key: option,
selected: option === stateSelectedOption,
onClick: event => handleMenuItemClick(event, index)
}, option))))));
})));
};
var WrappedSplitButton = _Theme.default.getWrappedComponent(SplitButton);
var _default = WrappedSplitButton;
exports.default = _default;
const WrappedSplitButton = _Theme.default.getWrappedComponent(SplitButton);
var _default = exports.default = WrappedSplitButton;
2 changes: 1 addition & 1 deletion lib/components/Button/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ Object.defineProperty(exports, "__esModule", {
});
Object.defineProperty(exports, "default", {
enumerable: true,
get: function get() {
get: function () {
return _SplitButton.default;
}
});
Expand Down
Loading
Loading