Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
backoffice_client
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Container Registry
Model registry
Operate
Environments
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Terms and privacy
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
web-et-numerique
Factory
LLLE_Project
backoffice_client
Commits
b3ce51dd
Commit
b3ce51dd
authored
2 years ago
by
Rémi PAILHAREY
Browse files
Options
Downloads
Patches
Plain Diff
style: expired consents are now less visible
parent
8cddad0d
No related branches found
Branches containing commit
No related tags found
4 merge requests
!96
Deploy OpenShift v2
,
!95
MEP fix liens undefined
,
!91
MEP: removed Meilisearch
,
!88
Resolve "[1] [SGE - Backoffice] Amélioration distinction consentement expirés/valides"
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
src/components/Consents/Consents.tsx
+25
-21
25 additions, 21 deletions
src/components/Consents/Consents.tsx
src/components/Consents/agGridOverrides.scss
+6
-2
6 additions, 2 deletions
src/components/Consents/agGridOverrides.scss
with
31 additions
and
23 deletions
src/components/Consents/Consents.tsx
+
25
−
21
View file @
b3ce51dd
...
...
@@ -153,25 +153,26 @@ const Consents: React.FC = () => {
}
},
[
gridApi
,
selectedNodes
])
const
handleSearchChange
=
useCallback
(
async
(
newSearch
:
string
)
=>
{
setSearch
(
newSearch
)
if
(
user
)
{
const
consentPagination
=
await
consentService
.
searchConsents
(
newSearch
,
rowsPerPage
,
page
,
getAxiosXSRFHeader
(
user
.
xsrftoken
)
)
if
(
consentPagination
)
{
setConsents
(
consentPagination
.
rows
)
checkSelectedNodes
()
setTotalRows
(
consentPagination
.
totalRows
)
}
const
searchConsents
=
async
()
=>
{
if
(
user
)
{
const
consentPagination
=
await
consentService
.
searchConsents
(
search
,
rowsPerPage
,
page
,
getAxiosXSRFHeader
(
user
.
xsrftoken
)
)
if
(
consentPagination
)
{
setConsents
(
consentPagination
.
rows
)
checkSelectedNodes
()
setTotalRows
(
consentPagination
.
totalRows
)
}
},
[
user
,
consentService
,
rowsPerPage
,
page
,
checkSelectedNodes
]
)
}
}
const
handleSearchChange
=
(
newSearch
:
string
)
=>
{
setSearch
(
newSearch
)
setPage
(
0
)
}
const
resetSelection
=
useCallback
(()
=>
{
if
(
gridApi
)
{
...
...
@@ -252,12 +253,12 @@ const Consents: React.FC = () => {
}
},
[
gridApi
])
/** Trigger search when page loads or when admin changes pagination */
/** Trigger search when page loads or when admin changes
input or
pagination */
useEffect
(()
=>
{
handleSearchChange
(
search
)
searchConsents
(
)
// /!\ Do not change dependencies or effect will not trigger when pagination changes
// eslint-disable-next-line react-hooks/exhaustive-deps
},
[
rowsPerPage
,
page
])
},
[
rowsPerPage
,
page
,
search
])
return
(
<>
...
...
@@ -299,6 +300,9 @@ const Consents: React.FC = () => {
rowMultiSelectWithClick
=
{
true
}
pagination
=
{
false
}
suppressCellFocus
=
{
true
}
rowClassRules
=
{
{
expired
:
(
params
)
=>
params
.
data
.
endDate
<
DateTime
.
now
(),
}
}
></
AgGridReact
>
{
!
isShowingSelection
&&
(
<
TablePagination
...
...
This diff is collapsed.
Click to expand it.
src/components/Consents/agGridOverrides.scss
+
6
−
2
View file @
b3ce51dd
...
...
@@ -10,10 +10,14 @@
.ag-header-cell-text
{
color
:
$gold
;
}
.ag-row-odd
,
.ag-row-even
{
.ag-row
{
background
:
transparent
!
important
;
transition
:
all
300ms
ease
!
important
;
&
.expired
{
*
{
color
:
$text-chart
;
}
}
}
.ag-cell-focus
{
outline
:
none
!
important
;
...
...
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