Skip to content

Commit

Permalink
Task rework (#1859)
Browse files Browse the repository at this point in the history
* follow update uncheck fixed

* task variable insert button disabled if no task variables entered

* optimized task header

* task header updations

* task page optimizations and rework

* test case fixes

* removed taskHeader

---------

Co-authored-by: AbijithS-aot <[email protected]>
  • Loading branch information
AbijithS-aot and AbijithS-aot authored Feb 2, 2024
1 parent 1ef022d commit f7b4f77
Show file tree
Hide file tree
Showing 17 changed files with 237 additions and 1,166 deletions.
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import TaskHeader from "../../../../components/ServiceFlow/details/TaskHeader";
import TaskHeaderListView from "../../../../components/ServiceFlow/details/TaskHeaderListView";
import configureStore from "redux-mock-store";
import { Provider } from "react-redux";
import { fireEvent, render, screen } from "@testing-library/react";
Expand All @@ -7,7 +7,7 @@ import "@testing-library/jest-dom/extend-expect";
let store;
let mockStore = configureStore([]);

it("Should render the Taskheader component without breaking", () => {
it("Should render the Taskheader component without breaking", async() => {
store = mockStore({
bpmTasks: {
taskDetail: {
Expand Down Expand Up @@ -41,7 +41,20 @@ it("Should render the Taskheader component without breaking", () => {
selectedFilter: "",
listReqParams: "",
firstResult: "",
vissibleAttributes:{
taskVisibleAttributes:{
applicationId:true,
assignee:true,
createdDate:true,
dueDate:true,
followUp:true,
groups:true,
priority:true,
taskTitle:true,
}
},
},

user: {
userDetail: {
preferred_username: "",
Expand All @@ -51,14 +64,13 @@ it("Should render the Taskheader component without breaking", () => {
store.dispatch = jest.fn();
render(
<Provider store={store}>
<TaskHeader />
<TaskHeaderListView />
</Provider>
);
expect(screen.getByText("Review Submission")).toBeInTheDocument();
expect(screen.getByText("Submission ID# 35")).toBeInTheDocument();
expect(screen.getByText("Set follow-up Date")).toBeInTheDocument();
expect(screen.getByText("Add groups")).toBeInTheDocument();
expect(screen.getByText("Claim")).toBeInTheDocument();

expect(screen.getByText("Follow up Date")).toBeInTheDocument();
expect(screen.getByText("Due Date")).toBeInTheDocument();
expect(screen.getByText("Assign to Me")).toBeInTheDocument();
const claimbtn = screen.getByTestId("clam-btn");
fireEvent.click(claimbtn);
expect(store.dispatch.mock.calls).toHaveLength(2);
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
import React, { useCallback, useEffect, useState } from "react";
import { Tab, Tabs } from "react-bootstrap";
import TaskHeader from "./TaskHeader";
import { Card, Col, Row, Tab, Tabs } from "react-bootstrap";
import {
reloadTaskFormSubmission,
setBPMTaskDetailLoader,
Expand Down Expand Up @@ -45,6 +44,7 @@ import NoTaskSelectedMessage from "../../../components/ServiceFlow/NoTaskSelec

import { bpmActionError } from "../../../actions/bpmTaskActions";
import { setCustomSubmission } from "../../../actions/checkListActions";
import TaskHeaderListView from "./TaskHeaderListView";
const ServiceFlowTaskDetails = React.memo(() => {
const { t } = useTranslation();
const { taskId } = useParams();
Expand Down Expand Up @@ -265,8 +265,37 @@ const ServiceFlowTaskDetails = React.memo(() => {
return (
<div className="service-task-details">
<LoadingOverlay active={isTaskUpdating} spinner text={t("Loading...")}>
<TaskHeader />
<Card className="me-2 bg-light">
<Card.Body>
<div className="d-flex justify-content-between">
<Col >
<Row className="ms-0 task-header">{task?.name}</Row>
<Row className="ms-0 task-name">
<span className="application-id" data-title={t("Process Name")}>
{" "}
{
getProcessDataObjectFromList(processList,
task?.processDefinitionId)
?.name
}
</span>
</Row>
<Row className="ms-0">
<span data-title={t("Application ID")} className="application-id">
{t("Application ID")}# {task?.applicationId}
</span>
</Row>
<Row className="ms-0 mt-3">
<TaskHeaderListView
task={task} taskId={task?.id} groupView={true}
/>
</Row>
</Col>
</div>
</Card.Body>
</Card>
<Tabs defaultActiveKey="form" id="service-task-details" mountOnEnter>

<Tab eventKey="form" title={t("Form")}>
<LoadingOverlay
active={task?.assignee !== currentUser}
Expand Down
Loading

0 comments on commit f7b4f77

Please sign in to comment.