Skip to content

Commit 221707d

Browse files
authored
Move Hint & Required to FieldSettings (#18099)
1 parent ffbb322 commit 221707d

File tree

18 files changed

+72
-69
lines changed

18 files changed

+72
-69
lines changed
Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,10 @@
1+
using OrchardCore.ContentManagement.Metadata.Settings;
2+
13
namespace OrchardCore.ContentFields.Settings;
24

3-
public class BooleanFieldSettings
5+
public class BooleanFieldSettings : FieldSettings
46
{
5-
public string Hint { get; set; }
67
public string Label { get; set; }
8+
79
public bool DefaultValue { get; set; }
810
}

src/OrchardCore.Modules/OrchardCore.ContentFields/Settings/ContentPickerFieldSettings.cs

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,10 @@
11
using System.ComponentModel;
2+
using OrchardCore.ContentManagement.Metadata.Settings;
23

34
namespace OrchardCore.ContentFields.Settings;
45

5-
public class ContentPickerFieldSettings
6+
public class ContentPickerFieldSettings : FieldSettings
67
{
7-
public string Hint { get; set; }
8-
9-
public bool Required { get; set; }
10-
118
public bool Multiple { get; set; }
129

1310
public bool DisplayAllContentTypes { get; set; }
Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,5 @@
1+
using OrchardCore.ContentManagement.Metadata.Settings;
2+
13
namespace OrchardCore.ContentFields.Settings;
24

3-
public class DateFieldSettings
4-
{
5-
public string Hint { get; set; }
6-
public bool Required { get; set; }
7-
}
5+
public class DateFieldSettings : FieldSettings;
Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,5 @@
1+
using OrchardCore.ContentManagement.Metadata.Settings;
2+
13
namespace OrchardCore.ContentFields.Settings;
24

3-
public class DateTimeFieldSettings
4-
{
5-
public string Hint { get; set; }
6-
public bool Required { get; set; }
7-
}
5+
public class DateTimeFieldSettings : FieldSettings;
Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,10 @@
11
using System.ComponentModel;
2+
using OrchardCore.ContentManagement.Metadata.Settings;
23

34
namespace OrchardCore.ContentFields.Settings;
45

5-
public class HtmlFieldSettings
6+
public class HtmlFieldSettings : FieldSettings
67
{
7-
public string Hint { get; set; }
8-
98
[DefaultValue(true)]
109
public bool SanitizeHtml { get; set; } = true;
1110
}

src/OrchardCore.Modules/OrchardCore.ContentFields/Settings/LinkFieldSettings.cs

Lines changed: 14 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,21 +1,27 @@
1+
using OrchardCore.ContentManagement.Metadata.Settings;
2+
13
namespace OrchardCore.ContentFields.Settings;
24

3-
public class LinkFieldSettings
5+
public class LinkFieldSettings : FieldSettings
46
{
5-
public string Hint { get; set; }
7+
public LinkFieldSettings()
8+
{
9+
LinkTextMode = LinkTextMode.Optional;
10+
}
11+
612
public string HintLinkText { get; set; }
7-
public bool Required { get; set; }
13+
814
public LinkTextMode LinkTextMode { get; set; }
15+
916
public string UrlPlaceholder { get; set; }
17+
1018
public string TextPlaceholder { get; set; }
19+
1120
public string DefaultUrl { get; set; }
21+
1222
public string DefaultText { get; set; }
13-
public string DefaultTarget { get; set; }
1423

15-
public LinkFieldSettings()
16-
{
17-
LinkTextMode = LinkTextMode.Optional;
18-
}
24+
public string DefaultTarget { get; set; }
1925
}
2026

2127
public enum LinkTextMode
Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,12 @@
1+
using OrchardCore.ContentManagement.Metadata.Settings;
12
using OrchardCore.Modules;
23

34
namespace OrchardCore.ContentFields.Settings;
45

56
[RequireFeatures("OrchardCore.ContentLocalization")]
6-
public class LocalizationSetContentPickerFieldSettings
7+
public class LocalizationSetContentPickerFieldSettings : FieldSettings
78
{
8-
public string Hint { get; set; }
9-
public bool Required { get; set; }
109
public bool Multiple { get; set; }
10+
1111
public string[] DisplayedContentTypes { get; set; } = [];
1212
}

src/OrchardCore.Modules/OrchardCore.ContentFields/Settings/MultiTextFieldSettings.cs

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,10 @@
11
using System.Text.Json.Serialization;
2+
using OrchardCore.ContentManagement.Metadata.Settings;
23

34
namespace OrchardCore.ContentFields.Settings;
45

5-
public class MultiTextFieldSettings
6+
public class MultiTextFieldSettings : FieldSettings
67
{
7-
public string Hint { get; set; }
8-
public bool Required { get; set; }
98
public MultiTextFieldValueOption[] Options { get; set; } = [];
109
}
1110

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,16 @@
1+
using OrchardCore.ContentManagement.Metadata.Settings;
2+
13
namespace OrchardCore.ContentFields.Settings;
24

3-
public class NumericFieldSettings
5+
public class NumericFieldSettings : FieldSettings
46
{
5-
public string Hint { get; set; }
6-
public bool Required { get; set; }
77
public int Scale { get; set; }
8+
89
public decimal? Minimum { get; set; }
10+
911
public decimal? Maximum { get; set; }
12+
1013
public string Placeholder { get; set; }
14+
1115
public string DefaultValue { get; set; }
1216
}
Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
1+
using OrchardCore.ContentManagement.Metadata.Settings;
2+
13
namespace OrchardCore.ContentFields.Settings;
24

3-
public class TextFieldSettings
5+
public class TextFieldSettings : FieldSettings
46
{
5-
public string Hint { get; set; }
6-
public bool Required { get; set; }
77
public string DefaultValue { get; set; }
88
}

0 commit comments

Comments
 (0)