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
444b9daa
Commit
444b9daa
authored
1 year ago
by
Domonkos Gulyas
Browse files
Options
Downloads
Patches
Plain Diff
CE-2151
: Make Record table links clickable
parent
8e5a4950
No related branches found
No related tags found
2 merge requests
!407
CE-2141: 3.0.0
,
!386
CE-2151: Make Record table links clickable
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
src/hooks/pagination.js
+2
-1
2 additions, 1 deletion
src/hooks/pagination.js
src/views/records/RecordListView.js
+9
-3
9 additions, 3 deletions
src/views/records/RecordListView.js
with
11 additions
and
4 deletions
src/hooks/pagination.js
+
2
−
1
View file @
444b9daa
...
...
@@ -52,6 +52,7 @@ export const usePagination = ({
return
{
pagination
,
setPagination
setPagination
,
setTotalCount
};
};
This diff is collapsed.
Click to expand it.
src/views/records/RecordListView.js
+
9
−
3
View file @
444b9daa
...
...
@@ -98,7 +98,7 @@ export function RecordListView() {
const
rowsPerPage
=
[
20
,
50
];
const
{
pagination
,
setPagination
}
=
usePagination
({
const
{
pagination
,
setPagination
,
setTotalCount
}
=
usePagination
({
rowsPerPageOptions
:
rowsPerPage
,
initLimit
:
urlPagination
.
rows
??
rowsPerPage
[
0
],
initPage
:
urlPagination
.
page
??
0
...
...
@@ -106,8 +106,14 @@ export function RecordListView() {
// update pagination whenever search result total pages change
useEffect
(()
=>
{
setPagination
({
totalCount
:
records
?.
totalCount
??
0
});
},
[
setPagination
,
records
?.
totalCount
]);
setTotalCount
((
prev
)
=>
{
if
(
prev
===
pagination
.
totalCount
&&
prev
>
0
)
{
return
prev
;
}
else
{
return
records
?.
totalCount
??
0
;
}
});
},
[
pagination
,
records
?.
totalCount
,
setTotalCount
]);
// whenever url state changes, update pagination
useEffect
(()
=>
{
...
...
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