Skip to content

Commit

Permalink
[SDL-5641][UI] Fixed issue with selection sensor columns from max tra…
Browse files Browse the repository at this point in the history
…nsform in sensor fusion feature generator (#27)
  • Loading branch information
mkaliberda authored Sep 22, 2024
1 parent 36d2256 commit 2124e94
Showing 1 changed file with 6 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ You should have received a copy of the GNU Affero General Public
License along with SensiML Piccolo AI. If not, see <https://www.gnu.org/licenses/>.
*/

import React, { useState, useCallback, useEffect } from "react";
import React, { useState, useCallback, useEffect, useMemo } from "react";
import _ from "lodash";
import PropTypes from "prop-types";
import { useTranslation } from "react-i18next";
Expand Down Expand Up @@ -62,6 +62,10 @@ const FormAutoMLFeaturesFormAdd = ({
return res;
};

const queryColumnOptions = useMemo(() => {
return queryColumns.map((column) => ({ name: column, value: column }));
}, [queryColumns]);

const getInputContractParameters = useCallback(
(el) => {
if (featuresParameters && featuresParameters[el.parent]) {
Expand Down Expand Up @@ -166,7 +170,7 @@ const FormAutoMLFeaturesFormAdd = ({
name="queryColumns"
id="queryColumnsId"
label="Default Columns"
options={queryColumns.map((column) => ({ name: column, value: column }))}
options={queryColumnOptions}
defaultValue={queryColumns}
onChange={handeChangeDefaultColumns}
/>
Expand Down

0 comments on commit 2124e94

Please sign in to comment.