Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
N
nisum-scorecard
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Venkaiah Naidu Singamchetty
nisum-scorecard
Commits
abd20890
Commit
abd20890
authored
Mar 20, 2024
by
Venkaiah Naidu Singamchetty
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
getReports call updated
parent
0f0c6e16
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
14 additions
and
5 deletions
+14
-5
index.jsx
src/components/leftSidebar/index.jsx
+4
-1
index.jsx
src/pages/viewReportee/index.jsx
+6
-0
viewreporteeSlice.js
src/redux/reducers/viewreporteeSlice.js
+4
-4
No files found.
src/components/leftSidebar/index.jsx
View file @
abd20890
...
...
@@ -9,12 +9,13 @@ import Loading from "../loading Component/Loading";
function
LeftSidebar
()
{
const
dispatch
=
useDispatch
();
const
[
currPage
,
setCurrPage
]
=
useState
(
1
);
const
[
inputValue
,
setInputValue
]
=
useState
(
''
);
const
[
inputValue
,
setInputValue
]
=
useState
(
null
);
const
{
reportees
,
loading
,
viewReportee
}
=
useSelector
((
state
)
=>
state
.
reportees
);
const
userDetails
=
useSelector
((
state
)
=>
state
.
userDetails
);
useEffect
(()
=>
{
if
(
inputValue
!==
null
){
const
debounceTimeout
=
setTimeout
(()
=>
{
const
data
=
{
reportees
:
userDetails
.
user
.
reportees
,
...
...
@@ -24,8 +25,10 @@ function LeftSidebar() {
};
dispatch
(
fetchReportees
(
data
));
},
1000
);
return
()
=>
clearTimeout
(
debounceTimeout
);
}
},
[
inputValue
]);
const
handleChange
=
(
event
)
=>
{
...
...
src/pages/viewReportee/index.jsx
View file @
abd20890
...
...
@@ -4,6 +4,7 @@ import { useParams, useNavigate } from "react-router";
import
{
base_url
}
from
"../../utils/constants"
;
import
axios
from
'axios'
;
import
{
fetchReportees
}
from
"../../redux/reducers/reporteesSlice"
;
import
{
fetchReporteeActivities
}
from
'../../redux/reducers/viewreporteeSlice'
import
Accordion
from
"../../components/accordion"
;
import
{
scoreColor
}
from
'../../utils/commonFunctions'
;
...
...
@@ -74,6 +75,11 @@ function Viewreportee() {
}
}
useEffect
(()
=>
{
if
(
reportees
.
length
>
0
&&
viewReportee
)
dispatch
(
fetchReporteeActivities
({
empId
:
viewReportee
.
empId
}))
},[
reportees
])
useEffect
(()
=>
{
...
...
src/redux/reducers/viewreporteeSlice.js
View file @
abd20890
...
...
@@ -10,7 +10,7 @@ const initialState = {
error
:
null
,
};
export
const
fetchReports
=
createAsyncThunk
(
"getReports"
,
async
(
data
)
=>
{
export
const
fetchReport
eeActivitie
s
=
createAsyncThunk
(
"getReports"
,
async
(
data
)
=>
{
return
await
axios
.
post
(
`
${
base_url
}
/getActivities`
,
data
)
.
then
((
response
)
=>
response
.
data
);
...
...
@@ -47,13 +47,13 @@ const reportSlice = createSlice({
},
extraReducers
:
(
builder
)
=>
{
builder
.
addCase
(
fetchReports
.
pending
,
(
state
)
=>
{
builder
.
addCase
(
fetchReport
eeActivitie
s
.
pending
,
(
state
)
=>
{
return
{...
state
,
loading
:
true
,
error
:
"loading"
}
});
builder
.
addCase
(
fetchReports
.
fulfilled
,
(
state
,
action
)
=>
{
builder
.
addCase
(
fetchReport
eeActivitie
s
.
fulfilled
,
(
state
,
action
)
=>
{
return
{...
state
,
loading
:
false
,
error
:
""
,
reports
:
action
.
payload
?.
activities
}
});
builder
.
addCase
(
fetchReports
.
rejected
,
(
state
,
action
)
=>
{
builder
.
addCase
(
fetchReport
eeActivitie
s
.
rejected
,
(
state
,
action
)
=>
{
return
{...
state
,
loading
:
false
,
error
:
action
.
error
||
"Something went wrong!"
,
reports
:
null
}
});
},
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment