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
d8b7a319
Commit
d8b7a319
authored
Mar 20, 2024
by
Venkaiah Naidu Singamchetty
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
empsearch modified
parent
88483e8a
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
16 additions
and
16 deletions
+16
-16
server.js
server.js
+9
-2
index.jsx
src/pages/dashboard/index.jsx
+7
-14
No files found.
server.js
View file @
d8b7a319
...
...
@@ -92,14 +92,21 @@ app.post("/getreportees",async (req, res) => {
let
query
=
{
empId
:
{
$in
:
reporteesArray
}
};
let
aggre
=
[{
$match
:
{
empId
:
{
$in
:
reporteesArray
}
}
}];
aggre
.
push
({
$addFields
:
{
empIdString
:
{
$toString
:
"$empId"
}
}
})
if
(
req
.
body
.
searchText
)
{
let
searchText
=
req
.
body
.
searchText
.
trim
();
let
searchStr
=
new
RegExp
(
searchText
,
"ig"
);
let
orCondation
=
{
$or
:
[
{
empId
:
searchStr
},
{
empId
String
:
searchStr
},
{
empName
:
searchStr
},
{
designation
:
searchStr
},
{
techStack
:
searchStr
}
],
};
aggre
.
push
({
$match
:
orCondation
});
...
...
@@ -120,7 +127,7 @@ app.post("/getreportees",async (req, res) => {
if
(
result
&&
result
.
length
)
{
res
.
status
(
201
).
json
({
...
result
[
0
]
});
}
else
{
res
.
status
(
404
).
json
({
data
:
[],
totalCount
:
{
count
:
0
}
});
res
.
status
(
201
).
json
({
data
:
[],
totalCount
:
{
count
:
0
}
});
}
})
.
catch
((
error
)
=>
res
.
status
(
401
).
send
(
error
));
...
...
src/pages/dashboard/index.jsx
View file @
d8b7a319
...
...
@@ -27,13 +27,7 @@ function Dashboard() {
setCurrPage
(
currPage
)
dispatch
(
fetchReportees
(
data
))
}
// useEffect(() => {
// let data={
// reportees:reportees,
// ["page"]:page,
// }
// dispatch(fetchReportees(data))
// } ,[page]);
useEffect
(()
=>
{
setPagesCount
(
Math
.
ceil
((
totalCount
)
/
(
10
)))
...
...
@@ -95,15 +89,15 @@ function Dashboard() {
title
:
"Designation"
,
id
:
'designation'
},
{
title
:
"Role"
,
id
:
'techStack'
},
{
title
:
"score"
,
id
:
"score"
,
render
:
(
value
)
=>
<
span
className=
{
`w-[30px] h-[30px] rounded-full flex items-center text-white justify-center ${scoreColor(value)}`
}
>
{
value
}
</
span
>
},
{
title
:
"Role"
,
id
:
'techStack'
},
{
title
:
"Action"
,
id
:
"empId"
,
...
...
@@ -123,9 +117,8 @@ function Dashboard() {
<
div
className=
""
>
{
reportees
&&
(
<
div
className=
"flex justify-center mt-2"
>
{
/* <div className="text-blue-500">Total Results: {pagesCount}</div> */
}
{
pagesCount
>
1
&&
(
<
div
className=
"flex justify-center mt-2 "
>
{
pagesCount
>=
1
&&
(
<
PaginationComponent
currentPage=
{
currPage
}
totalPages=
{
pagesCount
}
...
...
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