V11/merge v10 into v11 (#14602)
* V10: Dropzone should handle internal and external errors when uploading (#14578) * fix: mark files that result in error as processed * fix: for safety measure check that a file is truthy before trying to upload it * fix: push an error when file.$error is encountered to make sure it does not get uploaded * fix: remove header from error messages since it is not being used anyway * fix: check for maxFileSize before uploading pasted images in tinymce * use stored blob variable * feat: add property to fileManager to get and format the maxFileSize * fix: make tinymce use fileManager to get maxFileSize * fix(image cropper): check for maxFileSize before setting file to upload * multiply by 1000 to get bytes --------- Co-authored-by: Elitsa <elm@umbraco.dk> * Fix method invoke. (#14597) * Ensure that the Slider does not crash the back-office (#14601) * Ensure that the Slider does not crash the back-office * Add field descriptions to config --------- Co-authored-by: Jacob Overgaard <752371+iOvergaard@users.noreply.github.com> Co-authored-by: Elitsa <elm@umbraco.dk> Co-authored-by: Adrian Cojocariu <95346674+acoumb@users.noreply.github.com> Co-authored-by: Kenn Jacobsen <kja@umbraco.dk>
This commit is contained in:
@@ -14,12 +14,12 @@ public class SliderConfiguration
|
||||
[ConfigurationField("initVal2", "Initial value 2", "number", Description = "Used when range is enabled")]
|
||||
public decimal InitialValue2 { get; set; }
|
||||
|
||||
[ConfigurationField("minVal", "Minimum value", "number")]
|
||||
[ConfigurationField("minVal", "Minimum value", "number", Description = "Must be smaller than the Maximum value")]
|
||||
public decimal MinimumValue { get; set; }
|
||||
|
||||
[ConfigurationField("maxVal", "Maximum value", "number")]
|
||||
[ConfigurationField("maxVal", "Maximum value", "number", Description = "Must be larger than the Minimum value")]
|
||||
public decimal MaximumValue { get; set; }
|
||||
|
||||
[ConfigurationField("step", "Step increments", "number")]
|
||||
[ConfigurationField("step", "Step increments", "number", Description = "Must be a positive value")]
|
||||
public decimal StepIncrements { get; set; }
|
||||
}
|
||||
|
||||
@@ -25,4 +25,19 @@ public class SliderConfigurationEditor : ConfigurationEditor<SliderConfiguration
|
||||
ioHelper, editorConfigurationParser)
|
||||
{
|
||||
}
|
||||
|
||||
public override Dictionary<string, object> ToConfigurationEditor(SliderConfiguration? configuration)
|
||||
{
|
||||
// negative step increments can be configured in the back-office. they will cause the slider to
|
||||
// crash the entire back-office. as we can't configure min and max values for the number prevalue
|
||||
// editor, we have to this instead to limit the damage.
|
||||
// logically, the step increments should be inverted instead of hardcoding them to 1, but the
|
||||
// latter might point people in the direction of their misconfiguration.
|
||||
if (configuration?.StepIncrements <= 0)
|
||||
{
|
||||
configuration.StepIncrements = 1;
|
||||
}
|
||||
|
||||
return base.ToConfigurationEditor(configuration);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
// Copyright (c) Umbraco.
|
||||
// Copyright (c) Umbraco.
|
||||
// See LICENSE for more details.
|
||||
|
||||
using System.Text;
|
||||
@@ -92,6 +92,6 @@ namespace Umbraco.Cms.Core.PropertyEditors
|
||||
|
||||
[Obsolete("Use the overload that specifies availableCultures, scheduled for removal in v14")]
|
||||
public IEnumerable<KeyValuePair<string, IEnumerable<object?>>> GetIndexValues(IProperty property, string? culture, string? segment, bool published)
|
||||
=> GetIndexValues(property, culture, segment, published);
|
||||
=> GetIndexValues(property, culture, segment, published, Enumerable.Empty<string>());
|
||||
}
|
||||
}
|
||||
|
||||
@@ -328,6 +328,6 @@ public class RichTextPropertyEditor : DataEditor
|
||||
|
||||
[Obsolete("Use the overload with the 'availableCultures' parameter instead, scheduled for removal in v14")]
|
||||
public IEnumerable<KeyValuePair<string, IEnumerable<object?>>> GetIndexValues(IProperty property, string? culture, string? segment, bool published)
|
||||
=> GetIndexValues(property, culture, segment, published);
|
||||
=> GetIndexValues(property, culture, segment, published, Enumerable.Empty<string>());
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user