New: OnApplicationUpdate Notifications

* Added translations

Fixes #2552
[common]

(cherry picked from commit 9e175e28efcfc6ac3e414649b955a10fb0e951e7)
This commit is contained in:
Qstick 2021-12-20 23:12:12 -06:00
commit 67c96f0b89
34 changed files with 307 additions and 16 deletions

View file

@ -63,6 +63,7 @@ class Notification extends Component {
onDownloadFailure,
onImportFailure,
onTrackRetag,
onApplicationUpdate,
supportsOnGrab,
supportsOnReleaseImport,
supportsOnUpgrade,
@ -70,7 +71,8 @@ class Notification extends Component {
supportsOnHealthIssue,
supportsOnDownloadFailure,
supportsOnImportFailure,
supportsOnTrackRetag
supportsOnTrackRetag,
supportsOnApplicationUpdate
} = this.props;
return (
@ -86,62 +88,69 @@ class Notification extends Component {
{
supportsOnGrab && onGrab &&
<Label kind={kinds.SUCCESS}>
On Grab
{translate('OnGrab')}
</Label>
}
{
supportsOnReleaseImport && onReleaseImport &&
<Label kind={kinds.SUCCESS}>
On Release Import
{translate('OnReleaseImport')}
</Label>
}
{
supportsOnUpgrade && onReleaseImport && onUpgrade &&
<Label kind={kinds.SUCCESS}>
On Upgrade
{translate('OnUpgrade')}
</Label>
}
{
supportsOnRename && onRename &&
<Label kind={kinds.SUCCESS}>
On Rename
{translate('OnRename')}
</Label>
}
{
supportsOnTrackRetag && onTrackRetag &&
<Label kind={kinds.SUCCESS}>
On Track Tag Update
{translate('OnTrackRetag')}
</Label>
}
{
supportsOnHealthIssue && onHealthIssue &&
<Label kind={kinds.SUCCESS}>
On Health Issue
{translate('OnHealthIssue')}
</Label>
}
{
supportsOnDownloadFailure && onDownloadFailure &&
<Label kind={kinds.SUCCESS} >
On Download Failure
{translate('OnDownloadFailure')}
</Label>
}
{
supportsOnImportFailure && onImportFailure &&
<Label kind={kinds.SUCCESS} >
On Import Failure
{translate('OnImportFailure')}
</Label>
}
{
supportsOnApplicationUpdate && onApplicationUpdate &&
<Label kind={kinds.SUCCESS} >
{translate('OnApplicationUpdate')}
</Label>
}
{
!onGrab && !onReleaseImport && !onRename && !onTrackRetag &&
!onHealthIssue && !onDownloadFailure && !onImportFailure &&
!onHealthIssue && !onDownloadFailure && !onImportFailure && !onApplicationUpdate &&
<Label
kind={kinds.DISABLED}
outline={true}
@ -182,6 +191,7 @@ Notification.propTypes = {
onDownloadFailure: PropTypes.bool.isRequired,
onImportFailure: PropTypes.bool.isRequired,
onTrackRetag: PropTypes.bool.isRequired,
onApplicationUpdate: PropTypes.bool.isRequired,
supportsOnGrab: PropTypes.bool.isRequired,
supportsOnReleaseImport: PropTypes.bool.isRequired,
supportsOnUpgrade: PropTypes.bool.isRequired,
@ -190,6 +200,7 @@ Notification.propTypes = {
supportsOnDownloadFailure: PropTypes.bool.isRequired,
supportsOnImportFailure: PropTypes.bool.isRequired,
supportsOnTrackRetag: PropTypes.bool.isRequired,
supportsOnApplicationUpdate: PropTypes.bool.isRequired,
onConfirmDeleteNotification: PropTypes.func.isRequired
};

View file

@ -23,6 +23,7 @@ function NotificationEventItems(props) {
onDownloadFailure,
onImportFailure,
onTrackRetag,
onApplicationUpdate,
supportsOnGrab,
supportsOnReleaseImport,
supportsOnUpgrade,
@ -31,7 +32,8 @@ function NotificationEventItems(props) {
includeHealthWarnings,
supportsOnDownloadFailure,
supportsOnImportFailure,
supportsOnTrackRetag
supportsOnTrackRetag,
supportsOnApplicationUpdate
} = item;
return (
@ -125,6 +127,17 @@ function NotificationEventItems(props) {
/>
</div>
<div>
<FormInputGroup
type={inputTypes.CHECK}
name="onApplicationUpdate"
helpText={translate('OnApplicationUpdateHelpText')}
isDisabled={!supportsOnApplicationUpdate.value}
{...onApplicationUpdate}
onChange={onInputChange}
/>
</div>
<div>
<FormInputGroup
type={inputTypes.CHECK}
@ -149,6 +162,7 @@ function NotificationEventItems(props) {
/>
</div>
}
</div>
</div>
</FormGroup>

View file

@ -110,6 +110,7 @@ export default {
selectedSchema.onDownloadFailure = selectedSchema.supportsOnDownloadFailure;
selectedSchema.onImportFailure = selectedSchema.supportsOnImportFailure;
selectedSchema.onTrackRetag = selectedSchema.supportsOnTrackRetag;
selectedSchema.onApplicationUpdate = selectedSchema.supportsOnApplicationUpdate;
return selectedSchema;
});