-
-
Notifications
You must be signed in to change notification settings - Fork 65
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #228 from bielu/fix/grid-value-mistake
fix: another small bits and bobs at migrations
- Loading branch information
Showing
5 changed files
with
57 additions
and
7 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
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
40 changes: 40 additions & 0 deletions
40
uSync.Migrations/Migrators/BlockGrid/Models/GridConfiguration.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,40 @@ | ||
using Newtonsoft.Json; | ||
using Newtonsoft.Json.Linq; | ||
using Umbraco.Cms.Core; | ||
using Umbraco.Cms.Core.PropertyEditors; | ||
using Umbraco.Cms.Infrastructure.Serialization; | ||
|
||
namespace uSync.Migrations.Migrators.BlockGrid.Models; | ||
|
||
public class GridConfiguration: IIgnoreUserStartNodesConfig | ||
{ | ||
// TODO: Make these strongly typed, for now this works though | ||
[ConfigurationField("items", "Grid", "views/propertyeditors/grid/grid.prevalues.html", Description = "Grid configuration")] | ||
public JObject? Items { get; set; } | ||
|
||
// TODO: Make these strongly typed, for now this works though | ||
[ConfigurationField("rte", "Rich text editor", "views/propertyeditors/rte/rte.prevalues.html", Description = "Rich text editor configuration", HideLabel = true)] | ||
public JObject? Rte { get; set; } | ||
|
||
[ConfigurationField("mediaParentId", "Image Upload Folder", "mediafolderpicker", Description = "Choose the upload location of pasted images")] | ||
public GuidUdi? MediaParentId { get; set; } | ||
|
||
[ConfigurationField( | ||
Constants.DataTypes.ReservedPreValueKeys.IgnoreUserStartNodes, | ||
"Ignore User Start Nodes", | ||
"boolean", | ||
Description = "Selecting this option allows a user to choose nodes that they normally don't have access to.")] | ||
[JsonConverter(typeof(FuzzyBooleanConverter))] | ||
public bool IgnoreUserStartNodes { get; set; } | ||
|
||
public Umbraco.Cms.Core.PropertyEditors.GridConfiguration ToUmbracoGridConfiguration() | ||
{ | ||
return new Umbraco.Cms.Core.PropertyEditors.GridConfiguration() | ||
{ | ||
Items = this.Items, | ||
Rte = this.Rte, | ||
MediaParentId = this.MediaParentId, | ||
IgnoreUserStartNodes = this.IgnoreUserStartNodes | ||
}; | ||
} | ||
} |
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