Skip to content

Commit dc73de9

Browse files
committed
Merge remote-tracking branch 'Sonarr/phantom-develop' into phantom-develop
2 parents 89f878e + 5014472 commit dc73de9

File tree

34 files changed

+726
-276
lines changed

34 files changed

+726
-276
lines changed

frontend/src/Activity/History/HistoryConnector.js

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@ import selectUniqueIds from 'Utilities/Object/selectUniqueIds';
88
import withCurrentPage from 'Components/withCurrentPage';
99
import * as historyActions from 'Store/Actions/historyActions';
1010
import { fetchEpisodes, clearEpisodes } from 'Store/Actions/episodeActions';
11+
import { clearEpisodeFiles } from 'Store/Actions/episodeFileActions';
1112
import History from './History';
1213

1314
function createMapStateToProps() {
@@ -28,7 +29,8 @@ function createMapStateToProps() {
2829
const mapDispatchToProps = {
2930
...historyActions,
3031
fetchEpisodes,
31-
clearEpisodes
32+
clearEpisodes,
33+
clearEpisodeFiles
3234
};
3335

3436
class HistoryConnector extends Component {
@@ -68,6 +70,7 @@ class HistoryConnector extends Component {
6870
unregisterPagePopulator(this.repopulate);
6971
this.props.clearHistory();
7072
this.props.clearEpisodes();
73+
this.props.clearEpisodeFiles();
7174
}
7275

7376
//
@@ -150,7 +153,8 @@ HistoryConnector.propTypes = {
150153
setHistoryTableOption: PropTypes.func.isRequired,
151154
clearHistory: PropTypes.func.isRequired,
152155
fetchEpisodes: PropTypes.func.isRequired,
153-
clearEpisodes: PropTypes.func.isRequired
156+
clearEpisodes: PropTypes.func.isRequired,
157+
clearEpisodeFiles: PropTypes.func.isRequired
154158
};
155159

156160
export default withCurrentPage(

frontend/src/Activity/Queue/QueueStatusCell.js

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -116,6 +116,7 @@ function QueueStatusCell(props) {
116116
title={title}
117117
body={hasWarning || hasError ? getDetailedPopoverBody(statusMessages) : sourceTitle}
118118
position={tooltipPositions.RIGHT}
119+
canFlip={false}
119120
/>
120121
</TableRowCell>
121122
);

frontend/src/Books/Details/SeriesDetailsSeason.css

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -74,13 +74,19 @@
7474
}
7575

7676
.collapseButtonContainer {
77+
display: flex;
78+
align-items: center;
79+
justify-content: center;
7780
padding: 10px 15px;
7881
width: 100%;
7982
border-top: 1px solid $borderColor;
8083
border-bottom-right-radius: 4px;
8184
border-bottom-left-radius: 4px;
8285
background-color: #fafafa;
83-
text-align: center;
86+
}
87+
88+
.collapseButtonIcon {
89+
margin-bottom: -4px;
8490
}
8591

8692
.expandButtonIcon {

frontend/src/Books/Details/SeriesDetailsSeason.js

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -456,6 +456,7 @@ class SeriesDetailsSeason extends Component {
456456
}
457457
<div className={styles.collapseButtonContainer}>
458458
<IconButton
459+
iconClassName={styles.collapseButtonIcon}
459460
name={icons.COLLAPSE}
460461
size={20}
461462
title="Hide episodes"

frontend/src/Components/Tooltip/Tooltip.js

Lines changed: 44 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -35,6 +35,33 @@ class Tooltip extends Component {
3535
}
3636
}
3737

38+
//
39+
// Control
40+
41+
computeMaxSize = (data) => {
42+
const {
43+
top,
44+
right,
45+
bottom,
46+
left
47+
} = data.offsets.reference;
48+
49+
const windowWidth = window.innerWidth;
50+
const windowHeight = window.innerHeight;
51+
52+
if ((/^top/).test(data.placement)) {
53+
data.styles.maxHeight = top - 20;
54+
} else if ((/^bottom/).test(data.placement)) {
55+
data.styles.maxHeight = windowHeight - bottom - 20;
56+
} else if ((/^right/).test(data.placement)) {
57+
data.styles.maxWidth = windowWidth - right - 30;
58+
} else {
59+
data.styles.maxWidth = left - 30;
60+
}
61+
62+
return data;
63+
}
64+
3865
//
3966
// Listeners
4067

@@ -72,7 +99,8 @@ class Tooltip extends Component {
7299
anchor,
73100
tooltip,
74101
kind,
75-
position
102+
position,
103+
canFlip
76104
} = this.props;
77105

78106
return (
@@ -98,10 +126,18 @@ class Tooltip extends Component {
98126
// are shown (Quality Definitions for example).
99127
eventsEnabled={false}
100128
modifiers={{
129+
computeMaxHeight: {
130+
order: 851,
131+
enabled: true,
132+
fn: this.computeMaxSize
133+
},
101134
preventOverflow: {
102135
// Fixes positioning for tooltips in the queue
103136
// and likely others.
104137
escapeWithReference: true
138+
},
139+
flip: {
140+
enabled: canFlip
105141
}
106142
}}
107143
>
@@ -132,7 +168,9 @@ class Tooltip extends Component {
132168
)}
133169
/>
134170

135-
<div className={bodyClassName}>
171+
<div
172+
className={bodyClassName}
173+
>
136174
{tooltip}
137175
</div>
138176
</div> :
@@ -154,13 +192,15 @@ Tooltip.propTypes = {
154192
anchor: PropTypes.node.isRequired,
155193
tooltip: PropTypes.oneOfType([PropTypes.string, PropTypes.node]).isRequired,
156194
kind: PropTypes.oneOf([kinds.DEFAULT, kinds.INVERSE]),
157-
position: PropTypes.oneOf(tooltipPositions.all)
195+
position: PropTypes.oneOf(tooltipPositions.all),
196+
canFlip: PropTypes.bool.isRequired
158197
};
159198

160199
Tooltip.defaultProps = {
161200
bodyClassName: styles.body,
162201
kind: kinds.DEFAULT,
163-
position: tooltipPositions.TOP
202+
position: tooltipPositions.TOP,
203+
canFlip: true
164204
};
165205

166206
export default Tooltip;

frontend/src/Episode/Summary/EpisodeSummaryConnector.js

Lines changed: 46 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,8 @@
1+
import PropTypes from 'prop-types';
2+
import React, { Component } from 'react';
13
import { connect } from 'react-redux';
24
import { createSelector } from 'reselect';
3-
import { deleteEpisodeFile } from 'Store/Actions/episodeFileActions';
5+
import { fetchEpisodeFile, deleteEpisodeFile } from 'Store/Actions/episodeFileActions';
46
import createEpisodeSelector from 'Store/Selectors/createEpisodeSelector';
57
import createEpisodeFileSelector from 'Store/Selectors/createEpisodeFileSelector';
68
import createSeriesSelector from 'Store/Selectors/createSeriesSelector';
@@ -52,8 +54,50 @@ function createMapDispatchToProps(dispatch, props) {
5254
id: props.episodeFileId,
5355
episodeEntity: props.episodeEntity
5456
}));
57+
},
58+
59+
dispatchFetchEpisodeFile() {
60+
dispatch(fetchEpisodeFile({
61+
id: props.episodeFileId
62+
}));
5563
}
5664
};
5765
}
5866

59-
export default connect(createMapStateToProps, createMapDispatchToProps)(EpisodeSummary);
67+
class EpisodeSummaryConnector extends Component {
68+
69+
//
70+
// Lifecycle
71+
72+
componentDidMount() {
73+
const {
74+
episodeFileId,
75+
path,
76+
dispatchFetchEpisodeFile
77+
} = this.props;
78+
79+
if (episodeFileId && !path) {
80+
dispatchFetchEpisodeFile({ id: episodeFileId });
81+
}
82+
}
83+
84+
//
85+
// Render
86+
87+
render() {
88+
const {
89+
dispatchFetchEpisodeFile,
90+
...otherProps
91+
} = this.props;
92+
93+
return <EpisodeSummary {...otherProps} />;
94+
}
95+
}
96+
97+
EpisodeSummaryConnector.propTypes = {
98+
episodeFileId: PropTypes.number,
99+
path: PropTypes.string,
100+
dispatchFetchEpisodeFile: PropTypes.func.isRequired
101+
};
102+
103+
export default connect(createMapStateToProps, createMapDispatchToProps)(EpisodeSummaryConnector);

frontend/src/Store/Actions/episodeFileActions.js

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,7 @@ export const defaultState = {
3131
//
3232
// Actions Types
3333

34+
export const FETCH_EPISODE_FILE = 'episodeFiles/fetchEpisodeFile';
3435
export const FETCH_EPISODE_FILES = 'episodeFiles/fetchEpisodeFiles';
3536
export const DELETE_EPISODE_FILE = 'episodeFiles/deleteEpisodeFile';
3637
export const DELETE_EPISODE_FILES = 'episodeFiles/deleteEpisodeFiles';
@@ -40,6 +41,7 @@ export const CLEAR_EPISODE_FILES = 'episodeFiles/clearEpisodeFiles';
4041
//
4142
// Action Creators
4243

44+
export const fetchEpisodeFile = createThunk(FETCH_EPISODE_FILE);
4345
export const fetchEpisodeFiles = createThunk(FETCH_EPISODE_FILES);
4446
export const deleteEpisodeFile = createThunk(DELETE_EPISODE_FILE);
4547
export const deleteEpisodeFiles = createThunk(DELETE_EPISODE_FILES);
@@ -55,6 +57,7 @@ const deleteEpisodeFileHelper = createRemoveItemHandler(section, '/episodeFile')
5557
// Action Handlers
5658

5759
export const actionHandlers = handleThunks({
60+
[FETCH_EPISODE_FILE]: createFetchHandler(section, '/episodeFile'),
5861
[FETCH_EPISODE_FILES]: createFetchHandler(section, '/episodeFile'),
5962

6063
[DELETE_EPISODE_FILE]: function(getState, payload, dispatch) {

frontend/src/Styles/globals.css

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
11
/* stylelint-disable */
22

3-
@import '~normalize.css/normalize.css';
4-
@import 'scaffolding.css';
5-
@import '/Content/Fonts/fonts.css';
3+
@import "~normalize.css/normalize.css";
4+
@import "scaffolding.css";
65

76
/* stylelint-enable */

frontend/src/index.html

Lines changed: 41 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -1,28 +1,54 @@
11
<!DOCTYPE html>
22
<html lang="en">
3-
43
<head>
5-
<meta charset="utf-8">
6-
<meta name="viewport" content="width=device-width, initial-scale=1.0"/>
7-
<meta name="mobile-web-app-capable" content="yes"/>
8-
<meta name="apple-mobile-web-app-capable" content="yes"/>
4+
<meta charset="utf-8" />
5+
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
6+
<meta name="mobile-web-app-capable" content="yes" />
7+
<meta name="apple-mobile-web-app-capable" content="yes" />
98

109
<!-- Chrome, Opera, and Firefox OS -->
11-
<meta name="theme-color" content="#3a3f51"/>
10+
<meta name="theme-color" content="#3a3f51" />
1211
<!-- Windows Phone -->
13-
<meta name="msapplication-navbutton-color" content="#3a3f51"/>
12+
<meta name="msapplication-navbutton-color" content="#3a3f51" />
1413

1514
<meta name="description" content="Readarr">
1615

17-
<link rel="apple-touch-icon" sizes="180x180" href="/Content/Images/Icons/apple-touch-icon.png">
18-
<link rel="icon" type="image/png" sizes="32x32" href="/Content/Images/Icons/favicon-32x32.png">
19-
<link rel="icon" type="image/png" sizes="16x16" href="/Content/Images/Icons/favicon-16x16.png">
20-
<link rel="manifest" href="/Content/Images/Icons/manifest.json">
21-
<link rel="mask-icon" href="/Content/Images/Icons/safari-pinned-tab.svg" color="#00ccff">
22-
<link rel="shortcut icon" type="image/ico" href="/favicon.ico" data-no-hash />
23-
<meta name="msapplication-config" content="/Content/Images/Icons/browserconfig.xml">
16+
<link
17+
rel="apple-touch-icon"
18+
sizes="180x180"
19+
href="/Content/Images/Icons/apple-touch-icon.png"
20+
/>
21+
<link
22+
rel="icon"
23+
type="image/png"
24+
sizes="32x32"
25+
href="/Content/Images/Icons/favicon-32x32.png"
26+
/>
27+
<link
28+
rel="icon"
29+
type="image/png"
30+
sizes="16x16"
31+
href="/Content/Images/Icons/favicon-16x16.png"
32+
/>
33+
<link rel="manifest" href="/Content/Images/Icons/manifest.json" />
34+
<link
35+
rel="mask-icon"
36+
href="/Content/Images/Icons/safari-pinned-tab.svg"
37+
color="#00ccff"
38+
/>
39+
<link
40+
rel="shortcut icon"
41+
type="image/ico"
42+
href="/favicon.ico"
43+
data-no-hash
44+
/>
45+
<meta
46+
name="msapplication-config"
47+
content="/Content/Images/Icons/browserconfig.xml"
48+
/>
2449

25-
<link rel="stylesheet" type="text/css" href="/Content/styles.css">
50+
<link rel="stylesheet" type="text/css" href="/Content/styles.css" />
51+
<link rel="stylesheet" type="text/css" href="/Content/Fonts/fonts.css" />
2652

2753
<title>Readarr</title>
2854

@@ -57,5 +83,4 @@
5783
<script src="/vendor.js"></script>
5884
<script src="/preload.js"></script>
5985
<script src="/index.js"></script>
60-
6186
</html>

0 commit comments

Comments
 (0)