From da1bc0aa88c195e4b5d31c603f884e368efbaebc Mon Sep 17 00:00:00 2001 From: Mark McDowall Date: Sat, 27 Mar 2021 18:05:17 -0700 Subject: [PATCH] New: Calendar option for full color events (cherry picked from commit 0210b5c5c1b5c56dce6f4c9f3f56366adba950d3) Fixup Calendar for Full Color View, Final CSS fixups Update localization --- .../src/Calendar/Events/CalendarEvent.css | 52 ++++++++++++++++++- frontend/src/Calendar/Events/CalendarEvent.js | 9 ++-- frontend/src/Calendar/Legend/Legend.js | 11 +++- .../src/Calendar/Legend/LegendConnector.js | 4 +- .../src/Calendar/Legend/LegendIconItem.js | 7 +++ frontend/src/Calendar/Legend/LegendItem.css | 4 ++ frontend/src/Calendar/Legend/LegendItem.js | 5 +- .../Options/CalendarOptionsModalContent.js | 25 +++++++-- frontend/src/Components/Icon.css | 8 +++ frontend/src/Components/Icon.js | 6 ++- .../MediaManagement/Naming/NamingModal.css | 2 +- frontend/src/Store/Actions/calendarActions.js | 3 +- frontend/src/Styles/Themes/light.js | 4 ++ src/NzbDrone.Core/Localization/Core/en.json | 2 + 14 files changed, 128 insertions(+), 14 deletions(-) diff --git a/frontend/src/Calendar/Events/CalendarEvent.css b/frontend/src/Calendar/Events/CalendarEvent.css index 80903d4045..67b5a57bbb 100644 --- a/frontend/src/Calendar/Events/CalendarEvent.css +++ b/frontend/src/Calendar/Events/CalendarEvent.css @@ -1,3 +1,5 @@ +$fullColorGradient: rgba(244, 245, 246, 0.2); + .event { overflow-x: hidden; margin: 4px 2px; @@ -55,6 +57,10 @@ .downloaded { border-left-color: var(--successColor) !important; + &:global(.fullColor) { + background-color: rgba(39, 194, 76, 0.4) !important; + } + &:global(.colorImpaired) { border-left-color: color(var(--successColor), saturation(+15%)) !important; } @@ -62,28 +68,72 @@ .queue { border-left-color: var(--purple) !important; + + &:global(.fullColor) { + background-color: rgba(122, 67, 182, 0.4) !important; + } } .unmonitored { border-left-color: var(--gray) !important; + + &:global(.fullColor) { + background-color: rgba(173, 173, 173, 0.5) !important; + } + + &:global(.colorImpaired) { + background: repeating-linear-gradient(45deg, var(--colorImpairedGradientDark), var(--colorImpairedGradientDark) 5px, var(--colorImpairedGradient) 5px, var(--colorImpairedGradient) 10px); + } + + &:global(.fullColor.colorImpaired) { + background: repeating-linear-gradient(45deg, $fullColorGradient, $fullColorGradient 5px, transparent 5px, transparent 10px); + } } .missingUnmonitored { border-left-color: var(--warningColor) !important; + &:global(.fullColor) { + background-color: rgba(255, 165, 0, 0.6) !important; + } + &:global(.colorImpaired) { background: repeating-linear-gradient(45deg, var(--colorImpairedGradientDark), var(--colorImpairedGradientDark) 5px, var(--colorImpairedGradient) 5px, var(--colorImpairedGradient) 10px); } + + &:global(.fullColor.colorImpaired) { + background: repeating-linear-gradient(45deg, $fullColorGradient, $fullColorGradient 5px, transparent 5px, transparent 10px); + } } .missingMonitored { border-left-color: var(--dangerColor) !important; + &:global(.fullColor) { + background-color: rgba(240, 80, 80, 0.6) !important; + } + &:global(.colorImpaired) { background: repeating-linear-gradient(90deg, var(--colorImpairedGradientDark), var(--colorImpairedGradientDark) 5px, var(--colorImpairedGradient) 5px, var(--colorImpairedGradient) 10px); } + + &:global(.fullColor.colorImpaired) { + background: repeating-linear-gradient(90deg, $fullColorGradient, $fullColorGradient 5px, transparent 5px, transparent 10px); + } } -.continuing { +.unaired { border-left-color: var(--primaryColor) !important; + + &:global(.fullColor) { + background-color: rgba(93, 156, 236, 0.4) !important; + } + + &:global(.colorImpaired) { + background: repeating-linear-gradient(90deg, var(--colorImpairedGradientDark), var(--colorImpairedGradientDark) 5px, var(--colorImpairedGradient) 5px, var(--colorImpairedGradient) 10px); + } + + &:global(.fullColor.colorImpaired) { + background: repeating-linear-gradient(90deg, $fullColorGradient, $fullColorGradient 5px, transparent 5px, transparent 10px); + } } diff --git a/frontend/src/Calendar/Events/CalendarEvent.js b/frontend/src/Calendar/Events/CalendarEvent.js index 9e6d60ab0e..4d8e73228f 100644 --- a/frontend/src/Calendar/Events/CalendarEvent.js +++ b/frontend/src/Calendar/Events/CalendarEvent.js @@ -32,6 +32,7 @@ class CalendarEvent extends Component { queueItem, showMovieInformation, showCutoffUnmetIcon, + fullColorEvents, colorImpairedMode, date } = this.props; @@ -62,7 +63,8 @@ class CalendarEvent extends Component { styles.event, styles.link, styles[statusStyle], - colorImpairedMode && 'colorImpaired' + colorImpairedMode && 'colorImpaired', + fullColorEvents && 'fullColor' )} // component="div" to={link} @@ -97,7 +99,7 @@ class CalendarEvent extends Component { } @@ -142,11 +144,12 @@ CalendarEvent.propTypes = { digitalRelease: PropTypes.string, monitored: PropTypes.bool.isRequired, certification: PropTypes.string, - hasFile: PropTypes.bool.isRequired, + hasFile: PropTypes.bool, grabbed: PropTypes.bool, queueItem: PropTypes.object, showMovieInformation: PropTypes.bool.isRequired, showCutoffUnmetIcon: PropTypes.bool.isRequired, + fullColorEvents: PropTypes.bool.isRequired, timeFormat: PropTypes.string.isRequired, colorImpairedMode: PropTypes.bool.isRequired, date: PropTypes.string.isRequired diff --git a/frontend/src/Calendar/Legend/Legend.js b/frontend/src/Calendar/Legend/Legend.js index 143363dc5c..26915065c8 100644 --- a/frontend/src/Calendar/Legend/Legend.js +++ b/frontend/src/Calendar/Legend/Legend.js @@ -9,6 +9,7 @@ import styles from './Legend.css'; function Legend(props) { const { showCutoffUnmetIcon, + fullColorEvents, colorImpairedMode } = props; @@ -19,7 +20,7 @@ function Legend(props) { ); @@ -31,12 +32,14 @@ function Legend(props) { @@ -45,12 +48,14 @@ function Legend(props) { @@ -59,12 +64,14 @@ function Legend(props) { @@ -79,7 +86,9 @@ function Legend(props) { } Legend.propTypes = { + view: PropTypes.string.isRequired, showCutoffUnmetIcon: PropTypes.bool.isRequired, + fullColorEvents: PropTypes.bool.isRequired, colorImpairedMode: PropTypes.bool.isRequired }; diff --git a/frontend/src/Calendar/Legend/LegendConnector.js b/frontend/src/Calendar/Legend/LegendConnector.js index 30bbc4adb8..889b7a0024 100644 --- a/frontend/src/Calendar/Legend/LegendConnector.js +++ b/frontend/src/Calendar/Legend/LegendConnector.js @@ -6,10 +6,12 @@ import Legend from './Legend'; function createMapStateToProps() { return createSelector( (state) => state.calendar.options, + (state) => state.calendar.view, createUISettingsSelector(), - (calendarOptions, uiSettings) => { + (calendarOptions, view, uiSettings) => { return { ...calendarOptions, + view, colorImpairedMode: uiSettings.enableColorImpairedMode }; } diff --git a/frontend/src/Calendar/Legend/LegendIconItem.js b/frontend/src/Calendar/Legend/LegendIconItem.js index 13e1067849..5ce5f725be 100644 --- a/frontend/src/Calendar/Legend/LegendIconItem.js +++ b/frontend/src/Calendar/Legend/LegendIconItem.js @@ -8,6 +8,7 @@ function LegendIconItem(props) { name, icon, kind, + darken, tooltip } = props; @@ -19,6 +20,7 @@ function LegendIconItem(props) { @@ -31,7 +33,12 @@ LegendIconItem.propTypes = { name: PropTypes.string.isRequired, icon: PropTypes.object.isRequired, kind: PropTypes.string.isRequired, + darken: PropTypes.bool.isRequired, tooltip: PropTypes.string.isRequired }; +LegendIconItem.defaultProps = { + darken: false +}; + export default LegendIconItem; diff --git a/frontend/src/Calendar/Legend/LegendItem.css b/frontend/src/Calendar/Legend/LegendItem.css index 8112ad4ea1..f696cfdbd0 100644 --- a/frontend/src/Calendar/Legend/LegendItem.css +++ b/frontend/src/Calendar/Legend/LegendItem.css @@ -1,3 +1,5 @@ +$fullColorGradient: rgba(244, 245, 246, 0.2); + .legendItemContainer { margin-right: 5px; width: 220px; @@ -63,10 +65,12 @@ .missingMonitoredColorImpaired { background: repeating-linear-gradient(90deg, var(--colorImpairedGradientDark), var(--colorImpairedGradientDark) 5px, var(--colorImpairedGradient) 5px, var(--colorImpairedGradient) 10px); + color: var(--white); } .missingUnmonitoredColorImpaired { background: repeating-linear-gradient(45deg, var(--colorImpairedGradientDark), var(--colorImpairedGradientDark) 5px, var(--colorImpairedGradient) 5px, var(--colorImpairedGradient) 10px); + color: var(--white); } .legendItemText { diff --git a/frontend/src/Calendar/Legend/LegendItem.js b/frontend/src/Calendar/Legend/LegendItem.js index 264704ace3..2959464d3d 100644 --- a/frontend/src/Calendar/Legend/LegendItem.js +++ b/frontend/src/Calendar/Legend/LegendItem.js @@ -7,6 +7,7 @@ function LegendItem(props) { const { name, style, + fullColorEvents, colorImpairedMode } = props; @@ -16,7 +17,8 @@ function LegendItem(props) { className={classNames( styles.legendItem, styles[style], - colorImpairedMode && 'colorImpaired' + colorImpairedMode && 'colorImpaired', + fullColorEvents && 'fullColor' )} />
@@ -29,6 +31,7 @@ function LegendItem(props) { LegendItem.propTypes = { name: PropTypes.string.isRequired, style: PropTypes.string.isRequired, + fullColorEvents: PropTypes.bool.isRequired, colorImpairedMode: PropTypes.bool.isRequired }; diff --git a/frontend/src/Calendar/Options/CalendarOptionsModalContent.js b/frontend/src/Calendar/Options/CalendarOptionsModalContent.js index 223f153bf4..f917ec0f98 100644 --- a/frontend/src/Calendar/Options/CalendarOptionsModalContent.js +++ b/frontend/src/Calendar/Options/CalendarOptionsModalContent.js @@ -26,14 +26,16 @@ class CalendarOptionsModalContent extends Component { firstDayOfWeek, calendarWeekColumnHeader, timeFormat, - enableColorImpairedMode + enableColorImpairedMode, + fullColorEvents } = props; this.state = { firstDayOfWeek, calendarWeekColumnHeader, timeFormat, - enableColorImpairedMode + enableColorImpairedMode, + fullColorEvents }; } @@ -94,6 +96,7 @@ class CalendarOptionsModalContent extends Component { const { showMovieInformation, showCutoffUnmetIcon, + fullColorEvents, onModalClose } = this.props; @@ -136,6 +139,18 @@ class CalendarOptionsModalContent extends Component { onChange={this.onOptionInputChange} /> + + + {translate('FullColorEvents')} + + + @@ -176,7 +191,9 @@ class CalendarOptionsModalContent extends Component { value={timeFormat} onChange={this.onGlobalInputChange} /> - + + + {translate('EnableColorImpairedMode')} - @@ -209,6 +225,7 @@ CalendarOptionsModalContent.propTypes = { calendarWeekColumnHeader: PropTypes.string.isRequired, timeFormat: PropTypes.string.isRequired, enableColorImpairedMode: PropTypes.bool.isRequired, + fullColorEvents: PropTypes.bool.isRequired, dispatchSetCalendarOption: PropTypes.func.isRequired, dispatchSaveUISettings: PropTypes.func.isRequired, onModalClose: PropTypes.func.isRequired diff --git a/frontend/src/Components/Icon.css b/frontend/src/Components/Icon.css index 51c09226b8..69ffc40f5f 100644 --- a/frontend/src/Components/Icon.css +++ b/frontend/src/Components/Icon.css @@ -12,10 +12,18 @@ .info { color: var(--infoColor); + + &:global(.darken) { + color: color(var(--infoColor) shade(30%)); + } } .pink { color: var(--pink); + + &:global(.darken) { + color: color(var(--pink) shade(30%)); + } } .success { diff --git a/frontend/src/Components/Icon.js b/frontend/src/Components/Icon.js index e8c7c51784..8c534d8d46 100644 --- a/frontend/src/Components/Icon.js +++ b/frontend/src/Components/Icon.js @@ -18,6 +18,7 @@ class Icon extends PureComponent { kind, size, title, + darken, isSpinning, ...otherProps } = this.props; @@ -26,7 +27,8 @@ class Icon extends PureComponent {