Fixes testing custom invite user flow and the AllowManualLinking setting for external providers

This commit is contained in:
Shannon
2020-09-07 18:46:38 +10:00
parent f2b8f355e1
commit af53f27bc3
5 changed files with 14 additions and 7 deletions

View File

@@ -40,7 +40,7 @@ function externalLoginInfoService(externalLoginInfo, umbRequestHelper) {
*/
function getLoginProviders(excludeUnlinkable) {
if (excludeUnlinkable) {
return _.filter(externalLoginInfo.providers, x => !x.properties.UmbracoBackOfficeExternalLoginOptions.AutoLinkOptions.AllowManualLinking);
return _.filter(externalLoginInfo.providers, x => x.properties.ExternalSignInAutoLinkOptions.AllowManualLinking);
}
else {
return externalLoginInfo.providers;

View File

@@ -50,7 +50,7 @@
<div ng-repeat="login in externalLoginProviders">
<div ng-if="!login.properties.UmbracoBackOfficeExternalLoginOptions.DenyLocalLogin">
<div ng-if="login.properties.ExternalSignInAutoLinkOptions.AllowManualLinking">
<form ng-submit="linkProvider($event)" ng-if="login.linkedProviderKey == undefined" method="POST" action="{{externalLinkLoginFormAction}}" name="oauthloginform" id="oauthloginform-{{login.authType}}">
<input type="hidden" name="provider" value="{{login.authType}}" />
<button class="btn btn-block btn-social"

View File

@@ -88,6 +88,7 @@
// Don't show the invite button if no email is configured
if (Umbraco.Sys.ServerVariables.umbracoSettings.showUserInvite) {
vm.defaultButton = {
type: "button",
labelKey: "user_inviteUser",
handler: function () {
vm.setUsersViewState('inviteUser');

View File

@@ -517,7 +517,7 @@
size="m">
</umb-button>
<umb-button
ng-if-="vm.newUser.id"
ng-if="vm.newUser.id"
type="button"
button-style="action"
label-key="user_goToProfile"

View File

@@ -22,9 +22,9 @@ namespace Umbraco.Web.Editors.Filters
if (objectContent != null)
{
var model = objectContent.Value as UserBasic;
if (model != null)
if (model != null && model.Id is int userId)
{
model.IsCurrentUser = (int) model.Id == user.Id;
model.IsCurrentUser = userId == user.Id;
}
else
{
@@ -33,7 +33,10 @@ namespace Umbraco.Web.Editors.Filters
{
foreach (var userBasic in collection)
{
userBasic.IsCurrentUser = (int) userBasic.Id == user.Id;
if (userBasic.Id is int uid)
{
userBasic.IsCurrentUser = uid == user.Id;
}
}
}
else
@@ -43,7 +46,10 @@ namespace Umbraco.Web.Editors.Filters
{
foreach (var userBasic in paged.Items)
{
userBasic.IsCurrentUser = (int)userBasic.Id == user.Id;
if (userBasic.Id is int uid)
{
userBasic.IsCurrentUser = uid == user.Id;
}
}
}
}