Skip to content

Commit

Permalink
Merge branch 'root-network-panel' of https://github.com/gridsuite/gri…
Browse files Browse the repository at this point in the history
…dstudy-app into root-network-panel
  • Loading branch information
souissimai committed Jan 6, 2025
2 parents 92ab307 + e595a74 commit aa0f905
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 9 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -34,12 +34,7 @@ const MappingParameters: FunctionComponent<MappingParametersProps> = ({ mapping,
const { mappings } = mapping ?? {};

const mappingOptions = useMemo(() => {
return (
mappings?.map((elem) => ({
id: elem.name,
label: elem.name,
})) ?? []
);
return mappings?.map((elem) => elem.name) ?? [];
}, [mappings]);

const defParams: Record<string, DefParam> = {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
import { Grid, InputAdornment } from '@mui/material';
import { styles } from '../parameters';
import { FormattedMessage } from 'react-intl';
import { FloatInput, IntegerInput, MuiSelectInput, SwitchInput, TextInput } from '@gridsuite/commons-ui';
import { FloatInput, IntegerInput, Option, SelectInput, SwitchInput, TextInput } from '@gridsuite/commons-ui';
import LineSeparator from '../../commons/line-separator';
import { ReactElement } from 'react';

Expand All @@ -24,15 +24,15 @@ export enum TYPES {
export type DefParam = {
type: TYPES;
label: string;
options?: { id: string; label: string }[];
options?: Option[];
render?: (defParam: DefParam, path: string, key: string) => ReactElement;
};

const defaultParamRender = (defParam: DefParam, path: string, key: string) => {
switch (defParam.type) {
case TYPES.ENUM:
return (
<MuiSelectInput
<SelectInput
name={`${path}.${key}`}
label={''}
options={defParam?.options ?? []}
Expand Down

0 comments on commit aa0f905

Please sign in to comment.