diff --git a/src/components/ContentComponents/Konnector/KonnectorNotFound.tsx b/src/components/ContentComponents/Konnector/KonnectorNotFound.tsx index a3a27c229e3fb4d3a6fa77c6b11b63aac43a5af7..6432b778ac8bd90a31fd36289de48dba41d077a9 100644 --- a/src/components/ContentComponents/Konnector/KonnectorNotFound.tsx +++ b/src/components/ContentComponents/Konnector/KonnectorNotFound.tsx @@ -9,8 +9,16 @@ interface KonnectorNotFoundProps { } const KonnectorNotFound: React.FC<KonnectorNotFoundProps> = ({ + konnectorSlug, t, }: KonnectorNotFoundProps) => { + const openKonnectorURL = () => { + console.log(window.location) + const hostname = window.location.origin.replace('ecolyo', 'store') + const url = hostname + '/#/discover/' + konnectorSlug + window.open(url, '_blank') + } + return ( <div className="knotfound"> <div className="knotfound-text"> @@ -18,16 +26,7 @@ const KonnectorNotFound: React.FC<KonnectorNotFoundProps> = ({ {t('KONNECTORCONFIG.NOT_INSTALLED')} </div> <div className="knotfound-button"> - <StyledButton - type="button" - color="primary" - onClick={() => - window.open( - 'https://store.yoan.cozy.wf.alpha.grandlyon.com/#/discover/boulanger', - '_blank' - ) - } - > + <StyledButton type="button" color="primary" onClick={openKonnectorURL}> {t('KONNECTORCONFIG.BTN_INSTALL')} </StyledButton> </div> diff --git a/src/components/ContentComponents/KonnectorViewer/KonnectorViewerCard.tsx b/src/components/ContentComponents/KonnectorViewer/KonnectorViewerCard.tsx index 37e3b72c28a5ffa4ae850920c8a4fbec7f82e807..6239cc01dbc1c63b94974e1e4d607810d13e95a3 100644 --- a/src/components/ContentComponents/KonnectorViewer/KonnectorViewerCard.tsx +++ b/src/components/ContentComponents/KonnectorViewer/KonnectorViewerCard.tsx @@ -297,7 +297,9 @@ const KonnectorViewerCard: React.FC<KonnectorViewerCardProps> = ({ className={`accordion-content ${setActive}`} > {!konnector ? ( - <KonnectorNotFound /> + <KonnectorNotFound + konnectorSlug={fluidConfig.konnectorConfig.slug} + /> ) : !isKonnectorAcc ? ( !fluidConfig.konnectorConfig.oauth ? ( <KonnectorForm diff --git a/src/locales/en.json b/src/locales/en.json index 27b218e1528aad2f9cb9879a2225a9d06420cf3e..003f6eebbeed31e18f4f28a1c233ec134c6e7b1e 100644 --- a/src/locales/en.json +++ b/src/locales/en.json @@ -122,7 +122,7 @@ "BTN_DELETE": "Supprimer", "LOADING_DATA": "Vos premières données seront disponibles dans quelques minutes et les prochaines données seront chargées automatiquement.", "PLZ_WAIT": "Veuillez patienter...", - "NOT_INSTALLED": "Le connecteur n'est pas installer. Veuillez l'installer en cliquant sur le bouton ci-dessous." + "NOT_INSTALLED": "Le connecteur n'est pas installé. Veuillez l'installer en cliquant sur le bouton ci-dessous." }, "INDICATOR": { "DISPLAY_OTHER_FLUID": "Voir",