Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
Ecolyo
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
Ecolyo
Commits
819af223
Commit
819af223
authored
1 year ago
by
Pierre Ecarlat
Browse files
Options
Downloads
Patches
Plain Diff
feat: GRDF consent email
parent
017eeeb1
Branches
Branches containing commit
Tags
Tags containing commit
2 merge requests
!1162
3.0 Release
,
!1154
feat: GRDF consent email
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
src/components/Connection/GRDFConnect/GrdfWaitConsent.tsx
+14
-9
14 additions, 9 deletions
src/components/Connection/GRDFConnect/GrdfWaitConsent.tsx
src/components/Konnector/ConnectionResult/ConnectionResult.tsx
+1
-3
1 addition, 3 deletions
...omponents/Konnector/ConnectionResult/ConnectionResult.tsx
with
15 additions
and
12 deletions
src/components/Connection/GRDFConnect/GrdfWaitConsent.tsx
+
14
−
9
View file @
819af223
import
{
Button
}
from
'
@material-ui/core
'
import
GRDFMail
from
'
assets/icons/visu/onboarding/grdf-mail.svg
'
import
StyledIcon
from
'
components/CommonKit/Icon/StyledIcon
'
import
useUserInstanceSettings
from
'
components/Hooks/useUserInstanceSettings
'
import
{
useI18n
}
from
'
cozy-ui/transpiled/react/I18n
'
import
{
FluidType
}
from
'
enums
'
import
{
FluidConnection
}
from
'
models
'
import
{
AccountGRDFData
,
FluidConnection
}
from
'
models
'
import
React
,
{
useEffect
,
useState
}
from
'
react
'
import
{
updateFluidConnection
}
from
'
store/global/global.slice
'
import
{
useAppDispatch
,
useAppSelector
}
from
'
store/hooks
'
...
...
@@ -18,13 +17,9 @@ export const GrdfWaitConsent = ({
const
{
t
}
=
useI18n
()
const
dispatch
=
useAppDispatch
()
const
{
fluidStatus
}
=
useAppSelector
(
state
=>
state
.
ecolyo
.
global
)
const
{
data
:
instanceSettings
}
=
useUserInstanceSettings
()
const
[
emailSentOn
,
setEmailSentOn
]
=
useState
(
''
)
const
currentFluidStatus
=
fluidStatus
[
FluidType
.
GAS
]
useEffect
(()
=>
{
setEmailSentOn
(
instanceSettings
.
email
||
''
)
},
[
instanceSettings
])
const
account
=
currentFluidStatus
.
connection
.
account
const
[
consentEmail
,
setConsentEmail
]
=
useState
(
''
)
const
updateKonnector
=
async
()
=>
{
const
updatedConnection
:
FluidConnection
=
{
...
...
@@ -41,6 +36,16 @@ export const GrdfWaitConsent = ({
)
}
useEffect
(()
=>
{
if
(
account
?.
auth
)
{
const
auth
=
account
.
auth
const
authData
=
auth
as
AccountGRDFData
if
(
authData
.
email
)
{
setConsentEmail
(
authData
.
email
)
}
}
},
[
account
])
return
(
<
div
className
=
"grdfWait"
>
<
div
className
=
"text-18-normal"
>
...
...
@@ -49,7 +54,7 @@ export const GrdfWaitConsent = ({
<
div
className
=
"text-16-normal"
>
{
t
(
'
auth.grdfgrandlyon.waiting.mailDelay
'
)
}
</
div
>
<
span
className
=
"emailContainer"
>
{
emailSentOn
}
</
span
>
<
span
className
=
"emailContainer"
>
{
consentEmail
}
</
span
>
<
StyledIcon
size
=
{
80
}
icon
=
{
GRDFMail
}
/>
<
div
className
=
"text-18-normal"
>
<
span
className
=
"text-18-bold green"
>
...
...
This diff is collapsed.
Click to expand it.
src/components/Konnector/ConnectionResult/ConnectionResult.tsx
+
1
−
3
View file @
819af223
...
...
@@ -171,9 +171,7 @@ const ConnectionResult = ({
}
}
const
consentError
=
konnectorError
===
KonnectorUpdate
.
ERROR_CONSENT_FORM_GAS
||
konnectorError
===
KonnectorUpdate
.
ERROR_UPDATE_OAUTH
const
consentError
=
konnectorError
===
KonnectorUpdate
.
ERROR_UPDATE_OAUTH
/**
* Get Konnector state, possible values:
...
...
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