From b506fd3ab7fafd15fa0d6c179623f26dac3605ea Mon Sep 17 00:00:00 2001 From: Qstick Date: Sun, 26 Aug 2018 00:39:04 -0400 Subject: [PATCH] Fixed: UI fixes from Sonarr Co-Authored-By: Mark McDowall --- .../AddNewArtist/AddNewArtistSearchResult.js | 13 ++++---- .../src/Album/Details/AlbumDetailsMedium.js | 13 ++++---- frontend/src/Album/EpisodeStatus.js | 15 +++------ frontend/src/AlbumStudio/AlbumStudioRow.js | 12 +++---- frontend/src/Artist/ArtistBanner.js | 9 ++--- frontend/src/Artist/ArtistPoster.js | 9 ++--- .../Artist/Delete/DeleteArtistModalContent.js | 4 ++- .../src/Artist/Details/ArtistDetailsSeason.js | 13 ++++---- .../Artist/Index/Table/ArtistStatusCell.js | 23 ++++++------- frontend/src/Calendar/Agenda/AgendaEvent.js | 9 ++--- frontend/src/Calendar/Events/CalendarEvent.js | 11 ++++--- frontend/src/Components/Icon.js | 5 ++- .../Page/Sidebar/Messages/Message.js | 3 +- .../Profiles/Quality/QualityProfileItem.js | 3 +- .../Quality/QualityProfileItemGroup.js | 3 +- frontend/src/Store/Actions/calendarActions.js | 5 ++- frontend/src/Store/Actions/queueActions.js | 2 +- frontend/src/System/Backup/BackupRow.js | 9 ++--- frontend/src/System/Status/Health/Health.js | 11 ++++--- .../Music/Commands/BulkMoveArtistCommand.cs | 33 ++++++++++++++++++- 20 files changed, 117 insertions(+), 88 deletions(-) diff --git a/frontend/src/AddArtist/AddNewArtist/AddNewArtistSearchResult.js b/frontend/src/AddArtist/AddNewArtist/AddNewArtistSearchResult.js index 38a60bef8..3496f64d8 100644 --- a/frontend/src/AddArtist/AddNewArtist/AddNewArtistSearchResult.js +++ b/frontend/src/AddArtist/AddNewArtist/AddNewArtistSearchResult.js @@ -116,12 +116,13 @@ class AddNewArtistSearchResult extends Component { { isExistingArtist && - + + + } diff --git a/frontend/src/Album/Details/AlbumDetailsMedium.js b/frontend/src/Album/Details/AlbumDetailsMedium.js index 675ac5954..13dba0642 100644 --- a/frontend/src/Album/Details/AlbumDetailsMedium.js +++ b/frontend/src/Album/Details/AlbumDetailsMedium.js @@ -134,12 +134,13 @@ class AlbumDetailsMedium extends Component { className={styles.expandButton} onPress={this.onExpandPress} > - + + + { !isSmallScreen &&   diff --git a/frontend/src/Album/EpisodeStatus.js b/frontend/src/Album/EpisodeStatus.js index 9cdbd1923..8dc912f44 100644 --- a/frontend/src/Album/EpisodeStatus.js +++ b/frontend/src/Album/EpisodeStatus.js @@ -48,10 +48,9 @@ function EpisodeStatus(props) { if (grabbed) { return ( -
+
); @@ -75,10 +74,9 @@ function EpisodeStatus(props) { if (!airDateUtc) { return ( -
+
); @@ -86,10 +84,9 @@ function EpisodeStatus(props) { if (!monitored) { return ( -
+
); @@ -97,20 +94,18 @@ function EpisodeStatus(props) { if (hasAired) { return ( -
+
); } return ( -
+
); diff --git a/frontend/src/AlbumStudio/AlbumStudioRow.js b/frontend/src/AlbumStudio/AlbumStudioRow.js index 74ab860b7..99d12dd4b 100644 --- a/frontend/src/AlbumStudio/AlbumStudioRow.js +++ b/frontend/src/AlbumStudio/AlbumStudioRow.js @@ -39,12 +39,12 @@ class AlbumStudioRow extends Component { /> - + + + diff --git a/frontend/src/Artist/ArtistBanner.js b/frontend/src/Artist/ArtistBanner.js index eff4ae599..bcaafcdbf 100644 --- a/frontend/src/Artist/ArtistBanner.js +++ b/frontend/src/Artist/ArtistBanner.js @@ -67,14 +67,11 @@ class ArtistBanner extends Component { hasError: false, isLoaded: true }); - } - - // The banner could not be loaded.. - if (!nextBanner && (this.props !== prevProps)) { + } else if (!nextBanner && banner) { this.setState({ - banner: undefined, + banner: nextBanner, bannerUrl: bannerPlaceholder, - hasError: true + hasError: false }); } } diff --git a/frontend/src/Artist/ArtistPoster.js b/frontend/src/Artist/ArtistPoster.js index 55ed9d1d7..21038a9f6 100644 --- a/frontend/src/Artist/ArtistPoster.js +++ b/frontend/src/Artist/ArtistPoster.js @@ -67,14 +67,11 @@ class ArtistPoster extends Component { hasError: false, isLoaded: true }); - } - - // The poster could not be loaded.. - if (!nextPoster && (this.props !== prevProps)) { + } else if (!nextPoster && poster) { this.setState({ - poster: undefined, + poster: nextPoster, posterUrl: posterPlaceholder, - hasError: true + hasError: false }); } } diff --git a/frontend/src/Artist/Delete/DeleteArtistModalContent.js b/frontend/src/Artist/Delete/DeleteArtistModalContent.js index 5ae69155e..c17cf69f9 100644 --- a/frontend/src/Artist/Delete/DeleteArtistModalContent.js +++ b/frontend/src/Artist/Delete/DeleteArtistModalContent.js @@ -136,7 +136,9 @@ DeleteArtistModalContent.propTypes = { }; DeleteArtistModalContent.defaultProps = { - trackFileCount: 0 + statistics: { + trackFileCount: 0 + } }; export default DeleteArtistModalContent; diff --git a/frontend/src/Artist/Details/ArtistDetailsSeason.js b/frontend/src/Artist/Details/ArtistDetailsSeason.js index 3df7fca77..4ec43447b 100644 --- a/frontend/src/Artist/Details/ArtistDetailsSeason.js +++ b/frontend/src/Artist/Details/ArtistDetailsSeason.js @@ -150,12 +150,13 @@ class ArtistDetailsSeason extends Component {
- + + + { !isSmallScreen && diff --git a/frontend/src/Artist/Index/Table/ArtistStatusCell.js b/frontend/src/Artist/Index/Table/ArtistStatusCell.js index ab3042a10..7ead1d0cf 100644 --- a/frontend/src/Artist/Index/Table/ArtistStatusCell.js +++ b/frontend/src/Artist/Index/Table/ArtistStatusCell.js @@ -19,18 +19,19 @@ function ArtistStatusCell(props) { className={className} {...otherProps} > - + + + - + + + ); } diff --git a/frontend/src/Calendar/Agenda/AgendaEvent.js b/frontend/src/Calendar/Agenda/AgendaEvent.js index c869b096c..b450b9382 100644 --- a/frontend/src/Calendar/Agenda/AgendaEvent.js +++ b/frontend/src/Calendar/Agenda/AgendaEvent.js @@ -107,10 +107,11 @@ class AgendaEvent extends Component { { !queueItem && grabbed && - + + + }
diff --git a/frontend/src/Calendar/Events/CalendarEvent.js b/frontend/src/Calendar/Events/CalendarEvent.js index 7a66ae406..f664879ab 100644 --- a/frontend/src/Calendar/Events/CalendarEvent.js +++ b/frontend/src/Calendar/Events/CalendarEvent.js @@ -91,11 +91,12 @@ class CalendarEvent extends Component { { !queueItem && grabbed && - + + + }
diff --git a/frontend/src/Components/Icon.js b/frontend/src/Components/Icon.js index 56213a83b..13daccf5d 100644 --- a/frontend/src/Components/Icon.js +++ b/frontend/src/Components/Icon.js @@ -16,6 +16,10 @@ function Icon(props) { ...otherProps } = props; + if (title && !window.Lidarr.isProduction) { + console.error('Icons cannot have a title'); + } + return ( -
+
diff --git a/frontend/src/Settings/Profiles/Quality/QualityProfileItem.js b/frontend/src/Settings/Profiles/Quality/QualityProfileItem.js index 8161e7061..5950b4d52 100644 --- a/frontend/src/Settings/Profiles/Quality/QualityProfileItem.js +++ b/frontend/src/Settings/Profiles/Quality/QualityProfileItem.js @@ -92,10 +92,9 @@ class QualityProfileItem extends Component { { connectDragSource( -
+
diff --git a/frontend/src/Settings/Profiles/Quality/QualityProfileItemGroup.js b/frontend/src/Settings/Profiles/Quality/QualityProfileItemGroup.js index 34008b1ec..b59df95bb 100644 --- a/frontend/src/Settings/Profiles/Quality/QualityProfileItemGroup.js +++ b/frontend/src/Settings/Profiles/Quality/QualityProfileItemGroup.js @@ -129,11 +129,10 @@ class QualityProfileItemGroup extends Component { { connectDragSource( -
+
) diff --git a/frontend/src/Store/Actions/calendarActions.js b/frontend/src/Store/Actions/calendarActions.js index 3bbd901b3..3d4337b60 100644 --- a/frontend/src/Store/Actions/calendarActions.js +++ b/frontend/src/Store/Actions/calendarActions.js @@ -45,7 +45,7 @@ export const defaultState = { filters: [ { key: 'monitored', - value: false, + value: false || true, type: filterTypes.EQUAL } ] @@ -192,7 +192,6 @@ export const clearCalendar = createAction(CLEAR_CALENDAR); // Action Handlers export const actionHandlers = handleThunks({ - [FETCH_CALENDAR]: function(getState, payload, dispatch) { const state = getState(); const unmonitored = state.calendar.selectedFilterKey === 'all'; @@ -339,8 +338,8 @@ export const reducers = createHandleActions({ [CLEAR_CALENDAR]: (state) => { const { view, - showUpcoming, selectedFilterKey, + showUpcoming, ...otherDefaultState } = defaultState; diff --git a/frontend/src/Store/Actions/queueActions.js b/frontend/src/Store/Actions/queueActions.js index 8102fe6d8..d13c6ed57 100644 --- a/frontend/src/Store/Actions/queueActions.js +++ b/frontend/src/Store/Actions/queueActions.js @@ -225,7 +225,7 @@ export const actionHandlers = handleThunks({ promise.done((data) => { dispatch(batchActions([ - dispatch(fetchQueue()), + fetchQueue(), set({ section: paged, diff --git a/frontend/src/System/Backup/BackupRow.js b/frontend/src/System/Backup/BackupRow.js index e32145352..cbc53812e 100644 --- a/frontend/src/System/Backup/BackupRow.js +++ b/frontend/src/System/Backup/BackupRow.js @@ -87,10 +87,11 @@ class BackupRow extends Component { { - + + + } diff --git a/frontend/src/System/Status/Health/Health.js b/frontend/src/System/Status/Health/Health.js index ff2165048..869354ae1 100644 --- a/frontend/src/System/Status/Health/Health.js +++ b/frontend/src/System/Status/Health/Health.js @@ -125,11 +125,12 @@ class Health extends Component { return ( - + + + {item.message} diff --git a/src/NzbDrone.Core/Music/Commands/BulkMoveArtistCommand.cs b/src/NzbDrone.Core/Music/Commands/BulkMoveArtistCommand.cs index 52a4cfafd..1a2fed394 100644 --- a/src/NzbDrone.Core/Music/Commands/BulkMoveArtistCommand.cs +++ b/src/NzbDrone.Core/Music/Commands/BulkMoveArtistCommand.cs @@ -1,3 +1,4 @@ +using System; using System.Collections.Generic; using NzbDrone.Core.Messaging.Commands; @@ -11,9 +12,39 @@ namespace NzbDrone.Core.Music.Commands public override bool SendUpdatesToClient => true; } - public class BulkMoveArtist + public class BulkMoveArtist : IEquatable { public int ArtistId { get; set; } public string SourcePath { get; set; } + + public bool Equals(BulkMoveArtist other) + { + if (other == null) + { + return false; + } + + return ArtistId.Equals(other.ArtistId); + } + + public override bool Equals(object obj) + { + if (obj == null) + { + return false; + } + + if (obj.GetType() != GetType()) + { + return false; + } + + return ArtistId.Equals(((BulkMoveArtist)obj).ArtistId); + } + + public override int GetHashCode() + { + return ArtistId.GetHashCode(); + } } }