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
078ced93
Commit
078ced93
authored
Mar 19, 2024
by
Venkaiah Naidu Singamchetty
Browse files
Options
Browse Files
Download
Plain Diff
Merge branch 'apiserver' into 'master'
modified comments See merge request
!51
parents
a11a8f98
1c7e1849
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
40 additions
and
34 deletions
+40
-34
index.jsx
src/components/table/index.jsx
+25
-21
index.jsx
src/pages/dashboard/index.jsx
+3
-1
index.jsx
src/pages/reports/index.jsx
+10
-10
constants.js
src/utils/constants.js
+2
-2
No files found.
src/components/table/index.jsx
View file @
078ced93
...
...
@@ -3,7 +3,7 @@ import Loading from "../loading Component/Loading";
function
Table
({
headers
,
data
,
loading
,
maxHeight
})
{
if
(
loading
)
return
<
Loading
/>
if
(
data
?.
length
)
return
(
<
div
className=
{
` overflow-auto sm:rounded-lg p-4 max-h-[${maxHeight}vh] bg-gray-100`
}
>
<
table
className=
"w-full text-sm text-left rtl:text-right text-gray-500 dark:text-gray-400 bg-transparent justify-center border-separate border-spacing-y-2"
>
...
...
@@ -16,29 +16,33 @@ function Table({headers, data,loading, maxHeight}) {
))
}
</
tr
>
</
thead
>
<
tbody
>
{
data
?.
map
((
item
,
index
)
=>
(
<
tr
className=
"bg-white dark:bg-gray-800 dark:border-gray-700 dark:text-white hover:bg-gray-50 dark:hover:bg-gray-600"
>
{
headers
?.
map
(({
render
,
id
})
=>
(
<
td
className=
"px-6 py-4 listData"
>
{
render
?
render
(
item
[
id
])
:
item
[
id
]
===
""
?
"NA"
:
item
[
id
]
}
</
td
>
))
}
</
tr
>
))
}
</
tbody
>
{
(
data
?.
length
)?
<
tbody
>
{
data
?.
map
((
item
,
index
)
=>
(
<
tr
className=
"bg-white dark:bg-gray-800 dark:border-gray-700 dark:text-white hover:bg-gray-50 dark:hover:bg-gray-600"
>
{
headers
?.
map
(({
render
,
id
})
=>
(
<
td
className=
"px-6 py-4 listData"
>
{
render
?
render
(
item
[
id
])
:
item
[
id
]
===
""
?
"NA"
:
item
[
id
]
}
</
td
>
))
}
</
tr
>
))
}
</
tbody
>:
null
}
</
table
>
<
div
className=
{
`w-full h-[30vh] justify-center bg-white mt-3 flex items-center rounded ${data?.lenght !== 0 && 'hidden'}`
}
>
<
p
className=
"text-lg"
>
Reportees not assigned
</
p
>
</
div
>
{
(
!
data
?.
length
)?<
div
className=
"w-full h-full"
>
<
p
className=
"text-center align-middle pt-14 pb-14 text-blue-500 font-bold"
>
No records to display
</
p
>
</
div
>:
null
}
</
div
>
);
else
return
<
div
className=
"w-full h-full"
>
<
p
className=
"text-center align-middle pt-14 pb-14 text-blue-500 font-bold"
>
No records to display
</
p
>
</
div
>
//
else
//
return <div className="w-full h-full">
//
<p className="text-center align-middle pt-14 pb-14 text-blue-500 font-bold">No records to display</p>
//
</div>
}
export
default
Table
;
src/pages/dashboard/index.jsx
View file @
078ced93
...
...
@@ -61,7 +61,9 @@ function Dashboard() {
{
title
:
"Employee Name"
,
id
:
"empName"
,
render
:
(
value
)
=>
<
span
className=
"flex items-center"
><
img
className=
"pr-2"
src=
"/man.png"
width=
"30px"
height=
"30px"
/>
{
value
}
</
span
>
render
:
(
value
)
=>
<
span
className=
"flex items-center"
>
{
/* <img className="pr-2" src="/man.png" width="30px" height="30px" /> */
}
{
value
}
</
span
>
},
{
title
:
"Emp.Id"
,
...
...
src/pages/reports/index.jsx
View file @
078ced93
...
...
@@ -48,10 +48,10 @@ function Reports() {
}
}
const
getReports
=
(
startDate
=
null
,
endDate
=
null
)
=>
{
const
data
=
{
"empId"
:
empId
,
"fromDate"
:
startDate
,
"toDate"
:
endDate
}
dispatch
(
fetchReports
(
data
))
}
//
const getReports = (startDate = null, endDate = null) => {
//
const data = { "empId": empId, "fromDate": startDate, "toDate": endDate }
//
dispatch(fetchReports(data))
//
}
const
fetchLatestReporteesData
=
()
=>
{
if
(
user
)
{
const
data
=
{
...
...
@@ -74,7 +74,7 @@ function Reports() {
await
axios
.
post
(
`
${
base_url
}
/createActivity`
,
newData
)
.
then
(
async
(
result
)
=>
{
fetchLatestReporteesData
()
getReports
()
//
getReports()
})
}
else
{
...
...
@@ -156,14 +156,14 @@ function Reports() {
</
div
>
</
div
>
<
div
className=
"
max-h-[70vh] overflow-auto
"
>
<
div
className=
"container mx-auto mt-4 flex justify-end pe-4"
>
<
div
className=
""
>
{
/*
<div className="container mx-auto mt-4 flex justify-end pe-4">
<DateRangePicker getReports={getReports} />
</
div
>
<
div
className=
"
max-h-[50vh] overflow-auto
"
>
</div>
*/
}
<
div
className=
""
>
<
Accordion
title=
"Default"
open=
{
open
.
accordianOne
}
handleAccordian=
{
handleAccordian
}
data=
{
activities
?.
default
}
handleAddActivity=
{
handleAddActivity
}
/>
</
div
>
<
div
className=
"
max-h-[50vh] overflow-auto
"
>
<
div
className=
""
>
<
Accordion
title=
"Initiative"
open=
{
open
.
accordianTwo
}
handleAccordian=
{
handleAccordian
}
data=
{
activities
?.
initiative
}
handleAddActivity=
{
handleAddActivity
}
/>
</
div
>
</
div
>
...
...
src/utils/constants.js
View file @
078ced93
// export const base_url = 'http://localhost:4000'
// export const base_url = 'https://nisumscorecardserverdev.netlify.app/.netlify/functions/api'
export
const
base_url
=
'https://nisumscorecardservertesting.netlify.app/.netlify/functions/api'
\ No newline at end of file
export
const
base_url
=
'https://nisumscorecardserverdev.netlify.app/.netlify/functions/api'
// export const base_url = 'https://nisumscorecardservertesting.netlify.app/.netlify/functions/api'
\ No newline at end of file
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