branch feature/1_socialauth updated (0821907e -> 445695a5)
This is an automated email from the git hooks/post-receive script. New change to branch feature/1_socialauth in repository pollen. See https://gitlab.nuiton.org/chorem/pollen.git from 0821907e fix build new e18b813c refs #1 mise en page des comptes externes dans le profil new 445695a5 refs #1 gestion de la suppression des credentials The 2 revisions listed above as "new" are entirely new to this repository and will be described in separate emails. The revisions listed as "adds" were already present in the repository and have only been added to this reference. Detailed log of new commits: commit 445695a58820b7ddf47fe6a8a5630fbdb04b934d Author: Kevin Morin <morin@codelutin.com> Date: Thu Sep 7 11:01:10 2017 +0200 refs #1 gestion de la suppression des credentials commit e18b813c7b01bd9ced24be48beabdbd7753c321f Author: Kevin Morin <morin@codelutin.com> Date: Thu Sep 7 10:48:45 2017 +0200 refs #1 mise en page des comptes externes dans le profil Summary of changes: .../pollen/services/bean/UserCredentialBean.java | 11 +++ pollen-ui-riot-js/src/main/web/css/custom.css | 2 + pollen-ui-riot-js/src/main/web/i18n.json | 4 + .../src/main/web/tag/UserProfile.tag.html | 85 +++++++++++++++------- .../src/main/web/tag/admin/LoginProviders.tag.html | 2 +- 5 files changed, 76 insertions(+), 28 deletions(-) -- To stop receiving notification emails like this one, please contact chorem.org SCM administrator <admin+scm@chorem.org>.
This is an automated email from the git hooks/post-receive script. New commit to branch feature/1_socialauth in repository pollen. See https://gitlab.nuiton.org/chorem/pollen.git commit e18b813c7b01bd9ced24be48beabdbd7753c321f Author: Kevin Morin <morin@codelutin.com> Date: Thu Sep 7 10:48:45 2017 +0200 refs #1 mise en page des comptes externes dans le profil --- .../pollen/services/bean/UserCredentialBean.java | 11 ++++ pollen-ui-riot-js/src/main/web/css/custom.css | 2 + pollen-ui-riot-js/src/main/web/i18n.json | 2 + .../src/main/web/tag/UserProfile.tag.html | 73 +++++++++++++++------- 4 files changed, 64 insertions(+), 24 deletions(-) diff --git a/pollen-services/src/main/java/org/chorem/pollen/services/bean/UserCredentialBean.java b/pollen-services/src/main/java/org/chorem/pollen/services/bean/UserCredentialBean.java index d88f3444..85b44ae1 100644 --- a/pollen-services/src/main/java/org/chorem/pollen/services/bean/UserCredentialBean.java +++ b/pollen-services/src/main/java/org/chorem/pollen/services/bean/UserCredentialBean.java @@ -10,6 +10,7 @@ public class UserCredentialBean extends PollenBean<UserCredential> { protected String provider; protected String userName; + protected String emailAddress; protected UserCredentialBean() { super(UserCredential.class); @@ -20,6 +21,7 @@ public class UserCredentialBean extends PollenBean<UserCredential> { setEntityId(entity.getTopiaId()); setProvider(entity.getProvider()); setUserName(entity.getUserName()); + setEmailAddress(entity.getEmail()); } @Override @@ -28,6 +30,7 @@ public class UserCredentialBean extends PollenBean<UserCredential> { entity.setTopiaId(getEntityId()); entity.setProvider(getProvider()); entity.setUserName(getUserName()); + entity.setEmail(getEmailAddress()); return entity; } @@ -46,4 +49,12 @@ public class UserCredentialBean extends PollenBean<UserCredential> { public void setUserName(String userName) { this.userName = userName; } + + public String getEmailAddress() { + return emailAddress; + } + + public void setEmailAddress(String emailAddress) { + this.emailAddress = emailAddress; + } } diff --git a/pollen-ui-riot-js/src/main/web/css/custom.css b/pollen-ui-riot-js/src/main/web/css/custom.css index 5dd7b38c..dbbd4d85 100644 --- a/pollen-ui-riot-js/src/main/web/css/custom.css +++ b/pollen-ui-riot-js/src/main/web/css/custom.css @@ -93,4 +93,6 @@ --report: rgba(0,0,0,0.05); --report-hover: #04c4bb; + + --list-alternate-row: #f3f3f3; } diff --git a/pollen-ui-riot-js/src/main/web/i18n.json b/pollen-ui-riot-js/src/main/web/i18n.json index a39cf222..b8010814 100644 --- a/pollen-ui-riot-js/src/main/web/i18n.json +++ b/pollen-ui-riot-js/src/main/web/i18n.json @@ -396,6 +396,7 @@ "userProfile_repeatPassword_error": "Les deux mots de passe ne sont pas identiques.", "userProfile_savePassword": "Enregistrer", "userProfile_updatedPassword": "Votre mot de passe a été mis à jour", + "userProfile_loginProviders": "Comptes externes", "userProfile_linkProvider": "Associez un compte externe pour vous connecter à Pollen :", "choice_description_placeholder": "Vous pouvez saisir une description pour ce choix", "date-picker_today": "Aujourd'hui", @@ -942,6 +943,7 @@ "userProfile_repeatPassword_error": "The two passwords are not identical.", "userProfile_savePassword": "Save", "userProfile_updatedPassword": "Your password has been updated", + "userProfile_loginProviders": "External accounts", "userProfile_linkProvider": "Link an external account to connect to Pollen:", "choice_description_placeholder": "You can enter a description for this choice", "date-picker_today": "Today", diff --git a/pollen-ui-riot-js/src/main/web/tag/UserProfile.tag.html b/pollen-ui-riot-js/src/main/web/tag/UserProfile.tag.html index d036bbe2..3f30abfd 100644 --- a/pollen-ui-riot-js/src/main/web/tag/UserProfile.tag.html +++ b/pollen-ui-riot-js/src/main/web/tag/UserProfile.tag.html @@ -59,28 +59,6 @@ require("./components/HumanInput.tag.html"); {__.saveIdentity} </button> </div> - - <div> - <div each="{credential in user.credentials}" class="credential"> - <i if="{authService.providerIcons[credential.provider]}" - class="fa fa-{authService.providerIcons[credential.provider]}"></i> - <span if="{!authService.providerIcons[credential.provider]}">{credential.userName}</span> - <span>{credential.userName}</span> - <a if="{user.withPassword && user.email || user.credentials.length > 1}" - onclick="{unlinkProvider(credential.id)}">X</a> - </div> - </div> - - <div class="o-form-element align-center" if="{loginProviders.length > 0}"> - <p>{__.linkProvider}</p> - <p> - <a each="{loginProvider in loginProviders}" class="provider-link" - onclick="{linkProvider(loginProvider)}"> - <i class="fa fa-{authService.providerIcons[loginProvider]}" if="{authService.providerIcons[loginProvider]}"></i> - <span if="{!authService.providerIcons[loginProvider]}">{loginProvider}</span> - </a> - </p> - </div> </form> <form ref="password-form" class="password-form"> @@ -142,6 +120,32 @@ require("./components/HumanInput.tag.html"); </button> </div> </form> + + <div class="providers"> + <h3 class="c-heading"><i class="fa fa-sign-in"/> {__.loginProviders}</h3> + <div class="user-credentials"> + <div each="{credential, index in user.credentials}" class="user-credential {index % 2 == 0 ? 'even' : 'odd'}"> + <i if="{authService.providerIcons[credential.provider]}" + class="fa fa-{authService.providerIcons[credential.provider]}"></i> + <span if="{!authService.providerIcons[credential.provider]}">{credential.userName}</span> + <span class="credential-name">{credential.userName} <em if="{credential.emailAddress}">({credential.emailAddress})</em></span> + <button if="{user.withPassword && user.email || user.credentials.length > 1}" + onclick="{unlinkProvider(credential.id)}" class="c-button u-small c-button--error"><i class="fa fa-trash"></i></button> + </div> + </div> + + <div class="o-form-element align-center" if="{loginProviders.length > 0}"> + <p>{__.linkProvider}</p> + <p> + <a each="{loginProvider in loginProviders}" class="provider-link" + onclick="{linkProvider(loginProvider)}"> + <i class="fa fa-{authService.providerIcons[loginProvider]}" if="{authService.providerIcons[loginProvider]}"></i> + <span if="{!authService.providerIcons[loginProvider]}">{loginProvider}</span> + </a> + </p> + </div> + </div> + </div> </div> @@ -250,8 +254,29 @@ require("./components/HumanInput.tag.html"); padding: 0 5px; } - .credential { - font-size: 1.5em; + .providers { + padding: 0 10px; + } + + .user-credentials { + width: 100%; + } + + .user-credential { + display: flex; + justify-content: space-around; + align-items: center; + margin: 1px 0; + padding: 1px 5px; + } + + .user-credential.odd { + background-color: var(--list-alternate-row); + } + + .credential-name { + flex-grow: 1; + padding: 0 5px; } .provider-link { -- To stop receiving notification emails like this one, please contact chorem.org SCM administrator <admin+scm@chorem.org>.
This is an automated email from the git hooks/post-receive script. New commit to branch feature/1_socialauth in repository pollen. See https://gitlab.nuiton.org/chorem/pollen.git commit 445695a58820b7ddf47fe6a8a5630fbdb04b934d Author: Kevin Morin <morin@codelutin.com> Date: Thu Sep 7 11:01:10 2017 +0200 refs #1 gestion de la suppression des credentials --- pollen-ui-riot-js/src/main/web/i18n.json | 2 ++ pollen-ui-riot-js/src/main/web/tag/UserProfile.tag.html | 14 ++++++++++---- .../src/main/web/tag/admin/LoginProviders.tag.html | 2 +- 3 files changed, 13 insertions(+), 5 deletions(-) diff --git a/pollen-ui-riot-js/src/main/web/i18n.json b/pollen-ui-riot-js/src/main/web/i18n.json index b8010814..202ae6ca 100644 --- a/pollen-ui-riot-js/src/main/web/i18n.json +++ b/pollen-ui-riot-js/src/main/web/i18n.json @@ -398,6 +398,7 @@ "userProfile_updatedPassword": "Votre mot de passe a été mis à jour", "userProfile_loginProviders": "Comptes externes", "userProfile_linkProvider": "Associez un compte externe pour vous connecter à Pollen :", + "userProfile_unlinkProviderMessage": "Désassossier ce compte externe ? Vous ne pourrez plus vous connectez à votre compte Pollen avec ce compte externe.", "choice_description_placeholder": "Vous pouvez saisir une description pour ce choix", "date-picker_today": "Aujourd'hui", "date-picker_dateplaceholder": "Date", @@ -945,6 +946,7 @@ "userProfile_updatedPassword": "Your password has been updated", "userProfile_loginProviders": "External accounts", "userProfile_linkProvider": "Link an external account to connect to Pollen:", + "userProfile_unlinkProviderMessage": "Unlink this external account? You will not be able to connect to your Pollen account with this external account.", "choice_description_placeholder": "You can enter a description for this choice", "date-picker_today": "Today", "date-picker_dateplaceholder": "Date", diff --git a/pollen-ui-riot-js/src/main/web/tag/UserProfile.tag.html b/pollen-ui-riot-js/src/main/web/tag/UserProfile.tag.html index 3f30abfd..19256cf4 100644 --- a/pollen-ui-riot-js/src/main/web/tag/UserProfile.tag.html +++ b/pollen-ui-riot-js/src/main/web/tag/UserProfile.tag.html @@ -130,7 +130,7 @@ require("./components/HumanInput.tag.html"); <span if="{!authService.providerIcons[credential.provider]}">{credential.userName}</span> <span class="credential-name">{credential.userName} <em if="{credential.emailAddress}">({credential.emailAddress})</em></span> <button if="{user.withPassword && user.email || user.credentials.length > 1}" - onclick="{unlinkProvider(credential.id)}" class="c-button u-small c-button--error"><i class="fa fa-trash"></i></button> + onclick="{unlinkProvider(credential.id, index)}" class="c-button u-small c-button--error"><i class="fa fa-trash"></i></button> </div> </div> @@ -230,9 +230,15 @@ require("./components/HumanInput.tag.html"); }); }; - this.unlinkProvider = (credentialId) => (e) => { - userService.unlinkProvider(this.user.id, credentialId).then(result => { - console.log("ok"); + this.unlinkProvider = (credentialId, index) => (e) => { + this.confirm(this.__.unlinkProviderMessage).then((confirm) => { + if (!confirm) { + return Promise.reject(); + } + return userService.unlinkProvider(this.user.id, credentialId) + }).then(result => { + this.user.credentials.splice(index, 1); + this.update(); }); }; diff --git a/pollen-ui-riot-js/src/main/web/tag/admin/LoginProviders.tag.html b/pollen-ui-riot-js/src/main/web/tag/admin/LoginProviders.tag.html index 29e16779..883c0b24 100644 --- a/pollen-ui-riot-js/src/main/web/tag/admin/LoginProviders.tag.html +++ b/pollen-ui-riot-js/src/main/web/tag/admin/LoginProviders.tag.html @@ -87,7 +87,7 @@ require("../components/HumanInput.tag.html"); if (!confirm) { return Promise.reject(); } - if (confirm && loginProvider.id) { + if (loginProvider.id) { return authService.deleteLoginProvider(loginProvider); } }) -- To stop receiving notification emails like this one, please contact chorem.org SCM administrator <admin+scm@chorem.org>.
participants (1)
-
chorem.org scm