Skip to content

Commit

Permalink
FWF-3542: [Feature] Added form display to mapper
Browse files Browse the repository at this point in the history
  • Loading branch information
Bonymol-aot committed Oct 14, 2024
1 parent 993899f commit e94be27
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 7 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -13,8 +13,8 @@ import _camelCase from "lodash/camelCase";

const SettingsModal =
({ show, handleClose, handleConfirm, rolesState,
setRolesState, formDetails, updateFormName, updateFormDescription, formType,
setFormType, newPath, handleFormPathChange }) => {
setRolesState, formDetails, updateFormName, updateFormDescription, formDisplay,
setFormDisplay, newPath, handleFormPathChange }) => {
const { t } = useTranslation();
const dispatch = useDispatch();
const [userRoles, setUserRoles] = useState([]);
Expand Down Expand Up @@ -60,7 +60,7 @@ const SettingsModal =
target.type === "checkbox"
? target.checked ? "wizard" : "form"
: target.value;
setFormType(value);
setFormDisplay(value);
dispatchFormAction({ type: path, value });
};

Expand Down Expand Up @@ -214,7 +214,7 @@ const SettingsModal =
type="checkbox"
id="createCheckbox"
label={t("Allow adding multiple pages in this form")}
checked={formType === "wizard"}
checked={formDisplay === "wizard"}
onChange={(event) => handleChange("display", event)}


Expand Down
8 changes: 5 additions & 3 deletions forms-flow-web/src/components/Form/Item/Edit.js
Original file line number Diff line number Diff line change
Expand Up @@ -125,7 +125,7 @@ const Edit = React.memo(() => {
description: processListData.description,
});

const [formType, setFormType] = useState(processListData.formType);
const [formDisplay, setFormDisplay] = useState(processListData.formType);

const [rolesState, setRolesState] = useState({
edit: {
Expand Down Expand Up @@ -298,7 +298,8 @@ useEffect(() => {
: [],
anonymous: rolesState.create.isPublic,
parentFormId: parentFormId,
formType: formType,
formType: form.type,
display: formDisplay,
processKey: workflow?.value,
processName: workflow?.name,
id: processListData.id,
Expand Down Expand Up @@ -447,7 +448,8 @@ useEffect(() => {
handleConfirm={handleConfirmSettings}
rolesState={rolesState} setRolesState={setRolesState}
setFormDetails={setFormDetails} formDetails={formDetails}
updateFormName={updateFormName} formType={formType} setFormType={setFormType}
updateFormName={updateFormName} formDisplay={formDisplay}
setFormDisplay={setFormDisplay}
updateFormDescription={updateFormDescription} newPath={newPath}
handleFormPathChange={handleFormPathChange}/>

Expand Down

0 comments on commit e94be27

Please sign in to comment.