Renames in Frontend

This commit is contained in:
Qstick
2020-05-15 23:32:52 -04:00
committed by ta264
parent ee4e44b81a
commit ee43ccf620
387 changed files with 4036 additions and 4364 deletions
+6 -6
View File
@@ -30,15 +30,15 @@
border: none !important;
}
.artistName,
.albumTitle {
.authorName,
.bookTitle {
@add-mixin truncate;
flex: 0 1 300px;
margin-right: 10px;
}
.albumTitle {
.bookTitle {
flex: 1 1 1px;
}
@@ -46,7 +46,7 @@
flex: 0 0 100px;
}
.albumSeparator {
.bookSeparator {
display: none;
}
@@ -98,7 +98,7 @@
.date,
.time,
.artistName {
.authorName {
flex: 0 0 100%;
}
@@ -106,7 +106,7 @@
flex: 0 0 auto;
}
.albumSeparator {
.bookSeparator {
display: inline-block;
margin: 0 5px;
}
+13 -13
View File
@@ -39,7 +39,7 @@ class AgendaEvent extends Component {
render() {
const {
id,
artist,
author,
title,
titleSlug,
releaseDate,
@@ -54,10 +54,10 @@ class AgendaEvent extends Component {
} = this.props;
const startTime = moment(releaseDate);
// const endTime = startTime.add(artist.runtime, 'minutes');
// const endTime = startTime.add(author.runtime, 'minutes');
const downloading = !!(queueItem || grabbed);
const isMonitored = artist.monitored && monitored;
const statusStyle = getStatusStyle(id, downloading, startTime, isMonitored, statistics.percentOfTracks);
const isMonitored = author.monitored && monitored;
const statusStyle = getStatusStyle(id, downloading, startTime, isMonitored, statistics.percentOfBooks);
return (
<div>
@@ -85,15 +85,15 @@ class AgendaEvent extends Component {
{formatTime(releaseDate, timeFormat)}
</div>
<div className={styles.artistName}>
<Link to={`/author/${artist.titleSlug}`}>
{artist.artistName}
<div className={styles.authorName}>
<Link to={`/author/${author.titleSlug}`}>
{author.authorName}
</Link>
</div>
<div className={styles.albumSeparator}> - </div>
<div className={styles.bookSeparator}> - </div>
<div className={styles.albumTitle}>
<div className={styles.bookTitle}>
<Link to={`/book/${titleSlug}`}>
{title}
</Link>
@@ -110,7 +110,7 @@ class AgendaEvent extends Component {
!queueItem && grabbed &&
<Icon
name={icons.DOWNLOADING}
title="Album is downloading"
title="Book is downloading"
/>
}
</Link>
@@ -121,10 +121,10 @@ class AgendaEvent extends Component {
AgendaEvent.propTypes = {
id: PropTypes.number.isRequired,
artist: PropTypes.object.isRequired,
author: PropTypes.object.isRequired,
title: PropTypes.string.isRequired,
titleSlug: PropTypes.string.isRequired,
albumType: PropTypes.string.isRequired,
bookType: PropTypes.string.isRequired,
releaseDate: PropTypes.string.isRequired,
monitored: PropTypes.bool.isRequired,
statistics: PropTypes.object.isRequired,
@@ -138,7 +138,7 @@ AgendaEvent.propTypes = {
AgendaEvent.defaultProps = {
statistics: {
percentOfTracks: 0
percentOfBooks: 0
}
};
@@ -1,18 +1,18 @@
import { connect } from 'react-redux';
import { createSelector } from 'reselect';
import createArtistSelector from 'Store/Selectors/createArtistSelector';
import createAuthorSelector from 'Store/Selectors/createAuthorSelector';
import createQueueItemSelector from 'Store/Selectors/createQueueItemSelector';
import createUISettingsSelector from 'Store/Selectors/createUISettingsSelector';
import AgendaEvent from './AgendaEvent';
function createMapStateToProps() {
return createSelector(
createArtistSelector(),
createAuthorSelector(),
createQueueItemSelector(),
createUISettingsSelector(),
(artist, queueItem, uiSettings) => {
(author, queueItem, uiSettings) => {
return {
artist,
author,
queueItem,
timeFormat: uiSettings.timeFormat,
longDateFormat: uiSettings.longDateFormat,
+9 -9
View File
@@ -6,7 +6,7 @@ import { registerPagePopulator, unregisterPagePopulator } from 'Utilities/pagePo
import hasDifferentItems from 'Utilities/Object/hasDifferentItems';
import selectUniqueIds from 'Utilities/Object/selectUniqueIds';
import * as calendarActions from 'Store/Actions/calendarActions';
import { fetchTrackFiles, clearTrackFiles } from 'Store/Actions/trackFileActions';
import { fetchBookFiles, clearBookFiles } from 'Store/Actions/bookFileActions';
import { fetchQueueDetails, clearQueueDetails } from 'Store/Actions/queueActions';
import Calendar from './Calendar';
@@ -23,8 +23,8 @@ function createMapStateToProps() {
const mapDispatchToProps = {
...calendarActions,
fetchTrackFiles,
clearTrackFiles,
fetchBookFiles,
clearBookFiles,
fetchQueueDetails,
clearQueueDetails
};
@@ -66,14 +66,14 @@ class CalendarConnector extends Component {
if (hasDifferentItems(prevProps.items, items)) {
const bookIds = selectUniqueIds(items, 'id');
// const trackFileIds = selectUniqueIds(items, 'trackFileId');
// const bookFileIds = selectUniqueIds(items, 'bookFileId');
if (items.length) {
this.props.fetchQueueDetails({ bookIds });
}
// if (trackFileIds.length) {
// this.props.fetchTrackFiles({ trackFileIds });
// if (bookFileIds.length) {
// this.props.fetchBookFiles({ bookFileIds });
// }
}
@@ -86,7 +86,7 @@ class CalendarConnector extends Component {
unregisterPagePopulator(this.repopulate);
this.props.clearCalendar();
this.props.clearQueueDetails();
this.props.clearTrackFiles();
this.props.clearBookFiles();
this.clearUpdateTimeout();
}
@@ -165,8 +165,8 @@ CalendarConnector.propTypes = {
gotoCalendarNextRange: PropTypes.func.isRequired,
clearCalendar: PropTypes.func.isRequired,
fetchCalendar: PropTypes.func.isRequired,
fetchTrackFiles: PropTypes.func.isRequired,
clearTrackFiles: PropTypes.func.isRequired,
fetchBookFiles: PropTypes.func.isRequired,
clearBookFiles: PropTypes.func.isRequired,
fetchQueueDetails: PropTypes.func.isRequired,
clearQueueDetails: PropTypes.func.isRequired
};
+11 -11
View File
@@ -9,7 +9,7 @@ import PageToolbar from 'Components/Page/Toolbar/PageToolbar';
import PageToolbarSection from 'Components/Page/Toolbar/PageToolbarSection';
import PageToolbarButton from 'Components/Page/Toolbar/PageToolbarButton';
import FilterMenu from 'Components/Menu/FilterMenu';
import NoArtist from 'Artist/NoArtist';
import NoAuthor from 'Author/NoAuthor';
import CalendarLinkModal from './iCal/CalendarLinkModal';
import CalendarOptionsModal from './Options/CalendarOptionsModal';
import LegendConnector from './Legend/LegendConnector';
@@ -75,8 +75,8 @@ class CalendarPage extends Component {
const {
selectedFilterKey,
filters,
hasArtist,
artistError,
hasAuthor,
authorError,
missingBookIds,
isSearchingForMissing,
useCurrentPage,
@@ -90,7 +90,7 @@ class CalendarPage extends Component {
const isMeasured = this.state.width > 0;
const PageComponent = hasArtist ? CalendarConnector : NoArtist;
const PageComponent = hasAuthor ? CalendarConnector : NoAuthor;
return (
<PageContent title="Calendar">
@@ -120,7 +120,7 @@ class CalendarPage extends Component {
<FilterMenu
alignMenu={align.RIGHT}
isDisabled={!hasArtist}
isDisabled={!hasAuthor}
selectedFilterKey={selectedFilterKey}
filters={filters}
customFilters={[]}
@@ -134,14 +134,14 @@ class CalendarPage extends Component {
innerClassName={styles.calendarInnerPageBody}
>
{
artistError &&
authorError &&
<div className={styles.errorMessage}>
{getErrorMessage(artistError, 'Failed to load artist from API')}
{getErrorMessage(authorError, 'Failed to load author from API')}
</div>
}
{
!artistError &&
!authorError &&
<Measure
whitelist={['width']}
onMeasure={this.onMeasure}
@@ -157,7 +157,7 @@ class CalendarPage extends Component {
}
{
hasArtist && !!artistError &&
hasAuthor && !!authorError &&
<LegendConnector />
}
</PageContentBodyConnector>
@@ -180,8 +180,8 @@ class CalendarPage extends Component {
CalendarPage.propTypes = {
selectedFilterKey: PropTypes.string.isRequired,
filters: PropTypes.arrayOf(PropTypes.object).isRequired,
hasArtist: PropTypes.bool.isRequired,
artistError: PropTypes.object,
hasAuthor: PropTypes.bool.isRequired,
authorError: PropTypes.object,
missingBookIds: PropTypes.arrayOf(PropTypes.number).isRequired,
isSearchingForMissing: PropTypes.bool.isRequired,
useCurrentPage: PropTypes.bool.isRequired,
+12 -12
View File
@@ -5,7 +5,7 @@ import { isCommandExecuting } from 'Utilities/Command';
import isBefore from 'Utilities/Date/isBefore';
import withCurrentPage from 'Components/withCurrentPage';
import { searchMissing, setCalendarDaysCount, setCalendarFilter } from 'Store/Actions/calendarActions';
import createArtistCountSelector from 'Store/Selectors/createArtistCountSelector';
import createAuthorCountSelector from 'Store/Selectors/createAuthorCountSelector';
import createUISettingsSelector from 'Store/Selectors/createUISettingsSelector';
import createCommandsSelector from 'Store/Selectors/createCommandsSelector';
import CalendarPage from './CalendarPage';
@@ -16,18 +16,18 @@ function createMissingBookIdsSelector() {
(state) => state.calendar.end,
(state) => state.calendar.items,
(state) => state.queue.details.items,
(start, end, albums, queueDetails) => {
return albums.reduce((acc, album) => {
const releaseDate = album.releaseDate;
(start, end, books, queueDetails) => {
return books.reduce((acc, book) => {
const releaseDate = book.releaseDate;
if (
album.percentOfTracks < 100 &&
book.percentOfBooks < 100 &&
moment(releaseDate).isAfter(start) &&
moment(releaseDate).isBefore(end) &&
isBefore(album.releaseDate) &&
!queueDetails.some((details) => !!details.album && details.album.id === album.id)
isBefore(book.releaseDate) &&
!queueDetails.some((details) => !!details.book && details.book.id === book.id)
) {
acc.push(album.id);
acc.push(book.id);
}
return acc;
@@ -56,14 +56,14 @@ function createMapStateToProps() {
return createSelector(
(state) => state.calendar.selectedFilterKey,
(state) => state.calendar.filters,
createArtistCountSelector(),
createAuthorCountSelector(),
createUISettingsSelector(),
createMissingBookIdsSelector(),
createIsSearchingSelector(),
(
selectedFilterKey,
filters,
artistCount,
authorCount,
uiSettings,
missingBookIds,
isSearchingForMissing
@@ -72,8 +72,8 @@ function createMapStateToProps() {
selectedFilterKey,
filters,
colorImpairedMode: uiSettings.enableColorImpairedMode,
hasArtist: !!artistCount.count,
artistError: artistCount.error,
hasAuthor: !!authorCount.count,
authorError: authorCount.error,
missingBookIds,
isSearchingForMissing
};
@@ -12,19 +12,19 @@
}
.info,
.albumInfo {
.bookInfo {
display: flex;
}
.artistName,
.albumTitle {
.authorName,
.bookTitle {
@add-mixin truncate;
flex: 1 0 1px;
margin-right: 10px;
}
.artistName {
.authorName {
color: #3a3f51;
font-size: $defaultFontSize;
}
+13 -13
View File
@@ -43,7 +43,7 @@ class CalendarEvent extends Component {
render() {
const {
id,
artist,
author,
title,
titleSlug,
releaseDate,
@@ -55,15 +55,15 @@ class CalendarEvent extends Component {
colorImpairedMode
} = this.props;
if (!artist) {
if (!author) {
return null;
}
const startTime = moment(releaseDate);
// const endTime = startTime.add(artist.runtime, 'minutes');
// const endTime = startTime.add(author.runtime, 'minutes');
const downloading = !!(queueItem || grabbed);
const isMonitored = artist.monitored && monitored;
const statusStyle = getStatusStyle(id, downloading, startTime, isMonitored, statistics.percentOfTracks);
const isMonitored = author.monitored && monitored;
const statusStyle = getStatusStyle(id, downloading, startTime, isMonitored, statistics.percentOfBooks);
return (
<div>
@@ -77,9 +77,9 @@ class CalendarEvent extends Component {
onPress={this.onPress}
>
<div className={styles.info}>
<div className={styles.artistName}>
<Link to={`/author/${artist.titleSlug}`}>
{artist.artistName}
<div className={styles.authorName}>
<Link to={`/author/${author.titleSlug}`}>
{author.authorName}
</Link>
</div>
@@ -97,13 +97,13 @@ class CalendarEvent extends Component {
<Icon
className={styles.statusIcon}
name={icons.DOWNLOADING}
title="Album is downloading"
title="Book is downloading"
/>
}
</div>
<div className={styles.albumInfo}>
<div className={styles.albumTitle}>
<div className={styles.bookInfo}>
<div className={styles.bookTitle}>
<Link to={`/book/${titleSlug}`}>
{title}
</Link>
@@ -117,7 +117,7 @@ class CalendarEvent extends Component {
CalendarEvent.propTypes = {
id: PropTypes.number.isRequired,
artist: PropTypes.object.isRequired,
author: PropTypes.object.isRequired,
title: PropTypes.string.isRequired,
titleSlug: PropTypes.string.isRequired,
statistics: PropTypes.object.isRequired,
@@ -132,7 +132,7 @@ CalendarEvent.propTypes = {
CalendarEvent.defaultProps = {
statistics: {
percentOfTracks: 0
percentOfBooks: 0
}
};
@@ -1,18 +1,18 @@
import { connect } from 'react-redux';
import { createSelector } from 'reselect';
import createArtistSelector from 'Store/Selectors/createArtistSelector';
import createAuthorSelector from 'Store/Selectors/createAuthorSelector';
import createQueueItemSelector from 'Store/Selectors/createQueueItemSelector';
import createUISettingsSelector from 'Store/Selectors/createUISettingsSelector';
import CalendarEvent from './CalendarEvent';
function createMapStateToProps() {
return createSelector(
createArtistSelector(),
createAuthorSelector(),
createQueueItemSelector(),
createUISettingsSelector(),
(artist, queueItem, uiSettings) => {
(author, queueItem, uiSettings) => {
return {
artist,
author,
queueItem,
timeFormat: uiSettings.timeFormat,
colorImpairedMode: uiSettings.enableColorImpairedMode
@@ -25,7 +25,7 @@ function CalendarEventQueueDetails(props) {
status={status}
errorMessage={errorMessage}
progressBar={
<div title={`Album is downloading - ${progress.toFixed(1)}% ${title}`}>
<div title={`Book is downloading - ${progress.toFixed(1)}% ${title}`}>
<CircularProgressBar
progress={progress}
size={20}
@@ -41,7 +41,7 @@ function getTitle(time, start, end, view, longDateFormat) {
return `${startMoment.format(startFormat)} \u2014 ${endMoment.format(endFormat)}`;
}
// TODO Convert to a stateful Component so we can track view internally when changed
// TODO Convert to a stateful Component so we can book view internally when changed
class CalendarHeader extends Component {
+6 -6
View File
@@ -29,13 +29,13 @@ function Legend(props) {
<div>
<LegendItem
status="downloading"
tooltip="Album is currently downloading"
tooltip="Book is currently downloading"
colorImpairedMode={colorImpairedMode}
/>
<LegendItem
status="downloaded"
tooltip="Album was downloaded and sorted"
tooltip="Book was downloaded and sorted"
colorImpairedMode={colorImpairedMode}
/>
</div>
@@ -43,13 +43,13 @@ function Legend(props) {
<div>
<LegendItem
status="unreleased"
tooltip="Album hasn't released yet"
tooltip="Book hasn't released yet"
colorImpairedMode={colorImpairedMode}
/>
<LegendItem
status="partial"
tooltip="Album was partially downloaded"
tooltip="Book was partially downloaded"
colorImpairedMode={colorImpairedMode}
/>
</div>
@@ -57,13 +57,13 @@ function Legend(props) {
<div>
<LegendItem
status="unmonitored"
tooltip="Album is unmonitored"
tooltip="Book is unmonitored"
colorImpairedMode={colorImpairedMode}
/>
<LegendItem
status="missing"
tooltip="Track file has not been found"
tooltip="Book file has not been found"
colorImpairedMode={colorImpairedMode}
/>
</div>
@@ -91,7 +91,7 @@ class CalendarOptionsModalContent extends Component {
render() {
const {
collapseMultipleAlbums,
collapseMultipleBooks,
showCutoffUnmetIcon,
onModalClose
} = this.props;
@@ -113,13 +113,13 @@ class CalendarOptionsModalContent extends Component {
<FieldSet legend="Local">
<Form>
<FormGroup>
<FormLabel>Collapse Multiple Albums</FormLabel>
<FormLabel>Collapse Multiple Books</FormLabel>
<FormInputGroup
type={inputTypes.CHECK}
name="collapseMultipleAlbums"
value={collapseMultipleAlbums}
helpText="Collapse multiple albums releasing on the same day"
name="collapseMultipleBooks"
value={collapseMultipleBooks}
helpText="Collapse multiple books releasing on the same day"
onChange={this.onOptionInputChange}
/>
</FormGroup>
@@ -202,7 +202,7 @@ class CalendarOptionsModalContent extends Component {
}
CalendarOptionsModalContent.propTypes = {
collapseMultipleAlbums: PropTypes.bool.isRequired,
collapseMultipleBooks: PropTypes.bool.isRequired,
showCutoffUnmetIcon: PropTypes.bool.isRequired,
firstDayOfWeek: PropTypes.number.isRequired,
calendarWeekColumnHeader: PropTypes.string.isRequired,
+3 -3
View File
@@ -1,14 +1,14 @@
/* eslint max-params: 0 */
import moment from 'moment';
function getStatusStyle(episodeNumber, downloading, startTime, isMonitored, percentOfTracks) {
function getStatusStyle(episodeNumber, downloading, startTime, isMonitored, percentOfBooks) {
const currentTime = moment();
if (percentOfTracks === 100) {
if (percentOfBooks === 100) {
return 'downloaded';
}
if (percentOfTracks > 0) {
if (percentOfBooks > 0) {
return 'partial';
}
@@ -119,7 +119,7 @@ class CalendarLinkModalContent extends Component {
type={inputTypes.CHECK}
name="unmonitored"
value={unmonitored}
helpText="Include unmonitored albums in the iCal feed"
helpText="Include unmonitored books in the iCal feed"
onChange={this.onInputChange}
/>
</FormGroup>
@@ -155,7 +155,7 @@ class CalendarLinkModalContent extends Component {
type={inputTypes.TAG}
name="tags"
value={tags}
helpText="Feed will only contain artists with at least one matching tag"
helpText="Feed will only contain authors with at least one matching tag"
onChange={this.onInputChange}
/>
</FormGroup>