1
0
Fork 0
mirror of https://github.com/Sonarr/Sonarr synced 2024-12-25 09:18:34 +00:00

New: Highlight currently installed version on System: Updates

This commit is contained in:
Mark McDowall 2019-02-07 18:44:22 -08:00
parent 29f905b942
commit 69627911b3
3 changed files with 26 additions and 4 deletions

View file

@ -45,7 +45,7 @@
font-size: 16px;
}
.branch {
.label {
composes: label from 'Components/Label.css';
margin-left: 10px;

View file

@ -19,6 +19,7 @@ class Updates extends Component {
render() {
const {
currentVersion,
isFetching,
isPopulated,
updatesError,
@ -133,13 +134,25 @@ class Updates extends Component {
<div className={styles.date}>{formatDate(update.releaseDate, shortDateFormat)}</div>
{
update.branch !== 'master' &&
update.branch === 'master' ?
null:
<Label
className={styles.branch}
className={styles.label}
>
{update.branch}
</Label>
}
{
update.version === currentVersion ?
<Label
className={styles.label}
kind={kinds.SUCCESS}
>
Currently Installed
</Label> :
null
}
</div>
{
@ -189,6 +202,7 @@ class Updates extends Component {
}
Updates.propTypes = {
currentVersion: PropTypes.string.isRequired,
isFetching: PropTypes.bool.isRequired,
isPopulated: PropTypes.bool.isRequired,
updatesError: PropTypes.object,

View file

@ -12,11 +12,18 @@ import Updates from './Updates';
function createMapStateToProps() {
return createSelector(
(state) => state.app.version,
(state) => state.system.updates,
(state) => state.settings.general,
createUISettingsSelector(),
createCommandExecutingSelector(commandNames.APPLICATION_UPDATE),
(updates, generalSettings, uiSettings, isInstallingUpdate) => {
(
currentVersion,
updates,
generalSettings,
uiSettings,
isInstallingUpdate
) => {
const {
error: updatesError,
items
@ -26,6 +33,7 @@ function createMapStateToProps() {
const isPopulated = updates.isPopulated && generalSettings.isPopulated;
return {
currentVersion,
isFetching,
isPopulated,
updatesError,