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
80949863
Commit
80949863
authored
2 years ago
by
Rémi PAILHAREY
Browse files
Options
Downloads
Patches
Plain Diff
fix(consents): agGrid date sort
parent
c7f2c002
No related branches found
Branches containing commit
No related tags found
6 merge requests
!96
Deploy OpenShift v2
,
!95
MEP fix liens undefined
,
!91
MEP: removed Meilisearch
,
!79
Fix: nginx unprivileged image
,
!77
Back-office SGE before canary release
,
!73
Fix/us847 aggrid date sort
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
src/components/Consents/Consents.tsx
+10
-0
10 additions, 0 deletions
src/components/Consents/Consents.tsx
src/models/consent.model.ts
+3
-2
3 additions, 2 deletions
src/models/consent.model.ts
src/services/consent.service.ts
+4
-8
4 additions, 8 deletions
src/services/consent.service.ts
with
17 additions
and
10 deletions
src/components/Consents/Consents.tsx
+
10
−
0
View file @
80949863
...
...
@@ -17,6 +17,7 @@ import {
GridReadyEvent
,
RowNode
,
RowSelectedEvent
,
ValueFormatterParams
,
}
from
'
ag-grid-community
'
import
styles
from
'
./consents.module.scss
'
import
'
./agGridOverrides.scss
'
...
...
@@ -26,6 +27,7 @@ import { ConsentService } from '../../services/consent.service'
import
{
UserContextProps
,
UserContext
}
from
'
../../hooks/userContext
'
import
{
IConsent
}
from
'
../../models/consent.model
'
import
{
getAxiosXSRFHeader
}
from
'
../../axios.config
'
import
{
DateTime
}
from
'
luxon
'
const
Consents
:
React
.
FC
=
()
=>
{
const
[
gridApi
,
setGridApi
]
=
useState
<
GridApi
|
null
>
(
null
)
...
...
@@ -53,6 +55,11 @@ const Consents: React.FC = () => {
}),
[]
)
const
dateFormatter
=
(
data
:
ValueFormatterParams
):
string
=>
{
return
(
data
.
value
as
DateTime
).
toLocaleString
()
}
const
[
columnDefs
]
=
useState
<
(
ColDef
|
ColGroupDef
)[]
|
null
>
([
{
field
:
'
ID
'
,
...
...
@@ -98,6 +105,7 @@ const Consents: React.FC = () => {
},
{
field
:
'
startDate
'
,
valueFormatter
:
dateFormatter
,
headerName
:
'
Début du consentement
'
,
initialWidth
:
150
,
filter
:
true
,
...
...
@@ -105,11 +113,13 @@ const Consents: React.FC = () => {
},
{
field
:
'
endDate
'
,
valueFormatter
:
dateFormatter
,
headerName
:
'
Fin du consentement
'
,
initialWidth
:
150
,
filter
:
true
,
},
])
const
handleChangePage
=
useCallback
(
(
_event
:
React
.
MouseEvent
<
HTMLButtonElement
,
MouseEvent
>
|
null
,
...
...
This diff is collapsed.
Click to expand it.
src/models/consent.model.ts
+
3
−
2
View file @
80949863
import
{
DateTime
}
from
'
luxon
'
export
interface
IConsent
extends
Omit
<
ConsentEntity
,
'
CreatedAt
'
|
'
endDate
'
|
'
inseeCode
'
>
{
startDate
:
string
endDate
:
string
startDate
:
DateTime
endDate
:
DateTime
}
export
interface
ConsentEntity
{
...
...
This diff is collapsed.
Click to expand it.
src/services/consent.service.ts
+
4
−
8
View file @
80949863
...
...
@@ -73,16 +73,12 @@ export class ConsentService {
* @param consentEntity
*/
public
parseConsent
=
(
consentEntity
:
ConsentEntity
):
IConsent
=>
{
const
startDate
:
string
=
DateTime
.
fromISO
(
consentEntity
.
CreatedAt
,
{
const
startDate
:
DateTime
=
DateTime
.
fromISO
(
consentEntity
.
CreatedAt
,
{
zone
:
'
utc
'
,
})
.
setLocale
(
'
fr-FR
'
)
.
toLocaleString
()
const
endDate
:
string
=
DateTime
.
fromISO
(
consentEntity
.
endDate
,
{
}).
setLocale
(
'
fr-FR
'
)
const
endDate
:
DateTime
=
DateTime
.
fromISO
(
consentEntity
.
endDate
,
{
zone
:
'
utc
'
,
})
.
setLocale
(
'
fr-FR
'
)
.
toLocaleString
()
}).
setLocale
(
'
fr-FR
'
)
return
{
ID
:
consentEntity
.
ID
,
...
...
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