Skip to content

Commit

Permalink
New: Frontend Placeholders from the Backend
Browse files Browse the repository at this point in the history
  • Loading branch information
RobinDadswell committed Dec 7, 2021
1 parent 4d6c336 commit 7dda481
Show file tree
Hide file tree
Showing 4 changed files with 7 additions and 1 deletion.
3 changes: 3 additions & 0 deletions frontend/src/Components/Form/ProviderFieldFormGroup.js
Expand Up @@ -64,6 +64,7 @@ function ProviderFieldFormGroup(props) {
label,
helpText,
helpLink,
placeholder,
value,
type,
advanced,
Expand Down Expand Up @@ -96,6 +97,7 @@ function ProviderFieldFormGroup(props) {
label={label}
helpText={helpText}
helpLink={helpLink}
placeholder={placeholder}
value={value}
values={getSelectValues(selectOptions)}
errors={errors}
Expand All @@ -121,6 +123,7 @@ ProviderFieldFormGroup.propTypes = {
label: PropTypes.string.isRequired,
helpText: PropTypes.string,
helpLink: PropTypes.string,
placeholder: PropTypes.string,
value: PropTypes.any,
type: PropTypes.string.isRequired,
advanced: PropTypes.bool.isRequired,
Expand Down
1 change: 1 addition & 0 deletions src/NzbDrone.Core/Annotations/FieldDefinitionAttribute.cs
Expand Up @@ -23,6 +23,7 @@ public FieldDefinitionAttribute(int order)
public string Section { get; set; }
public HiddenType Hidden { get; set; }
public PrivacyLevel Privacy { get; set; }
public string Placeholder { get; set; }
}

[AttributeUsage(AttributeTargets.Property | AttributeTargets.Field, AllowMultiple = false)]
Expand Down
1 change: 1 addition & 0 deletions src/Radarr.Http/ClientSchema/Field.cs
Expand Up @@ -18,6 +18,7 @@ public class Field
public string SelectOptionsProviderAction { get; set; }
public string Section { get; set; }
public string Hidden { get; set; }
public string Placeholder { get; set; }

public Field Clone()
{
Expand Down
3 changes: 2 additions & 1 deletion src/Radarr.Http/ClientSchema/SchemaBuilder.cs
Expand Up @@ -101,7 +101,8 @@ private static FieldMapping[] GetFieldMapping(Type type, string prefix, Func<obj
Order = fieldAttribute.Order,
Advanced = fieldAttribute.Advanced,
Type = fieldAttribute.Type.ToString().FirstCharToLower(),
Section = fieldAttribute.Section
Section = fieldAttribute.Section,
Placeholder = fieldAttribute.Placeholder
};

if (fieldAttribute.Type == FieldType.Select || fieldAttribute.Type == FieldType.TagSelect)
Expand Down

0 comments on commit 7dda481

Please sign in to comment.