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

Expand all issue in tasklist fixed #1804

Merged
merged 19 commits into from
Jan 1, 2024
Merged
Show file tree
Hide file tree
Changes from 18 commits
Commits
Show all changes
19 commits
Select commit Hold shift + click to select a range
256d15e
list-view fixes
fahad-aot Nov 16, 2023
a014458
Merge branch 'develop' of https://github.com/fahad-aot/forms-flow-ai …
fahad-aot Nov 17, 2023
a713968
Merge branch 'develop' of https://github.com/fahad-aot/forms-flow-ai …
fahad-aot Nov 20, 2023
936ab38
Merge branch 'develop' of https://github.com/fahad-aot/forms-flow-ai …
fahad-aot Nov 21, 2023
b2c91c5
Merge branch 'develop' of https://github.com/fahad-aot/forms-flow-ai …
fahad-aot Nov 21, 2023
6248684
Merge branch 'develop' of https://github.com/fahad-aot/forms-flow-ai …
fahad-aot Nov 21, 2023
ea01aeb
Merge branch 'develop' of https://github.com/fahad-aot/forms-flow-ai …
fahad-aot Nov 21, 2023
67c8c70
Merge branch 'develop' of https://github.com/fahad-aot/forms-flow-ai …
fahad-aot Nov 21, 2023
f1d7a53
Merge branch 'develop' of https://github.com/fahad-aot/forms-flow-ai …
fahad-aot Nov 24, 2023
7d07954
Merge branch 'develop' of https://github.com/fahad-aot/forms-flow-ai …
fahad-aot Nov 27, 2023
947fd91
Merge branch 'develop' of https://github.com/fahad-aot/forms-flow-ai …
fahad-aot Nov 29, 2023
4218014
Merge branch 'develop' of https://github.com/fahad-aot/forms-flow-ai …
fahad-aot Dec 5, 2023
e769033
Merge branch 'develop' of https://github.com/fahad-aot/forms-flow-ai …
fahad-aot Dec 8, 2023
54f2fd2
Merge branch 'develop' of https://github.com/fahad-aot/forms-flow-ai …
fahad-aot Dec 12, 2023
06e1f76
Merge branch 'develop' of https://github.com/fahad-aot/forms-flow-ai …
fahad-aot Dec 13, 2023
2307047
expand all for taskvariable fixed
fahad-aot Dec 13, 2023
ab766ea
Merge branch 'develop' of https://github.com/fahad-aot/forms-flow-ai …
fahad-aot Dec 13, 2023
e52a0a4
blank space removed from task-list
fahad-aot Dec 14, 2023
72464cc
Merge branch 'develop' of https://github.com/fahad-aot/forms-flow-ai …
fahad-aot Dec 19, 2023
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-web/src/actions/actionConstants.js
Original file line number Diff line number Diff line change
Expand Up @@ -141,6 +141,7 @@ const ACTION_CONSTANTS = {
DMN_SEARCH_TEXT: "DMN_SEARCH_TEXT",
IS_BPMN_MODEL: "IS_BPMN_MODEL",
IS_PUBLIC_DIAGRAM: "IS_PUBLIC_DIAGRAM",
IS_ALL_TASKVARIABLES_EXPAND:"IS_ALL_TASKVARIABLES_EXPAND",
//BPM FORMS
BPM_FORM_LIST: "BPM_FORM_LIST",
IS_BPM_FORM_LIST_LOADING: "IS_BPM_FORM_LIST_LOADING",
Expand Down
7 changes: 7 additions & 0 deletions forms-flow-web/src/actions/bpmTaskActions.js
Original file line number Diff line number Diff line change
Expand Up @@ -214,3 +214,10 @@ export const setVisibleAttributes = (data) => (dispatch) => {
payload: data,
});
};

export const setIsAllTaskVariableExpand = (data) => (dispatch) => {
dispatch({
type: ACTION_CONSTANTS.IS_ALL_TASKVARIABLES_EXPAND,
payload: data,
});
};
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ import { fetchServiceTaskList } from "../../../apiManager/services/bpmTaskServic
import {
setBPMTaskListActivePage,
setBPMTaskLoader,
setIsAllTaskVariableExpand
} from "../../../actions/bpmTaskActions";
import Loading from "../../../containers/Loading";
import { useTranslation } from "react-i18next";
Expand Down Expand Up @@ -35,7 +36,7 @@ const ServiceTaskListView = React.memo(() => {
const firstResult = useSelector((state) => state.bpmTasks.firstResult);
const activePage = useSelector((state) => state.bpmTasks.activePage);
const [expandedTasks, setExpandedTasks] = useState({});
const [allTaskVariablesExpanded, setAllTaskVariablesExpanded] = useState(false);
const allTaskVariablesExpanded = useSelector((state) => state.bpmTasks.allTaskVariablesExpand);
const [selectedLimitValue, setSelectedLimitValue] = useState(15);
const tenantKey = useSelector((state) => state.tenants?.tenantId);
const redirectUrl = useRef(
Expand Down Expand Up @@ -92,10 +93,17 @@ const ServiceTaskListView = React.memo(() => {
dispatch(
fetchServiceTaskList(reqData,null,firstResultIndex,selectedLimitValue)
);
setAllTaskVariablesExpanded(false);
};


useEffect(() => {
// Initialize expandedTasks based on the initial value of allTaskVariablesExpanded
const updatedExpandedTasks = {};
if (allTaskVariablesExpanded) {
taskList.forEach((task) => {
updatedExpandedTasks[task.id] = allTaskVariablesExpanded;
});
}
setExpandedTasks(updatedExpandedTasks);
}, [allTaskVariablesExpanded, taskList]);
//Toggle the expanded state of TaskVariables in single task
const handleToggleTaskVariable = (taskId) => {
setExpandedTasks((prevExpandedTasks) => ({
Expand All @@ -113,9 +121,8 @@ const ServiceTaskListView = React.memo(() => {
updatedExpandedTasks[task.id] = newExpandedState;
fahad-aot marked this conversation as resolved.
Show resolved Hide resolved
}
});

setExpandedTasks(updatedExpandedTasks);
setAllTaskVariablesExpanded(newExpandedState);
dispatch(setIsAllTaskVariableExpand(newExpandedState));
};

const renderTaskList = () => {
Expand Down Expand Up @@ -197,7 +204,7 @@ const ServiceTaskListView = React.memo(() => {
e.stopPropagation();
handleToggleTaskVariable(task.id);
}}
title="Click for task variables"
title={t("Click for task variables")}
>
<i
className="fa fa-angle-down"
Expand All @@ -213,30 +220,37 @@ const ServiceTaskListView = React.memo(() => {
</Row>
{
expandedTasks[task.id] &&
<>
<hr />
<Row className="p-2" >
{task?._embedded?.variable?.map((eachVariable, index) => {
if ( eachVariable.name !== "applicationId" && eachVariable.name !== "formName" && selectedTaskVariables[eachVariable.name] === true) {
const data = taskvariables?.find(
(variableItem) => variableItem.name === eachVariable.name
);
return (
<Col xs={2} key={index} >
<div className="col-12" style={{ wordBreak: "break-all" }}>
<h6 className="font-weight-light">{data?.label}</h6>
</div>
<div className="d-flex col-12">
<h6>
<u className="font-weight-bold text-decoration-none ">{eachVariable.value}</u>
</h6>
</div>
</Col>
);
}
})}
</Row>
</>
task?._embedded?.variable?.some(
(eachVariable) =>
eachVariable.name !== "applicationId" &&
eachVariable.name !== "formName" &&
selectedTaskVariables[eachVariable.name] === true
) && (
<>
<hr />
<Row className="p-2" >
{task?._embedded?.variable?.map((eachVariable, index) => {
if (eachVariable.name !== "applicationId" && eachVariable.name !== "formName" && selectedTaskVariables[eachVariable.name] === true) {
const data = taskvariables?.find(
(variableItem) => variableItem.name === eachVariable.name
);
return (
<Col xs={2} key={index} >
<div className="col-12" style={{ wordBreak: "break-all" }}>
<h6 className="font-weight-light">{data?.label}</h6>
</div>
<div className="d-flex col-12">
<h6>
<u className="font-weight-bold text-decoration-none ">{eachVariable.value}</u>
</h6>
</div>
</Col>
);
}
})}
</Row>
</>
)
}
</div>
))}
Expand Down Expand Up @@ -305,8 +319,7 @@ const ServiceTaskListView = React.memo(() => {
return (
<>
<TaskSearchBarListView
toggleAllTaskVariables={toggleAllTaskVariables}
allTaskVariablesExpanded={allTaskVariablesExpanded} />
toggleAllTaskVariables={toggleAllTaskVariables} />
{isTaskListLoading ? <Loading /> : renderTaskList()}
</>
);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ import { setSelectedTaskVariables } from "../../../../actions/bpmTaskActions";
import { useTranslation } from "react-i18next";


const TaskSearchBarListView = React.memo(({ toggleAllTaskVariables, allTaskVariablesExpanded }) => {
const TaskSearchBarListView = React.memo(({ toggleAllTaskVariables }) => {
const isTaskListLoading = useSelector(
(state) => state.bpmTasks.isTaskListLoading
);
Expand All @@ -16,6 +16,7 @@ const TaskSearchBarListView = React.memo(({ toggleAllTaskVariables, allTaskVaria
const [SortOptions, setSortOptions] = useState(false);
const [filterParams, setFilterParams] = useState({});
const taskList = useSelector((state) => state.bpmTasks.tasksList);
const allTaskVariablesExpanded = useSelector((state) => state.bpmTasks.allTaskVariablesExpand);
const dispatch = useDispatch();
const { t } = useTranslation();
useEffect(() => {
Expand Down
7 changes: 5 additions & 2 deletions forms-flow-web/src/modules/bpmTaskReducer.js
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,8 @@ const initialState = {
viewType:true,
error: '',
filtersAndCount:[],
vissibleAttributes : {},
vissibleAttributes: {},
allTaskVariablesExpand:false
};

const bpmTasks = (state = initialState, action) => {
Expand Down Expand Up @@ -150,7 +151,9 @@ const bpmTasks = (state = initialState, action) => {
case ACTION_CONSTANTS.BPM_FILTERS_AND_COUNT:
return { ...state, filtersAndCount: action.payload };
case ACTION_CONSTANTS.BPM_VISSIBLE_ATTRIBUTES:
return { ...state, vissibleAttributes: action.payload };
return { ...state, vissibleAttributes: action.payload };
case ACTION_CONSTANTS.IS_ALL_TASKVARIABLES_EXPAND:
return { ...state, allTaskVariablesExpand: action.payload };
default:
return state;
}
Expand Down
Loading