Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
C
ce-deploy-ui
Manage
Activity
Members
Labels
Plan
Jira
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Locked files
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package Registry
Container Registry
Operate
Environments
Terraform modules
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Code review analytics
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
ccce
dev
ce-deploy-ui
Commits
1852e41c
Commit
1852e41c
authored
3 years ago
by
John Sparger
Browse files
Options
Downloads
Patches
Plain Diff
Update CustomTable to display loading animation
parent
1eb2fece
No related branches found
No related tags found
2 merge requests
!139
Merge before release
,
!111
Reimplement search to be more responsive
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
src/components/common/table/CustomTable.js
+3
-4
3 additions, 4 deletions
src/components/common/table/CustomTable.js
with
3 additions
and
4 deletions
src/components/common/table/CustomTable.js
+
3
−
4
View file @
1852e41c
import
React
from
'
react
'
;
import
PropTypes
from
'
prop-types
'
;
import
{
Paper
}
from
'
@material-ui/core
'
;
import
{
LinearProgress
,
Paper
}
from
'
@material-ui/core
'
;
import
{
DataTable
}
from
'
primereact/datatable
'
;
import
{
Column
}
from
'
primereact/column
'
;
import
'
primeicons/primeicons.css
'
;
...
...
@@ -10,9 +10,7 @@ import 'primeflex/primeflex.css';
import
'
./CustomTable.css
'
;
export
function
CustomTable
(
props
)
{
const
{
columns
,
rows
,
handleRowClick
,
totalCount
,
lazyParams
,
setLazyParams
,
columnSort
,
setColumnSort
,
rowsPerPage
}
=
props
;
//const [loading, setLoading] = useState(false);
const
{
columns
,
rows
,
handleRowClick
,
totalCount
,
lazyParams
,
setLazyParams
,
columnSort
,
setColumnSort
,
rowsPerPage
,
loading
=
false
}
=
props
;
const
dynamicColumns
=
columns
.
map
((
col
,
i
)
=>
{
return
<
Column
key
=
{
col
.
id
}
field
=
{
col
.
id
}
header
=
{
col
.
label
}
style
=
{{
width
:
col
.
width
}}
body
=
{
col
.
body
}
sortable
=
{
col
.
sortable
}
/>
;
...
...
@@ -84,6 +82,7 @@ export function CustomTable(props) {
onRowClick
=
{(
event
)
=>
handleClick
(
event
)}
rowClassName
=
{
rowClassName
}
totalRecords
=
{
totalCount
}
emptyMessage
=
{
loading
?
<
LinearProgress
/>
:
"
No records found
"
}
>
{
dynamicColumns
}
<
/DataTable
>
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment