Fixed: UI fixes from Sonarr

Co-Authored-By: Mark McDowall <markus101@users.noreply.github.com>
pull/6/head
Qstick 6 years ago
parent 6eafffeb2c
commit b506fd3ab7

@ -116,12 +116,13 @@ class AddNewArtistSearchResult extends Component {
{ {
isExistingArtist && isExistingArtist &&
<Icon <span title="Already in your library">
className={styles.alreadyExistsIcon} <Icon
name={icons.CHECK_CIRCLE} className={styles.alreadyExistsIcon}
size={36} name={icons.CHECK_CIRCLE}
title="Already in your library" size={36}
/> />
</span>
} }
</div> </div>

@ -134,12 +134,13 @@ class AlbumDetailsMedium extends Component {
className={styles.expandButton} className={styles.expandButton}
onPress={this.onExpandPress} onPress={this.onExpandPress}
> >
<Icon <span title={isExpanded ? 'Hide tracks' : 'Show tracks'}>
className={styles.expandButtonIcon} <Icon
name={isExpanded ? icons.COLLAPSE : icons.EXPAND} className={styles.expandButtonIcon}
title={isExpanded ? 'Hide tracks' : 'Show tracks'} name={isExpanded ? icons.COLLAPSE : icons.EXPAND}
size={24} size={24}
/> />
</span>
{ {
!isSmallScreen && !isSmallScreen &&
<span>&nbsp;</span> <span>&nbsp;</span>

@ -48,10 +48,9 @@ function EpisodeStatus(props) {
if (grabbed) { if (grabbed) {
return ( return (
<div className={styles.center}> <div className={styles.center} title="Album is downloading">
<Icon <Icon
name={icons.DOWNLOADING} name={icons.DOWNLOADING}
title="Album is downloading"
/> />
</div> </div>
); );
@ -75,10 +74,9 @@ function EpisodeStatus(props) {
if (!airDateUtc) { if (!airDateUtc) {
return ( return (
<div className={styles.center}> <div className={styles.center} title="TBA">
<Icon <Icon
name={icons.TBA} name={icons.TBA}
title="TBA"
/> />
</div> </div>
); );
@ -86,10 +84,9 @@ function EpisodeStatus(props) {
if (!monitored) { if (!monitored) {
return ( return (
<div className={styles.center}> <div className={styles.center} title="Album is not monitored">
<Icon <Icon
name={icons.UNMONITORED} name={icons.UNMONITORED}
title="Album is not monitored"
/> />
</div> </div>
); );
@ -97,20 +94,18 @@ function EpisodeStatus(props) {
if (hasAired) { if (hasAired) {
return ( return (
<div className={styles.center}> <div className={styles.center} title="Track missing from disk">
<Icon <Icon
name={icons.MISSING} name={icons.MISSING}
title="Track missing from disk"
/> />
</div> </div>
); );
} }
return ( return (
<div className={styles.center}> <div className={styles.center} title="Album has not aired">
<Icon <Icon
name={icons.NOT_AIRED} name={icons.NOT_AIRED}
title="Album has not aired"
/> />
</div> </div>
); );

@ -39,12 +39,12 @@ class AlbumStudioRow extends Component {
/> />
<TableRowCell className={styles.status}> <TableRowCell className={styles.status}>
<Icon <span title={status === 'ended' ? 'Ended' : 'Continuing'}>
className={styles.statusIcon} <Icon
name={status === 'ended' ? icons.ARTIST_ENDED : icons.ARTIST_CONTINUING} className={styles.statusIcon}
title={status === 'ended' ? 'Ended' : 'Continuing'} name={status === 'ended' ? icons.ARTIST_ENDED : icons.ARTIST_CONTINUING}
/>
/> </span>
</TableRowCell> </TableRowCell>
<TableRowCell className={styles.title}> <TableRowCell className={styles.title}>

@ -67,14 +67,11 @@ class ArtistBanner extends Component {
hasError: false, hasError: false,
isLoaded: true isLoaded: true
}); });
} } else if (!nextBanner && banner) {
// The banner could not be loaded..
if (!nextBanner && (this.props !== prevProps)) {
this.setState({ this.setState({
banner: undefined, banner: nextBanner,
bannerUrl: bannerPlaceholder, bannerUrl: bannerPlaceholder,
hasError: true hasError: false
}); });
} }
} }

@ -67,14 +67,11 @@ class ArtistPoster extends Component {
hasError: false, hasError: false,
isLoaded: true isLoaded: true
}); });
} } else if (!nextPoster && poster) {
// The poster could not be loaded..
if (!nextPoster && (this.props !== prevProps)) {
this.setState({ this.setState({
poster: undefined, poster: nextPoster,
posterUrl: posterPlaceholder, posterUrl: posterPlaceholder,
hasError: true hasError: false
}); });
} }
} }

@ -136,7 +136,9 @@ DeleteArtistModalContent.propTypes = {
}; };
DeleteArtistModalContent.defaultProps = { DeleteArtistModalContent.defaultProps = {
trackFileCount: 0 statistics: {
trackFileCount: 0
}
}; };
export default DeleteArtistModalContent; export default DeleteArtistModalContent;

