Merge branch 'v8/8.9' into v8/dev
# Conflicts: # src/SolutionInfo.cs
This commit is contained in:
@@ -18,5 +18,5 @@ using System.Resources;
|
||||
[assembly: AssemblyVersion("8.0.0")]
|
||||
|
||||
// these are FYI and changed automatically
|
||||
[assembly: AssemblyFileVersion("8.9.0")]
|
||||
[assembly: AssemblyInformationalVersion("8.9.0-rc")]
|
||||
[assembly: AssemblyFileVersion("8.9.1")]
|
||||
[assembly: AssemblyInformationalVersion("8.9.1")]
|
||||
|
||||
@@ -9,13 +9,13 @@ namespace Umbraco.Core.Services
|
||||
/// Gets an IconModel containing the icon name and SvgString according to an icon name found at the global icons path
|
||||
/// </summary>
|
||||
/// <param name="iconName"></param>
|
||||
/// <returns><see cref="IconModel"/></returns>
|
||||
/// <returns></returns>
|
||||
IconModel GetIcon(string iconName);
|
||||
|
||||
/// <summary>
|
||||
/// Gets a list of all svg icons found at at the global icons path.
|
||||
/// </summary>
|
||||
/// <returns>A list of <see cref="IconModel"/></returns>
|
||||
/// <returns></returns>
|
||||
IList<IconModel> GetAllIcons();
|
||||
}
|
||||
}
|
||||
|
||||
@@ -164,7 +164,7 @@
|
||||
|
||||
function inviteSavePassword() {
|
||||
|
||||
if (formHelper.submitForm({ scope: $scope })) {
|
||||
if (formHelper.submitForm({ scope: $scope, formCtrl: vm.inviteUserPasswordForm })) {
|
||||
|
||||
vm.invitedUserPasswordModel.buttonState = "busy";
|
||||
|
||||
@@ -172,7 +172,7 @@
|
||||
.then(function (data) {
|
||||
|
||||
//success
|
||||
formHelper.resetForm({ scope: $scope });
|
||||
formHelper.resetForm({ scope: $scope, formCtrl: vm.inviteUserPasswordForm });
|
||||
vm.invitedUserPasswordModel.buttonState = "success";
|
||||
//set the user and set them as logged in
|
||||
vm.invitedUser = data;
|
||||
@@ -181,7 +181,7 @@
|
||||
vm.inviteStep = 2;
|
||||
|
||||
}, function (err) {
|
||||
formHelper.resetForm({ scope: $scope, hasErrors: true });
|
||||
formHelper.resetForm({ scope: $scope, hasErrors: true, formCtrl: vm.inviteUserPasswordForm });
|
||||
formHelper.handleError(err);
|
||||
vm.invitedUserPasswordModel.buttonState = "error";
|
||||
});
|
||||
|
||||
@@ -14,7 +14,7 @@ function externalLoginInfoService(externalLoginInfo, umbRequestHelper) {
|
||||
}
|
||||
|
||||
function getLoginProviderView(provider) {
|
||||
if (provider && provider.properties.UmbracoBackOfficeExternalLoginOptions && provider.properties.UmbracoBackOfficeExternalLoginOptions.CustomBackOfficeView) {
|
||||
if (provider && provider.properties && provider.properties.UmbracoBackOfficeExternalLoginOptions && provider.properties.UmbracoBackOfficeExternalLoginOptions.CustomBackOfficeView) {
|
||||
return umbRequestHelper.convertVirtualToAbsolutePath(provider.properties.UmbracoBackOfficeExternalLoginOptions.CustomBackOfficeView);
|
||||
}
|
||||
return null;
|
||||
@@ -26,10 +26,10 @@ function externalLoginInfoService(externalLoginInfo, umbRequestHelper) {
|
||||
*/
|
||||
function hasDenyLocalLogin(provider) {
|
||||
if (!provider) {
|
||||
return _.some(externalLoginInfo.providers, x => x.properties.UmbracoBackOfficeExternalLoginOptions.DenyLocalLogin === true);
|
||||
return _.some(externalLoginInfo.providers, x => x.properties && x.properties.UmbracoBackOfficeExternalLoginOptions && (x.properties.UmbracoBackOfficeExternalLoginOptions.DenyLocalLogin === true));
|
||||
}
|
||||
else {
|
||||
return provider.properties.UmbracoBackOfficeExternalLoginOptions.DenyLocalLogin;
|
||||
return provider && provider.properties && provider.properties.UmbracoBackOfficeExternalLoginOptions && (provider.properties.UmbracoBackOfficeExternalLoginOptions.DenyLocalLogin === true);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -10,7 +10,7 @@
|
||||
|
||||
<div ng-if="!vm.denyLocalLogin" ng-show="vm.invitedUser != null" class="umb-login-container">
|
||||
|
||||
<form name="inviteUserPasswordForm" novalidate="" ng-submit="vm.inviteSavePassword()" val-form-manager>
|
||||
<form name="vm.inviteUserPasswordForm" novalidate="" ng-submit="vm.inviteSavePassword()" val-form-manager>
|
||||
<div class="form" ng-if="vm.inviteStep === 1">
|
||||
<h1 style="margin-bottom: 10px; text-align: left;">Hi, {{vm.invitedUser.name}}</h1>
|
||||
<p style="line-height: 1.6; margin-bottom: 25px;">
|
||||
@@ -79,7 +79,7 @@
|
||||
size="xl"
|
||||
unknown-char="+"
|
||||
img-src="{{vm.invitedUser.avatars[3]}}"
|
||||
img-srcset="{{vm.invitedUser.avatars[4]}} 2x, {{invitedUser.avatars[4]}} 3x">
|
||||
img-srcset="{{vm.invitedUser.avatars[4]}} 2x, {{vm.invitedUser.avatars[4]}} 3x">
|
||||
</umb-avatar>
|
||||
</a>
|
||||
|
||||
|
||||
@@ -346,9 +346,9 @@
|
||||
<WebProjectProperties>
|
||||
<UseIIS>False</UseIIS>
|
||||
<AutoAssignPort>True</AutoAssignPort>
|
||||
<DevelopmentServerPort>8900</DevelopmentServerPort>
|
||||
<DevelopmentServerPort>8910</DevelopmentServerPort>
|
||||
<DevelopmentServerVPath>/</DevelopmentServerVPath>
|
||||
<IISUrl>http://localhost:8900</IISUrl>
|
||||
<IISUrl>http://localhost:8910</IISUrl>
|
||||
<NTLMAuthentication>False</NTLMAuthentication>
|
||||
<UseCustomServer>False</UseCustomServer>
|
||||
<CustomServerUrl>
|
||||
|
||||
@@ -72,7 +72,7 @@
|
||||
you must configure your SMTP settings here - for example:
|
||||
-->
|
||||
<!--
|
||||
<smtp from="noreply@example.com">
|
||||
<smtp from="noreply@example.com" deliveryMethod="Network">
|
||||
<network host="localhost" port="25" enableSsl="false" userName="" password="" />
|
||||
</smtp>
|
||||
-->
|
||||
|
||||
@@ -19,11 +19,13 @@ namespace Umbraco.Web.Services
|
||||
_globalSettings = globalSettings;
|
||||
}
|
||||
|
||||
|
||||
/// <inheritdoc />
|
||||
public IList<IconModel> GetAllIcons()
|
||||
{
|
||||
var icons = new List<IconModel>();
|
||||
var iconNames = GetAllIconNames();
|
||||
var directory = new DirectoryInfo(IOHelper.MapPath($"{_globalSettings.IconsPath}/"));
|
||||
var iconNames = directory.GetFiles("*.svg");
|
||||
|
||||
iconNames.OrderBy(f => f.Name).ToList().ForEach(iconInfo =>
|
||||
{
|
||||
@@ -43,56 +45,36 @@ namespace Umbraco.Web.Services
|
||||
{
|
||||
return string.IsNullOrWhiteSpace(iconName)
|
||||
? null
|
||||
: CreateIconModel(iconName.StripFileExtension());
|
||||
: CreateIconModel(iconName.StripFileExtension(), IOHelper.MapPath($"{_globalSettings.IconsPath}/{iconName}.svg"));
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Gets an IconModel using values from a FileInfo model
|
||||
/// </summary>
|
||||
/// <param name="fileInfo"></param>
|
||||
/// <returns><see cref="IconModel"/></returns>
|
||||
private IconModel GetIcon(FileSystemInfo fileInfo)
|
||||
/// <returns></returns>
|
||||
private IconModel GetIcon(FileInfo fileInfo)
|
||||
{
|
||||
return fileInfo == null || string.IsNullOrWhiteSpace(fileInfo.Name)
|
||||
? null
|
||||
: CreateIconModel(fileInfo.Name.StripFileExtension(), fileInfo.FullName);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Gets an IconModel containing the icon name and SvgString
|
||||
/// </summary>
|
||||
/// <param name="iconName"></param>
|
||||
/// <returns><see cref="IconModel"/></returns>
|
||||
private IconModel CreateIconModel(string iconName)
|
||||
{
|
||||
if (string.IsNullOrWhiteSpace(iconName))
|
||||
return null;
|
||||
|
||||
var iconNames = GetAllIconNames();
|
||||
var iconPath = iconNames.FirstOrDefault(x => x.Name.InvariantEquals($"{iconName}.svg"))?.FullName;
|
||||
return iconPath == null
|
||||
? null
|
||||
: CreateIconModel(iconName, iconPath);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Gets an IconModel containing the icon name and SvgString
|
||||
/// </summary>
|
||||
/// <param name="iconName"></param>
|
||||
/// <param name="iconPath"></param>
|
||||
/// <returns><see cref="IconModel"/></returns>
|
||||
private static IconModel CreateIconModel(string iconName, string iconPath)
|
||||
/// <returns></returns>
|
||||
private IconModel CreateIconModel(string iconName, string iconPath)
|
||||
{
|
||||
if (string.IsNullOrWhiteSpace(iconPath))
|
||||
return null;
|
||||
var sanitizer = new HtmlSanitizer();
|
||||
sanitizer.AllowedAttributes.UnionWith(Constants.SvgSanitizer.Attributes);
|
||||
sanitizer.AllowedCssProperties.UnionWith(Constants.SvgSanitizer.Attributes);
|
||||
sanitizer.AllowedTags.UnionWith(Constants.SvgSanitizer.Tags);
|
||||
|
||||
try
|
||||
{
|
||||
var sanitizer = new HtmlSanitizer();
|
||||
sanitizer.AllowedAttributes.UnionWith(Constants.SvgSanitizer.Attributes);
|
||||
sanitizer.AllowedCssProperties.UnionWith(Constants.SvgSanitizer.Attributes);
|
||||
sanitizer.AllowedTags.UnionWith(Constants.SvgSanitizer.Tags);
|
||||
|
||||
var svgContent = System.IO.File.ReadAllText(iconPath);
|
||||
var sanitizedString = sanitizer.Sanitize(svgContent);
|
||||
|
||||
@@ -109,26 +91,5 @@ namespace Umbraco.Web.Services
|
||||
return null;
|
||||
}
|
||||
}
|
||||
|
||||
private IEnumerable<FileInfo> GetAllIconNames()
|
||||
{
|
||||
// add icons from plugins
|
||||
var appPlugins = new DirectoryInfo(IOHelper.MapPath(SystemDirectories.AppPlugins));
|
||||
var pluginIcons = appPlugins.Exists == false
|
||||
? new List<FileInfo>()
|
||||
: appPlugins.GetDirectories()
|
||||
// Find all directories in App_Plugins that are named "Icons" and get a list of SVGs from them
|
||||
.SelectMany(x => x.GetDirectories("Icons", SearchOption.AllDirectories))
|
||||
.SelectMany(x => x.GetFiles("*.svg", SearchOption.TopDirectoryOnly));
|
||||
|
||||
// add icons from IconsPath if not already added from plugins
|
||||
var directory = new DirectoryInfo(IOHelper.MapPath($"{_globalSettings.IconsPath}/"));
|
||||
var iconNames = directory.GetFiles("*.svg")
|
||||
.Where(x => pluginIcons.Any(i => i.Name == x.Name) == false);
|
||||
|
||||
iconNames = iconNames.Concat(pluginIcons).ToList();
|
||||
|
||||
return iconNames;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user