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

Fixed workflow filter option #1981

Merged
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
3 changes: 3 additions & 0 deletions forms-flow-web/src/components/Form/Steps/WorkFlow.js
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ import ViewAndEditTaskvariable from "./ViewAndEditTaskvariable";
import { useTranslation } from "react-i18next";
import { listProcess } from "../../../apiManager/services/formatterService";
import { DEFAULT_WORKFLOW } from "../../../constants/taskConstants";
import { filterSelectOptionByLabel } from "../../../helper/helper";

const WorkFlow = React.memo(
({
Expand Down Expand Up @@ -137,6 +138,7 @@ const WorkFlow = React.memo(
updateTaskvariableToProcessData(updatedData);
};


useEffect(() => {
if (!workflow) {
setModified(true);
Expand Down Expand Up @@ -228,6 +230,7 @@ const WorkFlow = React.memo(
onChange={(selectedOption) => handleListChange(selectedOption)}
isDisabled={disableWorkflowAssociation}
inputId="select-workflow"
filterOption={filterSelectOptionByLabel}
getOptionLabel={(option) => (
<span data-testid={`form-workflow-option-${option.value}`}>
{option.label}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,7 @@ import {
resetFormProcessData,
} from "../../../../apiManager/services/processServices";
import { fetchUserList } from "../../../../apiManager/services/bpmTaskServices";
import { filterSelectOptionByLabel } from "../../../../helper/helper";

const initialValueOfTaskAttribute = {
applicationId: true,
Expand Down Expand Up @@ -691,6 +692,7 @@ export default function CreateNewFilterDrawer({
onChange={(selectedOption) => {
setDefinitionKeyId(selectedOption?.label);
}}
filterOption={filterSelectOptionByLabel}
inputId="select-workflow"
getOptionLabel={(option) => (
<span data-testid={`form-workflow-option-${option.value}`}>
Expand Down
9 changes: 8 additions & 1 deletion forms-flow-web/src/helper/helper.js
Original file line number Diff line number Diff line change
Expand Up @@ -48,4 +48,11 @@ const renderPage = (formStatus, processLoadError) => {
);
}
};
export { replaceUrl, addTenantkey, removeTenantKey, textTruncate, renderPage };

const filterSelectOptionByLabel = (option, searchText) => {
return option.data.label.toLowerCase().includes(searchText.toLowerCase());
};


export { replaceUrl, addTenantkey, removeTenantKey, textTruncate, renderPage,
filterSelectOptionByLabel};
Loading