@ -150,12 +150,13 @@ class ArtistDetailsSeason extends Component {
</div> </div>
<Icon <span title={isExpanded ? 'Hide albums' : 'Show albums'}>
className={styles.expandButtonIcon} <Icon
name={isExpanded ? icons.COLLAPSE : icons.EXPAND} className={styles.expandButtonIcon}
title={isExpanded ? 'Hide albums' : 'Show albums'} name={isExpanded ? icons.COLLAPSE : icons.EXPAND}
size={24} size={24}
/> />
</span>
{ {
!isSmallScreen && !isSmallScreen &&

@ -19,18 +19,19 @@ function ArtistStatusCell(props) {
className={className} className={className}
{...otherProps} {...otherProps}
> >
<Icon <span title={monitored ? 'Artist is monitored' : 'Artist is unmonitored'}>
className={styles.statusIcon} <Icon
name={monitored ? icons.MONITORED : icons.UNMONITORED} className={styles.statusIcon}
title={monitored ? 'Artist is monitored' : 'Artist is unmonitored'} name={monitored ? icons.MONITORED : icons.UNMONITORED}
/> />
</span>
<Icon <span title={status === 'ended' ? 'Ended' : 'Continuing'}>
className={styles.statusIcon} <Icon
name={status === 'ended' ? icons.ARTIST_ENDED : icons.ARTIST_CONTINUING} className={styles.statusIcon}
title={status === 'ended' ? 'Ended' : 'Continuing'} name={status === 'ended' ? icons.ARTIST_ENDED : icons.ARTIST_CONTINUING}
/>
/> </span>
</Component> </Component>
); );
} }

