4
4
using System . Text . RegularExpressions ;
5
5
using Newtonsoft . Json ;
6
6
using Newtonsoft . Json . Linq ;
7
- using Umbraco . Core ;
8
- using Umbraco . Core . Configuration . Grid ;
9
- using Umbraco . Core . Deploy ;
10
- using Umbraco . Core . Models ;
11
- using Umbraco . Core . Services ;
12
- using Umbraco . Deploy . Connectors . DataTypeConfigurationConnectors ;
13
- using Umbraco . Deploy . Core ;
14
- using Umbraco . Web . PropertyEditors ;
7
+ using Umbraco . Cms . Core ;
8
+ using Umbraco . Cms . Core . Configuration . Grid ;
9
+ using Umbraco . Cms . Core . Deploy ;
10
+ using Umbraco . Cms . Core . Models ;
11
+ using Umbraco . Cms . Core . PropertyEditors ;
12
+ using Umbraco . Cms . Core . Serialization ;
13
+ using Umbraco . Cms . Core . Services ;
14
+ using Umbraco . Deploy . Infrastructure . Connectors . DataTypeConfigurationConnectors ;
15
+ using Umbraco . Extensions ;
15
16
16
17
namespace Umbraco . Deploy . Contrib . DataTypeConfigurationConnectors
17
18
{
18
19
/// <summary>
19
20
/// Implements a Grid layout data type configuration connector supporting DocTypeGridEditor.
20
21
/// </summary>
21
- public class DocTypeGridEditorDataTypeConfigurationConnector : DataTypeConfigurationConnectorBase2
22
+ public class DocTypeGridEditorDataTypeConfigurationConnector : DataTypeConfigurationConnectorBase
22
23
{
23
24
private readonly IGridConfig _gridConfig ;
24
25
private readonly IContentTypeService _contentTypeService ;
@@ -34,20 +35,22 @@ public class DocTypeGridEditorDataTypeConfigurationConnector : DataTypeConfigura
34
35
/// </summary>
35
36
/// <param name="gridConfig">The grid configuration.</param>
36
37
/// <param name="contentTypeService">The content type service.</param>
37
- public DocTypeGridEditorDataTypeConfigurationConnector ( IGridConfig gridConfig , IContentTypeService contentTypeService )
38
+ /// <param name="configurationEditorJsonSerializer">The configuration editor JSON serializer.</param>
39
+ public DocTypeGridEditorDataTypeConfigurationConnector ( IGridConfig gridConfig , IContentTypeService contentTypeService , IConfigurationEditorJsonSerializer configurationEditorJsonSerializer )
40
+ : base ( configurationEditorJsonSerializer )
38
41
{
39
42
_gridConfig = gridConfig ;
40
43
_contentTypeService = contentTypeService ;
41
44
}
42
45
43
46
/// <inheritdoc />
44
- public override string ToArtifact ( IDataType dataType , ICollection < ArtifactDependency > dependencies , IContextCache contextCache )
47
+ public override string ? ToArtifact ( IDataType dataType , ICollection < ArtifactDependency > dependencies , IContextCache contextCache )
45
48
{
46
49
if ( dataType . ConfigurationAs < GridConfiguration > ( ) is GridConfiguration gridConfiguration &&
47
50
gridConfiguration . Items ? . ToObject < GridConfigurationItems > ( ) is GridConfigurationItems gridConfigurationItems )
48
51
{
49
52
// Get all element types (when needed)
50
- var allElementTypes = new Lazy < IEnumerable < IContentType > > ( ( ) => _contentTypeService . GetAll ( ) . Where ( x => x . IsElement ) . ToList ( ) ) ;
53
+ var allElementTypes = new Lazy < IEnumerable < IContentType > > ( ( ) => _contentTypeService . GetAllElementTypes ( ) . Where ( x => x . IsElement ) . ToList ( ) ) ;
51
54
52
55
// Process DTGE editors
53
56
foreach ( var gridEditor in GetGridEditors ( gridConfigurationItems ) . Where ( IsDocTypeGridEditor ) )
0 commit comments