forked from umbraco/Umbraco-CMS
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'v8/dev' into v8/contrib
# Conflicts: # src/Umbraco.Web.UI.Client/package.json # src/Umbraco.Web.UI.Client/src/common/directives/components/content/umbvariantcontenteditors.directive.js # src/Umbraco.Web.UI.Client/src/common/directives/validation/valformmanager.directive.js # src/Umbraco.Web.UI.Client/src/common/services/formhelper.service.js # src/Umbraco.Web.UI.Client/src/views/components/overlays/umb-overlay.html # src/Umbraco.Web.UI.Client/src/views/content/overlays/publishdescendants.controller.js # src/Umbraco.Web.UI.Client/src/views/content/overlays/publishdescendants.html # src/Umbraco.Web.UI.Client/src/views/dictionary/edit.html # src/Umbraco.Web.UI/Umbraco/config/lang/en.xml
- Loading branch information
Showing
245 changed files
with
30,032 additions
and
4,209 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,40 +1,43 @@ | ||
# editorconfig.org | ||
|
||
# top-most EditorConfig file | ||
root = true | ||
|
||
# Default settings: | ||
# A newline ending every file | ||
# Use 4 spaces as indentation | ||
[*] | ||
insert_final_newline = true | ||
end_of_line = crlf | ||
indent_style = space | ||
indent_size = 4 | ||
|
||
# Trim trailing whitespace, limited support. | ||
# https://github.com/editorconfig/editorconfig/wiki/Property-research:-Trim-trailing-spaces | ||
trim_trailing_whitespace = true | ||
|
||
[*.{cs,vb}] | ||
dotnet_style_predefined_type_for_locals_parameters_members = true:error | ||
|
||
dotnet_naming_rule.private_members_with_underscore.symbols = private_fields | ||
dotnet_naming_rule.private_members_with_underscore.style = prefix_underscore | ||
dotnet_naming_rule.private_members_with_underscore.severity = suggestion | ||
|
||
dotnet_naming_symbols.private_fields.applicable_kinds = field | ||
dotnet_naming_symbols.private_fields.applicable_accessibilities = private | ||
|
||
dotnet_naming_style.prefix_underscore.capitalization = camel_case | ||
dotnet_naming_style.prefix_underscore.required_prefix = _ | ||
|
||
# https://github.com/MicrosoftDocs/visualstudio-docs/blob/master/docs/ide/editorconfig-code-style-settings-reference.md | ||
[*.cs] | ||
csharp_style_var_for_built_in_types = true:suggestion | ||
csharp_style_var_when_type_is_apparent = true:suggestion | ||
csharp_style_var_elsewhere = true:suggestion | ||
# editorconfig.org | ||
|
||
# top-most EditorConfig file | ||
root = true | ||
|
||
# Default settings: | ||
# A newline ending every file | ||
# Use 4 spaces as indentation | ||
[*] | ||
insert_final_newline = true | ||
end_of_line = crlf | ||
indent_style = space | ||
indent_size = 4 | ||
|
||
# Trim trailing whitespace, limited support. | ||
# https://github.com/editorconfig/editorconfig/wiki/Property-research:-Trim-trailing-spaces | ||
trim_trailing_whitespace = true | ||
|
||
[*.{cs,vb}] | ||
dotnet_style_predefined_type_for_locals_parameters_members = true:error | ||
|
||
dotnet_naming_rule.private_members_with_underscore.symbols = private_fields | ||
dotnet_naming_rule.private_members_with_underscore.style = prefix_underscore | ||
dotnet_naming_rule.private_members_with_underscore.severity = suggestion | ||
|
||
dotnet_naming_symbols.private_fields.applicable_kinds = field | ||
dotnet_naming_symbols.private_fields.applicable_accessibilities = private | ||
|
||
dotnet_naming_style.prefix_underscore.capitalization = camel_case | ||
dotnet_naming_style.prefix_underscore.required_prefix = _ | ||
|
||
# https://github.com/MicrosoftDocs/visualstudio-docs/blob/master/docs/ide/editorconfig-code-style-settings-reference.md | ||
[*.cs] | ||
csharp_style_var_for_built_in_types = true:suggestion | ||
csharp_style_var_when_type_is_apparent = true:suggestion | ||
csharp_style_var_elsewhere = true:suggestion | ||
csharp_prefer_braces = false : none | ||
|
||
[*.{js,less}] | ||
|
||
[*.js] | ||
trim_trailing_whitespace = true | ||
|
||
[*.less] | ||
trim_trailing_whitespace = false |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,52 @@ | ||
############################################################## | ||
## V8 CMS - .NET & AngularJS Doc sites ## | ||
## Built on demand only, NO automatic PR/branch triggers ## | ||
## ## | ||
## This build pipeline has a webhook for sucessful ## | ||
## builds, that sends the ZIP artifacts to our.umb to host ## | ||
############################################################## | ||
|
||
# Name != name of pipeline but the build number format | ||
# https://docs.microsoft.com/en-us/azure/devops/pipelines/process/run-number?view=azure-devops&tabs=yaml | ||
|
||
# Build Pipeline triggers | ||
# https://docs.microsoft.com/en-us/azure/devops/pipelines/repos/github?view=azure-devops&tabs=yaml#ci-triggers | ||
trigger: none | ||
pr: none | ||
|
||
# Variables & their default values | ||
variables: | ||
buildPlatform: 'Any CPU' | ||
buildConfiguration: 'Release' | ||
|
||
# VM to run the build on & it's installed software | ||
# https://docs.microsoft.com/en-us/azure/devops/pipelines/agents/hosted?view=azure-devops | ||
# https://github.com/actions/virtual-environments/blob/master/images/win/Windows2019-Readme.md | ||
pool: | ||
vmImage: 'windows-2019' | ||
|
||
jobs: | ||
- job: buildDocs | ||
displayName: 'Build static docs site as ZIPs' | ||
steps: | ||
|
||
- task: PowerShell@2 | ||
displayName: 'Prep build tool, build C# & JS Docs' | ||
inputs: | ||
targetType: 'inline' | ||
script: | | ||
$uenv=./build.ps1 -get -doc | ||
$uenv.SandboxNode() | ||
$uenv.CompileBelle() | ||
$uenv.PrepareAngularDocs() | ||
$nugetsourceUmbraco = "https://api.nuget.org/v3/index.json" | ||
$uenv.PrepareCSharpDocs() | ||
$uenv.RestoreNode() | ||
errorActionPreference: 'continue' | ||
workingDirectory: 'build' | ||
|
||
- task: PublishPipelineArtifact@1 | ||
inputs: | ||
targetPath: '$(Build.Repository.LocalPath)\build.out\' | ||
artifact: 'docs' | ||
publishLocation: 'pipeline' |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,45 @@ | ||
using Newtonsoft.Json.Linq; | ||
using System; | ||
using System.Collections.Generic; | ||
|
||
namespace Umbraco.Core.Models.Blocks | ||
{ | ||
|
||
/// <summary> | ||
/// Convertable block data from json | ||
/// </summary> | ||
public class BlockEditorData | ||
{ | ||
private readonly string _propertyEditorAlias; | ||
|
||
public static BlockEditorData Empty { get; } = new BlockEditorData(); | ||
|
||
private BlockEditorData() | ||
{ | ||
BlockValue = new BlockValue(); | ||
} | ||
|
||
public BlockEditorData(string propertyEditorAlias, | ||
IEnumerable<ContentAndSettingsReference> references, | ||
BlockValue blockValue) | ||
{ | ||
if (string.IsNullOrWhiteSpace(propertyEditorAlias)) | ||
throw new ArgumentException($"'{nameof(propertyEditorAlias)}' cannot be null or whitespace", nameof(propertyEditorAlias)); | ||
_propertyEditorAlias = propertyEditorAlias; | ||
BlockValue = blockValue ?? throw new ArgumentNullException(nameof(blockValue)); | ||
References = references != null ? new List<ContentAndSettingsReference>(references) : throw new ArgumentNullException(nameof(references)); | ||
} | ||
|
||
/// <summary> | ||
/// Returns the layout for this specific property editor | ||
/// </summary> | ||
public JToken Layout => BlockValue.Layout.TryGetValue(_propertyEditorAlias, out var layout) ? layout : null; | ||
|
||
/// <summary> | ||
/// Returns the reference to the original BlockValue | ||
/// </summary> | ||
public BlockValue BlockValue { get; } | ||
|
||
public List<ContentAndSettingsReference> References { get; } = new List<ContentAndSettingsReference>(); | ||
} | ||
} |
43 changes: 43 additions & 0 deletions
43
src/Umbraco.Core/Models/Blocks/BlockEditorDataConverter.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,43 @@ | ||
using Newtonsoft.Json; | ||
using Newtonsoft.Json.Linq; | ||
using System.Linq; | ||
using System.Collections.Generic; | ||
|
||
namespace Umbraco.Core.Models.Blocks | ||
{ | ||
|
||
/// <summary> | ||
/// Converts the block json data into objects | ||
/// </summary> | ||
public abstract class BlockEditorDataConverter | ||
{ | ||
private readonly string _propertyEditorAlias; | ||
|
||
protected BlockEditorDataConverter(string propertyEditorAlias) | ||
{ | ||
_propertyEditorAlias = propertyEditorAlias; | ||
} | ||
|
||
public BlockEditorData Deserialize(string json) | ||
{ | ||
var value = JsonConvert.DeserializeObject<BlockValue>(json); | ||
|
||
if (value.Layout == null) | ||
return BlockEditorData.Empty; | ||
|
||
var references = value.Layout.TryGetValue(_propertyEditorAlias, out var layout) | ||
? GetBlockReferences(layout) | ||
: Enumerable.Empty<ContentAndSettingsReference>(); | ||
|
||
return new BlockEditorData(_propertyEditorAlias, references, value); | ||
} | ||
|
||
/// <summary> | ||
/// Return the collection of <see cref="IBlockReference"/> from the block editor's Layout (which could be an array or an object depending on the editor) | ||
/// </summary> | ||
/// <param name="jsonLayout"></param> | ||
/// <returns></returns> | ||
protected abstract IEnumerable<ContentAndSettingsReference> GetBlockReferences(JToken jsonLayout); | ||
|
||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,36 @@ | ||
using System; | ||
using System.Collections.Generic; | ||
using System.Runtime.Serialization; | ||
using Umbraco.Core.Models.PublishedContent; | ||
|
||
namespace Umbraco.Core.Models.Blocks | ||
{ | ||
/// <summary> | ||
/// The base class for any strongly typed model for a Block editor implementation | ||
/// </summary> | ||
public abstract class BlockEditorModel | ||
{ | ||
protected BlockEditorModel(IEnumerable<IPublishedElement> contentData, IEnumerable<IPublishedElement> settingsData) | ||
{ | ||
ContentData = contentData ?? throw new ArgumentNullException(nameof(contentData)); | ||
SettingsData = settingsData ?? new List<IPublishedContent>(); | ||
} | ||
|
||
public BlockEditorModel() | ||
{ | ||
} | ||
|
||
|
||
/// <summary> | ||
/// The content data items of the Block List editor | ||
/// </summary> | ||
[DataMember(Name = "contentData")] | ||
public IEnumerable<IPublishedElement> ContentData { get; set; } = new List<IPublishedContent>(); | ||
|
||
/// <summary> | ||
/// The settings data items of the Block List editor | ||
/// </summary> | ||
[DataMember(Name = "settingsData")] | ||
public IEnumerable<IPublishedElement> SettingsData { get; set; } = new List<IPublishedContent>(); | ||
} | ||
} |
Oops, something went wrong.