- Fix bug

Signed-off-by: Dave Richer <dave@imexsystems.ca>
This commit is contained in:
Dave Richer
2024-08-02 19:34:15 -04:00
parent e1bac5fe9f
commit 8f83a5f5e6
2 changed files with 2 additions and 14 deletions

View File

@@ -154,7 +154,7 @@ const ProductionStatistics = ({ data, cardSettings, reducerData }) => {
const sortedStatistics = useMemo(() => {
const statisticsMap = new Map(statistics.map((stat) => [stat.id, stat]));
return cardSettings.statisticsOrder.reduce((sorted, orderId) => {
return (cardSettings?.statisticsOrder ? cardSettings.statisticsOrder : []).reduce((sorted, orderId) => {
const value = statisticsMap.get(orderId);
if (value && value.value !== null) {
sorted.push(value);

View File

@@ -74,19 +74,7 @@ FilterSettings.propTypes = {
setHasChanges: PropTypes.func.isRequired,
selectedEstimators: PropTypes.array.isRequired,
setSelectedEstimators: PropTypes.func,
bodyshop: PropTypes.shape({
md_ins_cos: PropTypes.arrayOf(
PropTypes.shape({
name: PropTypes.string.isRequired
})
).isRequired,
md_estimators: PropTypes.arrayOf(
PropTypes.shape({
est_ct_fn: PropTypes.string.isRequired,
est_ct_ln: PropTypes.string.isRequired
})
).isRequired
}).isRequired,
bodyshop: PropTypes.object.isRequired,
data: PropTypes.arrayOf(PropTypes.object).isRequired
};