@ -107,10 +107,11 @@ class AgendaEvent extends Component {
{ {
!queueItem && grabbed && !queueItem && grabbed &&
<Icon <span title="Album is downloading">
name={icons.DOWNLOADING} <Icon
title="Album is downloading" name={icons.DOWNLOADING}
/> />
</span>
} }
</Link> </Link>
</div> </div>

@ -91,11 +91,12 @@ class CalendarEvent extends Component {
{ {
!queueItem && grabbed && !queueItem && grabbed &&
<Icon <span title="Album is downloading">
className={styles.statusIcon} <Icon
name={icons.DOWNLOADING} className={styles.statusIcon}
title="Album is downloading" name={icons.DOWNLOADING}
/> />
</span>
} }
</div> </div>

@ -16,6 +16,10 @@ function Icon(props) {
...otherProps ...otherProps
} = props; } = props;
if (title && !window.Lidarr.isProduction) {
console.error('Icons cannot have a title');
}
return ( return (
<FontAwesomeIcon <FontAwesomeIcon
className={classNames( className={classNames(
@ -24,7 +28,6 @@ function Icon(props) {
)} )}
icon={name} icon={name}
spin={isSpinning} spin={isSpinning}
title={title}
style={{ style={{
fontSize: `${size}px` fontSize: `${size}px`
}} }}

@ -45,10 +45,9 @@ function Message(props) {
styles[type] styles[type]
)} )}
> >
<div className={styles.iconContainer}> <div className={styles.iconContainer} title={name}>
<Icon <Icon
name={getIconName(name)} name={getIconName(name)}
title={name}
/> />
</div> </div>

@ -92,10 +92,9 @@ class QualityProfileItem extends Component {
{ {
connectDragSource( connectDragSource(
<div className={styles.dragHandle}> <div className={styles.dragHandle} title="Create group">
<Icon <Icon
className={styles.dragIcon} className={styles.dragIcon}
title="Create group"
name={icons.REORDER} name={icons.REORDER}
/> />
</div> </div>

@ -129,11 +129,10 @@ class QualityProfileItemGroup extends Component {
{ {
connectDragSource( connectDragSource(
<div className={styles.dragHandle}> <div className={styles.dragHandle} title="Reorder">
<Icon <Icon
className={styles.dragIcon} className={styles.dragIcon}
name={icons.REORDER} name={icons.REORDER}
title="Reorder"
/> />
</div> </div>
) )

@ -45,7 +45,7 @@ export const defaultState = {
filters: [ filters: [
{ {
key: 'monitored', key: 'monitored',
value: false, value: false || true,
type: filterTypes.EQUAL type: filterTypes.EQUAL
} }
] ]
@ -192,7 +192,6 @@ export const clearCalendar = createAction(CLEAR_CALENDAR);
// Action Handlers // Action Handlers
export const actionHandlers = handleThunks({ export const actionHandlers = handleThunks({
[FETCH_CALENDAR]: function(getState, payload, dispatch) { [FETCH_CALENDAR]: function(getState, payload, dispatch) {
const state = getState(); const state = getState();
const unmonitored = state.calendar.selectedFilterKey === 'all'; const unmonitored = state.calendar.selectedFilterKey === 'all';
@ -339,8 +338,8 @@ export const reducers = createHandleActions({
[CLEAR_CALENDAR]: (state) => { [CLEAR_CALENDAR]: (state) => {
const { const {
view, view,
showUpcoming,
selectedFilterKey, selectedFilterKey,
showUpcoming,
...otherDefaultState ...otherDefaultState
} = defaultState; } = defaultState;

@ -225,7 +225,7 @@ export const actionHandlers = handleThunks({
promise.done((data) => { promise.done((data) => {
dispatch(batchActions([ dispatch(batchActions([
dispatch(fetchQueue()), fetchQueue(),
set({ set({
section: paged, section: paged,

@ -87,10 +87,11 @@ class BackupRow extends Component {
<TableRow key={id}> <TableRow key={id}>
<TableRowCell className={styles.type}> <TableRowCell className={styles.type}>
{ {
<Icon <span title={iconTooltip}>
name={iconClassName} <Icon
title={iconTooltip} name={iconClassName}
/> />
</span>
} }
</TableRowCell> </TableRowCell>

@ -125,11 +125,12 @@ class Health extends Component {
return ( return (
<TableRow key={`health${item.message}`}> <TableRow key={`health${item.message}`}>
<TableRowCell> <TableRowCell>
<Icon <span title={titleCase(item.type)}>
name={icons.DANGER} <Icon
kind={item.type.toLowerCase() === 'error' ? kinds.DANGER : kinds.WARNING} name={icons.DANGER}
title={titleCase(item.type)} kind={item.type.toLowerCase() === 'error' ? kinds.DANGER : kinds.WARNING}
/> />
</span>
</TableRowCell> </TableRowCell>
<TableRowCell>{item.message}</TableRowCell> <TableRowCell>{item.message}</TableRowCell>

@ -1,3 +1,4 @@
using System;
using System.Collections.Generic; using System.Collections.Generic;
using NzbDrone.Core.Messaging.Commands; using NzbDrone.Core.Messaging.Commands;
@ -11,9 +12,39 @@ namespace NzbDrone.Core.Music.Commands
public override bool SendUpdatesToClient => true; public override bool SendUpdatesToClient => true;
} }
public class BulkMoveArtist public class BulkMoveArtist : IEquatable<BulkMoveArtist>
{ {
public int ArtistId { get; set; } public int ArtistId { get; set; }
public string SourcePath { 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();
}
} }
} }

Loading…
Cancel
Save