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