Fixed: Last UI reference to nameSlug, remove from model

This commit is contained in:
Qstick 2018-01-21 23:22:12 -05:00
parent afc4aeb25f
commit b0070e0229
17 changed files with 6 additions and 279 deletions

View file

@ -66,7 +66,6 @@ class AddNewArtistSearchResult extends Component {
const {
foreignArtistId,
artistName,
nameSlug,
year,
disambiguation,
artistType,
@ -79,7 +78,7 @@ class AddNewArtistSearchResult extends Component {
isSmallScreen
} = this.props;
const linkProps = isExistingArtist ? { to: `/artist/${nameSlug}` } : { onPress: this.onPress };
const linkProps = isExistingArtist ? { to: `/artist/${foreignArtistId}` } : { onPress: this.onPress };
let albums = '1 Album';
if (albumCount > 1) {
@ -193,7 +192,6 @@ class AddNewArtistSearchResult extends Component {
AddNewArtistSearchResult.propTypes = {
foreignArtistId: PropTypes.string.isRequired,
artistName: PropTypes.string.isRequired,
nameSlug: PropTypes.string.isRequired,
year: PropTypes.number,
disambiguation: PropTypes.string,
artistType: PropTypes.string,

View file

@ -19,7 +19,6 @@ class AlbumStudioRow extends Component {
const {
artistId,
status,
nameSlug,
foreignArtistId,
artistName,
monitored,
@ -84,7 +83,6 @@ class AlbumStudioRow extends Component {
AlbumStudioRow.propTypes = {
artistId: PropTypes.number.isRequired,
status: PropTypes.string.isRequired,
nameSlug: PropTypes.string.isRequired,
foreignArtistId: PropTypes.string.isRequired,
artistName: PropTypes.string.isRequired,
monitored: PropTypes.bool.isRequired,

View file

@ -20,7 +20,6 @@ function createMapStateToProps() {
...artist,
artistId: artist.id,
artistName: artist.artistName,
nameSlug: artist.nameSlug,
monitored: artist.monitored,
status: artist.status,
isSaving: artist.isSaving,

View file

@ -66,7 +66,6 @@ class ArtistIndexRow extends Component {
monitored,
status,
artistName,
nameSlug,
foreignArtistId,
artistType,
qualityProfile,
@ -79,7 +78,6 @@ class ArtistIndexRow extends Component {
trackCount,
trackFileCount,
totalTrackCount,
latestAlbum,
path,
sizeOnDisk,
tags,
@ -361,7 +359,6 @@ ArtistIndexRow.propTypes = {
monitored: PropTypes.bool.isRequired,
status: PropTypes.string.isRequired,
artistName: PropTypes.string.isRequired,
nameSlug: PropTypes.string.isRequired,
foreignArtistId: PropTypes.string.isRequired,
artistType: PropTypes.string,
qualityProfile: PropTypes.object.isRequired,

View file

@ -1,126 +0,0 @@
import React from 'react';
import getProgressBarKind from 'Utilities/Artist/getProgressBarKind';
import ProgressBar from 'Components/ProgressBar';
import VirtualTableRowCell from 'Components/Table/Cells/VirtualTableRowCell';
import RelativeDateCellConnector from 'Components/Table/Cells/RelativeDateCellConnector';
import QualityProfileNameConnector from 'Settings/Profiles/Quality/QualityProfileNameConnector';
import ArtistNameLink from 'Artist/ArtistNameLink';
import ArtistIndexItemConnector from 'Artist/Index/ArtistIndexItemConnector';
import ArtistIndexActionsCell from './ArtistIndexActionsCell';
import ArtistStatusCell from './ArtistStatusCell';
export default function artistIndexCellRenderers(cellProps) {
const {
cellKey,
dataKey,
rowData,
...otherProps
} = cellProps;
const {
id,
monitored,
status,
name,
nameSlug,
foreignArtistId,
qualityProfileId,
nextAiring,
previousAiring,
albumCount,
trackCount,
trackFileCount
} = rowData;
const progress = trackCount ? trackFileCount / trackCount * 100 : 100;
if (dataKey === 'status') {
return (
<ArtistStatusCell
key={cellKey}
monitored={monitored}
status={status}
component={VirtualTableRowCell}
{...otherProps}
/>
);
}
if (dataKey === 'sortName') {
return (
<VirtualTableRowCell
key={cellKey}
{...otherProps}
>
<ArtistNameLink
foreignArtistId={foreignArtistId}
name={name}
/>
</VirtualTableRowCell>
);
}
if (dataKey === 'qualityProfileId') {
return (
<VirtualTableRowCell
key={cellKey}
{...otherProps}
>
<QualityProfileNameConnector
qualityProfileId={qualityProfileId}
/>
</VirtualTableRowCell>
);
}
if (dataKey === 'nextAiring') {
return (
<RelativeDateCellConnector
key={cellKey}
date={nextAiring}
component={VirtualTableRowCell}
{...otherProps}
/>
);
}
if (dataKey === 'albumCount') {
return (
<VirtualTableRowCell
key={cellKey}
{...otherProps}
>
{albumCount}
</VirtualTableRowCell>
);
}
if (dataKey === 'trackProgress') {
return (
<VirtualTableRowCell
key={cellKey}
{...otherProps}
>
<ProgressBar
progress={progress}
kind={getProgressBarKind(status, monitored, progress)}
showText={true}
text={`${trackFileCount} / ${trackCount}`}
width={125}
/>
</VirtualTableRowCell>
);
}
if (dataKey === 'actions') {
return (
<ArtistIndexItemConnector
key={cellKey}
component={ArtistIndexActionsCell}
id={id}
{...otherProps}
/>
);
}
}