New: Add name field to release profiles
This commit is contained in:
parent
f3f2648ce5
commit
5e4c9dfe60
|
@ -29,6 +29,7 @@ function EditReleaseProfileModalContent(props) {
|
||||||
|
|
||||||
const {
|
const {
|
||||||
id,
|
id,
|
||||||
|
name,
|
||||||
enabled,
|
enabled,
|
||||||
required,
|
required,
|
||||||
ignored,
|
ignored,
|
||||||
|
@ -46,6 +47,20 @@ function EditReleaseProfileModalContent(props) {
|
||||||
|
|
||||||
<ModalBody>
|
<ModalBody>
|
||||||
<Form {...otherProps}>
|
<Form {...otherProps}>
|
||||||
|
|
||||||
|
<FormGroup>
|
||||||
|
<FormLabel>Name</FormLabel>
|
||||||
|
|
||||||
|
<FormInputGroup
|
||||||
|
type={inputTypes.TEXT}
|
||||||
|
name="name"
|
||||||
|
{...name}
|
||||||
|
placeholder="Optional name"
|
||||||
|
canEdit={true}
|
||||||
|
onChange={onInputChange}
|
||||||
|
/>
|
||||||
|
</FormGroup>
|
||||||
|
|
||||||
<FormGroup>
|
<FormGroup>
|
||||||
<FormLabel>Enable Profile</FormLabel>
|
<FormLabel>Enable Profile</FormLabel>
|
||||||
|
|
||||||
|
|
|
@ -9,3 +9,11 @@
|
||||||
flex-wrap: wrap;
|
flex-wrap: wrap;
|
||||||
margin-top: 5px;
|
margin-top: 5px;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
.name {
|
||||||
|
@add-mixin truncate;
|
||||||
|
|
||||||
|
margin-bottom: 20px;
|
||||||
|
font-weight: 300;
|
||||||
|
font-size: 24px;
|
||||||
|
}
|
||||||
|
|
|
@ -56,6 +56,7 @@ class ReleaseProfile extends Component {
|
||||||
render() {
|
render() {
|
||||||
const {
|
const {
|
||||||
id,
|
id,
|
||||||
|
name,
|
||||||
enabled,
|
enabled,
|
||||||
required,
|
required,
|
||||||
ignored,
|
ignored,
|
||||||
|
@ -79,6 +80,14 @@ class ReleaseProfile extends Component {
|
||||||
overlayContent={true}
|
overlayContent={true}
|
||||||
onPress={this.onEditReleaseProfilePress}
|
onPress={this.onEditReleaseProfilePress}
|
||||||
>
|
>
|
||||||
|
{
|
||||||
|
name ?
|
||||||
|
<div className={styles.name}>
|
||||||
|
{name}
|
||||||
|
</div> :
|
||||||
|
null
|
||||||
|
}
|
||||||
|
|
||||||
<div>
|
<div>
|
||||||
{
|
{
|
||||||
split(required).map((item) => {
|
split(required).map((item) => {
|
||||||
|
@ -184,6 +193,7 @@ class ReleaseProfile extends Component {
|
||||||
|
|
||||||
ReleaseProfile.propTypes = {
|
ReleaseProfile.propTypes = {
|
||||||
id: PropTypes.number.isRequired,
|
id: PropTypes.number.isRequired,
|
||||||
|
name: PropTypes.string,
|
||||||
enabled: PropTypes.bool.isRequired,
|
enabled: PropTypes.bool.isRequired,
|
||||||
required: PropTypes.string.isRequired,
|
required: PropTypes.string.isRequired,
|
||||||
ignored: PropTypes.string.isRequired,
|
ignored: PropTypes.string.isRequired,
|
||||||
|
|
|
@ -0,0 +1,14 @@
|
||||||
|
using FluentMigrator;
|
||||||
|
using NzbDrone.Core.Datastore.Migration.Framework;
|
||||||
|
|
||||||
|
namespace NzbDrone.Core.Datastore.Migration
|
||||||
|
{
|
||||||
|
[Migration(154)]
|
||||||
|
public class add_name_release_profile : NzbDroneMigrationBase
|
||||||
|
{
|
||||||
|
protected override void MainDbUpgrade()
|
||||||
|
{
|
||||||
|
Alter.Table("ReleaseProfiles").AddColumn("Name").AsString().Nullable().WithDefaultValue(null);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
|
@ -5,6 +5,7 @@ namespace NzbDrone.Core.Profiles.Releases
|
||||||
{
|
{
|
||||||
public class ReleaseProfile : ModelBase
|
public class ReleaseProfile : ModelBase
|
||||||
{
|
{
|
||||||
|
public string Name { get; set; }
|
||||||
public bool Enabled { get; set; }
|
public bool Enabled { get; set; }
|
||||||
public string Required { get; set; }
|
public string Required { get; set; }
|
||||||
public string Ignored { get; set; }
|
public string Ignored { get; set; }
|
||||||
|
|
|
@ -7,6 +7,7 @@ namespace Sonarr.Api.V3.Profiles.Release
|
||||||
{
|
{
|
||||||
public class ReleaseProfileResource : RestResource
|
public class ReleaseProfileResource : RestResource
|
||||||
{
|
{
|
||||||
|
public string Name { get; set; }
|
||||||
public bool Enabled { get; set; }
|
public bool Enabled { get; set; }
|
||||||
public string Required { get; set; }
|
public string Required { get; set; }
|
||||||
public string Ignored { get; set; }
|
public string Ignored { get; set; }
|
||||||
|
@ -30,7 +31,7 @@ namespace Sonarr.Api.V3.Profiles.Release
|
||||||
return new ReleaseProfileResource
|
return new ReleaseProfileResource
|
||||||
{
|
{
|
||||||
Id = model.Id,
|
Id = model.Id,
|
||||||
|
Name = model.Name,
|
||||||
Enabled = model.Enabled,
|
Enabled = model.Enabled,
|
||||||
Required = model.Required,
|
Required = model.Required,
|
||||||
Ignored = model.Ignored,
|
Ignored = model.Ignored,
|
||||||
|
@ -48,7 +49,7 @@ namespace Sonarr.Api.V3.Profiles.Release
|
||||||
return new ReleaseProfile
|
return new ReleaseProfile
|
||||||
{
|
{
|
||||||
Id = resource.Id,
|
Id = resource.Id,
|
||||||
|
Name = resource.Name,
|
||||||
Enabled = resource.Enabled,
|
Enabled = resource.Enabled,
|
||||||
Required = resource.Required,
|
Required = resource.Required,
|
||||||
Ignored = resource.Ignored,
|
Ignored = resource.Ignored,
|
||||||
|
|
Loading…
Reference in New Issue