Skip to content
Snippets Groups Projects
Commit 888770e7 authored by Yoan VALLET's avatar Yoan VALLET
Browse files

Merge branch 'features/No-account-links' into 'dev'

Features/no account links

See merge request web-et-numerique/llle_project/ecolyo!12
parents 25cf2d5f f614060e
No related branches found
No related tags found
2 merge requests!15Merge Dev to Master,!12Features/no account links
...@@ -11,7 +11,8 @@ ...@@ -11,7 +11,8 @@
"oauth": true, "oauth": true,
"slug": "enedis", "slug": "enedis",
"id": "io.cozy.konnectors/enedis" "id": "io.cozy.konnectors/enedis"
} },
"siteLink": "https://mon-compte-client.enedis.fr/"
}, },
{ {
"fluidTypeId": 1, "fluidTypeId": 1,
...@@ -24,7 +25,8 @@ ...@@ -24,7 +25,8 @@
"oauth": false, "oauth": false,
"slug": "egl", "slug": "egl",
"id": "io.cozy.konnectors/egl" "id": "io.cozy.konnectors/egl"
} },
"siteLink": "https://agence.eaudugrandlyon.com/inscription.aspx"
}, },
{ {
"fluidTypeId": 2, "fluidTypeId": 2,
...@@ -37,7 +39,8 @@ ...@@ -37,7 +39,8 @@
"oauth": false, "oauth": false,
"slug": "grdf", "slug": "grdf",
"id": "io.cozy.konnectors/grdf" "id": "io.cozy.konnectors/grdf"
} },
"siteLink": "https://monespace.grdf.fr/monespace/connexion"
} }
] ]
} }
...@@ -32,6 +32,7 @@ const KonnectorForm: React.FC<KonnectorFormProps> = ({ ...@@ -32,6 +32,7 @@ const KonnectorForm: React.FC<KonnectorFormProps> = ({
}: KonnectorFormProps) => { }: KonnectorFormProps) => {
const konnectorName: string = fluidConfig.konnectorConfig.name const konnectorName: string = fluidConfig.konnectorConfig.name
const konnectorType: string = fluidConfig.konnectorConfig.type const konnectorType: string = fluidConfig.konnectorConfig.type
const siteLink: string = fluidConfig.siteLink
function revealPassword(idInput: string) { function revealPassword(idInput: string) {
const input = document.getElementById(idInput) const input = document.getElementById(idInput)
...@@ -91,7 +92,12 @@ const KonnectorForm: React.FC<KonnectorFormProps> = ({ ...@@ -91,7 +92,12 @@ const KonnectorForm: React.FC<KonnectorFormProps> = ({
<StyledButton type="submit" color="primary" disabled={loading}> <StyledButton type="submit" color="primary" disabled={loading}>
{t('KONNECTORCONFIG.BTN_CONNECTION')} {t('KONNECTORCONFIG.BTN_CONNECTION')}
</StyledButton> </StyledButton>
<StyledButton type="button" color="secondary" disabled={loading}> <StyledButton
type="button"
color="secondary"
disabled={loading}
onClick={() => window.open(siteLink, '_blank')}
>
{t('KONNECTORCONFIG.BTN_NOACCOUNT')} {t('KONNECTORCONFIG.BTN_NOACCOUNT')}
</StyledButton> </StyledButton>
</form> </form>
......
...@@ -23,7 +23,7 @@ const KonnectorLoading: React.FC<KonnectorLoadingProps> = ({ ...@@ -23,7 +23,7 @@ const KonnectorLoading: React.FC<KonnectorLoadingProps> = ({
return ( return (
<div className="kload-content"> <div className="kload-content">
<Lottie options={loadingOptions} height={50} width={50} /> <Lottie options={loadingOptions} height={50} width={50} />
<div className="kload-content-text text-16-normal"> <div className="kload-content-text kload-content-text-center text-16-normal">
<div>{t('KONNECTORCONFIG.PLZ_WAIT')}</div> <div>{t('KONNECTORCONFIG.PLZ_WAIT')}</div>
</div> </div>
<div className="kload-content-text text-16-normal"> <div className="kload-content-text text-16-normal">
......
...@@ -7,6 +7,7 @@ import StyledButton from 'components/CommonKit/Button/StyledButton' ...@@ -7,6 +7,7 @@ import StyledButton from 'components/CommonKit/Button/StyledButton'
interface KonnectorOAuthFormProps { interface KonnectorOAuthFormProps {
konnector: Konnector konnector: Konnector
siteLink: string
onSuccess: Function onSuccess: Function
loading: boolean loading: boolean
t: Function t: Function
...@@ -14,6 +15,7 @@ interface KonnectorOAuthFormProps { ...@@ -14,6 +15,7 @@ interface KonnectorOAuthFormProps {
const KonnectorOAuthForm: React.FC<KonnectorOAuthFormProps> = ({ const KonnectorOAuthForm: React.FC<KonnectorOAuthFormProps> = ({
konnector, konnector,
siteLink,
onSuccess, onSuccess,
loading, loading,
t, t,
...@@ -35,7 +37,12 @@ const KonnectorOAuthForm: React.FC<KonnectorOAuthFormProps> = ({ ...@@ -35,7 +37,12 @@ const KonnectorOAuthForm: React.FC<KonnectorOAuthFormProps> = ({
</div> </div>
</div> </div>
<div className="koauthform-button"> <div className="koauthform-button">
<StyledButton type="button" color="secondary" disabled={loading}> <StyledButton
type="button"
color="secondary"
disabled={loading}
onClick={() => window.open(siteLink, '_blank')}
>
{t('oauth.create_account.' + konnector.slug)} {t('oauth.create_account.' + konnector.slug)}
</StyledButton> </StyledButton>
</div> </div>
......
...@@ -22,7 +22,7 @@ const KonnectorResult: React.FC<KonnectorResultProps> = ({ ...@@ -22,7 +22,7 @@ const KonnectorResult: React.FC<KonnectorResultProps> = ({
t, t,
}: KonnectorResultProps) => { }: KonnectorResultProps) => {
return ( return (
<div> <div className="accordion-update-result">
<div className="accordion-update"> <div className="accordion-update">
<div <div
className={ className={
......
...@@ -313,6 +313,7 @@ const KonnectorViewerCard: React.FC<KonnectorViewerCardProps> = ({ ...@@ -313,6 +313,7 @@ const KonnectorViewerCard: React.FC<KonnectorViewerCardProps> = ({
) : ( ) : (
<KonnectorOAuthForm <KonnectorOAuthForm
konnector={konnector} konnector={konnector}
siteLink={fluidConfig.siteLink}
onSuccess={initOauthAccount} onSuccess={initOauthAccount}
loading={loading} loading={loading}
/> />
......
...@@ -13,4 +13,5 @@ export default interface IFluidConfig { ...@@ -13,4 +13,5 @@ export default interface IFluidConfig {
coefficient: number coefficient: number
dataDelayOffset: number dataDelayOffset: number
konnectorConfig: KonnectorConfig konnectorConfig: KonnectorConfig
siteLink: string
} }
...@@ -46,6 +46,12 @@ ...@@ -46,6 +46,12 @@
position: absolute; position: absolute;
} }
} }
.accordion-update-result {
margin: 0.5rem 1.5rem;
@media #{$large-phone} {
margin: 0.5rem 0;
}
}
.accordion-update { .accordion-update {
flex: 2; flex: 2;
padding: 0.5rem 1rem; padding: 0.5rem 1rem;
...@@ -107,6 +113,10 @@ ...@@ -107,6 +113,10 @@
// KonnectorOAuthForm // KonnectorOAuthForm
.koauthform{ .koauthform{
margin: 0 1.5rem;
@media #{$large-phone} {
margin: 0;
}
.koauthform-text{ .koauthform-text{
color: $text-bright; color: $text-bright;
padding-top: 1rem; padding-top: 1rem;
...@@ -118,12 +128,17 @@ ...@@ -118,12 +128,17 @@
// KonnectorLoading // KonnectorLoading
.kload-content { .kload-content {
margin: 0.5rem 0; margin: 0.5rem 1.5rem;
@media #{$large-phone} {
margin: 0.5rem 0;
}
.kload-content-text { .kload-content-text {
text-align: center;
color: $text-bright; color: $text-bright;
margin: 1rem 0; margin: 1rem 0;
} }
.kload-content-text-center {
text-align: center;
}
} }
.state-icon { .state-icon {
......
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