From e7fc3f13ae2b458a2203eb7dc76cc412f415b636 Mon Sep 17 00:00:00 2001
From: Romain CREY <ext.sopra.rcrey@grandlyon.com>
Date: Thu, 4 Jun 2020 14:48:28 +0200
Subject: [PATCH] WIP: error in konnector launch

---
 .../Konnector/KonnectorLaunch.tsx             | 26 +++++++++++++++++--
 src/locales/en.json                           |  4 ++-
 2 files changed, 27 insertions(+), 3 deletions(-)

diff --git a/src/components/ContentComponents/Konnector/KonnectorLaunch.tsx b/src/components/ContentComponents/Konnector/KonnectorLaunch.tsx
index 42fa86a68..7ab7567a0 100644
--- a/src/components/ContentComponents/Konnector/KonnectorLaunch.tsx
+++ b/src/components/ContentComponents/Konnector/KonnectorLaunch.tsx
@@ -13,6 +13,7 @@ import { Trigger } from 'doctypes'
 
 import Lottie from 'react-lottie'
 import * as loadingData from 'assets/anims/bounceloading.json'
+import StyledButton from 'components/CommonKit/Button/StyledButton'
 
 const loadingOptions = {
   loop: true,
@@ -85,8 +86,29 @@ const KonnectorLaunch: React.FC<KonnectorLaunchProps> = ({
       ) : (
         <>
           <div>
-            {/* // Add success when state <> ERROR_EVENT 
-            // Add Error when state = ERROR_EVENT */}
+            {state === ERROR_EVENT ? (
+              <div>
+                {t('KONNECTORCONFIG.ERROR_ACCOUNT_CREATION')}
+                <StyledButton
+                  type="button"
+                  color="primary"
+                  onClick={handleClick}
+                >
+                  <div>{t('KONNECTORCONFIG.OK')}</div>
+                </StyledButton>
+              </div>
+            ) : (
+              <div>
+                {t('KONNECTORCONFIG.SUCCESS')}
+                <StyledButton
+                  type="button"
+                  color="primary"
+                  onClick={handleClick}
+                >
+                  <div>{t('KONNECTORCONFIG.OK')}</div>
+                </StyledButton>
+              </div>
+            )}
           </div>
         </>
       )}
diff --git a/src/locales/en.json b/src/locales/en.json
index 4ad007114..7c4ab690a 100644
--- a/src/locales/en.json
+++ b/src/locales/en.json
@@ -125,7 +125,9 @@
     "NOT_INSTALLED": "Le connecteur n'est pas installé. Veuillez l'installer en cliquant sur le bouton ci-dessous.",
     "ERROR_NO_LOGIN_PASSWORD": "Identifiant et mot de passe requis",
     "ERROR_ACCOUNT_CREATION": "Une erreur est survenue, veuillez essayer de nouveau",
-    "ERROR_LOGIN_FAILED": "Identifiants invalides"
+    "ERROR_LOGIN_FAILED": "Identifiants invalides",
+    "SUCCESS": "Félicitations, la connexion a été effectuée",
+    "OK": "Ok"
   },
   "INDICATOR": {
     "DISPLAY_OTHER_FLUID": "Voir",
-- 
GitLab