Skip to content

Commit

Permalink
Filter count (AOT-Technologies#1980)
Browse files Browse the repository at this point in the history
* task attribute adjustments

* task variables and attribute changes

* fixed test cases

* submissionId aligned in list view and card view

* fixed filter dropdown count issue and priority issue

---------

Co-authored-by: shuhaib-aot <[email protected]>
  • Loading branch information
AbijithS-aot and shuhaib-aot authored Mar 28, 2024
1 parent ed56525 commit 5b58cab
Show file tree
Hide file tree
Showing 2 changed files with 73 additions and 30 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -180,7 +180,7 @@ const ServiceTaskListView = React.memo((props) => {
?.applicationId && (
<Col xs={2}>
<div className="col-12">
<h6 className="fw-bold">{t("Submission ID")}</h6>
<h6 className="fw-bold">{t("Submission Id")}</h6>
<h6>
{
task?._embedded?.variable?.filter(
Expand Down Expand Up @@ -222,9 +222,10 @@ const ServiceTaskListView = React.memo((props) => {
(variableItem) => variableItem.name === e.name
);
return (
<Col xs={2} key={i}>
<Col className= {`${i == adjustedValues.length - 1 ? 'd-flex' : ''}`} xs={2} key={i}>
<div>
<div className="col-12 word-break">
<h6 className="fw-bold">{data?.label}</h6>
<h6 className="fw-bold">{data?.label}</h6>
</div>
<div className="d-flex col-12">
<h6>
Expand All @@ -233,6 +234,35 @@ const ServiceTaskListView = React.memo((props) => {
</u>
</h6>
</div>
</div>

{taskListAttributes?.length >= 1
&& i == adjustedValues.length - 1 &&
!vissibleAttributes?.taskVisibleAttributes?.priority &&
(

<div
className="justify-content-center ms-4"
onClick={(e) => {
e.stopPropagation();
handleToggleTaskVariable(task.id);
}}
title={t("Click for task variables")}
>
<i
className="fa fa-angle-down"
style={{
transform: `${
expandedTasks[task.id]
? "rotate(180deg)"
: "rotate(0deg)"
}`,
}}
aria-hidden="true"
/>
</div>

)}
</Col>
);
})
Expand All @@ -242,7 +272,8 @@ const ServiceTaskListView = React.memo((props) => {


{vissibleAttributes?.taskVisibleAttributes?.priority &&
<Col xs={1}>
<Col xs={2} className="d-flex">
<div>
<div className="col-12">
<h6 className="fw-bold">{t("Priority")}</h6>
</div>
Expand All @@ -263,34 +294,37 @@ const ServiceTaskListView = React.memo((props) => {
</u>
</h6>
</div>
</div>

{taskListAttributes?.length >= 1 && (

<div
className="justify-content-center ms-4"
onClick={(e) => {
e.stopPropagation();
handleToggleTaskVariable(task.id);
}}
title={t("Click for task variables")}
>
<i
className="fa fa-angle-down"
style={{
transform: `${
expandedTasks[task.id]
? "rotate(180deg)"
: "rotate(0deg)"
}`,
}}
aria-hidden="true"
/>
</div>

)}
</Col>
}


{taskListAttributes?.length >= 1 && (
<Col xs={1}>
<div
className="justify-content-center"
onClick={(e) => {
e.stopPropagation();
handleToggleTaskVariable(task.id);
}}
title={t("Click for task variables")}
>
<i
className="fa fa-angle-down"
style={{
transform: `${
expandedTasks[task.id]
? "rotate(180deg)"
: "rotate(0deg)"
}`,
}}
aria-hidden="true"
/>
</div>
</Col>
)}

</Row>
{expandedTasks[task.id] &&
task?._embedded?.variable?.some(
Expand Down
13 changes: 11 additions & 2 deletions forms-flow-web/src/containers/TaskHead.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,10 @@ import { push } from "connected-react-router";
import { NavDropdown } from "react-bootstrap";
import ServiceFlowFilterListDropDown from "../components/ServiceFlow/filter/ServiceTaskFilterListDropDown";
import {MULTITENANCY_ENABLED} from "../constants/constants";
import {setSelectedTaskID, setViewType } from '../actions/bpmTaskActions';
import {setBPMFilterLoader, setBPMFiltersAndCount, setSelectedTaskID, setViewType } from '../actions/bpmTaskActions';
import CreateNewFilterDrawer from "../components/ServiceFlow/list/sort/CreateNewFilter";
import { useTranslation } from "react-i18next";
import { fetchBPMTaskCount } from "../apiManager/services/bpmTaskServices";
function TaskHead() {
const dispatch = useDispatch();
const { t } = useTranslation();
Expand All @@ -19,14 +20,22 @@ function TaskHead() {
const isFilterLoading = useSelector(
(state) => state.bpmTasks.isFilterLoading
);

const filterListItems = useSelector((state) => state.bpmTasks.filterList);
const isTaskListLoading = useSelector(
(state) => state.bpmTasks.isTaskListLoading
);

const baseUrl = MULTITENANCY_ENABLED ? `/tenant/${tenantKey}/` : "/";

const goToTask = () => {
fetchBPMTaskCount(filterListItems)
.then((res) => {
dispatch(setBPMFiltersAndCount(res.data));
})
.catch((err) => console.error(err))
.finally(() => {
dispatch(setBPMFilterLoader(false));
});
dispatch(push(`${baseUrl}task`));
};

Expand Down

0 comments on commit 5b58cab

Please sign in to comment.