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
6ef0f74a
Commit
6ef0f74a
authored
Mar 17, 2024
by
Venkaiah Naidu Singamchetty
Browse files
Options
Browse Files
Download
Plain Diff
Merge branch 'apiserver' into 'master'
network calls issues minimized See merge request
!42
parents
64a6b7d4
30a56a6d
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
62 additions
and
57 deletions
+62
-57
index.jsx
src/components/accordion/index.jsx
+12
-12
index.jsx
src/pages/reports/index.jsx
+50
-45
No files found.
src/components/accordion/index.jsx
View file @
6ef0f74a
...
@@ -16,18 +16,18 @@ function Accordion({ title, data ,handleAddActivity,open,handleAccordian}) {
...
@@ -16,18 +16,18 @@ function Accordion({ title, data ,handleAddActivity,open,handleAccordian}) {
const
{
reports
,
defaultAvgScore
,
initiativeAvgScore
,
loading
}
=
useSelector
((
state
)
=>
state
.
reports
);
const
{
reports
,
defaultAvgScore
,
initiativeAvgScore
,
loading
}
=
useSelector
((
state
)
=>
state
.
reports
);
const
userDetails
=
useSelector
((
state
)
=>
state
.
userDetails
);
const
userDetails
=
useSelector
((
state
)
=>
state
.
userDetails
);
//commented due to excess api calls by this method.
useEffect
(()
=>
{
//
useEffect(()=>{
if
(
userDetails
.
user
!==
null
){
//
if(userDetails.user!==null){
const
data
=
{
//
const data = {
reportees
:
userDetails
.
user
.
reportees
,
//
reportees: userDetails.user.reportees,
sort
:
{
type
:
"empId"
,
order
:
1
},
//
sort: { type: "empId", order: 1 },
page
:
1
,
//
page: 1,
perPage
:
10
,
//
perPage: 10,
}
//
}
dispatch
(
fetchReportees
(
data
))
//
dispatch(fetchReportees(data))
}
//
}
},[
userDetails
,
id
])
//
},[userDetails,id])
useEffect
(()
=>
{
useEffect
(()
=>
{
if
(
reports
!==
null
){
if
(
reports
!==
null
){
...
...
src/pages/reports/index.jsx
View file @
6ef0f74a
...
@@ -72,9 +72,10 @@ function Reports() {
...
@@ -72,9 +72,10 @@ function Reports() {
"data"
:
activityData
"data"
:
activityData
}
}
await
axios
.
post
(
`
${
base_url
}
/createActivity`
,
newData
)
await
axios
.
post
(
`
${
base_url
}
/createActivity`
,
newData
)
.
then
(
async
(
result
)
=>
{
.
then
(
async
(
result
)
=>
{
await
getReports
()
fetchLatestReporteesData
()
await
fetchLatestReporteesData
()
getReports
()
})
})
}
else
{
}
else
{
alert
(
"Please login"
)
alert
(
"Please login"
)
...
@@ -82,7 +83,7 @@ function Reports() {
...
@@ -82,7 +83,7 @@ function Reports() {
}
}
useEffect
(()
=>
{
useEffect
(()
=>
{
if
(
id
!==
undefined
||
null
)
{
if
(
id
!==
undefined
||
null
&&
reportees
.
length
>
0
)
{
const
emp
=
reportees
?.
filter
((
item
)
=>
item
.
empId
===
Number
(
id
));
const
emp
=
reportees
?.
filter
((
item
)
=>
item
.
empId
===
Number
(
id
));
setEmpDetails
(
emp
[
0
]);
setEmpDetails
(
emp
[
0
]);
const
data
=
{
const
data
=
{
...
@@ -103,11 +104,12 @@ function Reports() {
...
@@ -103,11 +104,12 @@ function Reports() {
}
else
{
}
else
{
navigate
(
"/"
)
navigate
(
"/"
)
}
}
},
[
user
,
id
]);
},
[
id
]);
return
(
if
(
reportees
.
length
&&
empDetails
)
return
(
<
div
className=
"p-4"
>
<
div
className=
"p-4"
>
<
div
className=
"
bg-white p-3"
>
<
div
className=
"
bg-white p-3"
>
<
div
className=
"flex"
>
<
div
className=
"flex"
>
{
/* <img src="/generic-male-avatar-rectangular.jpg" width="100px" height="100px" /> */
}
{
/* <img src="/generic-male-avatar-rectangular.jpg" width="100px" height="100px" /> */
}
<
div
className=
"w-1/2"
>
<
div
className=
"w-1/2"
>
...
@@ -147,8 +149,11 @@ function Reports() {
...
@@ -147,8 +149,11 @@ function Reports() {
</
div
>
</
div
>
</
div
>
</
div
>
</
div
>
</
div
>
);
);
// }
// else
return
<
div
className=
"w-full h-full"
>
<
p
className=
"text-center align-middle mt-14 mb-14 text-blue-500"
>
The Employee data you are trying to access
<
br
/>
is not under you reportees so data is hidden.
</
p
>
</
div
>
}
}
...
...
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