Skip to content

Commit

Permalink
Merge pull request #1 from umbraco/v8/contrib
Browse files Browse the repository at this point in the history
Merge upstream changes into OwainJ fork
  • Loading branch information
OwainJ authored Oct 19, 2020
2 parents 2de04b3 + cb60eeb commit 12a97d0
Show file tree
Hide file tree
Showing 304 changed files with 5,786 additions and 1,468 deletions.
2 changes: 1 addition & 1 deletion .github/CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -128,7 +128,7 @@ In order to build the Umbraco source code locally, first make sure you have the
* npm v6.4.1+ (installed with Node.js)
* [Git command line](https://git-scm.com/download/)

The easiest way to get started is to open `src\umbraco.sln` in Visual Studio 2017 (version 15.9.7 or higher, [the community edition is free](https://www.visualstudio.com/thank-you-downloading-visual-studio/?sku=Community&rel=15) for you to use to contribute to Open Source projects). In Visual Studio, find the Task Runner Explorer (in the View menu under Other Windows) and run the build task under the gulpfile.
The easiest way to get started is to open `src\umbraco.sln` in Visual Studio 2019 (version 16.3 or higher, [the community edition is free](https://www.visualstudio.com/thank-you-downloading-visual-studio/?sku=Community&rel=15) for you to use to contribute to Open Source projects). In Visual Studio, find the Task Runner Explorer (in the View menu under Other Windows) and run the build task under the gulpfile.

Alternatively, you can run `build.ps1` from the Powershell command line, which will build both the backoffice (also known as "Belle") and the Umbraco core. You can then easily start debugging from Visual Studio, or if you need to debug Belle you can run `gulp dev` in `src\Umbraco.Web.UI.Client`. See [this page](BUILD.md) for more details.

Expand Down
4 changes: 2 additions & 2 deletions src/SolutionInfo.cs
Original file line number Diff line number Diff line change
Expand Up @@ -18,5 +18,5 @@
[assembly: AssemblyVersion("8.0.0")]

// these are FYI and changed automatically
[assembly: AssemblyFileVersion("8.8.0")]
[assembly: AssemblyInformationalVersion("8.8.0")]
[assembly: AssemblyFileVersion("8.9.0")]
[assembly: AssemblyInformationalVersion("8.9.0-rc")]
2 changes: 1 addition & 1 deletion src/Umbraco.Core/CompositionExtensions.cs
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,7 @@ public static PropertyValueConverterCollectionBuilder PropertyValueConverters(th
=> composition.WithCollectionBuilder<PropertyValueConverterCollectionBuilder>();

/// <summary>
/// Gets the url segment providers collection builder.
/// Gets the URL segment providers collection builder.
/// </summary>
/// <param name="composition">The composition.</param>
public static UrlSegmentProviderCollectionBuilder UrlSegmentProviders(this Composition composition)
Expand Down
8 changes: 4 additions & 4 deletions src/Umbraco.Core/Configuration/GlobalSettings.cs
Original file line number Diff line number Diff line change
Expand Up @@ -68,9 +68,9 @@ public static bool HasSmtpServerConfigured(string appPath)
internal static bool? HasSmtpServer { get; set; }

/// <summary>
/// Gets the reserved urls from web.config.
/// Gets the reserved URLs from web.config.
/// </summary>
/// <value>The reserved urls.</value>
/// <value>The reserved URLs.</value>
public string ReservedUrls
{
get
Expand Down Expand Up @@ -354,10 +354,10 @@ public string DefaultUILanguage
}

/// <summary>
/// Gets a value indicating whether umbraco should hide top level nodes from generated urls.
/// Gets a value indicating whether umbraco should hide top level nodes from generated URLs.
/// </summary>
/// <value>
/// <c>true</c> if umbraco hides top level nodes from urls; otherwise, <c>false</c>.
/// <c>true</c> if umbraco hides top level nodes from URLs; otherwise, <c>false</c>.
/// </value>
public bool HideTopLevelNodeFromPath
{
Expand Down
8 changes: 4 additions & 4 deletions src/Umbraco.Core/Configuration/IGlobalSettings.cs
Original file line number Diff line number Diff line change
Expand Up @@ -6,9 +6,9 @@
public interface IGlobalSettings
{
/// <summary>
/// Gets the reserved urls from web.config.
/// Gets the reserved URLs from web.config.
/// </summary>
/// <value>The reserved urls.</value>
/// <value>The reserved URLs.</value>
string ReservedUrls { get; }

/// <summary>
Expand Down Expand Up @@ -45,10 +45,10 @@ public interface IGlobalSettings
string DefaultUILanguage { get; }

/// <summary>
/// Gets a value indicating whether umbraco should hide top level nodes from generated urls.
/// Gets a value indicating whether umbraco should hide top level nodes from generated URLs.
/// </summary>
/// <value>
/// <c>true</c> if umbraco hides top level nodes from urls; otherwise, <c>false</c>.
/// <c>true</c> if umbraco hides top level nodes from URLs; otherwise, <c>false</c>.
/// </value>
bool HideTopLevelNodeFromPath { get; }

Expand Down
4 changes: 2 additions & 2 deletions src/Umbraco.Core/Constants-AppSettings.cs
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,7 @@ public static class AppSettings
public const string MediaPath = "umbracoMediaPath";

/// <summary>
/// The reserved urls from web.config.
/// The reserved URLs from web.config.
/// </summary>
public const string ReservedUrls = "Umbraco.Core.ReservedUrls";

Expand Down Expand Up @@ -101,7 +101,7 @@ public static class AppSettings
public const string DefaultUILanguage = "Umbraco.Core.DefaultUILanguage";

/// <summary>
/// A true/false value indicating whether umbraco should hide top level nodes from generated urls.
/// A true/false value indicating whether umbraco should hide top level nodes from generated URLs.
/// </summary>
public const string HideTopLevelNodeFromPath = "Umbraco.Core.HideTopLevelNodeFromPath";

Expand Down
2 changes: 1 addition & 1 deletion src/Umbraco.Core/Constants-PropertyEditors.cs
Original file line number Diff line number Diff line change
Expand Up @@ -192,7 +192,7 @@ public static class Aliases
public const string NestedContent = "Umbraco.NestedContent";

/// <summary>
/// Alias for the multi url picker editor.
/// Alias for the multi URL picker editor.
/// </summary>
public const string MultiUrlPicker = "Umbraco.MultiUrlPicker";
}
Expand Down
2 changes: 2 additions & 0 deletions src/Umbraco.Core/Constants-Security.cs
Original file line number Diff line number Diff line change
Expand Up @@ -56,6 +56,8 @@ public static class Security
public const string AllowedApplicationsClaimType = "http://umbraco.org/2015/02/identity/claims/backoffice/allowedapp";
public const string SessionIdClaimType = "http://umbraco.org/2015/02/identity/claims/backoffice/sessionid";

public const string BackOfficeExternalLoginOptionsProperty = "UmbracoBackOfficeExternalLoginOptions";

}
}
}
4 changes: 2 additions & 2 deletions src/Umbraco.Core/GuidUdi.cs
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ public GuidUdi(Uri uriValue)
{
Guid guid;
if (Guid.TryParse(uriValue.AbsolutePath.TrimStart('/'), out guid) == false)
throw new FormatException("Url \"" + uriValue + "\" is not a guid entity id.");
throw new FormatException("URI \"" + uriValue + "\" is not a GUID entity ID.");

Guid = guid;
}
Expand All @@ -48,7 +48,7 @@ public GuidUdi(Uri uriValue)
{
var udi = Udi.Parse(s);
if (udi is GuidUdi == false)
throw new FormatException("String \"" + s + "\" is not a guid entity id.");
throw new FormatException("String \"" + s + "\" is not a GUID entity id.");

return (GuidUdi) udi;
}
Expand Down
8 changes: 4 additions & 4 deletions src/Umbraco.Core/IO/IFileSystem.cs
Original file line number Diff line number Diff line change
Expand Up @@ -102,7 +102,7 @@ public interface IFileSystem
/// <summary>
/// Returns the application relative path to the file.
/// </summary>
/// <param name="fullPathOrUrl">The full path or url.</param>
/// <param name="fullPathOrUrl">The full path or URL.</param>
/// <returns>
/// The <see cref="string"/> representing the relative path.
/// </returns>
Expand All @@ -118,11 +118,11 @@ public interface IFileSystem
string GetFullPath(string path);

/// <summary>
/// Returns the application relative url to the file.
/// Returns the application relative URL to the file.
/// </summary>
/// <param name="path">The path to return the url for.</param>
/// <param name="path">The path to return the URL for.</param>
/// <returns>
/// <see cref="string"/> representing the relative url.
/// <see cref="string"/> representing the relative URL.
/// </returns>
string GetUrl(string path);

Expand Down
16 changes: 8 additions & 8 deletions src/Umbraco.Core/IO/PhysicalFileSystem.cs
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ public class PhysicalFileSystem : IFileSystem
// (is used in GetRelativePath)
private readonly string _rootPathFwd;

// the relative url, using url separator chars, NOT ending with a separator
// the relative URL, using URL separator chars, NOT ending with a separator
// eg "" or "/Views" or "/Media" or "/<vpath>/Media" in case of a virtual path
private readonly string _rootUrl;

Expand Down Expand Up @@ -243,20 +243,20 @@ public bool FileExists(string path)
}

/// <summary>
/// Gets the filesystem-relative path of a full path or of an url.
/// Gets the filesystem-relative path of a full path or of an URL.
/// </summary>
/// <param name="fullPathOrUrl">The full path or url.</param>
/// <param name="fullPathOrUrl">The full path or URL.</param>
/// <returns>The path, relative to this filesystem's root.</returns>
/// <remarks>
/// <para>The relative path is relative to this filesystem's root, not starting with any
/// directory separator. All separators are forward-slashes.</para>
/// </remarks>
public string GetRelativePath(string fullPathOrUrl)
{
// test url
var path = fullPathOrUrl.Replace('\\', '/'); // ensure url separator char
// test URL
var path = fullPathOrUrl.Replace('\\', '/'); // ensure URL separator char

// if it starts with the root url, strip it and trim the starting slash to make it relative
// if it starts with the root URL, strip it and trim the starting slash to make it relative
// eg "/Media/1234/img.jpg" => "1234/img.jpg"
if (IOHelper.PathStartsWith(path, _rootUrl, '/'))
return path.Substring(_rootUrl.Length).TrimStart('/');
Expand Down Expand Up @@ -319,10 +319,10 @@ public string GetFullPath(string path)
}

/// <summary>
/// Gets the url.
/// Gets the URL.
/// </summary>
/// <param name="path">The filesystem-relative path.</param>
/// <returns>The url.</returns>
/// <returns>The URL.</returns>
/// <remarks>All separators are forward-slashes.</remarks>
public string GetUrl(string path)
{
Expand Down
2 changes: 1 addition & 1 deletion src/Umbraco.Core/IRuntimeState.cs
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ public interface IRuntimeState
ServerRole ServerRole { get; }

/// <summary>
/// Gets the Umbraco application url.
/// Gets the Umbraco application URL.
/// </summary>
/// <remarks>This is eg "http://www.example.com".</remarks>
Uri ApplicationUrl { get; }
Expand Down
2 changes: 1 addition & 1 deletion src/Umbraco.Core/Media/IEmbedProvider.cs
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ public interface IEmbedProvider
string[] UrlSchemeRegex { get; }

/// <summary>
/// A collection of querystring request parameters to append to the API Url
/// A collection of querystring request parameters to append to the API URL
/// </summary>
/// <example>?key=value&key2=value2</example>
Dictionary<string, string> RequestParams { get; }
Expand Down
12 changes: 8 additions & 4 deletions src/Umbraco.Core/Migrations/Upgrade/UmbracoPlan.cs
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
using Umbraco.Core.Migrations.Upgrade.V_8_0_1;
using Umbraco.Core.Migrations.Upgrade.V_8_1_0;
using Umbraco.Core.Migrations.Upgrade.V_8_6_0;
using Umbraco.Core.Migrations.Upgrade.V_8_9_0;

namespace Umbraco.Core.Migrations.Upgrade
{
Expand Down Expand Up @@ -175,24 +176,27 @@ protected void DefinePlan()
To<MergeDateAndDateTimePropertyEditor>("{78BAF571-90D0-4D28-8175-EF96316DA789}");
// release-8.0.0

// to 8.0.1...
// to 8.0.1
To<ChangeNuCacheJsonFormat>("{80C0A0CB-0DD5-4573-B000-C4B7C313C70D}");
// release-8.0.1

// to 8.1.0...
// to 8.1.0
To<ConvertTinyMceAndGridMediaUrlsToLocalLink>("{B69B6E8C-A769-4044-A27E-4A4E18D1645A}");
To<RenameUserLoginDtoDateIndex>("{0372A42B-DECF-498D-B4D1-6379E907EB94}");
To<FixContentNuCascade>("{5B1E0D93-F5A3-449B-84BA-65366B84E2D4}");

// to 8.6.0...
// to 8.6.0
To<UpdateRelationTypeTable>("{4759A294-9860-46BC-99F9-B4C975CAE580}");
To<AddNewRelationTypes>("{0BC866BC-0665-487A-9913-0290BD0169AD}");
To<AddPropertyTypeValidationMessageColumns>("{3D67D2C8-5E65-47D0-A9E1-DC2EE0779D6B}");
To<MissingContentVersionsIndexes>("{EE288A91-531B-4995-8179-1D62D9AA3E2E}");
To<AddMainDomLock>("{2AB29964-02A1-474D-BD6B-72148D2A53A2}");

// to 8.7.0...
// to 8.7.0
To<MissingDictionaryIndex>("{a78e3369-8ea3-40ec-ad3f-5f76929d2b20}");

// to 8.9.0
To<ExternalLoginTableUserData>("{B5838FF5-1D22-4F6C-BCEB-F83ACB14B575}");

//FINAL
}
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
using Umbraco.Core.Persistence.Dtos;

namespace Umbraco.Core.Migrations.Upgrade.V_8_9_0
{
public class ExternalLoginTableUserData : MigrationBase
{
public ExternalLoginTableUserData(IMigrationContext context)
: base(context)
{
}

/// <summary>
/// Adds new column to the External Login table
/// </summary>
public override void Migrate()
{
AddColumn<ExternalLoginDto>(Constants.DatabaseSchema.Tables.ExternalLogin, "userData");
}
}
}
2 changes: 1 addition & 1 deletion src/Umbraco.Core/Models/Entities/IMediaEntitySlim.cs
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ public interface IMediaEntitySlim : IContentEntitySlim
{

/// <summary>
/// The media file's path/url
/// The media file's path/URL
/// </summary>
string MediaPath { get; }
}
Expand Down
6 changes: 3 additions & 3 deletions src/Umbraco.Core/Models/IRedirectUrl.cs
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
namespace Umbraco.Core.Models
{
/// <summary>
/// Represents a redirect url.
/// Represents a redirect URL.
/// </summary>
public interface IRedirectUrl : IEntity, IRememberBeingDirty
{
Expand All @@ -22,7 +22,7 @@ public interface IRedirectUrl : IEntity, IRememberBeingDirty
Guid ContentKey { get; set; }

/// <summary>
/// Gets or sets the redirect url creation date.
/// Gets or sets the redirect URL creation date.
/// </summary>
[DataMember]
DateTime CreateDateUtc { get; set; }
Expand All @@ -34,7 +34,7 @@ public interface IRedirectUrl : IEntity, IRememberBeingDirty
string Culture { get; set; }

/// <summary>
/// Gets or sets the redirect url route.
/// Gets or sets the redirect URL route.
/// </summary>
/// <remarks>Is a proper Umbraco route eg /path/to/foo or 123/path/tofoo.</remarks>
[DataMember]
Expand Down
15 changes: 11 additions & 4 deletions src/Umbraco.Core/Models/Identity/BackOfficeIdentityUser.cs
Original file line number Diff line number Diff line change
Expand Up @@ -275,16 +275,23 @@ public override ICollection<IIdentityUserLogin> Logins
{
get
{
if (_getLogins != null && _getLogins.IsValueCreated == false)
// return if it exists
if (_logins != null) return _logins;

_logins = new ObservableCollection<IIdentityUserLogin>();

// if the callback is there and hasn't been created yet then execute it and populate the logins
if (_getLogins != null && !_getLogins.IsValueCreated)
{
_logins = new ObservableCollection<IIdentityUserLogin>();
foreach (var l in _getLogins.Value)
{
_logins.Add(l);
}
//now assign events
_logins.CollectionChanged += Logins_CollectionChanged;
}

//now assign events
_logins.CollectionChanged += Logins_CollectionChanged;

return _logins;
}
}
Expand Down
24 changes: 24 additions & 0 deletions src/Umbraco.Core/Models/Identity/ExternalLogin.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
using System;

namespace Umbraco.Core.Models.Identity
{
/// <inheritdoc />
public class ExternalLogin : IExternalLogin
{
public ExternalLogin(string loginProvider, string providerKey, string userData = null)
{
LoginProvider = loginProvider ?? throw new ArgumentNullException(nameof(loginProvider));
ProviderKey = providerKey ?? throw new ArgumentNullException(nameof(providerKey));
UserData = userData;
}

/// <inheritdoc />
public string LoginProvider { get; }

/// <inheritdoc />
public string ProviderKey { get; }

/// <inheritdoc />
public string UserData { get; }
}
}
12 changes: 12 additions & 0 deletions src/Umbraco.Core/Models/Identity/IExternalLogin.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
namespace Umbraco.Core.Models.Identity
{
/// <summary>
/// Used to persist external login data for a user
/// </summary>
public interface IExternalLogin
{
string LoginProvider { get; }
string ProviderKey { get; }
string UserData { get; }
}
}
Loading

0 comments on commit 12a97d0

Please sign in to comment.