mirror of
https://github.com/lidarr/lidarr.git
synced 2025-07-07 21:42:16 -07:00
[UI Work] Artist Detail Page, Album Studio, Wanted, NavSearch, Rename
This commit is contained in:
parent
456ead09da
commit
0054226307
93 changed files with 590 additions and 603 deletions
|
@ -18,9 +18,9 @@ function ErrorPage(props) {
|
|||
if (!isLocalStorageSupported) {
|
||||
errorMessage = 'Local Storage is not supported or disabled. A plugin or private browsing may have disabled it.';
|
||||
} else if (seriesError) {
|
||||
errorMessage = getErrorMessage(seriesError, 'Failed to load series from API');
|
||||
errorMessage = getErrorMessage(seriesError, 'Failed to load artist from API');
|
||||
} else if (tagsError) {
|
||||
errorMessage = getErrorMessage(seriesError, 'Failed to load series from API');
|
||||
errorMessage = getErrorMessage(seriesError, 'Failed to load artist from API');
|
||||
} else if (qualityProfilesError) {
|
||||
errorMessage = getErrorMessage(qualityProfilesError, 'Failed to load quality profiles from API');
|
||||
} else if (uiSettingsError) {
|
||||
|
|
|
@ -6,12 +6,12 @@ import jdu from 'jdu';
|
|||
import { icons } from 'Helpers/Props';
|
||||
import Icon from 'Components/Icon';
|
||||
import keyboardShortcuts, { shortcuts } from 'Components/keyboardShortcuts';
|
||||
import SeriesSearchResult from './SeriesSearchResult';
|
||||
import styles from './SeriesSearchInput.css';
|
||||
import ArtistSearchResult from './ArtistSearchResult';
|
||||
import styles from './ArtistSearchInput.css';
|
||||
|
||||
const ADD_NEW_TYPE = 'addNew';
|
||||
|
||||
class SeriesSearchInput extends Component {
|
||||
class ArtistSearchInput extends Component {
|
||||
|
||||
//
|
||||
// Lifecycle
|
||||
|
@ -28,7 +28,7 @@ class SeriesSearchInput extends Component {
|
|||
}
|
||||
|
||||
componentDidMount() {
|
||||
this.props.bindShortcut(shortcuts.SERIES_SEARCH_INPUT.key, this.focusInput);
|
||||
this.props.bindShortcut(shortcuts.ARTIST_SEARCH_INPUT.key, this.focusInput);
|
||||
}
|
||||
|
||||
//
|
||||
|
@ -69,7 +69,7 @@ class SeriesSearchInput extends Component {
|
|||
}
|
||||
|
||||
return (
|
||||
<SeriesSearchResult
|
||||
<ArtistSearchResult
|
||||
query={query}
|
||||
{...item}
|
||||
/>
|
||||
|
@ -78,7 +78,7 @@ class SeriesSearchInput extends Component {
|
|||
|
||||
goToSeries(series) {
|
||||
this.setState({ value: '' });
|
||||
this.props.onGoToSeries(series.titleSlug);
|
||||
this.props.onGoToSeries(series.nameSlug);
|
||||
}
|
||||
|
||||
reset() {
|
||||
|
@ -137,7 +137,7 @@ class SeriesSearchInput extends Component {
|
|||
const suggestions = _.filter(this.props.series, (series) => {
|
||||
// Check the title first and if there isn't a match fallback to the alternate titles
|
||||
|
||||
const titleMatch = jdu.replace(series.title).toLowerCase().contains(lowerCaseValue);
|
||||
const titleMatch = jdu.replace(series.artistName).toLowerCase().contains(lowerCaseValue);
|
||||
|
||||
return titleMatch || _.some(series.alternateTitles, (alternateTitle) => {
|
||||
return jdu.replace(alternateTitle.title).toLowerCase().contains(lowerCaseValue);
|
||||
|
@ -172,14 +172,14 @@ class SeriesSearchInput extends Component {
|
|||
|
||||
if (suggestions.length) {
|
||||
suggestionGroups.push({
|
||||
title: 'Existing Series',
|
||||
title: 'Existing Artist',
|
||||
suggestions
|
||||
});
|
||||
}
|
||||
|
||||
if (suggestions.length <= 3) {
|
||||
suggestionGroups.push({
|
||||
title: 'Add New Series',
|
||||
title: 'Add New Artist',
|
||||
suggestions: [
|
||||
{
|
||||
type: ADD_NEW_TYPE,
|
||||
|
@ -240,11 +240,11 @@ class SeriesSearchInput extends Component {
|
|||
}
|
||||
}
|
||||
|
||||
SeriesSearchInput.propTypes = {
|
||||
ArtistSearchInput.propTypes = {
|
||||
series: PropTypes.arrayOf(PropTypes.object).isRequired,
|
||||
onGoToSeries: PropTypes.func.isRequired,
|
||||
onGoToAddNewArtist: PropTypes.func.isRequired,
|
||||
bindShortcut: PropTypes.func.isRequired
|
||||
};
|
||||
|
||||
export default keyboardShortcuts(SeriesSearchInput);
|
||||
export default keyboardShortcuts(ArtistSearchInput);
|
|
@ -2,15 +2,15 @@ import _ from 'lodash';
|
|||
import { connect } from 'react-redux';
|
||||
import { push } from 'react-router-redux';
|
||||
import { createSelector } from 'reselect';
|
||||
import createAllSeriesSelector from 'Store/Selectors/createAllSeriesSelector';
|
||||
import SeriesSearchInput from './SeriesSearchInput';
|
||||
import createAllArtistSelector from 'Store/Selectors/createAllArtistSelector';
|
||||
import ArtistSearchInput from './ArtistSearchInput';
|
||||
|
||||
function createMapStateToProps() {
|
||||
return createSelector(
|
||||
createAllSeriesSelector(),
|
||||
createAllArtistSelector(),
|
||||
(series) => {
|
||||
return {
|
||||
series: _.sortBy(series, 'sortTitle')
|
||||
series: _.sortBy(series, 'sortName')
|
||||
};
|
||||
}
|
||||
);
|
||||
|
@ -18,8 +18,8 @@ function createMapStateToProps() {
|
|||
|
||||
function createMapDispatchToProps(dispatch, props) {
|
||||
return {
|
||||
onGoToSeries(titleSlug) {
|
||||
dispatch(push(`${window.Sonarr.urlBase}/series/${titleSlug}`));
|
||||
onGoToSeries(nameSlug) {
|
||||
dispatch(push(`${window.Sonarr.urlBase}/artist/${nameSlug}`));
|
||||
},
|
||||
|
||||
onGoToAddNewArtist(query) {
|
||||
|
@ -28,4 +28,4 @@ function createMapDispatchToProps(dispatch, props) {
|
|||
};
|
||||
}
|
||||
|
||||
export default connect(createMapStateToProps, createMapDispatchToProps)(SeriesSearchInput);
|
||||
export default connect(createMapStateToProps, createMapDispatchToProps)(ArtistSearchInput);
|
|
@ -2,7 +2,7 @@ import _ from 'lodash';
|
|||
import PropTypes from 'prop-types';
|
||||
import React from 'react';
|
||||
import ArtistPoster from 'Artist/ArtistPoster';
|
||||
import styles from './SeriesSearchResult.css';
|
||||
import styles from './ArtistSearchResult.css';
|
||||
|
||||
function getMatchingAlternateTile(alternateTitles, query) {
|
||||
return _.first(alternateTitles, (alternateTitle) => {
|
||||
|
@ -10,18 +10,18 @@ function getMatchingAlternateTile(alternateTitles, query) {
|
|||
});
|
||||
}
|
||||
|
||||
function SeriesSearchResult(props) {
|
||||
function ArtistSearchResult(props) {
|
||||
const {
|
||||
query,
|
||||
title,
|
||||
alternateTitles,
|
||||
artistName,
|
||||
// alternateTitles,
|
||||
images
|
||||
} = props;
|
||||
|
||||
const index = title.toLowerCase().indexOf(query.toLowerCase());
|
||||
const alternateTitle = index === -1 ?
|
||||
getMatchingAlternateTile(alternateTitles, query) :
|
||||
null;
|
||||
const index = artistName.toLowerCase().indexOf(query.toLowerCase());
|
||||
// const alternateTitle = index === -1 ?
|
||||
// getMatchingAlternateTile(alternateTitles, query) :
|
||||
// null;
|
||||
|
||||
return (
|
||||
<div className={styles.result}>
|
||||
|
@ -35,25 +35,25 @@ function SeriesSearchResult(props) {
|
|||
|
||||
<div className={styles.titles}>
|
||||
<div className={styles.title}>
|
||||
{title}
|
||||
{artistName}
|
||||
</div>
|
||||
|
||||
{
|
||||
!!alternateTitle &&
|
||||
<div className={styles.alternateTitle}>
|
||||
{alternateTitle.title}
|
||||
</div>
|
||||
// !!alternateTitle &&
|
||||
// <div className={styles.alternateTitle}>
|
||||
// {alternateTitle.title}
|
||||
// </div>
|
||||
}
|
||||
</div>
|
||||
</div>
|
||||
);
|
||||
}
|
||||
|
||||
SeriesSearchResult.propTypes = {
|
||||
ArtistSearchResult.propTypes = {
|
||||
query: PropTypes.string.isRequired,
|
||||
title: PropTypes.string.isRequired,
|
||||
alternateTitles: PropTypes.arrayOf(PropTypes.object).isRequired,
|
||||
artistName: PropTypes.string.isRequired,
|
||||
// alternateTitles: PropTypes.arrayOf(PropTypes.object).isRequired,
|
||||
images: PropTypes.arrayOf(PropTypes.object).isRequired
|
||||
};
|
||||
|
||||
export default SeriesSearchResult;
|
||||
export default ArtistSearchResult;
|
|
@ -4,7 +4,7 @@ import { icons } from 'Helpers/Props';
|
|||
import keyboardShortcuts, { shortcuts } from 'Components/keyboardShortcuts';
|
||||
import IconButton from 'Components/Link/IconButton';
|
||||
import Link from 'Components/Link/Link';
|
||||
import SeriesSearchInputConnector from './SeriesSearchInputConnector';
|
||||
import ArtistSearchInputConnector from './ArtistSearchInputConnector';
|
||||
import PageHeaderActionsMenuConnector from './PageHeaderActionsMenuConnector';
|
||||
import KeyboardShortcutsModal from './KeyboardShortcutsModal';
|
||||
import styles from './PageHeader.css';
|
||||
|
@ -68,7 +68,7 @@ class PageHeader extends Component {
|
|||
/>
|
||||
</div>
|
||||
|
||||
<SeriesSearchInputConnector />
|
||||
<ArtistSearchInputConnector />
|
||||
|
||||
<div className={styles.right}>
|
||||
<IconButton
|
||||
|
|
|
@ -5,7 +5,7 @@ import { withRouter } from 'react-router-dom';
|
|||
import { createSelector } from 'reselect';
|
||||
import createDimensionsSelector from 'Store/Selectors/createDimensionsSelector';
|
||||
import { saveDimensions, setIsSidebarVisible } from 'Store/Actions/appActions';
|
||||
import { fetchArtist } from 'Store/Actions/seriesActions';
|
||||
import { fetchArtist } from 'Store/Actions/artistActions';
|
||||
import { fetchTags } from 'Store/Actions/tagActions';
|
||||
import { fetchQualityProfiles, fetchLanguageProfiles, fetchUISettings } from 'Store/Actions/settingsActions';
|
||||
import { fetchStatus } from 'Store/Actions/systemActions';
|
||||
|
|
|
@ -17,7 +17,7 @@ function getIconName(name) {
|
|||
return icons.SEARCH;
|
||||
case 'Housekeeping':
|
||||
return icons.HOUSEKEEPING;
|
||||
case 'RefreshSeries':
|
||||
case 'RefreshArtist':
|
||||
return icons.REFRESH;
|
||||
case 'RssSync':
|
||||
return icons.RSS;
|
||||
|
|
|
@ -34,11 +34,11 @@ const links = [
|
|||
},
|
||||
{
|
||||
title: 'Mass Editor',
|
||||
to: '/serieseditor'
|
||||
to: '/artisteditor'
|
||||
},
|
||||
{
|
||||
title: 'Album Studio',
|
||||
to: '/seasonpass'
|
||||
to: '/albumstudio'
|
||||
}
|
||||
]
|
||||
},
|
||||
|
|
|
@ -8,7 +8,7 @@ export const shortcuts = {
|
|||
name: 'Open This Modal'
|
||||
},
|
||||
|
||||
SERIES_SEARCH_INPUT: {
|
||||
ARTIST_SEARCH_INPUT: {
|
||||
key: 's',
|
||||
name: 'Focus Search Box'
|
||||
},
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue