New: Add OnDelete Notification to TraktConnection

to remove movies from Trakt Collection when they are removed from Radarr

Add OnDelete Notification to TraktConnection to remove movies from Trakt Collection when they are removed from Radarr

skip the deleteHandler if the delete Event was triggered for reason: Upgrade

change migration from 180 to 182 since 180 and 181 are already in plan
to be used

address comments regarding helpText for OnDelete
and move check for OnUpgrade deletion reason into trakt connection OnDelete handler

reuse TraktCollectMoviesResource for OnDelete
trakt api should just ignore the other properties anyway

add WithDefaultValue to migration

add unit test case for onDelete to

fix unit testcase for onDelete
This commit is contained in:
geogolem
2020-08-16 00:32:53 -04:00
committed by Qstick
parent 261e598c99
commit e033ce1eff
17 changed files with 171 additions and 3 deletions

View File

@@ -59,11 +59,13 @@ class Notification extends Component {
onDownload,
onUpgrade,
onRename,
onDelete,
onHealthIssue,
supportsOnGrab,
supportsOnDownload,
supportsOnUpgrade,
supportsOnRename,
supportsOnDelete,
supportsOnHealthIssue
} = this.props;
@@ -84,6 +86,13 @@ class Notification extends Component {
</Label>
}
{
supportsOnDelete && onDelete &&
<Label kind={kinds.SUCCESS}>
On Delete
</Label>
}
{
supportsOnDownload && onDownload &&
<Label kind={kinds.SUCCESS}>
@@ -113,7 +122,7 @@ class Notification extends Component {
}
{
!onGrab && !onDownload && !onRename && !onHealthIssue &&
!onGrab && !onDownload && !onRename && !onHealthIssue && !onDelete &&
<Label
kind={kinds.DISABLED}
outline={true}
@@ -150,9 +159,11 @@ Notification.propTypes = {
onDownload: PropTypes.bool.isRequired,
onUpgrade: PropTypes.bool.isRequired,
onRename: PropTypes.bool.isRequired,
onDelete: PropTypes.bool.isRequired,
onHealthIssue: PropTypes.bool.isRequired,
supportsOnGrab: PropTypes.bool.isRequired,
supportsOnDownload: PropTypes.bool.isRequired,
supportsOnDelete: PropTypes.bool.isRequired,
supportsOnUpgrade: PropTypes.bool.isRequired,
supportsOnRename: PropTypes.bool.isRequired,
supportsOnHealthIssue: PropTypes.bool.isRequired,

View File

@@ -19,11 +19,13 @@ function NotificationEventItems(props) {
onDownload,
onUpgrade,
onRename,
onDelete,
onHealthIssue,
supportsOnGrab,
supportsOnDownload,
supportsOnUpgrade,
supportsOnRename,
supportsOnDelete,
supportsOnHealthIssue,
includeHealthWarnings
} = item;
@@ -84,6 +86,17 @@ function NotificationEventItems(props) {
/>
</div>
<div>
<FormInputGroup
type={inputTypes.CHECK}
name="onDelete"
helpText="On Delete"
isDisabled={!supportsOnDelete.value}
{...onDelete}
onChange={onInputChange}
/>
</div>
<div>
<FormInputGroup
type={inputTypes.CHECK}