Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Added Form Id in Task Filter #1983

Merged
merged 3 commits into from
Mar 28, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions forms-flow-api/src/formsflow_api/services/application.py
Original file line number Diff line number Diff line change
Expand Up @@ -59,6 +59,7 @@ def get_start_task_payload(
"submitterName": {"value": application.created_by},
"submissionDate": {"value": str(application.created)},
"tenantKey": {"value": mapper.tenant},
"formId": {"value": mapper.form_id},
}
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@ import { MAX_RESULTS } from "../constants/taskConstants";
import { getFirstResultIndex } from "../../../apiManager/services/taskSearchParamsFormatterService";
import TaskVariable from "./TaskVariable";
import { MULTITENANCY_ENABLED } from "../../../constants/constants";
import _ from "lodash";
const ServiceFlowTaskList = React.memo((props) => {
const {expandedTasks,setExpandedTasks} = props;
const { t } = useTranslation();
Expand All @@ -42,12 +43,16 @@ const ServiceFlowTaskList = React.memo((props) => {

useEffect(() => {
if (selectedFilter?.id) {

const reqDataProcessVariables = reqData?.criteria?.processVariables || [];
const selectedProcessVariables = selectedFilter?.criteria?.processVariables || [];

const selectedBPMFilterParams = {
...selectedFilter,
criteria: {
...selectedFilter?.criteria,
...reqData?.criteria
...reqData?.criteria,
processVariables:_.isEqual(reqDataProcessVariables, selectedProcessVariables)
? selectedProcessVariables : [...reqDataProcessVariables,...selectedProcessVariables]
}
};
dispatch(setBPMTaskLoader(true));
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -418,16 +418,19 @@ export default function CreateNewFilterDrawer({
* If a form is selected, set the formId property in the data object
* to the id of the selected form.
*/
if (selectedForm) {
data.properties.formId = selectedForm;
}



// Remove empty keys inside criteria
const cleanedCriteria = omitBy(
data.criteria,
(value) => value === undefined || value === "" || value === null
);
data.criteria = cleanedCriteria;
);
data.criteria = cleanedCriteria;

if (selectedForm) {
data.properties.formId = selectedForm;
data.criteria.processVariables = [{name: "formId", operator: "eq", value: selectedForm}];
}

const submitFunction = selectedFilterData
? editFilters(data, selectedFilterData?.id)
Expand Down
Loading