mirror of
https://github.com/Prowlarr/Prowlarr.git
synced 2025-09-17 17:14:18 +02:00
Fixed: Automation/Integration/Unit Tests
This commit is contained in:
@@ -1,6 +1,6 @@
|
||||
import _ from 'lodash';
|
||||
import PropTypes from 'prop-types';
|
||||
import React, { Component, Fragment } from 'react';
|
||||
import React, { Component } from 'react';
|
||||
import { icons, kinds } from 'Helpers/Props';
|
||||
import formatDate from 'Utilities/Date/formatDate';
|
||||
import LoadingIndicator from 'Components/Loading/LoadingIndicator';
|
||||
@@ -26,7 +26,7 @@ class Updates extends Component {
|
||||
generalSettingsError,
|
||||
items,
|
||||
isInstallingUpdate,
|
||||
updateMechanism,
|
||||
isDocker,
|
||||
shortDateFormat,
|
||||
onInstallLatestPress
|
||||
} = this.props;
|
||||
@@ -37,12 +37,6 @@ class Updates extends Component {
|
||||
const hasUpdateToInstall = hasUpdates && _.some(items, { installable: true, latest: true });
|
||||
const noUpdateToInstall = hasUpdates && !hasUpdateToInstall;
|
||||
|
||||
const externalUpdaterMessages = {
|
||||
external: 'Unable to update Radarr directly, Radarr is configured to use an external update mechanism',
|
||||
apt: 'Unable to update Radarr directly, use apt to install the update',
|
||||
docker: 'Unable to update Radarr directly, update the docker container to receive the update'
|
||||
};
|
||||
|
||||
return (
|
||||
<PageContent title="Updates">
|
||||
<PageContentBodyConnector>
|
||||
@@ -58,29 +52,24 @@ class Updates extends Component {
|
||||
|
||||
{
|
||||
hasUpdateToInstall &&
|
||||
<div className={styles.messageContainer}>
|
||||
<div className={styles.updateAvailable}>
|
||||
{
|
||||
updateMechanism === 'builtIn' || updateMechanism === 'script' ?
|
||||
<SpinnerButton
|
||||
className={styles.updateAvailable}
|
||||
kind={kinds.PRIMARY}
|
||||
isSpinning={isInstallingUpdate}
|
||||
onPress={onInstallLatestPress}
|
||||
>
|
||||
Install Latest
|
||||
</SpinnerButton> :
|
||||
!isDocker &&
|
||||
<SpinnerButton
|
||||
className={styles.updateAvailable}
|
||||
kind={kinds.PRIMARY}
|
||||
isSpinning={isInstallingUpdate}
|
||||
onPress={onInstallLatestPress}
|
||||
>
|
||||
Install Latest
|
||||
</SpinnerButton>
|
||||
}
|
||||
|
||||
<Fragment>
|
||||
<Icon
|
||||
name={icons.WARNING}
|
||||
kind={kinds.WARNING}
|
||||
size={30}
|
||||
/>
|
||||
|
||||
<div className={styles.message}>
|
||||
{externalUpdaterMessages[updateMechanism] || externalUpdaterMessages.external}
|
||||
</div>
|
||||
</Fragment>
|
||||
{
|
||||
isDocker &&
|
||||
<div className={styles.upToDateMessage}>
|
||||
An update is available. Please update your Docker image and re-create the container.
|
||||
</div>
|
||||
}
|
||||
|
||||
{
|
||||
@@ -209,6 +198,7 @@ Updates.propTypes = {
|
||||
generalSettingsError: PropTypes.object,
|
||||
items: PropTypes.array.isRequired,
|
||||
isInstallingUpdate: PropTypes.bool.isRequired,
|
||||
isDocker: PropTypes.bool.isRequired,
|
||||
updateMechanism: PropTypes.string,
|
||||
shortDateFormat: PropTypes.string.isRequired,
|
||||
onInstallLatestPress: PropTypes.func.isRequired
|
||||
|
Reference in New Issue
Block a user