mirror of
https://github.com/lidarr/lidarr.git
synced 2025-07-14 00:53:57 -07:00
Fixed: Misc UI Fixes
This commit is contained in:
parent
457955c306
commit
ef93ae3792
6 changed files with 34 additions and 7 deletions
|
@ -2,8 +2,8 @@ import _ from 'lodash';
|
||||||
import moment from 'moment';
|
import moment from 'moment';
|
||||||
import PropTypes from 'prop-types';
|
import PropTypes from 'prop-types';
|
||||||
import React, { Component } from 'react';
|
import React, { Component } from 'react';
|
||||||
import { connect } from 'react-redux';
|
|
||||||
import { createSelector } from 'reselect';
|
import { createSelector } from 'reselect';
|
||||||
|
import connectSection from 'Store/connectSection';
|
||||||
import CalendarDay from './CalendarDay';
|
import CalendarDay from './CalendarDay';
|
||||||
|
|
||||||
function createCalendarEventsConnector() {
|
function createCalendarEventsConnector() {
|
||||||
|
@ -52,4 +52,10 @@ CalendarDayConnector.propTypes = {
|
||||||
date: PropTypes.string.isRequired
|
date: PropTypes.string.isRequired
|
||||||
};
|
};
|
||||||
|
|
||||||
export default connect(createMapStateToProps)(CalendarDayConnector);
|
export default connectSection(
|
||||||
|
createMapStateToProps,
|
||||||
|
undefined,
|
||||||
|
undefined,
|
||||||
|
undefined,
|
||||||
|
{ section: 'calendar' }
|
||||||
|
)(CalendarDayConnector);
|
||||||
|
|
|
@ -27,7 +27,9 @@ class SelectInput extends Component {
|
||||||
values,
|
values,
|
||||||
isDisabled,
|
isDisabled,
|
||||||
hasError,
|
hasError,
|
||||||
hasWarning
|
hasWarning,
|
||||||
|
autoFocus,
|
||||||
|
onBlur
|
||||||
} = this.props;
|
} = this.props;
|
||||||
|
|
||||||
return (
|
return (
|
||||||
|
@ -41,7 +43,9 @@ class SelectInput extends Component {
|
||||||
disabled={isDisabled}
|
disabled={isDisabled}
|
||||||
name={name}
|
name={name}
|
||||||
value={value}
|
value={value}
|
||||||
|
autoFocus={autoFocus}
|
||||||
onChange={this.onChange}
|
onChange={this.onChange}
|
||||||
|
onBlur={onBlur}
|
||||||
>
|
>
|
||||||
{
|
{
|
||||||
values.map((option) => {
|
values.map((option) => {
|
||||||
|
@ -76,13 +80,16 @@ SelectInput.propTypes = {
|
||||||
isDisabled: PropTypes.bool,
|
isDisabled: PropTypes.bool,
|
||||||
hasError: PropTypes.bool,
|
hasError: PropTypes.bool,
|
||||||
hasWarning: PropTypes.bool,
|
hasWarning: PropTypes.bool,
|
||||||
onChange: PropTypes.func.isRequired
|
autoFocus: PropTypes.bool.isRequired,
|
||||||
|
onChange: PropTypes.func.isRequired,
|
||||||
|
onBlur: PropTypes.func
|
||||||
};
|
};
|
||||||
|
|
||||||
SelectInput.defaultProps = {
|
SelectInput.defaultProps = {
|
||||||
className: styles.select,
|
className: styles.select,
|
||||||
disabledClassName: styles.isDisabled,
|
disabledClassName: styles.isDisabled,
|
||||||
isDisabled: false
|
isDisabled: false,
|
||||||
|
autoFocus: false
|
||||||
};
|
};
|
||||||
|
|
||||||
export default SelectInput;
|
export default SelectInput;
|
||||||
|
|
|
@ -53,6 +53,13 @@
|
||||||
color: $disabledColor;
|
color: $disabledColor;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
.pageSelect {
|
||||||
|
composes: select from 'Components/Form/SelectInput.css';
|
||||||
|
|
||||||
|
padding: 0 2px;
|
||||||
|
height: 25px;
|
||||||
|
}
|
||||||
|
|
||||||
@media only screen and (max-width: $breakpointSmall) {
|
@media only screen and (max-width: $breakpointSmall) {
|
||||||
.pager {
|
.pager {
|
||||||
flex-wrap: wrap;
|
flex-wrap: wrap;
|
||||||
|
|
|
@ -33,6 +33,10 @@ class TablePager extends Component {
|
||||||
this.props.onPageSelect(parseInt(page));
|
this.props.onPageSelect(parseInt(page));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
onPageSelectBlur = () => {
|
||||||
|
this.setState({ isShowingPageSelect: false });
|
||||||
|
}
|
||||||
|
|
||||||
//
|
//
|
||||||
// Render
|
// Render
|
||||||
|
|
||||||
|
@ -115,10 +119,13 @@ class TablePager extends Component {
|
||||||
{
|
{
|
||||||
isShowingPageSelect &&
|
isShowingPageSelect &&
|
||||||
<SelectInput
|
<SelectInput
|
||||||
|
className={styles.pageSelect}
|
||||||
name="pageSelect"
|
name="pageSelect"
|
||||||
value={page}
|
value={page}
|
||||||
values={pages}
|
values={pages}
|
||||||
|
autoFocus={true}
|
||||||
onChange={this.onPageSelect}
|
onChange={this.onPageSelect}
|
||||||
|
onBlur={this.onPageSelectBlur}
|
||||||
/>
|
/>
|
||||||
}
|
}
|
||||||
</div>
|
</div>
|
||||||
|
|
|
@ -136,7 +136,7 @@ class InteractiveImportModalContent extends Component {
|
||||||
onImportSelectedPress = () => {
|
onImportSelectedPress = () => {
|
||||||
const selected = this.getSelectedIds();
|
const selected = this.getSelectedIds();
|
||||||
|
|
||||||
this.props.onImportSelectedPress(selected, this.state.importMode);
|
this.props.onImportSelectedPress(selected, this.props.importMode);
|
||||||
}
|
}
|
||||||
|
|
||||||
onFilterExistingFilesChange = (value) => {
|
onFilterExistingFilesChange = (value) => {
|
||||||
|
|
|
@ -117,7 +117,7 @@ namespace Lidarr.Api.V1.Tracks
|
||||||
{
|
{
|
||||||
foreach (var track in message.TrackFile.Tracks.Value)
|
foreach (var track in message.TrackFile.Tracks.Value)
|
||||||
{
|
{
|
||||||
BroadcastResourceChange(ModelAction.Deleted, track.Id);
|
BroadcastResourceChange(ModelAction.Updated, track.Id);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue