Skip to content
Snippets Groups Projects
Commit 405a3f17 authored by Pierre Ecarlat's avatar Pierre Ecarlat
Browse files

fix: Handle the refuse status for grdf

parent 5f3901d0
No related branches found
No related tags found
1 merge request!1286fix: Handle the refuse status for grdf
...@@ -159,6 +159,7 @@ ...@@ -159,6 +159,7 @@
"usageevent", "usageevent",
"Usain", "Usain",
"userchallenge", "userchallenge",
"WEBAUTH",
"weektype" "weektype"
], ],
"typescript.tsdk": "node_modules/typescript/lib", "typescript.tsdk": "node_modules/typescript/lib",
......
...@@ -92,6 +92,9 @@ const KonnectorViewerCard = ({ ...@@ -92,6 +92,9 @@ const KonnectorViewerCard = ({
const isWaitingForConsent = const isWaitingForConsent =
fluidType === FluidType.GAS && fluidType === FluidType.GAS &&
currentFluidStatus.status === FluidState.CHALLENGE_ASKED currentFluidStatus.status === FluidState.CHALLENGE_ASKED
const emailHasBeenIgnored =
fluidType === FluidType.GAS &&
currentFluidStatus.status === FluidState.EMAIL_IGNORED
const fluidService = useMemo(() => new FluidService(client), [client]) const fluidService = useMemo(() => new FluidService(client), [client])
const accountService = useMemo(() => new AccountService(client), [client]) const accountService = useMemo(() => new AccountService(client), [client])
...@@ -465,7 +468,7 @@ const KonnectorViewerCard = ({ ...@@ -465,7 +468,7 @@ const KonnectorViewerCard = ({
return ( return (
<div className="konnector-section-root"> <div className="konnector-section-root">
{isWaitingForConsent && <GrdfWaitConsent />} {isWaitingForConsent && <GrdfWaitConsent />}
{!isWaitingForConsent && !showOfflineData && ( {(!isWaitingForConsent || emailHasBeenIgnored) && !showOfflineData && (
<Connection fluidType={fluidType} /> <Connection fluidType={fluidType} />
)} )}
{!isWaitingForConsent && showOfflineData && ( {!isWaitingForConsent && showOfflineData && (
......
...@@ -13,4 +13,5 @@ export enum FluidState { ...@@ -13,4 +13,5 @@ export enum FluidState {
ERROR = 'ERROR', ERROR = 'ERROR',
LOGIN_FAILED = 'LOGIN_FAILED', LOGIN_FAILED = 'LOGIN_FAILED',
CHALLENGE_ASKED = 'CHALLENGE_ASKED', CHALLENGE_ASKED = 'CHALLENGE_ASKED',
EMAIL_IGNORED = 'EMAIL_IGNORED',
} }
...@@ -4,6 +4,7 @@ export enum KonnectorError { ...@@ -4,6 +4,7 @@ export enum KonnectorError {
USER_ACTION_NEEDED = 'USER_ACTION_NEEDED', USER_ACTION_NEEDED = 'USER_ACTION_NEEDED',
TERMS_VERSION_MISMATCH = 'TERMS_VERSION_MISMATCH', TERMS_VERSION_MISMATCH = 'TERMS_VERSION_MISMATCH',
CHALLENGE_ASKED = 'CHALLENGE_ASKED', CHALLENGE_ASKED = 'CHALLENGE_ASKED',
EMAIL_IGNORED = 'USER_ACTION_NEEDED.WEBAUTH_REQUIRED',
UNKNOWN_ERROR = 'UNKNOWN_ERROR', UNKNOWN_ERROR = 'UNKNOWN_ERROR',
CRITICAL = 'exit status 1', CRITICAL = 'exit status 1',
MISSING_SECRET = "Cannot read property 'secret' of null", MISSING_SECRET = "Cannot read property 'secret' of null",
......
...@@ -31,6 +31,9 @@ export default class FluidService { ...@@ -31,6 +31,9 @@ export default class FluidService {
if (state?.last_error === 'CHALLENGE_ASKED') { if (state?.last_error === 'CHALLENGE_ASKED') {
return FluidState.CHALLENGE_ASKED return FluidState.CHALLENGE_ASKED
} }
if (state?.last_error === 'EMAIL_IGNORED') {
return FluidState.EMAIL_IGNORED
}
return FluidState.ERROR return FluidState.ERROR
default: default:
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment