Skip to content

Commit

Permalink
Adjust FE
Browse files Browse the repository at this point in the history
  • Loading branch information
Elmacioro committed Jan 9, 2025
1 parent 867308e commit 98b18db
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 8 deletions.
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
import { isNil } from "lodash";
import { Expression, ReturnedType } from "../../../../../types";
import { resolveRefClazzName } from "./utils";

Expand Down Expand Up @@ -78,7 +79,7 @@ export function isAnyValueWithSuggestionsParameter(item: PermittedTypeParameterV
}

export function isAnyValueParameter(item: PermittedTypeParameterVariant): item is AnyValueParameterVariant {
return item.valueEditor === null;
return isNil(item.valueEditor);
}

const permittedTypesMapping = {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
import React from "react";
import { isNil } from "lodash";
import { Option } from "../../../FieldsSelect";
import { TypeSelect } from "../../../TypeSelect";
import { useTranslation } from "react-i18next";
Expand All @@ -23,12 +24,11 @@ export default function InputModeSelect(props: Props) {
const { t } = useTranslation();
const { temporaryUserDefinedList } = useSettings();

const value =
item.valueEditor === null
? InputMode.AnyValue
: item.valueEditor.allowOtherValue
? InputMode.AnyValueWithSuggestions
: InputMode.FixedList;
const value = isNil(item.valueEditor)
? InputMode.AnyValue
: item.valueEditor.allowOtherValue
? InputMode.AnyValueWithSuggestions
: InputMode.FixedList;
return (
<>
<FormControl>
Expand Down
4 changes: 3 additions & 1 deletion designer/client/src/reducers/scenarioState.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,9 @@ import { ProcessStateType } from "../components/Process/types";
export const reducer: Reducer<ProcessStateType> = (state = null, action: Action): ProcessStateType => {
switch (action.type) {
case "DISPLAY_PROCESS":
return action.scenario.state;
// Since scenario endpoint doesn't return null attributes the state will be undefined for fragments.
// Redux does not allow to return undefined values so in that case we return null explicitly.
return action.scenario.state ?? null;
case "PROCESS_STATE_LOADED":
return action.processState;
default:
Expand Down

0 comments on commit 98b18db

Please sign in to comment.