- Add Alert Filter to visual production board

Signed-off-by: Dave Richer <dave@imexsystems.ca>
This commit is contained in:
Dave Richer
2024-08-16 12:14:52 -04:00
parent 134ce05d27
commit 01cbdf14a9
3 changed files with 16 additions and 9 deletions

View File

@@ -48,6 +48,8 @@ const defaultKanbanSettings = {
selectedEstimators: []
};
const defaultFilters = { search: "", employeeId: null, alert: false };
const mergeWithDefaults = (settings) => {
// Create a new object that starts with the default settings
const mergedSettings = { ...defaultKanbanSettings };
@@ -64,4 +66,4 @@ const mergeWithDefaults = (settings) => {
return mergedSettings;
};
export { defaultKanbanSettings, statisticsItems, mergeWithDefaults };
export { defaultKanbanSettings, statisticsItems, mergeWithDefaults, defaultFilters };

View File

@@ -9,8 +9,9 @@ import InformationSettings from "./InformationSettings.jsx";
import StatisticsSettings from "./StatisticsSettings.jsx";
import FilterSettings from "./FilterSettings.jsx";
import PropTypes from "prop-types";
import { isFunction } from "lodash";
function ProductionBoardKanbanSettings({ associationSettings, parentLoading, bodyshop, data }) {
function ProductionBoardKanbanSettings({ associationSettings, parentLoading, bodyshop, data, onSettingsChange }) {
const [form] = Form.useForm();
const [open, setOpen] = useState(false);
const [loading, setLoading] = useState(false);
@@ -61,6 +62,11 @@ function ProductionBoardKanbanSettings({ associationSettings, parentLoading, bod
setOpen(false);
setLoading(false);
parentLoading(false);
if (onSettingsChange && isFunction(onSettingsChange)) {
onSettingsChange(values);
}
setHasChanges(false);
};
@@ -156,6 +162,7 @@ ProductionBoardKanbanSettings.propTypes = {
associationSettings: PropTypes.object,
parentLoading: PropTypes.func.isRequired,
bodyshop: PropTypes.object.isRequired,
onSettingsChange: PropTypes.func,
data: PropTypes.array
};