diff --git a/forms-flow-web/src/actions/actionConstants.js b/forms-flow-web/src/actions/actionConstants.js index fe50290446..b0ff77d88e 100644 --- a/forms-flow-web/src/actions/actionConstants.js +++ b/forms-flow-web/src/actions/actionConstants.js @@ -157,6 +157,7 @@ const ACTION_CONSTANTS = { BPM_FORM_TYPE: "BPM_FORM_TYPE", BPM_FORM_LOADING: "BPM_FORM_LOADING", BPM_FORM_SORT:"BPM_FORM_SORT", + BPM_CLIENT_FORM_SEARCH:"BPM_CLIENT_FORM_SEARCH", //CheckList Form DESIGNER_DENIED_ACCESS: "DESIGNER_DENIED_ACCESS", FORM_CHECK_LIST_UPDATE: "FORM_CHECK_LIST_UPDATE", diff --git a/forms-flow-web/src/actions/formActions.js b/forms-flow-web/src/actions/formActions.js index 4255ba3a1c..f4fdfcd683 100644 --- a/forms-flow-web/src/actions/formActions.js +++ b/forms-flow-web/src/actions/formActions.js @@ -203,3 +203,9 @@ export const setBpmFormSort = (data) => (dispatch) => { }); }; +export const setClientFormSearch = ( data ) => (dispatch) => { + dispatch({ + type: ACTION_CONSTANTS.BPM_CLIENT_FORM_SEARCH, + payload: data, + }); +}; diff --git a/forms-flow-web/src/components/Form/SubmitList.js b/forms-flow-web/src/components/Form/SubmitList.js index 2cda968a68..d322ed12d9 100644 --- a/forms-flow-web/src/components/Form/SubmitList.js +++ b/forms-flow-web/src/components/Form/SubmitList.js @@ -4,7 +4,7 @@ import { DRAFT_ENABLED } from "../../constants/constants"; import "../Form/List.scss"; import { setBPMFormListLoading, - setBpmFormSearch, + setClientFormSearch, setBPMFormListPage, } from "../../actions/formActions"; import { fetchBPMFormList } from "../../apiManager/services/bpmFormServices"; @@ -22,7 +22,7 @@ import PropTypes from "prop-types"; const SubmitList = React.memo((props) => { const { t } = useTranslation(); - const searchText = useSelector((state) => state.bpmForms.searchText); + const searchText = useSelector((state) => state.bpmForms.clientFormSearch); const tenantId = useSelector((state) => state.tenants?.tenantId); const [search, setSearch] = useState(searchText || ""); const userRoles = useSelector((state) => state.user.roles || []); @@ -35,16 +35,16 @@ const SubmitList = React.memo((props) => { useEffect(() => { if (!search?.trim()) { - dispatch(setBpmFormSearch("")); + dispatch(setClientFormSearch("")); } }, [search]); const handleSearch = () => { - dispatch(setBpmFormSearch(search)); + dispatch(setClientFormSearch(search)); dispatch(setBPMFormListPage(1)); }; const handleClearSearch = () => { setSearch(""); - dispatch(setBpmFormSearch("")); + dispatch(setClientFormSearch("")); }; const { getFormsInit } = props; diff --git a/forms-flow-web/src/modules/bpmFormReducer.js b/forms-flow-web/src/modules/bpmFormReducer.js index 8332df1c33..498d086ad5 100644 --- a/forms-flow-web/src/modules/bpmFormReducer.js +++ b/forms-flow-web/src/modules/bpmFormReducer.js @@ -20,6 +20,7 @@ const initialState = { visibility: { sortOrder: "asc"}, status: { sortOrder: "asc" }, }, + clientFormSearch:"", }; const bpmForms = (state = initialState, action) => { @@ -44,8 +45,10 @@ const bpmForms = (state = initialState, action) => { return { ...state, bpmFormLoading: action.payload }; case ACTION_CONSTANTS.BPM_FORM_TYPE: return { ...state, formType: action.payload }; - case ACTION_CONSTANTS.BPM_FORM_SORT: + case ACTION_CONSTANTS.BPM_FORM_SORT: return { ...state, sort: action.payload }; + case ACTION_CONSTANTS.BPM_CLIENT_FORM_SEARCH: + return { ...state, clientFormSearch: action.payload }; default: return state; }