Skip to content

Commit 530e4a8

Browse files
authored
BP-1083: Support new rich-text editor - redactor. (#53)
1 parent 0a4cc16 commit 530e4a8

File tree

4 files changed

+8
-8
lines changed

4 files changed

+8
-8
lines changed

Enigmatry.Entry.CodeGeneration.Configuration/Form/Controls/RichText/RichTextEditor.cs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,5 +2,6 @@
22

33
public enum RichTextEditor
44
{
5-
Ckeditor = 0
5+
Ckeditor = 0,
6+
Redactor
67
}

Enigmatry.Entry.CodeGeneration.Tests/Angular/FilesToBeGenerated/mock-edit-generated.component.ts.txt

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -173,9 +173,9 @@ modelOptions: { updateOn: 'blur' },
173173
},
174174
{
175175
key: 'description',
176-
type: this.resolveFieldType('ckeditor', false),
176+
type: this.resolveFieldType('redactor', false),
177177
focus: false,
178-
className: `entry-description-field entry-ckeditor`,
178+
className: `entry-description-field entry-redactor`,
179179
hideExpression: this.fieldsHideExpressions?.description ?? false,
180180
expressionProperties: {
181181
'templateOptions.disabled': (model) => (this.isReadonly || (this.fieldsDisableExpressions?.description ? this.fieldsDisableExpressions.description(model) : false)),

Enigmatry.Entry.CodeGeneration.Tests/Angular/HtmlHelperExtensions/AngularFormlyHtmlHelperExtensionsFixture.cs

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,6 @@
55
using FluentAssertions;
66
using Humanizer;
77
using NUnit.Framework;
8-
using NUnit.Framework.Internal;
98
using System;
109
using System.Linq;
1110

@@ -26,7 +25,7 @@ public void SetUp()
2625
}
2726

2827
[TestCase(nameof(FormMock.Name), ExpectedResult = "className: `entry-name-field entry-input`,\r\n")]
29-
[TestCase(nameof(FormMock.Description), ExpectedResult = "className: `entry-description-field entry-ckeditor`,\r\n")]
28+
[TestCase(nameof(FormMock.Description), ExpectedResult = "className: `entry-description-field entry-redactor`,\r\n")]
3029
[TestCase(nameof(FormMock.Date), ExpectedResult = "className: `entry-date-field entry-datepicker`,\r\n")]
3130
[TestCase(nameof(FormMock.CategoryId), ExpectedResult = "className: `entry-category-id-field entry-select`,\r\n")]
3231
[TestCase(nameof(FormMock.Money), ExpectedResult = "className: `entry-money-field entry-input`,\r\n")]
@@ -40,7 +39,7 @@ public string FieldCssClass(string propertyName)
4039
var formControl = _formComponent
4140
.FormControlsOfType<FormControl>()
4241
.Single(x => x.PropertyName == propertyName.Camelize());
43-
return _htmlHelper.FieldCssClass(formControl)?.ToString() ?? "";
42+
return _htmlHelper.FieldCssClass(formControl).ToString() ?? "";
4443
}
4544

4645
[TestCase(ExpectedResult = "fieldGroupClassName: `entry-field-group ${this.applyOptionally('group-wrapper-readonly', this.isReadonly)}`,\r\n")]
@@ -49,7 +48,7 @@ public string GroupCssClass()
4948
var formControlGroup = _formComponent
5049
.FormControlsOfType<FormControlGroup>()
5150
.First();
52-
return _htmlHelper.GroupCssClass(formControlGroup)?.ToString() ?? "";
51+
return _htmlHelper.GroupCssClass(formControlGroup).ToString() ?? "";
5352
}
5453

5554
[Test]

Enigmatry.Entry.CodeGeneration.Tests/Angular/Mocks/FormMockConfiguration.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,7 @@ public void Configure(FormComponentBuilder<FormMock> builder)
4848

4949
formGroup
5050
.RichTextInputFormControl(x => x.Description)
51-
.WithEditor(RichTextEditor.Ckeditor)
51+
.WithEditor(RichTextEditor.Redactor)
5252
.WithLabel("Some Description");
5353

5454
formGroup

0 commit comments

Comments
 (0)