From 6fbaedbe9738beff112ba3048f08dc15ed4f89a4 Mon Sep 17 00:00:00 2001 From: Max Kaliberda Date: Wed, 18 Sep 2024 16:45:36 +0000 Subject: [PATCH] [WebUI] bug-fix V2024.3.0 * [SDL-5726] fixed Pipeline Builder -> Feature Grouping -> Combine Labels is crashing * fixed undefined pipeline name in massage * [SDL-5729] Fixed Pipeline Augmentation steps do not survive import/export of pipeline * [SDL-5732] Fixed Clicking on the model in model results does not take to the correct model in model explore screen --- src/ui/src/components/FormElements/InputDict.jsx | 1 + .../components/FormElements/InputDictSelectMultiChip.jsx | 4 ++-- src/ui/src/components/FormElements/SelectMultiChip.jsx | 2 +- src/ui/src/components/PipelinesTable/PipelinesTable.jsx | 5 ++++- .../BuildModel/componets/TableAutoSenseMetrics.jsx | 4 ++-- src/ui/src/containers/ExploreModels/TheExploreModels.jsx | 8 +++++++- src/ui/src/containers/ExploreModels/index.js | 9 ++------- .../domain/PipelineImportDecomposer.js | 8 +++++--- 8 files changed, 24 insertions(+), 17 deletions(-) diff --git a/src/ui/src/components/FormElements/InputDict.jsx b/src/ui/src/components/FormElements/InputDict.jsx index 2ea40874..5a2bb89f 100644 --- a/src/ui/src/components/FormElements/InputDict.jsx +++ b/src/ui/src/components/FormElements/InputDict.jsx @@ -1,3 +1,4 @@ +/* eslint-disable no-unused-vars */ /* Copyright 2017-2024 SensiML Corporation diff --git a/src/ui/src/components/FormElements/InputDictSelectMultiChip.jsx b/src/ui/src/components/FormElements/InputDictSelectMultiChip.jsx index ac7acf8b..edfb66e3 100644 --- a/src/ui/src/components/FormElements/InputDictSelectMultiChip.jsx +++ b/src/ui/src/components/FormElements/InputDictSelectMultiChip.jsx @@ -30,7 +30,7 @@ const InputDictSelectMultiChip = ({ labelId, label, name, - defaultValue, + defaultValue = [], options, onChange, }) => { @@ -63,7 +63,7 @@ const InputDictSelectMultiChip = ({ InputDictSelectMultiChip.propTypes = { id: PropTypes.string.isRequired, onChange: PropTypes.func.isRequired, - defaultValue: PropTypes.objectOf(PropTypes.arrayOf(PropTypes.string)).isRequired, + // defaultValue: PropTypes.objectOf(PropTypes.arrayOf(PropTypes.string)).isRequired, }; export default InputDictSelectMultiChip; diff --git a/src/ui/src/components/FormElements/SelectMultiChip.jsx b/src/ui/src/components/FormElements/SelectMultiChip.jsx index 7f9bb6dc..ae1f023e 100644 --- a/src/ui/src/components/FormElements/SelectMultiChip.jsx +++ b/src/ui/src/components/FormElements/SelectMultiChip.jsx @@ -82,7 +82,7 @@ const SelectMultiChip = ({ onChange(name, defaultValue); } } - }, [options]); + }, []); useEffect(() => { if (isObserveDefaultValue) { diff --git a/src/ui/src/components/PipelinesTable/PipelinesTable.jsx b/src/ui/src/components/PipelinesTable/PipelinesTable.jsx index 4c0aeba5..e56b9dc6 100644 --- a/src/ui/src/components/PipelinesTable/PipelinesTable.jsx +++ b/src/ui/src/components/PipelinesTable/PipelinesTable.jsx @@ -168,7 +168,10 @@ const PipelinesTable = ({ onUpdateProjectAction(); } if (deletedItems?.length) { - openSnackBarWithMsg("success", `Successfully deleted the Pipeline ${selectedPipelineName}.`); + openSnackBarWithMsg( + "success", + `Successfully deleted the Pipeline ${selectedPipelineName || ""}.`, + ); } handleCloseConfirmDelete(); setDeletingPipeline(false); diff --git a/src/ui/src/containers/BuildModel/componets/TableAutoSenseMetrics.jsx b/src/ui/src/containers/BuildModel/componets/TableAutoSenseMetrics.jsx index 18bfc272..03704b17 100644 --- a/src/ui/src/containers/BuildModel/componets/TableAutoSenseMetrics.jsx +++ b/src/ui/src/containers/BuildModel/componets/TableAutoSenseMetrics.jsx @@ -60,10 +60,10 @@ const TableAutoSenseMetrics = ({ autosenseMetrics, projectUUID, pipelineUUID }) routersHistory.push(getModelPagePath(row.knowledgepack)); }; - const openModelRender = (modelUUID, row) => { + const openModelRender = (modelUUID) => { return ( - + diff --git a/src/ui/src/containers/ExploreModels/TheExploreModels.jsx b/src/ui/src/containers/ExploreModels/TheExploreModels.jsx index 3dbea5e4..935bfbec 100644 --- a/src/ui/src/containers/ExploreModels/TheExploreModels.jsx +++ b/src/ui/src/containers/ExploreModels/TheExploreModels.jsx @@ -49,7 +49,7 @@ function a11yProps(index) { }; } -const ExploreModels = ({ model }) => { +const ExploreModels = ({ model, selectedModel, setSelectedModel }) => { const classes = useStyles(); const { projectUUID, modelUUID } = useParams(); @@ -67,6 +67,12 @@ const ExploreModels = ({ model }) => { if (model) setLoadingModelData(model.isFetching); }, [model]); + useEffect(() => { + if (modelUUID && modelUUID !== selectedModel) { + setSelectedModel(modelUUID); + } + }, [modelUUID]); + useEffect(() => { window.scrollTo(0, 0); }, []); diff --git a/src/ui/src/containers/ExploreModels/index.js b/src/ui/src/containers/ExploreModels/index.js index 5d11236b..7500412d 100644 --- a/src/ui/src/containers/ExploreModels/index.js +++ b/src/ui/src/containers/ExploreModels/index.js @@ -19,22 +19,17 @@ License along with SensiML Piccolo AI. If not, see { return { - selectedProject: state.projects.selectedProject.uuid, - selectedPipeline: state.pipelines.selectedPipeline, - selectedProjectName: state.projects.selectedProject.name, - classifierRun: state.classifiers.classifierRun, - classifierCache: state.classifiers.classifierCache, selectedModel: state.models.selectedModel, model: state.models.modelData, }; }; -const mapDispatchToProps = { loadModel }; +const mapDispatchToProps = { loadModel, setSelectedModel }; export default connect(mapStateToProps, mapDispatchToProps)(ExploreModels); diff --git a/src/ui/src/store/containerBuildModel/domain/PipelineImportDecomposer.js b/src/ui/src/store/containerBuildModel/domain/PipelineImportDecomposer.js index cfd40696..268b8adf 100644 --- a/src/ui/src/store/containerBuildModel/domain/PipelineImportDecomposer.js +++ b/src/ui/src/store/containerBuildModel/domain/PipelineImportDecomposer.js @@ -165,7 +165,7 @@ class PipelineImportDecomposer extends PipelineDataDecomposer { super.__setPipelineStep(name, customName, updatedData, updatedOptions); } - __setFeatureFunctions(name, customName, data = [], options) { + __setPipelineStepWithSet(name, customName, data = [], options) { /** * set feature generators or feature selectors steps * with replacing dynamic fields like group_columns, sample_rate @@ -233,9 +233,11 @@ class PipelineImportDecomposer extends PipelineDataDecomposer { } if (PIPELINE_STEP_TYPES.FEATURE_GENERATOR === name) { - this.__setFeatureFunctions(name, customName, data, options); + this.__setPipelineStepWithSet(name, customName, data, options); } else if (PIPELINE_STEP_TYPES.FEATURE_SELECTOR === name) { - this.__setFeatureFunctions(name, customName, data, options); + this.__setPipelineStepWithSet(name, customName, data, options); + } else if (PIPELINE_STEP_TYPES.AUGMENTATION === name) { + this.__setPipelineStepWithSet(name, customName, data, options); } else if (AUTOML_PARAMS_NAME === name) { super.__setPipelineStep(name, customName, data, options); } else if (PIPELINE_STEP_TYPES.QUERY === name) {