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>.