From 9b9ca54e65b43d215893838378d4f748bd01db57 Mon Sep 17 00:00:00 2001 From: Qstick Date: Sun, 27 Jan 2019 00:21:44 -0500 Subject: [PATCH] New: Toggle Monitored from Artist Details Page --- frontend/src/Artist/Details/ArtistDetails.css | 31 +++++++++++++------ frontend/src/Artist/Details/ArtistDetails.js | 27 +++++++++++++--- .../Artist/Details/ArtistDetailsConnector.js | 11 +++++++ 3 files changed, 54 insertions(+), 15 deletions(-) diff --git a/frontend/src/Artist/Details/ArtistDetails.css b/frontend/src/Artist/Details/ArtistDetails.css index 485be844b..dd1e8be64 100644 --- a/frontend/src/Artist/Details/ArtistDetails.css +++ b/frontend/src/Artist/Details/ArtistDetails.css @@ -32,13 +32,6 @@ color: $white; } -.logo { - flex-shrink: 0; - margin-right: 35px; - width: 250px; - height: 97px; -} - .poster { flex-shrink: 0; margin-right: 35px; @@ -68,19 +61,33 @@ .titleContainer { display: flex; - justify-content: space-between; + margin-bottom: 5px; } .title { - margin-bottom: 5px; font-weight: 300; font-size: 50px; line-height: 50px; } +.toggleMonitoredContainer { + align-self: center; + margin-right: 10px; +} + +.monitorToggleButton { + composes: toggleButton from 'Components/MonitorToggleButton.css'; + + width: 40px; + + &:hover { + color: $iconButtonHoverLightColor; + } +} + .alternateTitlesIconContainer { + align-self: flex-end; margin-left: 20px; - line-height: 50px; } .artistNavigationButtons { @@ -94,6 +101,10 @@ width: 30px; color: #e1e2e3; white-space: nowrap; + + &:hover { + color: $iconButtonHoverLightColor; + } } .details { diff --git a/frontend/src/Artist/Details/ArtistDetails.js b/frontend/src/Artist/Details/ArtistDetails.js index 21bce5fbc..1d2dfe858 100644 --- a/frontend/src/Artist/Details/ArtistDetails.js +++ b/frontend/src/Artist/Details/ArtistDetails.js @@ -12,6 +12,7 @@ import Icon from 'Components/Icon'; import IconButton from 'Components/Link/IconButton'; import Label from 'Components/Label'; import Measure from 'Components/Measure'; +import MonitorToggleButton from 'Components/MonitorToggleButton'; import LoadingIndicator from 'Components/Loading/LoadingIndicator'; import PageContent from 'Components/Page/PageContent'; import PageContentBodyConnector from 'Components/Page/PageContentBodyConnector'; @@ -173,6 +174,7 @@ class ArtistDetails extends Component { images, alternateTitles, tags, + isSaving, isRefreshing, isSearching, isFetching, @@ -182,6 +184,7 @@ class ArtistDetails extends Component { hasMonitoredAlbums, previousArtist, nextArtist, + onMonitorTogglePress, onRefreshPress, onSearchPress } = this.props; @@ -313,13 +316,25 @@ class ArtistDetails extends Component { />
-
-
- {artistName} +
+
+
+ +
+ +
+ {artistName} +
{ !!alternateTitles.length && - +
} position={tooltipPositions.BOTTOM} /> - +
}
@@ -616,6 +631,7 @@ ArtistDetails.propTypes = { images: PropTypes.arrayOf(PropTypes.object).isRequired, alternateTitles: PropTypes.arrayOf(PropTypes.string).isRequired, tags: PropTypes.arrayOf(PropTypes.number).isRequired, + isSaving: PropTypes.bool.isRequired, isRefreshing: PropTypes.bool.isRequired, isSearching: PropTypes.bool.isRequired, isFetching: PropTypes.bool.isRequired, @@ -625,6 +641,7 @@ ArtistDetails.propTypes = { hasMonitoredAlbums: PropTypes.bool.isRequired, previousArtist: PropTypes.object.isRequired, nextArtist: PropTypes.object.isRequired, + onMonitorTogglePress: PropTypes.func.isRequired, onRefreshPress: PropTypes.func.isRequired, onSearchPress: PropTypes.func.isRequired }; diff --git a/frontend/src/Artist/Details/ArtistDetailsConnector.js b/frontend/src/Artist/Details/ArtistDetailsConnector.js index 27e849b6c..f7ed9db40 100644 --- a/frontend/src/Artist/Details/ArtistDetailsConnector.js +++ b/frontend/src/Artist/Details/ArtistDetailsConnector.js @@ -10,6 +10,7 @@ import createAllArtistSelector from 'Store/Selectors/createAllArtistSelector'; import createCommandsSelector from 'Store/Selectors/createCommandsSelector'; import { fetchAlbums, clearAlbums } from 'Store/Actions/albumActions'; import { fetchTrackFiles, clearTrackFiles } from 'Store/Actions/trackFileActions'; +import { toggleArtistMonitored } from 'Store/Actions/artistActions'; import { fetchQueueDetails, clearQueueDetails } from 'Store/Actions/queueActions'; import { executeCommand } from 'Store/Actions/commandActions'; import * as commandNames from 'Commands/commandNames'; @@ -101,6 +102,7 @@ const mapDispatchToProps = { clearAlbums, fetchTrackFiles, clearTrackFiles, + toggleArtistMonitored, fetchQueueDetails, clearQueueDetails, executeCommand @@ -168,6 +170,13 @@ class ArtistDetailsConnector extends Component { // // Listeners + onMonitorTogglePress = (monitored) => { + this.props.toggleArtistMonitored({ + artistId: this.props.id, + monitored + }); + } + onRefreshPress = () => { this.props.executeCommand({ name: commandNames.REFRESH_ARTIST, @@ -189,6 +198,7 @@ class ArtistDetailsConnector extends Component { return ( @@ -208,6 +218,7 @@ ArtistDetailsConnector.propTypes = { clearAlbums: PropTypes.func.isRequired, fetchTrackFiles: PropTypes.func.isRequired, clearTrackFiles: PropTypes.func.isRequired, + toggleArtistMonitored: PropTypes.func.isRequired, fetchQueueDetails: PropTypes.func.isRequired, clearQueueDetails: PropTypes.func.isRequired, executeCommand: PropTypes.func.isRequired