mirror of
https://github.com/Radarr/Radarr.git
synced 2026-04-18 21:35:51 -04:00
Compare commits
1 Commits
v4.4.3.703
...
remove-mon
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
6683c88bb9 |
@@ -19,10 +19,10 @@ indent_size = 4
|
|||||||
dotnet_sort_system_directives_first = true
|
dotnet_sort_system_directives_first = true
|
||||||
|
|
||||||
# Avoid "this." and "Me." if not necessary
|
# Avoid "this." and "Me." if not necessary
|
||||||
dotnet_style_qualification_for_field = false:refactoring
|
dotnet_style_qualification_for_field = false:warning
|
||||||
dotnet_style_qualification_for_property = false:refactoring
|
dotnet_style_qualification_for_property = false:warning
|
||||||
dotnet_style_qualification_for_method = false:refactoring
|
dotnet_style_qualification_for_method = false:warning
|
||||||
dotnet_style_qualification_for_event = false:refactoring
|
dotnet_style_qualification_for_event = false:warning
|
||||||
|
|
||||||
# Indentation preferences
|
# Indentation preferences
|
||||||
csharp_indent_block_contents = true
|
csharp_indent_block_contents = true
|
||||||
@@ -32,10 +32,6 @@ csharp_indent_case_contents_when_block = true
|
|||||||
csharp_indent_switch_labels = true
|
csharp_indent_switch_labels = true
|
||||||
csharp_indent_labels = flush_left
|
csharp_indent_labels = flush_left
|
||||||
|
|
||||||
dotnet_style_qualification_for_field = false:suggestion
|
|
||||||
dotnet_style_qualification_for_property = false:suggestion
|
|
||||||
dotnet_style_qualification_for_method = false:suggestion
|
|
||||||
dotnet_style_qualification_for_event = false:suggestion
|
|
||||||
dotnet_naming_style.instance_field_style.capitalization = camel_case
|
dotnet_naming_style.instance_field_style.capitalization = camel_case
|
||||||
dotnet_naming_style.instance_field_style.required_prefix = _
|
dotnet_naming_style.instance_field_style.required_prefix = _
|
||||||
|
|
||||||
@@ -46,6 +42,7 @@ csharp_style_var_elsewhere = true:suggestion
|
|||||||
|
|
||||||
# Stylecop Rules
|
# Stylecop Rules
|
||||||
dotnet_diagnostic.SA0001.severity = none
|
dotnet_diagnostic.SA0001.severity = none
|
||||||
|
dotnet_diagnostic.SA1005.severity = none
|
||||||
dotnet_diagnostic.SA1025.severity = none
|
dotnet_diagnostic.SA1025.severity = none
|
||||||
dotnet_diagnostic.SA1101.severity = none
|
dotnet_diagnostic.SA1101.severity = none
|
||||||
dotnet_diagnostic.SA1116.severity = none
|
dotnet_diagnostic.SA1116.severity = none
|
||||||
@@ -68,7 +65,6 @@ dotnet_diagnostic.SA1406.severity = suggestion
|
|||||||
dotnet_diagnostic.SA1410.severity = suggestion
|
dotnet_diagnostic.SA1410.severity = suggestion
|
||||||
dotnet_diagnostic.SA1411.severity = suggestion
|
dotnet_diagnostic.SA1411.severity = suggestion
|
||||||
dotnet_diagnostic.SA1413.severity = none
|
dotnet_diagnostic.SA1413.severity = none
|
||||||
dotnet_diagnostic.SA1512.severity = none
|
|
||||||
dotnet_diagnostic.SA1516.severity = none
|
dotnet_diagnostic.SA1516.severity = none
|
||||||
dotnet_diagnostic.SA1600.severity = none
|
dotnet_diagnostic.SA1600.severity = none
|
||||||
dotnet_diagnostic.SA1601.severity = none
|
dotnet_diagnostic.SA1601.severity = none
|
||||||
@@ -167,7 +163,6 @@ dotnet_diagnostic.CA1309.severity = suggestion
|
|||||||
dotnet_diagnostic.CA1310.severity = suggestion
|
dotnet_diagnostic.CA1310.severity = suggestion
|
||||||
dotnet_diagnostic.CA1401.severity = suggestion
|
dotnet_diagnostic.CA1401.severity = suggestion
|
||||||
dotnet_diagnostic.CA1416.severity = suggestion
|
dotnet_diagnostic.CA1416.severity = suggestion
|
||||||
dotnet_diagnostic.CA1419.severity = suggestion
|
|
||||||
dotnet_diagnostic.CA1507.severity = suggestion
|
dotnet_diagnostic.CA1507.severity = suggestion
|
||||||
dotnet_diagnostic.CA1508.severity = suggestion
|
dotnet_diagnostic.CA1508.severity = suggestion
|
||||||
dotnet_diagnostic.CA1707.severity = suggestion
|
dotnet_diagnostic.CA1707.severity = suggestion
|
||||||
@@ -183,6 +178,9 @@ dotnet_diagnostic.CA1720.severity = suggestion
|
|||||||
dotnet_diagnostic.CA1721.severity = suggestion
|
dotnet_diagnostic.CA1721.severity = suggestion
|
||||||
dotnet_diagnostic.CA1724.severity = suggestion
|
dotnet_diagnostic.CA1724.severity = suggestion
|
||||||
dotnet_diagnostic.CA1725.severity = suggestion
|
dotnet_diagnostic.CA1725.severity = suggestion
|
||||||
|
dotnet_diagnostic.CA1801.severity = suggestion
|
||||||
|
dotnet_diagnostic.CA1802.severity = suggestion
|
||||||
|
dotnet_diagnostic.CA1805.severity = suggestion
|
||||||
dotnet_diagnostic.CA1806.severity = suggestion
|
dotnet_diagnostic.CA1806.severity = suggestion
|
||||||
dotnet_diagnostic.CA1810.severity = suggestion
|
dotnet_diagnostic.CA1810.severity = suggestion
|
||||||
dotnet_diagnostic.CA1812.severity = suggestion
|
dotnet_diagnostic.CA1812.severity = suggestion
|
||||||
@@ -194,11 +192,13 @@ dotnet_diagnostic.CA1819.severity = suggestion
|
|||||||
dotnet_diagnostic.CA1822.severity = suggestion
|
dotnet_diagnostic.CA1822.severity = suggestion
|
||||||
dotnet_diagnostic.CA1823.severity = suggestion
|
dotnet_diagnostic.CA1823.severity = suggestion
|
||||||
dotnet_diagnostic.CA1824.severity = suggestion
|
dotnet_diagnostic.CA1824.severity = suggestion
|
||||||
dotnet_diagnostic.CA1848.severity = suggestion
|
|
||||||
dotnet_diagnostic.CA2000.severity = suggestion
|
dotnet_diagnostic.CA2000.severity = suggestion
|
||||||
dotnet_diagnostic.CA2002.severity = suggestion
|
dotnet_diagnostic.CA2002.severity = suggestion
|
||||||
dotnet_diagnostic.CA2007.severity = suggestion
|
dotnet_diagnostic.CA2007.severity = suggestion
|
||||||
dotnet_diagnostic.CA2008.severity = suggestion
|
dotnet_diagnostic.CA2008.severity = suggestion
|
||||||
|
dotnet_diagnostic.CA2009.severity = suggestion
|
||||||
|
dotnet_diagnostic.CA2010.severity = suggestion
|
||||||
|
dotnet_diagnostic.CA2011.severity = suggestion
|
||||||
dotnet_diagnostic.CA2012.severity = suggestion
|
dotnet_diagnostic.CA2012.severity = suggestion
|
||||||
dotnet_diagnostic.CA2013.severity = suggestion
|
dotnet_diagnostic.CA2013.severity = suggestion
|
||||||
dotnet_diagnostic.CA2100.severity = suggestion
|
dotnet_diagnostic.CA2100.severity = suggestion
|
||||||
@@ -229,9 +229,6 @@ dotnet_diagnostic.CA2243.severity = suggestion
|
|||||||
dotnet_diagnostic.CA2244.severity = suggestion
|
dotnet_diagnostic.CA2244.severity = suggestion
|
||||||
dotnet_diagnostic.CA2245.severity = suggestion
|
dotnet_diagnostic.CA2245.severity = suggestion
|
||||||
dotnet_diagnostic.CA2246.severity = suggestion
|
dotnet_diagnostic.CA2246.severity = suggestion
|
||||||
dotnet_diagnostic.CA2249.severity = suggestion
|
|
||||||
dotnet_diagnostic.CA2251.severity = suggestion
|
|
||||||
dotnet_diagnostic.CA2254.severity = suggestion
|
|
||||||
dotnet_diagnostic.CA3061.severity = suggestion
|
dotnet_diagnostic.CA3061.severity = suggestion
|
||||||
dotnet_diagnostic.CA3075.severity = suggestion
|
dotnet_diagnostic.CA3075.severity = suggestion
|
||||||
dotnet_diagnostic.CA3076.severity = suggestion
|
dotnet_diagnostic.CA3076.severity = suggestion
|
||||||
@@ -259,7 +256,7 @@ dotnet_diagnostic.CA5392.severity = suggestion
|
|||||||
dotnet_diagnostic.CA5394.severity = suggestion
|
dotnet_diagnostic.CA5394.severity = suggestion
|
||||||
dotnet_diagnostic.CA5397.severity = suggestion
|
dotnet_diagnostic.CA5397.severity = suggestion
|
||||||
|
|
||||||
dotnet_diagnostic.SYSLIB0006.severity = none
|
|
||||||
|
|
||||||
[*.{js,html,js,hbs,less,css}]
|
[*.{js,html,js,hbs,less,css}]
|
||||||
charset = utf-8
|
charset = utf-8
|
||||||
|
|||||||
10
.esprintrc
Normal file
10
.esprintrc
Normal file
@@ -0,0 +1,10 @@
|
|||||||
|
{
|
||||||
|
"paths": [
|
||||||
|
"frontend/src/**/*.js",
|
||||||
|
"src/NzbDrone.Core/Localization/Core/*.json"
|
||||||
|
],
|
||||||
|
"ignored": [
|
||||||
|
"**/node_modules/**/*"
|
||||||
|
],
|
||||||
|
"port": 5004
|
||||||
|
}
|
||||||
2
.github/FUNDING.yml
vendored
2
.github/FUNDING.yml
vendored
@@ -1,6 +1,6 @@
|
|||||||
# These are supported funding model platforms
|
# These are supported funding model platforms
|
||||||
|
|
||||||
github: radarr
|
github: # Replace with up to 4 GitHub Sponsors-enabled usernames e.g., [user1, user2]
|
||||||
patreon: # Replace with a single Patreon username
|
patreon: # Replace with a single Patreon username
|
||||||
open_collective: radarr
|
open_collective: radarr
|
||||||
ko_fi: # Replace with a single Ko-fi username
|
ko_fi: # Replace with a single Ko-fi username
|
||||||
|
|||||||
14
.github/ISSUE_TEMPLATE/bug_report.yml
vendored
14
.github/ISSUE_TEMPLATE/bug_report.yml
vendored
@@ -5,9 +5,9 @@ body:
|
|||||||
- type: checkboxes
|
- type: checkboxes
|
||||||
attributes:
|
attributes:
|
||||||
label: Is there an existing issue for this?
|
label: Is there an existing issue for this?
|
||||||
description: Please search to see if an open or closed issue already exists for the bug you encountered. If a bug exists and is closed note that it may only be fixed in an unstable branch.
|
description: Please search to see if an issue already exists for the bug you encountered.
|
||||||
options:
|
options:
|
||||||
- label: I have searched the existing open and closed issues
|
- label: I have searched the existing issues
|
||||||
required: true
|
required: true
|
||||||
- type: textarea
|
- type: textarea
|
||||||
attributes:
|
attributes:
|
||||||
@@ -42,14 +42,12 @@ body:
|
|||||||
- **Docker Install**: Yes
|
- **Docker Install**: Yes
|
||||||
- **Using Reverse Proxy**: No
|
- **Using Reverse Proxy**: No
|
||||||
- **Browser**: Firefox 90 (If UI related)
|
- **Browser**: Firefox 90 (If UI related)
|
||||||
- **Database**: Sqlite 3.36.0
|
|
||||||
value: |
|
value: |
|
||||||
- OS:
|
- OS:
|
||||||
- Radarr:
|
- Radarr:
|
||||||
- Docker Install:
|
- Docker Install:
|
||||||
- Using Reverse Proxy:
|
- Using Reverse Proxy:
|
||||||
- Browser:
|
- Browser:
|
||||||
- Database:
|
|
||||||
render: markdown
|
render: markdown
|
||||||
validations:
|
validations:
|
||||||
required: true
|
required: true
|
||||||
|
|||||||
4
.github/ISSUE_TEMPLATE/feature_request.yml
vendored
4
.github/ISSUE_TEMPLATE/feature_request.yml
vendored
@@ -5,9 +5,9 @@ body:
|
|||||||
- type: checkboxes
|
- type: checkboxes
|
||||||
attributes:
|
attributes:
|
||||||
label: Is there an existing issue for this?
|
label: Is there an existing issue for this?
|
||||||
description: Please search to see if an open or closed issue already exists for the feature you are requesting. If a request exists and is closed note that it may only be fixed in an unstable branch.
|
description: Please search to see if an issue already exists for the feature you are requesting.
|
||||||
options:
|
options:
|
||||||
- label: I have searched the existing open and closed issues
|
- label: I have searched the existing issues
|
||||||
required: true
|
required: true
|
||||||
- type: textarea
|
- type: textarea
|
||||||
attributes:
|
attributes:
|
||||||
|
|||||||
41
.github/workflows/azuresync.yml
vendored
Normal file
41
.github/workflows/azuresync.yml
vendored
Normal file
@@ -0,0 +1,41 @@
|
|||||||
|
name: Sync issue to Azure DevOps work item
|
||||||
|
|
||||||
|
on:
|
||||||
|
issues:
|
||||||
|
types:
|
||||||
|
[opened, edited, deleted, closed, reopened, labeled, unlabeled, assigned]
|
||||||
|
|
||||||
|
concurrency: azuresync-${{ github.event.issue.number }}
|
||||||
|
|
||||||
|
jobs:
|
||||||
|
alert:
|
||||||
|
runs-on: ubuntu-latest
|
||||||
|
steps:
|
||||||
|
- uses: danhellem/github-actions-issue-to-work-item@master
|
||||||
|
if: "${{ contains(github.event.issue.labels.*.name, 'Type: Bug') == true }}"
|
||||||
|
env:
|
||||||
|
ado_token: "${{ secrets.ADO_PERSONAL_ACCESS_TOKEN }}"
|
||||||
|
github_token: "${{ github.token }}"
|
||||||
|
ado_organization: "Servarr"
|
||||||
|
ado_project: "Servarr"
|
||||||
|
ado_area_path: "Servarr\\Radarr"
|
||||||
|
ado_wit: "Bug"
|
||||||
|
ado_new_state: "New"
|
||||||
|
ado_active_state: "Active"
|
||||||
|
ado_close_state: "Closed"
|
||||||
|
ado_bypassrules: true
|
||||||
|
log_level: 100
|
||||||
|
- uses: danhellem/github-actions-issue-to-work-item@master
|
||||||
|
if: "${{ contains(github.event.issue.labels.*.name, 'Type: Bug') == false }}"
|
||||||
|
env:
|
||||||
|
ado_token: "${{ secrets.ADO_PERSONAL_ACCESS_TOKEN }}"
|
||||||
|
github_token: "${{ github.token }}"
|
||||||
|
ado_organization: "Servarr"
|
||||||
|
ado_project: "Servarr"
|
||||||
|
ado_area_path: "Servarr\\Radarr"
|
||||||
|
ado_wit: "User Story"
|
||||||
|
ado_new_state: "New"
|
||||||
|
ado_active_state: "Active"
|
||||||
|
ado_close_state: "Closed"
|
||||||
|
ado_bypassrules: true
|
||||||
|
log_level: 100
|
||||||
5
.github/workflows/lock.yml
vendored
5
.github/workflows/lock.yml
vendored
@@ -5,13 +5,8 @@ on:
|
|||||||
schedule:
|
schedule:
|
||||||
- cron: '0 0 * * *'
|
- cron: '0 0 * * *'
|
||||||
|
|
||||||
permissions: {}
|
|
||||||
jobs:
|
jobs:
|
||||||
lock:
|
lock:
|
||||||
permissions:
|
|
||||||
issues: write # to lock issues (dessant/lock-threads)
|
|
||||||
pull-requests: write # to lock PRs (dessant/lock-threads)
|
|
||||||
|
|
||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
steps:
|
steps:
|
||||||
- uses: dessant/lock-threads@v2
|
- uses: dessant/lock-threads@v2
|
||||||
|
|||||||
4
.github/workflows/support.yml
vendored
4
.github/workflows/support.yml
vendored
@@ -4,12 +4,8 @@ on:
|
|||||||
issues:
|
issues:
|
||||||
types: [labeled, unlabeled, reopened]
|
types: [labeled, unlabeled, reopened]
|
||||||
|
|
||||||
permissions: {}
|
|
||||||
jobs:
|
jobs:
|
||||||
support:
|
support:
|
||||||
permissions:
|
|
||||||
issues: write # to modify issues
|
|
||||||
|
|
||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
steps:
|
steps:
|
||||||
- uses: dessant/support-requests@v2
|
- uses: dessant/support-requests@v2
|
||||||
|
|||||||
23
.gitignore
vendored
23
.gitignore
vendored
@@ -166,8 +166,27 @@ packages.config.md5sum
|
|||||||
|
|
||||||
# Common IntelliJ Platform excludes
|
# Common IntelliJ Platform excludes
|
||||||
|
|
||||||
# Ignore Rider projects completely for now
|
# User specific
|
||||||
.idea/
|
**/.idea/**/workspace.xml
|
||||||
|
**/.idea/**/tasks.xml
|
||||||
|
**/.idea/shelf/*
|
||||||
|
**/.idea/dictionaries
|
||||||
|
**/.idea/.idea.Radarr.Posix
|
||||||
|
**/.idea/.idea.Radarr.Windows
|
||||||
|
|
||||||
|
# Sensitive or high-churn files
|
||||||
|
**/.idea/**/dataSources/
|
||||||
|
**/.idea/**/dataSources.ids
|
||||||
|
**/.idea/**/dataSources.xml
|
||||||
|
**/.idea/**/dataSources.local.xml
|
||||||
|
**/.idea/**/sqlDataSources.xml
|
||||||
|
**/.idea/**/dynamic.xml
|
||||||
|
|
||||||
|
# Rider
|
||||||
|
# Rider auto-generates .iml files, and contentModel.xml
|
||||||
|
**/.idea/**/*.iml
|
||||||
|
**/.idea/**/contentModel.xml
|
||||||
|
**/.idea/**/modules.xml
|
||||||
|
|
||||||
# ignore node_modules symlink
|
# ignore node_modules symlink
|
||||||
node_modules
|
node_modules
|
||||||
|
|||||||
@@ -1,132 +0,0 @@
|
|||||||
# Contributor Covenant Code of Conduct
|
|
||||||
|
|
||||||
## Our Pledge
|
|
||||||
|
|
||||||
We as members, contributors, and leaders pledge to make participation in our
|
|
||||||
community a harassment-free experience for everyone, regardless of age, body
|
|
||||||
size, visible or invisible disability, ethnicity, sex characteristics, gender
|
|
||||||
identity and expression, level of experience, education, socio-economic status,
|
|
||||||
nationality, personal appearance, race, caste, color, religion, or sexual
|
|
||||||
identity and orientation.
|
|
||||||
|
|
||||||
We pledge to act and interact in ways that contribute to an open, welcoming,
|
|
||||||
diverse, inclusive, and healthy community.
|
|
||||||
|
|
||||||
## Our Standards
|
|
||||||
|
|
||||||
Examples of behavior that contributes to a positive environment for our
|
|
||||||
community include:
|
|
||||||
|
|
||||||
* Demonstrating empathy and kindness toward other people
|
|
||||||
* Being respectful of differing opinions, viewpoints, and experiences
|
|
||||||
* Giving and gracefully accepting constructive feedback
|
|
||||||
* Accepting responsibility and apologizing to those affected by our mistakes,
|
|
||||||
and learning from the experience
|
|
||||||
* Focusing on what is best not just for us as individuals, but for the overall
|
|
||||||
community
|
|
||||||
|
|
||||||
Examples of unacceptable behavior include:
|
|
||||||
|
|
||||||
* The use of sexualized language or imagery, and sexual attention or advances of
|
|
||||||
any kind
|
|
||||||
* Trolling, insulting or derogatory comments, and personal or political attacks
|
|
||||||
* Public or private harassment
|
|
||||||
* Publishing others' private information, such as a physical or email address,
|
|
||||||
without their explicit permission
|
|
||||||
* Other conduct which could reasonably be considered inappropriate in a
|
|
||||||
professional setting
|
|
||||||
|
|
||||||
## Enforcement Responsibilities
|
|
||||||
|
|
||||||
Community leaders are responsible for clarifying and enforcing our standards of
|
|
||||||
acceptable behavior and will take appropriate and fair corrective action in
|
|
||||||
response to any behavior that they deem inappropriate, threatening, offensive,
|
|
||||||
or harmful.
|
|
||||||
|
|
||||||
Community leaders have the right and responsibility to remove, edit, or reject
|
|
||||||
comments, commits, code, wiki edits, issues, and other contributions that are
|
|
||||||
not aligned to this Code of Conduct, and will communicate reasons for moderation
|
|
||||||
decisions when appropriate.
|
|
||||||
|
|
||||||
## Scope
|
|
||||||
|
|
||||||
This Code of Conduct applies within all community spaces, and also applies when
|
|
||||||
an individual is officially representing the community in public spaces.
|
|
||||||
Examples of representing our community include using an official e-mail address,
|
|
||||||
posting via an official social media account, or acting as an appointed
|
|
||||||
representative at an online or offline event.
|
|
||||||
|
|
||||||
## Enforcement
|
|
||||||
|
|
||||||
Instances of abusive, harassing, or otherwise unacceptable behavior may be
|
|
||||||
reported to the community leaders responsible for enforcement at
|
|
||||||
<development@radarr.video>.
|
|
||||||
All complaints will be reviewed and investigated promptly and fairly.
|
|
||||||
|
|
||||||
All community leaders are obligated to respect the privacy and security of the
|
|
||||||
reporter of any incident.
|
|
||||||
|
|
||||||
## Enforcement Guidelines
|
|
||||||
|
|
||||||
Community leaders will follow these Community Impact Guidelines in determining
|
|
||||||
the consequences for any action they deem in violation of this Code of Conduct:
|
|
||||||
|
|
||||||
### 1. Correction
|
|
||||||
|
|
||||||
**Community Impact**: Use of inappropriate language or other behavior deemed
|
|
||||||
unprofessional or unwelcome in the community.
|
|
||||||
|
|
||||||
**Consequence**: A private, written warning from community leaders, providing
|
|
||||||
clarity around the nature of the violation and an explanation of why the
|
|
||||||
behavior was inappropriate. A public apology may be requested.
|
|
||||||
|
|
||||||
### 2. Warning
|
|
||||||
|
|
||||||
**Community Impact**: A violation through a single incident or series of
|
|
||||||
actions.
|
|
||||||
|
|
||||||
**Consequence**: A warning with consequences for continued behavior. No
|
|
||||||
interaction with the people involved, including unsolicited interaction with
|
|
||||||
those enforcing the Code of Conduct, for a specified period of time. This
|
|
||||||
includes avoiding interactions in community spaces as well as external channels
|
|
||||||
like social media. Violating these terms may lead to a temporary or permanent
|
|
||||||
ban.
|
|
||||||
|
|
||||||
### 3. Temporary Ban
|
|
||||||
|
|
||||||
**Community Impact**: A serious violation of community standards, including
|
|
||||||
sustained inappropriate behavior.
|
|
||||||
|
|
||||||
**Consequence**: A temporary ban from any sort of interaction or public
|
|
||||||
communication with the community for a specified period of time. No public or
|
|
||||||
private interaction with the people involved, including unsolicited interaction
|
|
||||||
with those enforcing the Code of Conduct, is allowed during this period.
|
|
||||||
Violating these terms may lead to a permanent ban.
|
|
||||||
|
|
||||||
### 4. Permanent Ban
|
|
||||||
|
|
||||||
**Community Impact**: Demonstrating a pattern of violation of community
|
|
||||||
standards, including sustained inappropriate behavior, harassment of an
|
|
||||||
individual, or aggression toward or disparagement of classes of individuals.
|
|
||||||
|
|
||||||
**Consequence**: A permanent ban from any sort of public interaction within the
|
|
||||||
community.
|
|
||||||
|
|
||||||
## Attribution
|
|
||||||
|
|
||||||
This Code of Conduct is adapted from the [Contributor Covenant][homepage],
|
|
||||||
version 2.1, available at
|
|
||||||
[https://www.contributor-covenant.org/version/2/1/code_of_conduct.html][v2.1].
|
|
||||||
|
|
||||||
Community Impact Guidelines were inspired by
|
|
||||||
[Mozilla's code of conduct enforcement ladder][Mozilla CoC].
|
|
||||||
|
|
||||||
For answers to common questions about this code of conduct, see the FAQ at
|
|
||||||
[https://www.contributor-covenant.org/faq][FAQ]. Translations are available at
|
|
||||||
[https://www.contributor-covenant.org/translations][translations].
|
|
||||||
|
|
||||||
[homepage]: https://www.contributor-covenant.org
|
|
||||||
[v2.1]: https://www.contributor-covenant.org/version/2/1/code_of_conduct.html
|
|
||||||
[Mozilla CoC]: https://github.com/mozilla/diversity
|
|
||||||
[FAQ]: https://www.contributor-covenant.org/faq
|
|
||||||
[translations]: https://www.contributor-covenant.org/translations
|
|
||||||
@@ -76,15 +76,6 @@ Thank you to [<img src="/Logo/jetbrains.svg" alt="JetBrains" width="32"> JetBrai
|
|||||||
* [<img src="/Logo/rider.svg" alt="Rider" width="32"> Rider](http://www.jetbrains.com/rider/)
|
* [<img src="/Logo/rider.svg" alt="Rider" width="32"> Rider](http://www.jetbrains.com/rider/)
|
||||||
* [<img src="/Logo/dottrace.svg" alt="dotTrace" width="32"> dotTrace](http://www.jetbrains.com/dottrace/)
|
* [<img src="/Logo/dottrace.svg" alt="dotTrace" width="32"> dotTrace](http://www.jetbrains.com/dottrace/)
|
||||||
|
|
||||||
## DigitalOcean
|
|
||||||
|
|
||||||
This project is also supported by DigitalOcean
|
|
||||||
<p>
|
|
||||||
<a href="https://www.digitalocean.com/">
|
|
||||||
<img src="https://opensource.nyc3.cdn.digitaloceanspaces.com/attribution/assets/SVG/DO_Logo_horizontal_blue.svg" width="201px">
|
|
||||||
</a>
|
|
||||||
</p>
|
|
||||||
|
|
||||||
### License
|
### License
|
||||||
|
|
||||||
* [GNU GPL v3](http://www.gnu.org/licenses/gpl.html)
|
* [GNU GPL v3](http://www.gnu.org/licenses/gpl.html)
|
||||||
|
|||||||
@@ -1,8 +0,0 @@
|
|||||||
# Security Policy
|
|
||||||
|
|
||||||
## Reporting a Vulnerability
|
|
||||||
|
|
||||||
Please report (suspected) security vulnerabilities on Discord (preferred) to
|
|
||||||
any of the Servarr Dev role holders (red names) or via email: development@servarr.com. You will receive a response from
|
|
||||||
us within 72 hours. If the issue is confirmed, we will release a patch as soon
|
|
||||||
as possible depending on complexity/severity.
|
|
||||||
@@ -9,13 +9,13 @@ variables:
|
|||||||
testsFolder: './_tests'
|
testsFolder: './_tests'
|
||||||
yarnCacheFolder: $(Pipeline.Workspace)/.yarn
|
yarnCacheFolder: $(Pipeline.Workspace)/.yarn
|
||||||
nugetCacheFolder: $(Pipeline.Workspace)/.nuget/packages
|
nugetCacheFolder: $(Pipeline.Workspace)/.nuget/packages
|
||||||
majorVersion: '4.4.3'
|
majorVersion: '4.2.0'
|
||||||
minorVersion: $[counter('minorVersion', 2000)]
|
minorVersion: $[counter('minorVersion', 2000)]
|
||||||
radarrVersion: '$(majorVersion).$(minorVersion)'
|
radarrVersion: '$(majorVersion).$(minorVersion)'
|
||||||
buildName: '$(Build.SourceBranchName).$(radarrVersion)'
|
buildName: '$(Build.SourceBranchName).$(radarrVersion)'
|
||||||
sentryOrg: 'servarr'
|
sentryOrg: 'servarr'
|
||||||
sentryUrl: 'https://sentry.servarr.com'
|
sentryUrl: 'https://sentry.servarr.com'
|
||||||
dotnetVersion: '6.0.400'
|
dotnetVersion: '6.0.202'
|
||||||
nodeVersion: '16.X'
|
nodeVersion: '16.X'
|
||||||
innoVersion: '6.2.0'
|
innoVersion: '6.2.0'
|
||||||
windowsImage: 'windows-2022'
|
windowsImage: 'windows-2022'
|
||||||
@@ -173,6 +173,7 @@ stages:
|
|||||||
key: 'yarn | "$(osName)" | yarn.lock'
|
key: 'yarn | "$(osName)" | yarn.lock'
|
||||||
restoreKeys: |
|
restoreKeys: |
|
||||||
yarn | "$(osName)"
|
yarn | "$(osName)"
|
||||||
|
yarn
|
||||||
path: $(yarnCacheFolder)
|
path: $(yarnCacheFolder)
|
||||||
displayName: Cache Yarn packages
|
displayName: Cache Yarn packages
|
||||||
- bash: ./build.sh --frontend
|
- bash: ./build.sh --frontend
|
||||||
@@ -549,7 +550,7 @@ stages:
|
|||||||
Radarr__Postgres__Password: 'radarr'
|
Radarr__Postgres__Password: 'radarr'
|
||||||
|
|
||||||
pool:
|
pool:
|
||||||
vmImage: ${{ variables.linuxImage }}
|
vmImage: 'ubuntu-18.04'
|
||||||
|
|
||||||
timeoutInMinutes: 10
|
timeoutInMinutes: 10
|
||||||
|
|
||||||
@@ -576,7 +577,6 @@ stages:
|
|||||||
-e POSTGRES_PASSWORD=radarr \
|
-e POSTGRES_PASSWORD=radarr \
|
||||||
-e POSTGRES_USER=radarr \
|
-e POSTGRES_USER=radarr \
|
||||||
-p 5432:5432/tcp \
|
-p 5432:5432/tcp \
|
||||||
-v /usr/share/zoneinfo/America/Chicago:/etc/localtime:ro \
|
|
||||||
postgres:14
|
postgres:14
|
||||||
displayName: Start postgres
|
displayName: Start postgres
|
||||||
- bash: |
|
- bash: |
|
||||||
@@ -687,7 +687,7 @@ stages:
|
|||||||
Radarr__Postgres__Password: 'radarr'
|
Radarr__Postgres__Password: 'radarr'
|
||||||
|
|
||||||
pool:
|
pool:
|
||||||
vmImage: ${{ variables.linuxImage }}
|
vmImage: 'ubuntu-18.04'
|
||||||
|
|
||||||
steps:
|
steps:
|
||||||
- task: UseDotNet@2
|
- task: UseDotNet@2
|
||||||
@@ -722,7 +722,6 @@ stages:
|
|||||||
-e POSTGRES_PASSWORD=radarr \
|
-e POSTGRES_PASSWORD=radarr \
|
||||||
-e POSTGRES_USER=radarr \
|
-e POSTGRES_USER=radarr \
|
||||||
-p 5432:5432/tcp \
|
-p 5432:5432/tcp \
|
||||||
-v /usr/share/zoneinfo/America/Chicago:/etc/localtime:ro \
|
|
||||||
postgres:14
|
postgres:14
|
||||||
displayName: Start postgres
|
displayName: Start postgres
|
||||||
- bash: |
|
- bash: |
|
||||||
@@ -761,7 +760,7 @@ stages:
|
|||||||
inputs:
|
inputs:
|
||||||
buildType: 'current'
|
buildType: 'current'
|
||||||
artifactName: Packages
|
artifactName: Packages
|
||||||
itemPattern: '**/$(pattern)'
|
itemPattern: '/$(pattern)'
|
||||||
targetPath: $(Build.ArtifactStagingDirectory)
|
targetPath: $(Build.ArtifactStagingDirectory)
|
||||||
- bash: |
|
- bash: |
|
||||||
mkdir -p ${BUILD_ARTIFACTSTAGINGDIRECTORY}/bin
|
mkdir -p ${BUILD_ARTIFACTSTAGINGDIRECTORY}/bin
|
||||||
@@ -977,6 +976,7 @@ stages:
|
|||||||
key: 'yarn | "$(osName)" | yarn.lock'
|
key: 'yarn | "$(osName)" | yarn.lock'
|
||||||
restoreKeys: |
|
restoreKeys: |
|
||||||
yarn | "$(osName)"
|
yarn | "$(osName)"
|
||||||
|
yarn
|
||||||
path: $(yarnCacheFolder)
|
path: $(yarnCacheFolder)
|
||||||
displayName: Cache Yarn packages
|
displayName: Cache Yarn packages
|
||||||
- bash: ./build.sh --lint
|
- bash: ./build.sh --lint
|
||||||
@@ -1143,5 +1143,4 @@ stages:
|
|||||||
SYSTEM_ACCESSTOKEN: $(System.AccessToken)
|
SYSTEM_ACCESSTOKEN: $(System.AccessToken)
|
||||||
DISCORDCHANNELID: $(discordChannelId)
|
DISCORDCHANNELID: $(discordChannelId)
|
||||||
DISCORDWEBHOOKKEY: $(discordWebhookKey)
|
DISCORDWEBHOOKKEY: $(discordWebhookKey)
|
||||||
DISCORDTHREADID: $(discordThreadId)
|
|
||||||
|
|
||||||
|
|||||||
@@ -39,7 +39,6 @@ module.exports = {
|
|||||||
plugins: [
|
plugins: [
|
||||||
'filenames',
|
'filenames',
|
||||||
'react',
|
'react',
|
||||||
'react-hooks',
|
|
||||||
'simple-import-sort',
|
'simple-import-sort',
|
||||||
'import'
|
'import'
|
||||||
],
|
],
|
||||||
@@ -309,9 +308,7 @@ module.exports = {
|
|||||||
'react/react-in-jsx-scope': 2,
|
'react/react-in-jsx-scope': 2,
|
||||||
'react/self-closing-comp': 2,
|
'react/self-closing-comp': 2,
|
||||||
'react/sort-comp': 2,
|
'react/sort-comp': 2,
|
||||||
'react/jsx-wrap-multilines': 2,
|
'react/jsx-wrap-multilines': 2
|
||||||
'react-hooks/rules-of-hooks': 'error',
|
|
||||||
'react-hooks/exhaustive-deps': 'error'
|
|
||||||
},
|
},
|
||||||
overrides: [
|
overrides: [
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -223,6 +223,7 @@ module.exports = (env) => {
|
|||||||
{
|
{
|
||||||
loader: 'url-loader',
|
loader: 'url-loader',
|
||||||
options: {
|
options: {
|
||||||
|
limit: 10240,
|
||||||
mimetype: 'application/font-woff',
|
mimetype: 'application/font-woff',
|
||||||
emitFile: false,
|
emitFile: false,
|
||||||
name: 'Content/Fonts/[name].[ext]'
|
name: 'Content/Fonts/[name].[ext]'
|
||||||
|
|||||||
@@ -1,4 +1,3 @@
|
|||||||
// eslint-disable-next-line filenames/match-exported
|
|
||||||
const loaderUtils = require('loader-utils');
|
const loaderUtils = require('loader-utils');
|
||||||
|
|
||||||
module.exports = function cssVariablesLoader(source) {
|
module.exports = function cssVariablesLoader(source) {
|
||||||
|
|||||||
@@ -1,6 +1,7 @@
|
|||||||
const reload = require('require-nocache')(module);
|
const reload = require('require-nocache')(module);
|
||||||
|
|
||||||
const cssVarsFiles = [
|
const cssVarsFiles = [
|
||||||
|
'./src/Styles/Variables/colors',
|
||||||
'./src/Styles/Variables/dimensions',
|
'./src/Styles/Variables/dimensions',
|
||||||
'./src/Styles/Variables/fonts',
|
'./src/Styles/Variables/fonts',
|
||||||
'./src/Styles/Variables/animations',
|
'./src/Styles/Variables/animations',
|
||||||
@@ -28,4 +29,4 @@ module.exports = {
|
|||||||
'postcss-color-function',
|
'postcss-color-function',
|
||||||
'postcss-nested'
|
'postcss-nested'
|
||||||
]
|
]
|
||||||
};
|
};
|
||||||
@@ -10,12 +10,6 @@
|
|||||||
width: 80px;
|
width: 80px;
|
||||||
}
|
}
|
||||||
|
|
||||||
.customFormatScore {
|
|
||||||
composes: cell from '~Components/Table/Cells/TableRowCell.css';
|
|
||||||
|
|
||||||
width: 55px;
|
|
||||||
}
|
|
||||||
|
|
||||||
.releaseGroup {
|
.releaseGroup {
|
||||||
composes: cell from '~Components/Table/Cells/TableRowCell.css';
|
composes: cell from '~Components/Table/Cells/TableRowCell.css';
|
||||||
|
|
||||||
|
|||||||
@@ -9,7 +9,6 @@ import MovieFormats from 'Movie/MovieFormats';
|
|||||||
import MovieLanguage from 'Movie/MovieLanguage';
|
import MovieLanguage from 'Movie/MovieLanguage';
|
||||||
import MovieQuality from 'Movie/MovieQuality';
|
import MovieQuality from 'Movie/MovieQuality';
|
||||||
import MovieTitleLink from 'Movie/MovieTitleLink';
|
import MovieTitleLink from 'Movie/MovieTitleLink';
|
||||||
import formatCustomFormatScore from 'Utilities/Number/formatCustomFormatScore';
|
|
||||||
import HistoryDetailsModal from './Details/HistoryDetailsModal';
|
import HistoryDetailsModal from './Details/HistoryDetailsModal';
|
||||||
import HistoryEventTypeCell from './HistoryEventTypeCell';
|
import HistoryEventTypeCell from './HistoryEventTypeCell';
|
||||||
import styles from './HistoryRow.css';
|
import styles from './HistoryRow.css';
|
||||||
@@ -56,7 +55,6 @@ class HistoryRow extends Component {
|
|||||||
movie,
|
movie,
|
||||||
quality,
|
quality,
|
||||||
customFormats,
|
customFormats,
|
||||||
customFormatScore,
|
|
||||||
languages,
|
languages,
|
||||||
qualityCutoffNotMet,
|
qualityCutoffNotMet,
|
||||||
eventType,
|
eventType,
|
||||||
@@ -170,17 +168,6 @@ class HistoryRow extends Component {
|
|||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (name === 'customFormatScore') {
|
|
||||||
return (
|
|
||||||
<TableRowCell
|
|
||||||
key={name}
|
|
||||||
className={styles.customFormatScore}
|
|
||||||
>
|
|
||||||
{formatCustomFormatScore(customFormatScore)}
|
|
||||||
</TableRowCell>
|
|
||||||
);
|
|
||||||
}
|
|
||||||
|
|
||||||
if (name === 'releaseGroup') {
|
if (name === 'releaseGroup') {
|
||||||
return (
|
return (
|
||||||
<TableRowCell
|
<TableRowCell
|
||||||
@@ -192,16 +179,6 @@ class HistoryRow extends Component {
|
|||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (name === 'sourceTitle') {
|
|
||||||
return (
|
|
||||||
<TableRowCell
|
|
||||||
key={name}
|
|
||||||
>
|
|
||||||
{sourceTitle}
|
|
||||||
</TableRowCell>
|
|
||||||
);
|
|
||||||
}
|
|
||||||
|
|
||||||
if (name === 'details') {
|
if (name === 'details') {
|
||||||
return (
|
return (
|
||||||
<TableRowCell
|
<TableRowCell
|
||||||
@@ -242,9 +219,8 @@ HistoryRow.propTypes = {
|
|||||||
movie: PropTypes.object.isRequired,
|
movie: PropTypes.object.isRequired,
|
||||||
languages: PropTypes.arrayOf(PropTypes.object).isRequired,
|
languages: PropTypes.arrayOf(PropTypes.object).isRequired,
|
||||||
quality: PropTypes.object.isRequired,
|
quality: PropTypes.object.isRequired,
|
||||||
customFormats: PropTypes.arrayOf(PropTypes.object),
|
|
||||||
customFormatScore: PropTypes.number.isRequired,
|
|
||||||
qualityCutoffNotMet: PropTypes.bool.isRequired,
|
qualityCutoffNotMet: PropTypes.bool.isRequired,
|
||||||
|
customFormats: PropTypes.arrayOf(PropTypes.object).isRequired,
|
||||||
eventType: PropTypes.string.isRequired,
|
eventType: PropTypes.string.isRequired,
|
||||||
sourceTitle: PropTypes.string.isRequired,
|
sourceTitle: PropTypes.string.isRequired,
|
||||||
date: PropTypes.string.isRequired,
|
date: PropTypes.string.isRequired,
|
||||||
|
|||||||
@@ -1,13 +1,13 @@
|
|||||||
.torrent {
|
.torrent {
|
||||||
composes: label from '~Components/Label.css';
|
composes: label from '~Components/Label.css';
|
||||||
|
|
||||||
border-color: var(--torrentColor);
|
border-color: $torrentColor;
|
||||||
background-color: var(--torrentColor);
|
background-color: $torrentColor;
|
||||||
}
|
}
|
||||||
|
|
||||||
.usenet {
|
.usenet {
|
||||||
composes: label from '~Components/Label.css';
|
composes: label from '~Components/Label.css';
|
||||||
|
|
||||||
border-color: var(--usenetColor);
|
border-color: $usenetColor;
|
||||||
background-color: var(--usenetColor);
|
background-color: $usenetColor;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -75,23 +75,13 @@ class Queue extends Component {
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
const nextState = {};
|
|
||||||
|
|
||||||
if (prevProps.items !== items) {
|
|
||||||
nextState.items = items;
|
|
||||||
}
|
|
||||||
|
|
||||||
const selectedIds = this.getSelectedIds();
|
const selectedIds = this.getSelectedIds();
|
||||||
const isPendingSelected = _.some(this.props.items, (item) => {
|
const isPendingSelected = _.some(this.props.items, (item) => {
|
||||||
return selectedIds.indexOf(item.id) > -1 && item.status === 'delay';
|
return selectedIds.indexOf(item.id) > -1 && item.status === 'delay';
|
||||||
});
|
});
|
||||||
|
|
||||||
if (isPendingSelected !== this.state.isPendingSelected) {
|
if (isPendingSelected !== this.state.isPendingSelected) {
|
||||||
nextState.isPendingSelected = isPendingSelected;
|
this.setState({ isPendingSelected });
|
||||||
}
|
|
||||||
|
|
||||||
if (!_.isEmpty(nextState)) {
|
|
||||||
this.setState(nextState);
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -224,29 +214,26 @@ class Queue extends Component {
|
|||||||
|
|
||||||
<PageContentBody>
|
<PageContentBody>
|
||||||
{
|
{
|
||||||
isRefreshing && !isAllPopulated ?
|
isRefreshing && !isAllPopulated &&
|
||||||
<LoadingIndicator /> :
|
<LoadingIndicator />
|
||||||
null
|
|
||||||
}
|
}
|
||||||
|
|
||||||
{
|
{
|
||||||
!isRefreshing && hasError ?
|
!isRefreshing && hasError &&
|
||||||
<div>
|
<div>
|
||||||
{translate('FailedToLoadQueue')}
|
{translate('FailedToLoadQueue')}
|
||||||
</div> :
|
</div>
|
||||||
null
|
|
||||||
}
|
}
|
||||||
|
|
||||||
{
|
{
|
||||||
isAllPopulated && !hasError && !items.length ?
|
isAllPopulated && !hasError && !items.length &&
|
||||||
<div>
|
<div>
|
||||||
{translate('QueueIsEmpty')}
|
{translate('QueueIsEmpty')}
|
||||||
</div> :
|
</div>
|
||||||
null
|
|
||||||
}
|
}
|
||||||
|
|
||||||
{
|
{
|
||||||
isAllPopulated && !hasError && !!items.length ?
|
isAllPopulated && !hasError && !!items.length &&
|
||||||
<div>
|
<div>
|
||||||
<Table
|
<Table
|
||||||
columns={columns}
|
columns={columns}
|
||||||
@@ -281,8 +268,7 @@ class Queue extends Component {
|
|||||||
isFetching={isRefreshing}
|
isFetching={isRefreshing}
|
||||||
{...otherProps}
|
{...otherProps}
|
||||||
/>
|
/>
|
||||||
</div> :
|
</div>
|
||||||
null
|
|
||||||
}
|
}
|
||||||
</PageContentBody>
|
</PageContentBody>
|
||||||
|
|
||||||
|
|||||||
@@ -128,7 +128,6 @@ class QueueRow extends Component {
|
|||||||
|
|
||||||
{
|
{
|
||||||
columns.map((column) => {
|
columns.map((column) => {
|
||||||
|
|
||||||
const {
|
const {
|
||||||
name,
|
name,
|
||||||
isVisible
|
isVisible
|
||||||
@@ -235,16 +234,6 @@ class QueueRow extends Component {
|
|||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (name === 'year') {
|
|
||||||
return (
|
|
||||||
<TableRowCell key={name}>
|
|
||||||
{
|
|
||||||
movie ? movie.year : ''
|
|
||||||
}
|
|
||||||
</TableRowCell>
|
|
||||||
);
|
|
||||||
}
|
|
||||||
|
|
||||||
if (name === 'title') {
|
if (name === 'title') {
|
||||||
return (
|
return (
|
||||||
<TableRowCell key={name}>
|
<TableRowCell key={name}>
|
||||||
@@ -373,7 +362,6 @@ QueueRow.propTypes = {
|
|||||||
estimatedCompletionTime: PropTypes.string,
|
estimatedCompletionTime: PropTypes.string,
|
||||||
timeleft: PropTypes.string,
|
timeleft: PropTypes.string,
|
||||||
size: PropTypes.number,
|
size: PropTypes.number,
|
||||||
year: PropTypes.number,
|
|
||||||
sizeleft: PropTypes.number,
|
sizeleft: PropTypes.number,
|
||||||
showRelativeDates: PropTypes.bool.isRequired,
|
showRelativeDates: PropTypes.bool.isRequired,
|
||||||
shortDateFormat: PropTypes.string.isRequired,
|
shortDateFormat: PropTypes.string.isRequired,
|
||||||
|
|||||||
@@ -6,12 +6,12 @@
|
|||||||
.searchIconContainer {
|
.searchIconContainer {
|
||||||
width: 58px;
|
width: 58px;
|
||||||
height: 46px;
|
height: 46px;
|
||||||
border: 1px solid var(--inputBorderColor);
|
border: 1px solid $inputBorderColor;
|
||||||
border-right: none;
|
border-right: none;
|
||||||
border-radius: 4px;
|
border-radius: 4px;
|
||||||
border-top-right-radius: 0;
|
border-top-right-radius: 0;
|
||||||
border-bottom-right-radius: 0;
|
border-bottom-right-radius: 0;
|
||||||
background-color: var(--searchIconContainerBackgroundColor);
|
background-color: #edf1f2;
|
||||||
text-align: center;
|
text-align: center;
|
||||||
line-height: 46px;
|
line-height: 46px;
|
||||||
}
|
}
|
||||||
@@ -25,7 +25,7 @@
|
|||||||
}
|
}
|
||||||
|
|
||||||
.clearLookupButton {
|
.clearLookupButton {
|
||||||
border: 1px solid var(--inputBorderColor);
|
border: 1px solid $inputBorderColor;
|
||||||
border-left: none;
|
border-left: none;
|
||||||
border-top-right-radius: 4px;
|
border-top-right-radius: 4px;
|
||||||
border-bottom-right-radius: 4px;
|
border-bottom-right-radius: 4px;
|
||||||
|
|||||||
@@ -4,7 +4,7 @@
|
|||||||
|
|
||||||
.year {
|
.year {
|
||||||
margin-left: 5px;
|
margin-left: 5px;
|
||||||
color: var(--disabledColor);
|
color: $disabledColor;
|
||||||
}
|
}
|
||||||
|
|
||||||
.poster {
|
.poster {
|
||||||
|
|||||||
@@ -9,15 +9,13 @@
|
|||||||
.underlay {
|
.underlay {
|
||||||
@add-mixin cover;
|
@add-mixin cover;
|
||||||
|
|
||||||
background-color: var(--addMovieBackgroundColor);
|
background-color: $white;
|
||||||
transition: background 500ms;
|
transition: background 500ms;
|
||||||
|
|
||||||
&:hover {
|
&:hover {
|
||||||
background-color: var(--pageBackground);
|
background-color: #eaf2ff;
|
||||||
box-shadow: 0 0 12px var(--black);
|
|
||||||
color: inherit;
|
color: inherit;
|
||||||
text-decoration: none;
|
text-decoration: none;
|
||||||
transition: all 200ms ease-in;
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -33,7 +31,7 @@
|
|||||||
display: block;
|
display: block;
|
||||||
margin-right: 20px;
|
margin-right: 20px;
|
||||||
height: 250px;
|
height: 250px;
|
||||||
background-color: var(--defaultColor);
|
background-color: $defaultColor;
|
||||||
}
|
}
|
||||||
|
|
||||||
.content {
|
.content {
|
||||||
@@ -58,7 +56,7 @@
|
|||||||
|
|
||||||
.year {
|
.year {
|
||||||
margin-left: 10px;
|
margin-left: 10px;
|
||||||
color: var(--disabledColor);
|
color: $disabledColor;
|
||||||
}
|
}
|
||||||
|
|
||||||
.icons {
|
.icons {
|
||||||
@@ -77,7 +75,7 @@
|
|||||||
|
|
||||||
.exclusionIcon {
|
.exclusionIcon {
|
||||||
margin-left: 10px;
|
margin-left: 10px;
|
||||||
color: var(--dangerColor);
|
color: $dangerColor;
|
||||||
pointer-events: all;
|
pointer-events: all;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -1,9 +1,9 @@
|
|||||||
import PropTypes from 'prop-types';
|
import PropTypes from 'prop-types';
|
||||||
import React, { Component } from 'react';
|
import React, { Component } from 'react';
|
||||||
|
import HeartRating from 'Components/HeartRating';
|
||||||
import Icon from 'Components/Icon';
|
import Icon from 'Components/Icon';
|
||||||
import Label from 'Components/Label';
|
import Label from 'Components/Label';
|
||||||
import Link from 'Components/Link/Link';
|
import Link from 'Components/Link/Link';
|
||||||
import TmdbRating from 'Components/TmdbRating';
|
|
||||||
import Tooltip from 'Components/Tooltip/Tooltip';
|
import Tooltip from 'Components/Tooltip/Tooltip';
|
||||||
import { icons, kinds, sizes, tooltipPositions } from 'Helpers/Props';
|
import { icons, kinds, sizes, tooltipPositions } from 'Helpers/Props';
|
||||||
import MovieDetailsLinks from 'Movie/Details/MovieDetailsLinks';
|
import MovieDetailsLinks from 'Movie/Details/MovieDetailsLinks';
|
||||||
@@ -190,7 +190,7 @@ class AddNewMovieSearchResult extends Component {
|
|||||||
|
|
||||||
<div>
|
<div>
|
||||||
<Label size={sizes.LARGE}>
|
<Label size={sizes.LARGE}>
|
||||||
<TmdbRating
|
<HeartRating
|
||||||
ratings={ratings}
|
ratings={ratings}
|
||||||
iconSize={13}
|
iconSize={13}
|
||||||
/>
|
/>
|
||||||
|
|||||||
@@ -225,19 +225,13 @@ class ImportMovieFooter extends Component {
|
|||||||
body={
|
body={
|
||||||
<ul>
|
<ul>
|
||||||
{
|
{
|
||||||
Array.isArray(importError.responseJSON) ?
|
importError.responseJSON.map((error, index) => {
|
||||||
importError.responseJSON.map((error, index) => {
|
return (
|
||||||
return (
|
<li key={index}>
|
||||||
<li key={index}>
|
{error.errorMessage}
|
||||||
{error.errorMessage}
|
</li>
|
||||||
</li>
|
);
|
||||||
);
|
})
|
||||||
}) :
|
|
||||||
<li>
|
|
||||||
{
|
|
||||||
JSON.stringify(importError.responseJSON)
|
|
||||||
}
|
|
||||||
</li>
|
|
||||||
}
|
}
|
||||||
</ul>
|
</ul>
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,25 +1,8 @@
|
|||||||
.container {
|
.movie {
|
||||||
display: flex;
|
|
||||||
padding: 10px 20px;
|
padding: 10px 20px;
|
||||||
width: 100%;
|
width: 100%;
|
||||||
|
|
||||||
&:hover {
|
&:hover {
|
||||||
background-color: var(--menuItemHoverBackgroundColor);
|
background-color: $menuItemHoverBackgroundColor;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
.movie {
|
|
||||||
flex: 1 0 0;
|
|
||||||
overflow: hidden;
|
|
||||||
}
|
|
||||||
|
|
||||||
.tmdbLink {
|
|
||||||
composes: link from '~Components/Link/Link.css';
|
|
||||||
|
|
||||||
margin-left: auto;
|
|
||||||
color: var(--textColor);
|
|
||||||
}
|
|
||||||
|
|
||||||
.tmdbLinkIcon {
|
|
||||||
margin-left: 10px;
|
|
||||||
}
|
|
||||||
|
|||||||
@@ -1,8 +1,6 @@
|
|||||||
import PropTypes from 'prop-types';
|
import PropTypes from 'prop-types';
|
||||||
import React, { Component } from 'react';
|
import React, { Component } from 'react';
|
||||||
import Icon from 'Components/Icon';
|
|
||||||
import Link from 'Components/Link/Link';
|
import Link from 'Components/Link/Link';
|
||||||
import { icons } from 'Helpers/Props';
|
|
||||||
import ImportMovieTitle from './ImportMovieTitle';
|
import ImportMovieTitle from './ImportMovieTitle';
|
||||||
import styles from './ImportMovieSearchResult.css';
|
import styles from './ImportMovieSearchResult.css';
|
||||||
|
|
||||||
@@ -20,7 +18,6 @@ class ImportMovieSearchResult extends Component {
|
|||||||
|
|
||||||
render() {
|
render() {
|
||||||
const {
|
const {
|
||||||
tmdbId,
|
|
||||||
title,
|
title,
|
||||||
year,
|
year,
|
||||||
studio,
|
studio,
|
||||||
@@ -28,30 +25,17 @@ class ImportMovieSearchResult extends Component {
|
|||||||
} = this.props;
|
} = this.props;
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<div className={styles.container}>
|
<Link
|
||||||
<Link
|
className={styles.movie}
|
||||||
className={styles.movie}
|
onPress={this.onPress}
|
||||||
onPress={this.onPress}
|
>
|
||||||
>
|
<ImportMovieTitle
|
||||||
<ImportMovieTitle
|
title={title}
|
||||||
title={title}
|
year={year}
|
||||||
year={year}
|
network={studio}
|
||||||
network={studio}
|
isExistingMovie={isExistingMovie}
|
||||||
isExistingMovie={isExistingMovie}
|
/>
|
||||||
/>
|
</Link>
|
||||||
</Link>
|
|
||||||
|
|
||||||
<Link
|
|
||||||
className={styles.tmdbLink}
|
|
||||||
to={`https://www.themoviedb.org/movie/${tmdbId}`}
|
|
||||||
>
|
|
||||||
<Icon
|
|
||||||
className={styles.tmdbLinkIcon}
|
|
||||||
name={icons.EXTERNAL_LINK}
|
|
||||||
size={16}
|
|
||||||
/>
|
|
||||||
</Link>
|
|
||||||
</div>
|
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -7,10 +7,10 @@
|
|||||||
padding: 6px 16px;
|
padding: 6px 16px;
|
||||||
width: 100%;
|
width: 100%;
|
||||||
height: 35px;
|
height: 35px;
|
||||||
border: 1px solid var(--inputBorderColor);
|
border: 1px solid $inputBorderColor;
|
||||||
border-radius: 4px;
|
border-radius: 4px;
|
||||||
background-color: var(--inputBackgroundColor);
|
background-color: $white;
|
||||||
box-shadow: inset 0 1px 1px var(--inputBoxShadowColor);
|
box-shadow: inset 0 1px 1px $inputBoxShadowColor;
|
||||||
}
|
}
|
||||||
|
|
||||||
.loading {
|
.loading {
|
||||||
@@ -38,9 +38,9 @@
|
|||||||
|
|
||||||
.content {
|
.content {
|
||||||
padding: 4px;
|
padding: 4px;
|
||||||
border: 1px solid var(--inputBorderColor);
|
border: 1px solid $inputBorderColor;
|
||||||
border-radius: 4px;
|
border-radius: 4px;
|
||||||
background-color: var(--inputBackgroundColor);
|
background-color: $white;
|
||||||
}
|
}
|
||||||
|
|
||||||
.searchContainer {
|
.searchContainer {
|
||||||
@@ -49,12 +49,12 @@
|
|||||||
|
|
||||||
.searchIconContainer {
|
.searchIconContainer {
|
||||||
width: 58px;
|
width: 58px;
|
||||||
border: 1px solid var(--inputBorderColor);
|
border: 1px solid $inputBorderColor;
|
||||||
border-right: none;
|
border-right: none;
|
||||||
border-radius: 4px;
|
border-radius: 4px;
|
||||||
border-top-right-radius: 0;
|
border-top-right-radius: 0;
|
||||||
border-bottom-right-radius: 0;
|
border-bottom-right-radius: 0;
|
||||||
background-color: var(--searchIconContainerBackgroundColor);
|
background-color: #edf1f2;
|
||||||
text-align: center;
|
text-align: center;
|
||||||
line-height: 33px;
|
line-height: 33px;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -9,7 +9,7 @@
|
|||||||
|
|
||||||
.year {
|
.year {
|
||||||
margin-left: 5px;
|
margin-left: 5px;
|
||||||
color: var(--disabledColor);
|
color: $disabledColor;
|
||||||
}
|
}
|
||||||
|
|
||||||
.existing {
|
.existing {
|
||||||
|
|||||||
@@ -152,19 +152,13 @@ class ImportMovieSelectFolder extends Component {
|
|||||||
|
|
||||||
<ul>
|
<ul>
|
||||||
{
|
{
|
||||||
Array.isArray(saveError.responseJSON) ?
|
saveError.responseJSON.map((e, index) => {
|
||||||
saveError.responseJSON.map((e, index) => {
|
return (
|
||||||
return (
|
<li key={index}>
|
||||||
<li key={index}>
|
{e.errorMessage}
|
||||||
{e.errorMessage}
|
</li>
|
||||||
</li>
|
);
|
||||||
);
|
})
|
||||||
}) :
|
|
||||||
<li>
|
|
||||||
{
|
|
||||||
JSON.stringify(saveError.responseJSON)
|
|
||||||
}
|
|
||||||
</li>
|
|
||||||
}
|
}
|
||||||
</ul>
|
</ul>
|
||||||
</Alert> :
|
</Alert> :
|
||||||
|
|||||||
@@ -4,19 +4,16 @@ import React from 'react';
|
|||||||
import DocumentTitle from 'react-document-title';
|
import DocumentTitle from 'react-document-title';
|
||||||
import { Provider } from 'react-redux';
|
import { Provider } from 'react-redux';
|
||||||
import PageConnector from 'Components/Page/PageConnector';
|
import PageConnector from 'Components/Page/PageConnector';
|
||||||
import ApplyTheme from './ApplyTheme';
|
|
||||||
import AppRoutes from './AppRoutes';
|
import AppRoutes from './AppRoutes';
|
||||||
|
|
||||||
function App({ store, history }) {
|
function App({ store, history }) {
|
||||||
return (
|
return (
|
||||||
<DocumentTitle title={window.Radarr.instanceName}>
|
<DocumentTitle title="Radarr">
|
||||||
<Provider store={store}>
|
<Provider store={store}>
|
||||||
<ConnectedRouter history={history}>
|
<ConnectedRouter history={history}>
|
||||||
<ApplyTheme>
|
<PageConnector>
|
||||||
<PageConnector>
|
<AppRoutes app={App} />
|
||||||
<AppRoutes app={App} />
|
</PageConnector>
|
||||||
</PageConnector>
|
|
||||||
</ApplyTheme>
|
|
||||||
</ConnectedRouter>
|
</ConnectedRouter>
|
||||||
</Provider>
|
</Provider>
|
||||||
</DocumentTitle>
|
</DocumentTitle>
|
||||||
|
|||||||
@@ -7,7 +7,6 @@ import QueueConnector from 'Activity/Queue/QueueConnector';
|
|||||||
import AddNewMovieConnector from 'AddMovie/AddNewMovie/AddNewMovieConnector';
|
import AddNewMovieConnector from 'AddMovie/AddNewMovie/AddNewMovieConnector';
|
||||||
import ImportMovies from 'AddMovie/ImportMovie/ImportMovies';
|
import ImportMovies from 'AddMovie/ImportMovie/ImportMovies';
|
||||||
import CalendarPageConnector from 'Calendar/CalendarPageConnector';
|
import CalendarPageConnector from 'Calendar/CalendarPageConnector';
|
||||||
import CollectionConnector from 'Collection/CollectionConnector';
|
|
||||||
import NotFound from 'Components/NotFound';
|
import NotFound from 'Components/NotFound';
|
||||||
import Switch from 'Components/Router/Switch';
|
import Switch from 'Components/Router/Switch';
|
||||||
import DiscoverMovieConnector from 'DiscoverMovie/DiscoverMovieConnector';
|
import DiscoverMovieConnector from 'DiscoverMovie/DiscoverMovieConnector';
|
||||||
@@ -22,7 +21,7 @@ import MediaManagementConnector from 'Settings/MediaManagement/MediaManagementCo
|
|||||||
import MetadataSettings from 'Settings/Metadata/MetadataSettings';
|
import MetadataSettings from 'Settings/Metadata/MetadataSettings';
|
||||||
import NotificationSettings from 'Settings/Notifications/NotificationSettings';
|
import NotificationSettings from 'Settings/Notifications/NotificationSettings';
|
||||||
import Profiles from 'Settings/Profiles/Profiles';
|
import Profiles from 'Settings/Profiles/Profiles';
|
||||||
import QualityConnector from 'Settings/Quality/QualityConnector';
|
import Quality from 'Settings/Quality/Quality';
|
||||||
import Settings from 'Settings/Settings';
|
import Settings from 'Settings/Settings';
|
||||||
import TagSettings from 'Settings/Tags/TagSettings';
|
import TagSettings from 'Settings/Tags/TagSettings';
|
||||||
import UISettingsConnector from 'Settings/UI/UISettingsConnector';
|
import UISettingsConnector from 'Settings/UI/UISettingsConnector';
|
||||||
@@ -73,11 +72,6 @@ function AppRoutes(props) {
|
|||||||
component={AddNewMovieConnector}
|
component={AddNewMovieConnector}
|
||||||
/>
|
/>
|
||||||
|
|
||||||
<Route
|
|
||||||
path="/collections"
|
|
||||||
component={CollectionConnector}
|
|
||||||
/>
|
|
||||||
|
|
||||||
<Route
|
<Route
|
||||||
path="/add/import"
|
path="/add/import"
|
||||||
component={ImportMovies}
|
component={ImportMovies}
|
||||||
@@ -143,7 +137,7 @@ function AppRoutes(props) {
|
|||||||
|
|
||||||
<Route
|
<Route
|
||||||
path="/settings/quality"
|
path="/settings/quality"
|
||||||
component={QualityConnector}
|
component={Quality}
|
||||||
/>
|
/>
|
||||||
|
|
||||||
<Route
|
<Route
|
||||||
|
|||||||
@@ -1,49 +0,0 @@
|
|||||||
import PropTypes from 'prop-types';
|
|
||||||
import React, { Fragment, useCallback, useEffect } from 'react';
|
|
||||||
import { connect } from 'react-redux';
|
|
||||||
import { createSelector } from 'reselect';
|
|
||||||
import themes from 'Styles/Themes';
|
|
||||||
|
|
||||||
function createMapStateToProps() {
|
|
||||||
return createSelector(
|
|
||||||
(state) => state.settings.ui.item.theme || window.Radarr.theme,
|
|
||||||
(
|
|
||||||
theme
|
|
||||||
) => {
|
|
||||||
return {
|
|
||||||
theme
|
|
||||||
};
|
|
||||||
}
|
|
||||||
);
|
|
||||||
}
|
|
||||||
|
|
||||||
function ApplyTheme({ theme, children }) {
|
|
||||||
// Update the CSS Variables
|
|
||||||
const updateCSSVariables = useCallback(() => {
|
|
||||||
const arrayOfVariableKeys = Object.keys(themes[theme]);
|
|
||||||
const arrayOfVariableValues = Object.values(themes[theme]);
|
|
||||||
|
|
||||||
// Loop through each array key and set the CSS Variables
|
|
||||||
arrayOfVariableKeys.forEach((cssVariableKey, index) => {
|
|
||||||
// Based on our snippet from MDN
|
|
||||||
document.documentElement.style.setProperty(
|
|
||||||
`--${cssVariableKey}`,
|
|
||||||
arrayOfVariableValues[index]
|
|
||||||
);
|
|
||||||
});
|
|
||||||
}, [theme]);
|
|
||||||
|
|
||||||
// On Component Mount and Component Update
|
|
||||||
useEffect(() => {
|
|
||||||
updateCSSVariables(theme);
|
|
||||||
}, [updateCSSVariables, theme]);
|
|
||||||
|
|
||||||
return <Fragment>{children}</Fragment>;
|
|
||||||
}
|
|
||||||
|
|
||||||
ApplyTheme.propTypes = {
|
|
||||||
theme: PropTypes.string.isRequired,
|
|
||||||
children: PropTypes.object.isRequired
|
|
||||||
};
|
|
||||||
|
|
||||||
export default connect(createMapStateToProps)(ApplyTheme);
|
|
||||||
@@ -2,11 +2,11 @@
|
|||||||
display: flex;
|
display: flex;
|
||||||
overflow-x: hidden;
|
overflow-x: hidden;
|
||||||
padding: 5px;
|
padding: 5px;
|
||||||
border-bottom: 1px solid var(--borderColor);
|
border-bottom: 1px solid $borderColor;
|
||||||
font-size: $defaultFontSize;
|
font-size: $defaultFontSize;
|
||||||
|
|
||||||
&:hover {
|
&:hover {
|
||||||
background-color: var(--tableRowHoverBackgroundColor);
|
background-color: $tableRowHoverBackgroundColor;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -2,8 +2,8 @@
|
|||||||
flex: 1 0 14.28%;
|
flex: 1 0 14.28%;
|
||||||
overflow: hidden;
|
overflow: hidden;
|
||||||
min-height: 70px;
|
min-height: 70px;
|
||||||
border-bottom: 1px solid var(--calendarBorderColor);
|
border-bottom: 1px solid $calendarBorderColor;
|
||||||
border-left: 1px solid var(--calendarBorderColor);
|
border-left: 1px solid $calendarBorderColor;
|
||||||
}
|
}
|
||||||
|
|
||||||
.isSingleDay {
|
.isSingleDay {
|
||||||
@@ -12,14 +12,14 @@
|
|||||||
|
|
||||||
.dayOfMonth {
|
.dayOfMonth {
|
||||||
padding-right: 5px;
|
padding-right: 5px;
|
||||||
border-bottom: 1px solid var(--calendarBorderColor);
|
border-bottom: 1px solid $calendarBorderColor;
|
||||||
text-align: right;
|
text-align: right;
|
||||||
}
|
}
|
||||||
|
|
||||||
.isToday {
|
.isToday {
|
||||||
background-color: var(--calendarTodayBackgroundColor);
|
background-color: $calendarTodayBackgroundColor;
|
||||||
}
|
}
|
||||||
|
|
||||||
.isDifferentMonth {
|
.isDifferentMonth {
|
||||||
color: var(--disabledColor);
|
color: $disabledColor;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
.days {
|
.days {
|
||||||
display: flex;
|
display: flex;
|
||||||
border-right: 1px solid var(--calendarBorderColor);
|
border-right: 1px solid $calendarBorderColor;
|
||||||
}
|
}
|
||||||
|
|
||||||
.day,
|
.day,
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
.dayOfWeek {
|
.dayOfWeek {
|
||||||
flex: 1 0 14.28%;
|
flex: 1 0 14.28%;
|
||||||
background-color: var(--calendarBackgroudColor);
|
background-color: #e4eaec;
|
||||||
text-align: center;
|
text-align: center;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -9,5 +9,5 @@
|
|||||||
}
|
}
|
||||||
|
|
||||||
.isToday {
|
.isToday {
|
||||||
background-color: var(--calendarTodayBackgroundColor);
|
background-color: $calendarTodayBackgroundColor;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -2,8 +2,8 @@
|
|||||||
overflow-x: hidden;
|
overflow-x: hidden;
|
||||||
margin: 4px 2px;
|
margin: 4px 2px;
|
||||||
padding: 5px;
|
padding: 5px;
|
||||||
border-bottom: 1px solid var(--calendarBorderColor);
|
border-bottom: 1px solid $borderColor;
|
||||||
border-left: 4px solid var(--calendarBorderColor);
|
border-left: 4px solid $borderColor;
|
||||||
font-size: 12px;
|
font-size: 12px;
|
||||||
|
|
||||||
&:global(.colorImpaired) {
|
&:global(.colorImpaired) {
|
||||||
@@ -15,10 +15,10 @@
|
|||||||
composes: link from '~Components/Link/Link.css';
|
composes: link from '~Components/Link/Link.css';
|
||||||
|
|
||||||
display: block;
|
display: block;
|
||||||
color: var(--defaultColor);
|
color: $defaultColor;
|
||||||
|
|
||||||
&:hover {
|
&:hover {
|
||||||
color: var(--defaultColor);
|
color: $defaultColor;
|
||||||
text-decoration: none;
|
text-decoration: none;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -29,7 +29,7 @@
|
|||||||
}
|
}
|
||||||
|
|
||||||
.movieInfo {
|
.movieInfo {
|
||||||
color: var(--calendarTextDim);
|
color: $calendarTextDim;
|
||||||
}
|
}
|
||||||
|
|
||||||
.movieTitle,
|
.movieTitle,
|
||||||
@@ -40,7 +40,7 @@
|
|||||||
}
|
}
|
||||||
|
|
||||||
.movieTitle {
|
.movieTitle {
|
||||||
color: var(--calendarTextDimAlternate);
|
color: #3a3f51;
|
||||||
font-size: $defaultFontSize;
|
font-size: $defaultFontSize;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -53,37 +53,37 @@
|
|||||||
*/
|
*/
|
||||||
|
|
||||||
.downloaded {
|
.downloaded {
|
||||||
border-left-color: var(--successColor) !important;
|
border-left-color: $successColor !important;
|
||||||
|
|
||||||
&:global(.colorImpaired) {
|
&:global(.colorImpaired) {
|
||||||
border-left-color: color(var(--successColor), saturation(+15%)) !important;
|
border-left-color: color($successColor, saturation(+15%)) !important;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
.queue {
|
.queue {
|
||||||
border-left-color: var(--purple) !important;
|
border-left-color: $purple !important;
|
||||||
}
|
}
|
||||||
|
|
||||||
.unmonitored {
|
.unmonitored {
|
||||||
border-left-color: var(--gray) !important;
|
border-left-color: $gray !important;
|
||||||
}
|
}
|
||||||
|
|
||||||
.missingUnmonitored {
|
.missingUnmonitored {
|
||||||
border-left-color: var(--warningColor) !important;
|
border-left-color: $warningColor !important;
|
||||||
|
|
||||||
&:global(.colorImpaired) {
|
&:global(.colorImpaired) {
|
||||||
background: repeating-linear-gradient(45deg, var(--colorImpairedGradientDark), var(--colorImpairedGradientDark) 5px, var(--colorImpairedGradient) 5px, var(--colorImpairedGradient) 10px);
|
background: repeating-linear-gradient(45deg, $colorImpairedGradientDark, $colorImpairedGradientDark 5px, $colorImpairedGradient 5px, $colorImpairedGradient 10px);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
.missingMonitored {
|
.missingMonitored {
|
||||||
border-left-color: var(--dangerColor) !important;
|
border-left-color: $dangerColor !important;
|
||||||
|
|
||||||
&:global(.colorImpaired) {
|
&:global(.colorImpaired) {
|
||||||
background: repeating-linear-gradient(90deg, var(--colorImpairedGradientDark), var(--colorImpairedGradientDark) 5px, var(--colorImpairedGradient) 5px, var(--colorImpairedGradient) 10px);
|
background: repeating-linear-gradient(90deg, $colorImpairedGradientDark, $colorImpairedGradientDark 5px, $colorImpairedGradient 5px, $colorImpairedGradient 10px);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
.continuing {
|
.continuing {
|
||||||
border-left-color: var(--primaryColor) !important;
|
border-left-color: $primaryColor !important;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -2,6 +2,7 @@ import PropTypes from 'prop-types';
|
|||||||
import React from 'react';
|
import React from 'react';
|
||||||
import QueueDetails from 'Activity/Queue/QueueDetails';
|
import QueueDetails from 'Activity/Queue/QueueDetails';
|
||||||
import CircularProgressBar from 'Components/CircularProgressBar';
|
import CircularProgressBar from 'Components/CircularProgressBar';
|
||||||
|
import colors from 'Styles/Variables/colors';
|
||||||
import translate from 'Utilities/String/translate';
|
import translate from 'Utilities/String/translate';
|
||||||
|
|
||||||
function CalendarEventQueueDetails(props) {
|
function CalendarEventQueueDetails(props) {
|
||||||
@@ -34,7 +35,7 @@ function CalendarEventQueueDetails(props) {
|
|||||||
progress={progress}
|
progress={progress}
|
||||||
size={20}
|
size={20}
|
||||||
strokeWidth={2}
|
strokeWidth={2}
|
||||||
strokeColor={'#7a43b6'}
|
strokeColor={colors.purple}
|
||||||
/>
|
/>
|
||||||
</div>
|
</div>
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -20,53 +20,53 @@
|
|||||||
.queue {
|
.queue {
|
||||||
composes: legendItemColor;
|
composes: legendItemColor;
|
||||||
|
|
||||||
background-color: var(--queueColor);
|
background-color: $queueColor;
|
||||||
}
|
}
|
||||||
|
|
||||||
.continuing {
|
.continuing {
|
||||||
composes: legendItemColor;
|
composes: legendItemColor;
|
||||||
|
|
||||||
background-color: var(--primaryColor);
|
background-color: $primaryColor;
|
||||||
}
|
}
|
||||||
|
|
||||||
.availNotMonitored {
|
.availNotMonitored {
|
||||||
composes: legendItemColor;
|
composes: legendItemColor;
|
||||||
|
|
||||||
background-color: var(--darkGray);
|
background-color: $darkGray;
|
||||||
}
|
}
|
||||||
|
|
||||||
.ended {
|
.ended {
|
||||||
composes: legendItemColor;
|
composes: legendItemColor;
|
||||||
|
|
||||||
background-color: var(--successColor);
|
background-color: $successColor;
|
||||||
}
|
}
|
||||||
|
|
||||||
.missingMonitored {
|
.missingMonitored {
|
||||||
composes: legendItemColor;
|
composes: legendItemColor;
|
||||||
|
|
||||||
background-color: var(--dangerColor);
|
background-color: $dangerColor;
|
||||||
|
|
||||||
&:global(.colorImpaired) {
|
&:global(.colorImpaired) {
|
||||||
background: repeating-linear-gradient(90deg, color(var(--dangerColor) shade(5%)), color(var(--dangerColor) shade(5%)) 5px, color(var(--dangerColor) shade(15%)) 5px, color(var(--dangerColor) shade(15%)) 10px);
|
background: repeating-linear-gradient(90deg, color($dangerColor shade(5%)), color($dangerColor shade(5%)) 5px, color($dangerColor shade(15%)) 5px, color($dangerColor shade(15%)) 10px);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
.missingUnmonitored {
|
.missingUnmonitored {
|
||||||
composes: legendItemColor;
|
composes: legendItemColor;
|
||||||
|
|
||||||
background-color: var(--warningColor);
|
background-color: $warningColor;
|
||||||
|
|
||||||
&:global(.colorImpaired) {
|
&:global(.colorImpaired) {
|
||||||
background: repeating-linear-gradient(45deg, var(--warningColor), var(--warningColor) 5px, color(var(--warningColor) tint(15%)) 5px, color(var(--warningColor) tint(15%)) 10px);
|
background: repeating-linear-gradient(45deg, $warningColor, $warningColor 5px, color($warningColor tint(15%)) 5px, color($warningColor tint(15%)) 10px);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
.missingMonitoredColorImpaired {
|
.missingMonitoredColorImpaired {
|
||||||
background: repeating-linear-gradient(90deg, var(--colorImpairedGradientDark), var(--colorImpairedGradientDark) 5px, var(--colorImpairedGradient) 5px, var(--colorImpairedGradient) 10px);
|
background: repeating-linear-gradient(90deg, $colorImpairedGradientDark, $colorImpairedGradientDark 5px, $colorImpairedGradient 5px, $colorImpairedGradient 10px);
|
||||||
}
|
}
|
||||||
|
|
||||||
.missingUnmonitoredColorImpaired {
|
.missingUnmonitoredColorImpaired {
|
||||||
background: repeating-linear-gradient(45deg, var(--colorImpairedGradientDark), var(--colorImpairedGradientDark) 5px, var(--colorImpairedGradient) 5px, var(--colorImpairedGradient) 10px);
|
background: repeating-linear-gradient(45deg, $colorImpairedGradientDark, $colorImpairedGradientDark 5px, $colorImpairedGradient 5px, $colorImpairedGradient 10px);
|
||||||
}
|
}
|
||||||
|
|
||||||
.legendItemText {
|
.legendItemText {
|
||||||
|
|||||||
@@ -162,7 +162,7 @@ class CalendarOptionsModalContent extends Component {
|
|||||||
values={weekColumnOptions}
|
values={weekColumnOptions}
|
||||||
value={calendarWeekColumnHeader}
|
value={calendarWeekColumnHeader}
|
||||||
onChange={this.onGlobalInputChange}
|
onChange={this.onGlobalInputChange}
|
||||||
helpText={translate('SettingsWeekColumnHeaderHelpText')}
|
helpText={translate('HelpText')}
|
||||||
/>
|
/>
|
||||||
</FormGroup>
|
</FormGroup>
|
||||||
|
|
||||||
|
|||||||
@@ -1,31 +0,0 @@
|
|||||||
import PropTypes from 'prop-types';
|
|
||||||
import React from 'react';
|
|
||||||
import Modal from 'Components/Modal/Modal';
|
|
||||||
import AddNewCollectionMovieModalContentConnector from './AddNewCollectionMovieModalContentConnector';
|
|
||||||
|
|
||||||
function AddNewCollectionMovieModal(props) {
|
|
||||||
const {
|
|
||||||
isOpen,
|
|
||||||
onModalClose,
|
|
||||||
...otherProps
|
|
||||||
} = props;
|
|
||||||
|
|
||||||
return (
|
|
||||||
<Modal
|
|
||||||
isOpen={isOpen}
|
|
||||||
onModalClose={onModalClose}
|
|
||||||
>
|
|
||||||
<AddNewCollectionMovieModalContentConnector
|
|
||||||
{...otherProps}
|
|
||||||
onModalClose={onModalClose}
|
|
||||||
/>
|
|
||||||
</Modal>
|
|
||||||
);
|
|
||||||
}
|
|
||||||
|
|
||||||
AddNewCollectionMovieModal.propTypes = {
|
|
||||||
isOpen: PropTypes.bool.isRequired,
|
|
||||||
onModalClose: PropTypes.func.isRequired
|
|
||||||
};
|
|
||||||
|
|
||||||
export default AddNewCollectionMovieModal;
|
|
||||||
@@ -1,68 +0,0 @@
|
|||||||
.container {
|
|
||||||
display: flex;
|
|
||||||
}
|
|
||||||
|
|
||||||
.year {
|
|
||||||
margin-left: 5px;
|
|
||||||
color: var(--disabledColor);
|
|
||||||
}
|
|
||||||
|
|
||||||
.poster {
|
|
||||||
flex: 0 0 170px;
|
|
||||||
margin-right: 20px;
|
|
||||||
height: 250px;
|
|
||||||
}
|
|
||||||
|
|
||||||
.info {
|
|
||||||
flex-grow: 1;
|
|
||||||
}
|
|
||||||
|
|
||||||
.overview {
|
|
||||||
margin-bottom: 30px;
|
|
||||||
}
|
|
||||||
|
|
||||||
.labelIcon {
|
|
||||||
margin-left: 8px;
|
|
||||||
}
|
|
||||||
|
|
||||||
.searchForMissingMovieLabelContainer {
|
|
||||||
display: flex;
|
|
||||||
margin-top: 2px;
|
|
||||||
}
|
|
||||||
|
|
||||||
.searchForMissingMovieLabel {
|
|
||||||
margin-right: 8px;
|
|
||||||
font-weight: normal;
|
|
||||||
}
|
|
||||||
|
|
||||||
.searchForMissingMovieContainer {
|
|
||||||
composes: container from '~Components/Form/CheckInput.css';
|
|
||||||
|
|
||||||
flex: 0 1 0;
|
|
||||||
}
|
|
||||||
|
|
||||||
.searchForMissingMovieInput {
|
|
||||||
composes: input from '~Components/Form/CheckInput.css';
|
|
||||||
|
|
||||||
margin-top: 0;
|
|
||||||
}
|
|
||||||
|
|
||||||
.modalFooter {
|
|
||||||
composes: modalFooter from '~Components/Modal/ModalFooter.css';
|
|
||||||
}
|
|
||||||
|
|
||||||
.addButton {
|
|
||||||
@add-mixin truncate;
|
|
||||||
composes: button from '~Components/Link/SpinnerButton.css';
|
|
||||||
}
|
|
||||||
|
|
||||||
@media only screen and (max-width: $breakpointSmall) {
|
|
||||||
.modalFooter {
|
|
||||||
display: block;
|
|
||||||
text-align: center;
|
|
||||||
}
|
|
||||||
|
|
||||||
.addButton {
|
|
||||||
margin-top: 10px;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
@@ -1,204 +0,0 @@
|
|||||||
import PropTypes from 'prop-types';
|
|
||||||
import React, { Component } from 'react';
|
|
||||||
import CheckInput from 'Components/Form/CheckInput';
|
|
||||||
import Form from 'Components/Form/Form';
|
|
||||||
import FormGroup from 'Components/Form/FormGroup';
|
|
||||||
import FormInputGroup from 'Components/Form/FormInputGroup';
|
|
||||||
import FormLabel from 'Components/Form/FormLabel';
|
|
||||||
import SpinnerButton from 'Components/Link/SpinnerButton';
|
|
||||||
import ModalBody from 'Components/Modal/ModalBody';
|
|
||||||
import ModalContent from 'Components/Modal/ModalContent';
|
|
||||||
import ModalFooter from 'Components/Modal/ModalFooter';
|
|
||||||
import ModalHeader from 'Components/Modal/ModalHeader';
|
|
||||||
import { inputTypes, kinds } from 'Helpers/Props';
|
|
||||||
import MoviePoster from 'Movie/MoviePoster';
|
|
||||||
import translate from 'Utilities/String/translate';
|
|
||||||
import styles from './AddNewCollectionMovieModalContent.css';
|
|
||||||
|
|
||||||
class AddNewCollectionMovieModalContent extends Component {
|
|
||||||
|
|
||||||
//
|
|
||||||
// Listeners
|
|
||||||
|
|
||||||
onQualityProfileIdChange = ({ value }) => {
|
|
||||||
this.props.onInputChange({ name: 'qualityProfileId', value: parseInt(value) });
|
|
||||||
};
|
|
||||||
|
|
||||||
onAddMoviePress = () => {
|
|
||||||
this.props.onAddMoviePress();
|
|
||||||
};
|
|
||||||
|
|
||||||
//
|
|
||||||
// Render
|
|
||||||
|
|
||||||
render() {
|
|
||||||
const {
|
|
||||||
title,
|
|
||||||
year,
|
|
||||||
overview,
|
|
||||||
images,
|
|
||||||
isAdding,
|
|
||||||
folder,
|
|
||||||
tags,
|
|
||||||
isSmallScreen,
|
|
||||||
isWindows,
|
|
||||||
onModalClose,
|
|
||||||
onInputChange,
|
|
||||||
rootFolderPath,
|
|
||||||
monitor,
|
|
||||||
qualityProfileId,
|
|
||||||
minimumAvailability,
|
|
||||||
searchForMovie
|
|
||||||
} = this.props;
|
|
||||||
|
|
||||||
return (
|
|
||||||
<ModalContent onModalClose={onModalClose}>
|
|
||||||
<ModalHeader>
|
|
||||||
{title}
|
|
||||||
|
|
||||||
{
|
|
||||||
!title.contains(year) && !!year &&
|
|
||||||
<span className={styles.year}>({year})</span>
|
|
||||||
}
|
|
||||||
</ModalHeader>
|
|
||||||
|
|
||||||
<ModalBody>
|
|
||||||
<div className={styles.container}>
|
|
||||||
{
|
|
||||||
!isSmallScreen &&
|
|
||||||
<div className={styles.poster}>
|
|
||||||
<MoviePoster
|
|
||||||
className={styles.poster}
|
|
||||||
images={images}
|
|
||||||
size={250}
|
|
||||||
/>
|
|
||||||
</div>
|
|
||||||
}
|
|
||||||
|
|
||||||
<div className={styles.info}>
|
|
||||||
<div className={styles.overview}>
|
|
||||||
{overview}
|
|
||||||
</div>
|
|
||||||
|
|
||||||
<Form>
|
|
||||||
<FormGroup>
|
|
||||||
<FormLabel>{translate('RootFolder')}</FormLabel>
|
|
||||||
|
|
||||||
<FormInputGroup
|
|
||||||
type={inputTypes.ROOT_FOLDER_SELECT}
|
|
||||||
name="rootFolderPath"
|
|
||||||
valueOptions={{
|
|
||||||
movieFolder: folder,
|
|
||||||
isWindows
|
|
||||||
}}
|
|
||||||
selectedValueOptions={{
|
|
||||||
movieFolder: folder,
|
|
||||||
isWindows
|
|
||||||
}}
|
|
||||||
helpText={translate('SubfolderWillBeCreatedAutomaticallyInterp', [folder])}
|
|
||||||
onChange={onInputChange}
|
|
||||||
{...rootFolderPath}
|
|
||||||
/>
|
|
||||||
</FormGroup>
|
|
||||||
|
|
||||||
<FormGroup>
|
|
||||||
<FormLabel>
|
|
||||||
{translate('Monitor')}
|
|
||||||
</FormLabel>
|
|
||||||
|
|
||||||
<FormInputGroup
|
|
||||||
type={inputTypes.MOVIE_MONITORED_SELECT}
|
|
||||||
name="monitor"
|
|
||||||
onChange={onInputChange}
|
|
||||||
{...monitor}
|
|
||||||
/>
|
|
||||||
</FormGroup>
|
|
||||||
|
|
||||||
<FormGroup>
|
|
||||||
<FormLabel>{translate('MinimumAvailability')}</FormLabel>
|
|
||||||
|
|
||||||
<FormInputGroup
|
|
||||||
type={inputTypes.AVAILABILITY_SELECT}
|
|
||||||
name="minimumAvailability"
|
|
||||||
onChange={onInputChange}
|
|
||||||
{...minimumAvailability}
|
|
||||||
/>
|
|
||||||
</FormGroup>
|
|
||||||
|
|
||||||
<FormGroup>
|
|
||||||
<FormLabel>{translate('QualityProfile')}</FormLabel>
|
|
||||||
|
|
||||||
<FormInputGroup
|
|
||||||
type={inputTypes.QUALITY_PROFILE_SELECT}
|
|
||||||
name="qualityProfileId"
|
|
||||||
onChange={this.onQualityProfileIdChange}
|
|
||||||
{...qualityProfileId}
|
|
||||||
/>
|
|
||||||
</FormGroup>
|
|
||||||
|
|
||||||
<FormGroup>
|
|
||||||
<FormLabel>{translate('Tags')}</FormLabel>
|
|
||||||
|
|
||||||
<FormInputGroup
|
|
||||||
type={inputTypes.TAG}
|
|
||||||
name="tags"
|
|
||||||
onChange={onInputChange}
|
|
||||||
{...tags}
|
|
||||||
/>
|
|
||||||
</FormGroup>
|
|
||||||
</Form>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
</ModalBody>
|
|
||||||
|
|
||||||
<ModalFooter className={styles.modalFooter}>
|
|
||||||
<label className={styles.searchForMissingMovieLabelContainer}>
|
|
||||||
<span className={styles.searchForMissingMovieLabel}>
|
|
||||||
{translate('StartSearchForMissingMovie')}
|
|
||||||
</span>
|
|
||||||
|
|
||||||
<CheckInput
|
|
||||||
containerClassName={styles.searchForMissingMovieContainer}
|
|
||||||
className={styles.searchForMissingMovieInput}
|
|
||||||
name="searchForMovie"
|
|
||||||
onChange={onInputChange}
|
|
||||||
{...searchForMovie}
|
|
||||||
/>
|
|
||||||
</label>
|
|
||||||
|
|
||||||
<SpinnerButton
|
|
||||||
className={styles.addButton}
|
|
||||||
kind={kinds.SUCCESS}
|
|
||||||
isSpinning={isAdding}
|
|
||||||
onPress={this.onAddMoviePress}
|
|
||||||
>
|
|
||||||
{translate('AddMovie')}
|
|
||||||
</SpinnerButton>
|
|
||||||
</ModalFooter>
|
|
||||||
</ModalContent>
|
|
||||||
);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
AddNewCollectionMovieModalContent.propTypes = {
|
|
||||||
title: PropTypes.string.isRequired,
|
|
||||||
year: PropTypes.number.isRequired,
|
|
||||||
overview: PropTypes.string,
|
|
||||||
images: PropTypes.arrayOf(PropTypes.object).isRequired,
|
|
||||||
isAdding: PropTypes.bool.isRequired,
|
|
||||||
addError: PropTypes.object,
|
|
||||||
rootFolderPath: PropTypes.object,
|
|
||||||
monitor: PropTypes.object.isRequired,
|
|
||||||
qualityProfileId: PropTypes.object,
|
|
||||||
minimumAvailability: PropTypes.object.isRequired,
|
|
||||||
searchForMovie: PropTypes.object.isRequired,
|
|
||||||
folder: PropTypes.string.isRequired,
|
|
||||||
tags: PropTypes.object.isRequired,
|
|
||||||
isSmallScreen: PropTypes.bool.isRequired,
|
|
||||||
isWindows: PropTypes.bool.isRequired,
|
|
||||||
onModalClose: PropTypes.func.isRequired,
|
|
||||||
onInputChange: PropTypes.func.isRequired,
|
|
||||||
onAddMoviePress: PropTypes.func.isRequired
|
|
||||||
};
|
|
||||||
|
|
||||||
export default AddNewCollectionMovieModalContent;
|
|
||||||
@@ -1,121 +0,0 @@
|
|||||||
import PropTypes from 'prop-types';
|
|
||||||
import React, { Component } from 'react';
|
|
||||||
import { connect } from 'react-redux';
|
|
||||||
import { createSelector } from 'reselect';
|
|
||||||
import { addMovie, setMovieCollectionValue } from 'Store/Actions/movieCollectionActions';
|
|
||||||
import createCollectionSelector from 'Store/Selectors/createCollectionSelector';
|
|
||||||
import createDimensionsSelector from 'Store/Selectors/createDimensionsSelector';
|
|
||||||
import createSystemStatusSelector from 'Store/Selectors/createSystemStatusSelector';
|
|
||||||
import selectSettings from 'Store/Selectors/selectSettings';
|
|
||||||
import AddNewMovieModalContent from './AddNewCollectionMovieModalContent';
|
|
||||||
|
|
||||||
function createMapStateToProps() {
|
|
||||||
return createSelector(
|
|
||||||
(state) => state.movieCollections,
|
|
||||||
createCollectionSelector(),
|
|
||||||
createDimensionsSelector(),
|
|
||||||
createSystemStatusSelector(),
|
|
||||||
(discoverMovieState, collection, dimensions, systemStatus) => {
|
|
||||||
const {
|
|
||||||
isAdding,
|
|
||||||
addError,
|
|
||||||
pendingChanges
|
|
||||||
} = discoverMovieState;
|
|
||||||
|
|
||||||
const collectionDefaults = {
|
|
||||||
rootFolderPath: collection.rootFolderPath,
|
|
||||||
monitor: 'movieOnly',
|
|
||||||
qualityProfileId: collection.qualityProfileId,
|
|
||||||
minimumAvailability: collection.minimumAvailability,
|
|
||||||
searchForMovie: collection.searchOnAdd,
|
|
||||||
tags: []
|
|
||||||
};
|
|
||||||
|
|
||||||
const {
|
|
||||||
settings,
|
|
||||||
validationErrors,
|
|
||||||
validationWarnings
|
|
||||||
} = selectSettings(collectionDefaults, pendingChanges, addError);
|
|
||||||
|
|
||||||
return {
|
|
||||||
isAdding,
|
|
||||||
addError,
|
|
||||||
isSmallScreen: dimensions.isSmallScreen,
|
|
||||||
validationErrors,
|
|
||||||
validationWarnings,
|
|
||||||
isWindows: systemStatus.isWindows,
|
|
||||||
...settings
|
|
||||||
};
|
|
||||||
}
|
|
||||||
);
|
|
||||||
}
|
|
||||||
|
|
||||||
const mapDispatchToProps = {
|
|
||||||
addMovie,
|
|
||||||
setMovieCollectionValue
|
|
||||||
};
|
|
||||||
|
|
||||||
class AddNewCollectionMovieModalContentConnector extends Component {
|
|
||||||
|
|
||||||
//
|
|
||||||
// Listeners
|
|
||||||
|
|
||||||
onInputChange = ({ name, value }) => {
|
|
||||||
this.props.setMovieCollectionValue({ name, value });
|
|
||||||
};
|
|
||||||
|
|
||||||
onAddMoviePress = () => {
|
|
||||||
const {
|
|
||||||
tmdbId,
|
|
||||||
title,
|
|
||||||
rootFolderPath,
|
|
||||||
monitor,
|
|
||||||
qualityProfileId,
|
|
||||||
minimumAvailability,
|
|
||||||
searchForMovie,
|
|
||||||
tags
|
|
||||||
} = this.props;
|
|
||||||
|
|
||||||
this.props.addMovie({
|
|
||||||
tmdbId,
|
|
||||||
title,
|
|
||||||
rootFolderPath: rootFolderPath.value,
|
|
||||||
monitor: monitor.value,
|
|
||||||
qualityProfileId: qualityProfileId.value,
|
|
||||||
minimumAvailability: minimumAvailability.value,
|
|
||||||
searchForMovie: searchForMovie.value,
|
|
||||||
tags: tags.value
|
|
||||||
});
|
|
||||||
|
|
||||||
this.props.onModalClose(true);
|
|
||||||
};
|
|
||||||
|
|
||||||
//
|
|
||||||
// Render
|
|
||||||
|
|
||||||
render() {
|
|
||||||
return (
|
|
||||||
<AddNewMovieModalContent
|
|
||||||
{...this.props}
|
|
||||||
onInputChange={this.onInputChange}
|
|
||||||
onAddMoviePress={this.onAddMoviePress}
|
|
||||||
/>
|
|
||||||
);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
AddNewCollectionMovieModalContentConnector.propTypes = {
|
|
||||||
tmdbId: PropTypes.number.isRequired,
|
|
||||||
title: PropTypes.string.isRequired,
|
|
||||||
rootFolderPath: PropTypes.object,
|
|
||||||
monitor: PropTypes.object.isRequired,
|
|
||||||
qualityProfileId: PropTypes.object,
|
|
||||||
minimumAvailability: PropTypes.object.isRequired,
|
|
||||||
searchForMovie: PropTypes.object.isRequired,
|
|
||||||
tags: PropTypes.object.isRequired,
|
|
||||||
onModalClose: PropTypes.func.isRequired,
|
|
||||||
addMovie: PropTypes.func.isRequired,
|
|
||||||
setMovieCollectionValue: PropTypes.func.isRequired
|
|
||||||
};
|
|
||||||
|
|
||||||
export default connect(createMapStateToProps, mapDispatchToProps)(AddNewCollectionMovieModalContentConnector);
|
|
||||||
@@ -1,403 +0,0 @@
|
|||||||
import _ from 'lodash';
|
|
||||||
import PropTypes from 'prop-types';
|
|
||||||
import React, { Component } from 'react';
|
|
||||||
import LoadingIndicator from 'Components/Loading/LoadingIndicator';
|
|
||||||
import PageContent from 'Components/Page/PageContent';
|
|
||||||
import PageContentBody from 'Components/Page/PageContentBody';
|
|
||||||
import PageJumpBar from 'Components/Page/PageJumpBar';
|
|
||||||
import PageToolbar from 'Components/Page/Toolbar/PageToolbar';
|
|
||||||
import PageToolbarButton from 'Components/Page/Toolbar/PageToolbarButton';
|
|
||||||
import PageToolbarSection from 'Components/Page/Toolbar/PageToolbarSection';
|
|
||||||
import PageToolbarSeparator from 'Components/Page/Toolbar/PageToolbarSeparator';
|
|
||||||
import { align, icons, sortDirections } from 'Helpers/Props';
|
|
||||||
import styles from 'Movie/Index/MovieIndex.css';
|
|
||||||
import hasDifferentItemsOrOrder from 'Utilities/Object/hasDifferentItemsOrOrder';
|
|
||||||
import translate from 'Utilities/String/translate';
|
|
||||||
import getSelectedIds from 'Utilities/Table/getSelectedIds';
|
|
||||||
import selectAll from 'Utilities/Table/selectAll';
|
|
||||||
import toggleSelected from 'Utilities/Table/toggleSelected';
|
|
||||||
import CollectionFooter from './CollectionFooter';
|
|
||||||
import CollectionFilterMenu from './Menus/CollectionFilterMenu';
|
|
||||||
import CollectionSortMenu from './Menus/CollectionSortMenu';
|
|
||||||
import NoCollection from './NoCollection';
|
|
||||||
import CollectionOverviewsConnector from './Overview/CollectionOverviewsConnector';
|
|
||||||
import CollectionOverviewOptionsModal from './Overview/Options/CollectionOverviewOptionsModal';
|
|
||||||
|
|
||||||
function getViewComponent(view) {
|
|
||||||
return CollectionOverviewsConnector;
|
|
||||||
}
|
|
||||||
|
|
||||||
class Collection extends Component {
|
|
||||||
|
|
||||||
//
|
|
||||||
// Lifecycle
|
|
||||||
|
|
||||||
constructor(props, context) {
|
|
||||||
super(props, context);
|
|
||||||
|
|
||||||
this.state = {
|
|
||||||
scroller: null,
|
|
||||||
jumpBarItems: { order: [] },
|
|
||||||
jumpToCharacter: null,
|
|
||||||
isPosterOptionsModalOpen: false,
|
|
||||||
isOverviewOptionsModalOpen: false,
|
|
||||||
isConfirmSearchModalOpen: false,
|
|
||||||
searchType: null,
|
|
||||||
allSelected: false,
|
|
||||||
allUnselected: false,
|
|
||||||
lastToggled: null,
|
|
||||||
selectedState: {}
|
|
||||||
};
|
|
||||||
}
|
|
||||||
|
|
||||||
componentDidMount() {
|
|
||||||
this.setJumpBarItems();
|
|
||||||
this.setSelectedState();
|
|
||||||
}
|
|
||||||
|
|
||||||
componentDidUpdate(prevProps) {
|
|
||||||
const {
|
|
||||||
items,
|
|
||||||
sortKey,
|
|
||||||
sortDirection
|
|
||||||
} = this.props;
|
|
||||||
|
|
||||||
if (sortKey !== prevProps.sortKey ||
|
|
||||||
sortDirection !== prevProps.sortDirection ||
|
|
||||||
hasDifferentItemsOrOrder(prevProps.items, items)
|
|
||||||
) {
|
|
||||||
this.setJumpBarItems();
|
|
||||||
this.setSelectedState();
|
|
||||||
}
|
|
||||||
|
|
||||||
if (this.state.jumpToCharacter != null) {
|
|
||||||
this.setState({ jumpToCharacter: null });
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
//
|
|
||||||
// Control
|
|
||||||
|
|
||||||
setScrollerRef = (ref) => {
|
|
||||||
this.setState({ scroller: ref });
|
|
||||||
};
|
|
||||||
|
|
||||||
getSelectedIds = () => {
|
|
||||||
if (this.state.allUnselected) {
|
|
||||||
return [];
|
|
||||||
}
|
|
||||||
return getSelectedIds(this.state.selectedState);
|
|
||||||
};
|
|
||||||
|
|
||||||
setSelectedState() {
|
|
||||||
const {
|
|
||||||
items
|
|
||||||
} = this.props;
|
|
||||||
|
|
||||||
const {
|
|
||||||
selectedState
|
|
||||||
} = this.state;
|
|
||||||
|
|
||||||
const newSelectedState = {};
|
|
||||||
|
|
||||||
items.forEach((collection) => {
|
|
||||||
const isItemSelected = selectedState[collection.id];
|
|
||||||
|
|
||||||
if (isItemSelected) {
|
|
||||||
newSelectedState[collection.id] = isItemSelected;
|
|
||||||
} else {
|
|
||||||
newSelectedState[collection.id] = false;
|
|
||||||
}
|
|
||||||
});
|
|
||||||
|
|
||||||
const selectedCount = getSelectedIds(newSelectedState).length;
|
|
||||||
const newStateCount = Object.keys(newSelectedState).length;
|
|
||||||
let isAllSelected = false;
|
|
||||||
let isAllUnselected = false;
|
|
||||||
|
|
||||||
if (selectedCount === 0) {
|
|
||||||
isAllUnselected = true;
|
|
||||||
} else if (selectedCount === newStateCount) {
|
|
||||||
isAllSelected = true;
|
|
||||||
}
|
|
||||||
|
|
||||||
this.setState({ selectedState: newSelectedState, allSelected: isAllSelected, allUnselected: isAllUnselected });
|
|
||||||
}
|
|
||||||
|
|
||||||
setJumpBarItems() {
|
|
||||||
const {
|
|
||||||
items,
|
|
||||||
sortKey,
|
|
||||||
sortDirection
|
|
||||||
} = this.props;
|
|
||||||
|
|
||||||
// Reset if not sorting by sortTitle
|
|
||||||
if (sortKey !== 'sortTitle') {
|
|
||||||
this.setState({ jumpBarItems: { order: [] } });
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
const characters = _.reduce(items, (acc, item) => {
|
|
||||||
let char = item.sortTitle.charAt(0);
|
|
||||||
|
|
||||||
if (!isNaN(char)) {
|
|
||||||
char = '#';
|
|
||||||
}
|
|
||||||
|
|
||||||
if (char in acc) {
|
|
||||||
acc[char] = acc[char] + 1;
|
|
||||||
} else {
|
|
||||||
acc[char] = 1;
|
|
||||||
}
|
|
||||||
|
|
||||||
return acc;
|
|
||||||
}, {});
|
|
||||||
|
|
||||||
const order = Object.keys(characters).sort();
|
|
||||||
|
|
||||||
// Reverse if sorting descending
|
|
||||||
if (sortDirection === sortDirections.DESCENDING) {
|
|
||||||
order.reverse();
|
|
||||||
}
|
|
||||||
|
|
||||||
const jumpBarItems = {
|
|
||||||
characters,
|
|
||||||
order
|
|
||||||
};
|
|
||||||
|
|
||||||
this.setState({ jumpBarItems });
|
|
||||||
}
|
|
||||||
|
|
||||||
//
|
|
||||||
// Listeners
|
|
||||||
|
|
||||||
onOverviewOptionsPress = () => {
|
|
||||||
this.setState({ isOverviewOptionsModalOpen: true });
|
|
||||||
};
|
|
||||||
|
|
||||||
onOverviewOptionsModalClose = () => {
|
|
||||||
this.setState({ isOverviewOptionsModalOpen: false });
|
|
||||||
};
|
|
||||||
|
|
||||||
onJumpBarItemPress = (jumpToCharacter) => {
|
|
||||||
this.setState({ jumpToCharacter });
|
|
||||||
};
|
|
||||||
|
|
||||||
onSelectAllChange = ({ value }) => {
|
|
||||||
this.setState(selectAll(this.state.selectedState, value));
|
|
||||||
};
|
|
||||||
|
|
||||||
onSelectAllPress = () => {
|
|
||||||
this.onSelectAllChange({ value: !this.state.allSelected });
|
|
||||||
};
|
|
||||||
|
|
||||||
onRefreshMovieCollectionsPress = () => {
|
|
||||||
this.props.onRefreshMovieCollectionsPress();
|
|
||||||
};
|
|
||||||
|
|
||||||
onSelectedChange = ({ id, value, shiftKey = false }) => {
|
|
||||||
this.setState((state) => {
|
|
||||||
return toggleSelected(state, this.props.items, id, value, shiftKey, 'id');
|
|
||||||
});
|
|
||||||
};
|
|
||||||
|
|
||||||
onUpdateSelectedPress = (changes) => {
|
|
||||||
this.props.onUpdateSelectedPress({
|
|
||||||
collectionIds: this.getSelectedIds(),
|
|
||||||
...changes
|
|
||||||
});
|
|
||||||
};
|
|
||||||
|
|
||||||
//
|
|
||||||
// Render
|
|
||||||
|
|
||||||
render() {
|
|
||||||
const {
|
|
||||||
isFetching,
|
|
||||||
isPopulated,
|
|
||||||
error,
|
|
||||||
totalItems,
|
|
||||||
items,
|
|
||||||
selectedFilterKey,
|
|
||||||
filters,
|
|
||||||
customFilters,
|
|
||||||
sortKey,
|
|
||||||
sortDirection,
|
|
||||||
view,
|
|
||||||
onSortSelect,
|
|
||||||
onFilterSelect,
|
|
||||||
onScroll,
|
|
||||||
isRefreshingCollections,
|
|
||||||
isSaving,
|
|
||||||
isAdding,
|
|
||||||
...otherProps
|
|
||||||
} = this.props;
|
|
||||||
|
|
||||||
const {
|
|
||||||
scroller,
|
|
||||||
jumpBarItems,
|
|
||||||
jumpToCharacter,
|
|
||||||
isOverviewOptionsModalOpen,
|
|
||||||
selectedState,
|
|
||||||
allSelected,
|
|
||||||
allUnselected
|
|
||||||
} = this.state;
|
|
||||||
|
|
||||||
const selectedMovieIds = this.getSelectedIds();
|
|
||||||
|
|
||||||
const ViewComponent = getViewComponent(view);
|
|
||||||
const isLoaded = !!(!error && isPopulated && items.length && scroller);
|
|
||||||
const hasNoCollection = !totalItems;
|
|
||||||
|
|
||||||
return (
|
|
||||||
<PageContent>
|
|
||||||
<PageToolbar>
|
|
||||||
<PageToolbarSection>
|
|
||||||
<PageToolbarButton
|
|
||||||
label={translate('RefreshCollections')}
|
|
||||||
iconName={icons.REFRESH}
|
|
||||||
isSpinning={isRefreshingCollections}
|
|
||||||
isDisabled={hasNoCollection}
|
|
||||||
onPress={this.onRefreshMovieCollectionsPress}
|
|
||||||
/>
|
|
||||||
<PageToolbarButton
|
|
||||||
label={allSelected ? translate('UnselectAll') : translate('SelectAll')}
|
|
||||||
iconName={icons.CHECK_SQUARE}
|
|
||||||
isDisabled={hasNoCollection}
|
|
||||||
onPress={this.onSelectAllPress}
|
|
||||||
/>
|
|
||||||
</PageToolbarSection>
|
|
||||||
|
|
||||||
<PageToolbarSection
|
|
||||||
alignContent={align.RIGHT}
|
|
||||||
collapseButtons={false}
|
|
||||||
>
|
|
||||||
{
|
|
||||||
view === 'overview' ?
|
|
||||||
<PageToolbarButton
|
|
||||||
label={translate('Options')}
|
|
||||||
iconName={icons.OVERVIEW}
|
|
||||||
onPress={this.onOverviewOptionsPress}
|
|
||||||
/> :
|
|
||||||
null
|
|
||||||
}
|
|
||||||
|
|
||||||
{
|
|
||||||
(view === 'posters' || view === 'overview') &&
|
|
||||||
<PageToolbarSeparator />
|
|
||||||
}
|
|
||||||
|
|
||||||
<CollectionSortMenu
|
|
||||||
sortKey={sortKey}
|
|
||||||
sortDirection={sortDirection}
|
|
||||||
isDisabled={hasNoCollection}
|
|
||||||
onSortSelect={onSortSelect}
|
|
||||||
/>
|
|
||||||
|
|
||||||
<CollectionFilterMenu
|
|
||||||
selectedFilterKey={selectedFilterKey}
|
|
||||||
filters={filters}
|
|
||||||
customFilters={customFilters}
|
|
||||||
isDisabled={hasNoCollection}
|
|
||||||
onFilterSelect={onFilterSelect}
|
|
||||||
/>
|
|
||||||
</PageToolbarSection>
|
|
||||||
</PageToolbar>
|
|
||||||
|
|
||||||
<div className={styles.pageContentBodyWrapper}>
|
|
||||||
<PageContentBody
|
|
||||||
registerScroller={this.setScrollerRef}
|
|
||||||
className={styles.contentBody}
|
|
||||||
innerClassName={styles[`${view}InnerContentBody`]}
|
|
||||||
onScroll={onScroll}
|
|
||||||
>
|
|
||||||
{
|
|
||||||
isFetching && !isPopulated &&
|
|
||||||
<LoadingIndicator />
|
|
||||||
}
|
|
||||||
|
|
||||||
{
|
|
||||||
!isFetching && !!error &&
|
|
||||||
<div>
|
|
||||||
{translate('UnableToLoadCollections')}
|
|
||||||
</div>
|
|
||||||
}
|
|
||||||
|
|
||||||
{
|
|
||||||
isLoaded &&
|
|
||||||
<div className={styles.contentBodyContainer}>
|
|
||||||
<ViewComponent
|
|
||||||
scroller={scroller}
|
|
||||||
items={items}
|
|
||||||
filters={filters}
|
|
||||||
sortKey={sortKey}
|
|
||||||
sortDirection={sortDirection}
|
|
||||||
jumpToCharacter={jumpToCharacter}
|
|
||||||
allSelected={allSelected}
|
|
||||||
allUnselected={allUnselected}
|
|
||||||
onSelectedChange={this.onSelectedChange}
|
|
||||||
onSelectAllChange={this.onSelectAllChange}
|
|
||||||
selectedState={selectedState}
|
|
||||||
{...otherProps}
|
|
||||||
/>
|
|
||||||
</div>
|
|
||||||
}
|
|
||||||
|
|
||||||
{
|
|
||||||
!error && isPopulated && !items.length &&
|
|
||||||
<NoCollection totalItems={totalItems} />
|
|
||||||
}
|
|
||||||
</PageContentBody>
|
|
||||||
|
|
||||||
{
|
|
||||||
isLoaded && !!jumpBarItems.order.length &&
|
|
||||||
<PageJumpBar
|
|
||||||
items={jumpBarItems}
|
|
||||||
onItemPress={this.onJumpBarItemPress}
|
|
||||||
/>
|
|
||||||
}
|
|
||||||
</div>
|
|
||||||
|
|
||||||
{
|
|
||||||
isLoaded &&
|
|
||||||
<CollectionFooter
|
|
||||||
selectedIds={selectedMovieIds}
|
|
||||||
isSaving={isSaving}
|
|
||||||
isAdding={isAdding}
|
|
||||||
onUpdateSelectedPress={this.onUpdateSelectedPress}
|
|
||||||
/>
|
|
||||||
}
|
|
||||||
|
|
||||||
<CollectionOverviewOptionsModal
|
|
||||||
isOpen={isOverviewOptionsModalOpen}
|
|
||||||
onModalClose={this.onOverviewOptionsModalClose}
|
|
||||||
/>
|
|
||||||
</PageContent>
|
|
||||||
);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
Collection.propTypes = {
|
|
||||||
isFetching: PropTypes.bool.isRequired,
|
|
||||||
isPopulated: PropTypes.bool.isRequired,
|
|
||||||
isSaving: PropTypes.bool.isRequired,
|
|
||||||
isAdding: PropTypes.bool.isRequired,
|
|
||||||
error: PropTypes.object,
|
|
||||||
totalItems: PropTypes.number.isRequired,
|
|
||||||
items: PropTypes.arrayOf(PropTypes.object).isRequired,
|
|
||||||
selectedFilterKey: PropTypes.oneOfType([PropTypes.string, PropTypes.number]).isRequired,
|
|
||||||
filters: PropTypes.arrayOf(PropTypes.object).isRequired,
|
|
||||||
customFilters: PropTypes.arrayOf(PropTypes.object).isRequired,
|
|
||||||
sortKey: PropTypes.string,
|
|
||||||
sortDirection: PropTypes.oneOf(sortDirections.all),
|
|
||||||
view: PropTypes.string.isRequired,
|
|
||||||
isRefreshingCollections: PropTypes.bool.isRequired,
|
|
||||||
isSmallScreen: PropTypes.bool.isRequired,
|
|
||||||
onSortSelect: PropTypes.func.isRequired,
|
|
||||||
onFilterSelect: PropTypes.func.isRequired,
|
|
||||||
onScroll: PropTypes.func.isRequired,
|
|
||||||
onUpdateSelectedPress: PropTypes.func.isRequired,
|
|
||||||
onRefreshMovieCollectionsPress: PropTypes.func.isRequired
|
|
||||||
};
|
|
||||||
|
|
||||||
export default Collection;
|
|
||||||
@@ -1,108 +0,0 @@
|
|||||||
import PropTypes from 'prop-types';
|
|
||||||
import React, { Component } from 'react';
|
|
||||||
import { connect } from 'react-redux';
|
|
||||||
import { createSelector } from 'reselect';
|
|
||||||
import * as commandNames from 'Commands/commandNames';
|
|
||||||
import withScrollPosition from 'Components/withScrollPosition';
|
|
||||||
import { executeCommand } from 'Store/Actions/commandActions';
|
|
||||||
import { saveMovieCollections, setMovieCollectionsFilter, setMovieCollectionsSort } from 'Store/Actions/movieCollectionActions';
|
|
||||||
import { fetchRootFolders } from 'Store/Actions/rootFolderActions';
|
|
||||||
import scrollPositions from 'Store/scrollPositions';
|
|
||||||
import createCollectionClientSideCollectionItemsSelector from 'Store/Selectors/createCollectionClientSideCollectionItemsSelector';
|
|
||||||
import createCommandExecutingSelector from 'Store/Selectors/createCommandExecutingSelector';
|
|
||||||
import createDimensionsSelector from 'Store/Selectors/createDimensionsSelector';
|
|
||||||
import { registerPagePopulator, unregisterPagePopulator } from 'Utilities/pagePopulator';
|
|
||||||
import Collection from './Collection';
|
|
||||||
|
|
||||||
function createMapStateToProps() {
|
|
||||||
return createSelector(
|
|
||||||
createCollectionClientSideCollectionItemsSelector('movieCollections'),
|
|
||||||
createCommandExecutingSelector(commandNames.REFRESH_COLLECTIONS),
|
|
||||||
createDimensionsSelector(),
|
|
||||||
(
|
|
||||||
collections,
|
|
||||||
isRefreshingCollections,
|
|
||||||
dimensionsState
|
|
||||||
) => {
|
|
||||||
return {
|
|
||||||
...collections,
|
|
||||||
isRefreshingCollections,
|
|
||||||
isSmallScreen: dimensionsState.isSmallScreen
|
|
||||||
};
|
|
||||||
}
|
|
||||||
);
|
|
||||||
}
|
|
||||||
|
|
||||||
function createMapDispatchToProps(dispatch, props) {
|
|
||||||
return {
|
|
||||||
dispatchFetchRootFolders() {
|
|
||||||
dispatch(fetchRootFolders());
|
|
||||||
},
|
|
||||||
onUpdateSelectedPress(payload) {
|
|
||||||
dispatch(saveMovieCollections(payload));
|
|
||||||
},
|
|
||||||
onSortSelect(sortKey) {
|
|
||||||
dispatch(setMovieCollectionsSort({ sortKey }));
|
|
||||||
},
|
|
||||||
onFilterSelect(selectedFilterKey) {
|
|
||||||
dispatch(setMovieCollectionsFilter({ selectedFilterKey }));
|
|
||||||
},
|
|
||||||
onRefreshMovieCollectionsPress() {
|
|
||||||
dispatch(executeCommand({
|
|
||||||
name: commandNames.REFRESH_COLLECTIONS
|
|
||||||
}));
|
|
||||||
}
|
|
||||||
};
|
|
||||||
}
|
|
||||||
|
|
||||||
class CollectionConnector extends Component {
|
|
||||||
|
|
||||||
//
|
|
||||||
// Lifecycle
|
|
||||||
|
|
||||||
componentDidMount() {
|
|
||||||
registerPagePopulator(this.repopulate);
|
|
||||||
this.props.dispatchFetchRootFolders();
|
|
||||||
}
|
|
||||||
|
|
||||||
componentWillUnmount() {
|
|
||||||
unregisterPagePopulator(this.repopulate);
|
|
||||||
}
|
|
||||||
|
|
||||||
//
|
|
||||||
// Listeners
|
|
||||||
|
|
||||||
onScroll = ({ scrollTop }) => {
|
|
||||||
scrollPositions.movieCollections = scrollTop;
|
|
||||||
};
|
|
||||||
|
|
||||||
onUpdateSelectedPress = (payload) => {
|
|
||||||
this.props.onUpdateSelectedPress(payload);
|
|
||||||
};
|
|
||||||
|
|
||||||
//
|
|
||||||
// Render
|
|
||||||
|
|
||||||
render() {
|
|
||||||
return (
|
|
||||||
<Collection
|
|
||||||
{...this.props}
|
|
||||||
onViewSelect={this.onViewSelect}
|
|
||||||
onScroll={this.onScroll}
|
|
||||||
onUpdateSelectedPress={this.onUpdateSelectedPress}
|
|
||||||
/>
|
|
||||||
);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
CollectionConnector.propTypes = {
|
|
||||||
isSmallScreen: PropTypes.bool.isRequired,
|
|
||||||
view: PropTypes.string.isRequired,
|
|
||||||
onUpdateSelectedPress: PropTypes.func.isRequired,
|
|
||||||
dispatchFetchRootFolders: PropTypes.func.isRequired
|
|
||||||
};
|
|
||||||
|
|
||||||
export default withScrollPosition(
|
|
||||||
connect(createMapStateToProps, createMapDispatchToProps)(CollectionConnector),
|
|
||||||
'movieCollections'
|
|
||||||
);
|
|
||||||
@@ -1,24 +0,0 @@
|
|||||||
import { connect } from 'react-redux';
|
|
||||||
import { createSelector } from 'reselect';
|
|
||||||
import FilterModal from 'Components/Filter/FilterModal';
|
|
||||||
import { setMovieCollectionsFilter } from 'Store/Actions/movieCollectionActions';
|
|
||||||
|
|
||||||
function createMapStateToProps() {
|
|
||||||
return createSelector(
|
|
||||||
(state) => state.movieCollections.items,
|
|
||||||
(state) => state.movieCollections.filterBuilderProps,
|
|
||||||
(sectionItems, filterBuilderProps) => {
|
|
||||||
return {
|
|
||||||
sectionItems,
|
|
||||||
filterBuilderProps,
|
|
||||||
customFilterType: 'movieCollections'
|
|
||||||
};
|
|
||||||
}
|
|
||||||
);
|
|
||||||
}
|
|
||||||
|
|
||||||
const mapDispatchToProps = {
|
|
||||||
dispatchSetFilter: setMovieCollectionsFilter
|
|
||||||
};
|
|
||||||
|
|
||||||
export default connect(createMapStateToProps, mapDispatchToProps)(FilterModal);
|
|
||||||
@@ -1,56 +0,0 @@
|
|||||||
.inputContainer {
|
|
||||||
margin-right: 20px;
|
|
||||||
min-width: 150px;
|
|
||||||
}
|
|
||||||
|
|
||||||
.buttonContainer {
|
|
||||||
display: flex;
|
|
||||||
justify-content: flex-end;
|
|
||||||
flex-grow: 1;
|
|
||||||
}
|
|
||||||
|
|
||||||
.buttonContainerContent {
|
|
||||||
flex-grow: 0;
|
|
||||||
}
|
|
||||||
|
|
||||||
.buttons {
|
|
||||||
display: flex;
|
|
||||||
justify-content: flex-end;
|
|
||||||
flex-grow: 1;
|
|
||||||
}
|
|
||||||
|
|
||||||
.addSelectedButton {
|
|
||||||
composes: button from '~Components/Link/SpinnerButton.css';
|
|
||||||
|
|
||||||
margin-right: 10px;
|
|
||||||
height: 35px;
|
|
||||||
}
|
|
||||||
|
|
||||||
.excludeSelectedButton {
|
|
||||||
composes: button from '~Components/Link/SpinnerButton.css';
|
|
||||||
|
|
||||||
margin-left: 25px;
|
|
||||||
height: 35px;
|
|
||||||
}
|
|
||||||
|
|
||||||
@media only screen and (max-width: $breakpointSmall) {
|
|
||||||
.inputContainer {
|
|
||||||
margin-right: 0;
|
|
||||||
}
|
|
||||||
|
|
||||||
.buttonContainer {
|
|
||||||
justify-content: flex-start;
|
|
||||||
}
|
|
||||||
|
|
||||||
.buttonContainerContent {
|
|
||||||
flex-grow: 1;
|
|
||||||
}
|
|
||||||
|
|
||||||
.buttons {
|
|
||||||
justify-content: space-between;
|
|
||||||
}
|
|
||||||
|
|
||||||
.selectedMovieLabel {
|
|
||||||
text-align: left;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
@@ -1,236 +0,0 @@
|
|||||||
import _ from 'lodash';
|
|
||||||
import PropTypes from 'prop-types';
|
|
||||||
import React, { Component } from 'react';
|
|
||||||
import AvailabilitySelectInput from 'Components/Form/AvailabilitySelectInput';
|
|
||||||
import QualityProfileSelectInputConnector from 'Components/Form/QualityProfileSelectInputConnector';
|
|
||||||
import RootFolderSelectInputConnector from 'Components/Form/RootFolderSelectInputConnector';
|
|
||||||
import SelectInput from 'Components/Form/SelectInput';
|
|
||||||
import SpinnerButton from 'Components/Link/SpinnerButton';
|
|
||||||
import PageContentFooter from 'Components/Page/PageContentFooter';
|
|
||||||
import { kinds } from 'Helpers/Props';
|
|
||||||
import translate from 'Utilities/String/translate';
|
|
||||||
import CollectionFooterLabel from './CollectionFooterLabel';
|
|
||||||
import styles from './CollectionFooter.css';
|
|
||||||
|
|
||||||
const NO_CHANGE = 'noChange';
|
|
||||||
|
|
||||||
class CollectionFooter extends Component {
|
|
||||||
|
|
||||||
//
|
|
||||||
// Lifecycle
|
|
||||||
|
|
||||||
constructor(props, context) {
|
|
||||||
super(props, context);
|
|
||||||
|
|
||||||
this.state = {
|
|
||||||
monitor: NO_CHANGE,
|
|
||||||
monitored: NO_CHANGE,
|
|
||||||
qualityProfileId: NO_CHANGE,
|
|
||||||
minimumAvailability: NO_CHANGE,
|
|
||||||
rootFolderPath: NO_CHANGE,
|
|
||||||
destinationRootFolder: null
|
|
||||||
};
|
|
||||||
}
|
|
||||||
|
|
||||||
componentDidUpdate(prevProps) {
|
|
||||||
const {
|
|
||||||
isSaving,
|
|
||||||
saveError
|
|
||||||
} = this.props;
|
|
||||||
|
|
||||||
const newState = {};
|
|
||||||
if (prevProps.isSaving && !isSaving && !saveError) {
|
|
||||||
this.setState({
|
|
||||||
monitored: NO_CHANGE,
|
|
||||||
monitor: NO_CHANGE,
|
|
||||||
qualityProfileId: NO_CHANGE,
|
|
||||||
rootFolderPath: NO_CHANGE,
|
|
||||||
minimumAvailability: NO_CHANGE
|
|
||||||
});
|
|
||||||
}
|
|
||||||
|
|
||||||
if (!_.isEmpty(newState)) {
|
|
||||||
this.setState(newState);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
//
|
|
||||||
// Listeners
|
|
||||||
|
|
||||||
onInputChange = ({ name, value }) => {
|
|
||||||
this.setState({ [name]: value });
|
|
||||||
};
|
|
||||||
|
|
||||||
onUpdateSelectedPress = () => {
|
|
||||||
const {
|
|
||||||
monitor,
|
|
||||||
monitored,
|
|
||||||
qualityProfileId,
|
|
||||||
minimumAvailability,
|
|
||||||
rootFolderPath
|
|
||||||
} = this.state;
|
|
||||||
|
|
||||||
const changes = {};
|
|
||||||
|
|
||||||
if (monitored !== NO_CHANGE) {
|
|
||||||
changes.monitored = monitored === 'monitored';
|
|
||||||
}
|
|
||||||
|
|
||||||
if (monitor !== NO_CHANGE) {
|
|
||||||
changes.monitor = monitor;
|
|
||||||
}
|
|
||||||
|
|
||||||
if (qualityProfileId !== NO_CHANGE) {
|
|
||||||
changes.qualityProfileId = qualityProfileId;
|
|
||||||
}
|
|
||||||
|
|
||||||
if (minimumAvailability !== NO_CHANGE) {
|
|
||||||
changes.minimumAvailability = minimumAvailability;
|
|
||||||
}
|
|
||||||
|
|
||||||
if (rootFolderPath !== NO_CHANGE) {
|
|
||||||
changes.rootFolderPath = rootFolderPath;
|
|
||||||
}
|
|
||||||
|
|
||||||
this.props.onUpdateSelectedPress(changes);
|
|
||||||
};
|
|
||||||
|
|
||||||
//
|
|
||||||
// Render
|
|
||||||
|
|
||||||
render() {
|
|
||||||
const {
|
|
||||||
selectedIds,
|
|
||||||
isSaving
|
|
||||||
} = this.props;
|
|
||||||
|
|
||||||
const {
|
|
||||||
monitored,
|
|
||||||
monitor,
|
|
||||||
qualityProfileId,
|
|
||||||
minimumAvailability,
|
|
||||||
rootFolderPath
|
|
||||||
} = this.state;
|
|
||||||
|
|
||||||
const monitoredOptions = [
|
|
||||||
{ key: NO_CHANGE, value: translate('NoChange'), disabled: true },
|
|
||||||
{ key: 'monitored', value: translate('Monitored') },
|
|
||||||
{ key: 'unmonitored', value: translate('Unmonitored') }
|
|
||||||
];
|
|
||||||
|
|
||||||
const selectedCount = selectedIds.length;
|
|
||||||
|
|
||||||
return (
|
|
||||||
<PageContentFooter>
|
|
||||||
<div className={styles.inputContainer}>
|
|
||||||
<CollectionFooterLabel
|
|
||||||
label={translate('MonitorCollection')}
|
|
||||||
isSaving={isSaving}
|
|
||||||
/>
|
|
||||||
|
|
||||||
<SelectInput
|
|
||||||
name="monitored"
|
|
||||||
value={monitored}
|
|
||||||
values={monitoredOptions}
|
|
||||||
isDisabled={!selectedCount}
|
|
||||||
onChange={this.onInputChange}
|
|
||||||
/>
|
|
||||||
</div>
|
|
||||||
|
|
||||||
<div className={styles.inputContainer}>
|
|
||||||
<CollectionFooterLabel
|
|
||||||
label={translate('MonitorMovies')}
|
|
||||||
isSaving={isSaving}
|
|
||||||
/>
|
|
||||||
|
|
||||||
<SelectInput
|
|
||||||
name="monitor"
|
|
||||||
value={monitor}
|
|
||||||
values={monitoredOptions}
|
|
||||||
isDisabled={!selectedCount}
|
|
||||||
onChange={this.onInputChange}
|
|
||||||
/>
|
|
||||||
</div>
|
|
||||||
|
|
||||||
<div className={styles.inputContainer}>
|
|
||||||
<CollectionFooterLabel
|
|
||||||
label={translate('QualityProfile')}
|
|
||||||
isSaving={isSaving && qualityProfileId !== NO_CHANGE}
|
|
||||||
/>
|
|
||||||
|
|
||||||
<QualityProfileSelectInputConnector
|
|
||||||
name="qualityProfileId"
|
|
||||||
value={qualityProfileId}
|
|
||||||
includeNoChange={true}
|
|
||||||
isDisabled={!selectedCount}
|
|
||||||
onChange={this.onInputChange}
|
|
||||||
/>
|
|
||||||
</div>
|
|
||||||
|
|
||||||
<div className={styles.inputContainer}>
|
|
||||||
<CollectionFooterLabel
|
|
||||||
label={translate('MinimumAvailability')}
|
|
||||||
isSaving={isSaving && minimumAvailability !== NO_CHANGE}
|
|
||||||
/>
|
|
||||||
|
|
||||||
<AvailabilitySelectInput
|
|
||||||
name="minimumAvailability"
|
|
||||||
value={minimumAvailability}
|
|
||||||
includeNoChange={true}
|
|
||||||
isDisabled={!selectedCount}
|
|
||||||
onChange={this.onInputChange}
|
|
||||||
/>
|
|
||||||
</div>
|
|
||||||
|
|
||||||
<div className={styles.inputContainer}>
|
|
||||||
<CollectionFooterLabel
|
|
||||||
label={translate('RootFolder')}
|
|
||||||
isSaving={isSaving && rootFolderPath !== NO_CHANGE}
|
|
||||||
/>
|
|
||||||
|
|
||||||
<RootFolderSelectInputConnector
|
|
||||||
name="rootFolderPath"
|
|
||||||
value={rootFolderPath}
|
|
||||||
includeNoChange={true}
|
|
||||||
isDisabled={!selectedCount}
|
|
||||||
selectedValueOptions={{ includeFreeSpace: false }}
|
|
||||||
onChange={this.onInputChange}
|
|
||||||
/>
|
|
||||||
</div>
|
|
||||||
|
|
||||||
<div className={styles.buttonContainer}>
|
|
||||||
<div className={styles.buttonContainerContent}>
|
|
||||||
<CollectionFooterLabel
|
|
||||||
label={translate('CollectionsSelectedInterp', [selectedCount])}
|
|
||||||
isSaving={false}
|
|
||||||
/>
|
|
||||||
|
|
||||||
<div className={styles.buttons}>
|
|
||||||
<div>
|
|
||||||
<SpinnerButton
|
|
||||||
className={styles.addSelectedButton}
|
|
||||||
kind={kinds.PRIMARY}
|
|
||||||
isSpinning={isSaving}
|
|
||||||
isDisabled={!selectedCount || isSaving}
|
|
||||||
onPress={this.onUpdateSelectedPress}
|
|
||||||
>
|
|
||||||
{translate('UpdateSelected')}
|
|
||||||
</SpinnerButton>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
</PageContentFooter>
|
|
||||||
);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
CollectionFooter.propTypes = {
|
|
||||||
selectedIds: PropTypes.arrayOf(PropTypes.number).isRequired,
|
|
||||||
isAdding: PropTypes.bool.isRequired,
|
|
||||||
isSaving: PropTypes.bool.isRequired,
|
|
||||||
saveError: PropTypes.object,
|
|
||||||
onUpdateSelectedPress: PropTypes.func.isRequired
|
|
||||||
};
|
|
||||||
|
|
||||||
export default CollectionFooter;
|
|
||||||
@@ -1,8 +0,0 @@
|
|||||||
.label {
|
|
||||||
margin-bottom: 3px;
|
|
||||||
font-weight: bold;
|
|
||||||
}
|
|
||||||
|
|
||||||
.savingIcon {
|
|
||||||
margin-left: 8px;
|
|
||||||
}
|
|
||||||
@@ -1,40 +0,0 @@
|
|||||||
import PropTypes from 'prop-types';
|
|
||||||
import React from 'react';
|
|
||||||
import SpinnerIcon from 'Components/SpinnerIcon';
|
|
||||||
import { icons } from 'Helpers/Props';
|
|
||||||
import styles from './CollectionFooterLabel.css';
|
|
||||||
|
|
||||||
function CollectionFooterLabel(props) {
|
|
||||||
const {
|
|
||||||
className,
|
|
||||||
label,
|
|
||||||
isSaving
|
|
||||||
} = props;
|
|
||||||
|
|
||||||
return (
|
|
||||||
<div className={className}>
|
|
||||||
{label}
|
|
||||||
|
|
||||||
{
|
|
||||||
isSaving &&
|
|
||||||
<SpinnerIcon
|
|
||||||
className={styles.savingIcon}
|
|
||||||
name={icons.SPINNER}
|
|
||||||
isSpinning={true}
|
|
||||||
/>
|
|
||||||
}
|
|
||||||
</div>
|
|
||||||
);
|
|
||||||
}
|
|
||||||
|
|
||||||
CollectionFooterLabel.propTypes = {
|
|
||||||
className: PropTypes.string.isRequired,
|
|
||||||
label: PropTypes.string.isRequired,
|
|
||||||
isSaving: PropTypes.bool.isRequired
|
|
||||||
};
|
|
||||||
|
|
||||||
CollectionFooterLabel.defaultProps = {
|
|
||||||
className: styles.label
|
|
||||||
};
|
|
||||||
|
|
||||||
export default CollectionFooterLabel;
|
|
||||||
@@ -1,75 +0,0 @@
|
|||||||
import PropTypes from 'prop-types';
|
|
||||||
import React, { Component } from 'react';
|
|
||||||
import { connect } from 'react-redux';
|
|
||||||
import { createSelector } from 'reselect';
|
|
||||||
import createAllMoviesSelector from 'Store/Selectors/createAllMoviesSelector';
|
|
||||||
import createCollectionSelector from 'Store/Selectors/createCollectionSelector';
|
|
||||||
|
|
||||||
function createMapStateToProps() {
|
|
||||||
return createSelector(
|
|
||||||
createCollectionSelector(),
|
|
||||||
createAllMoviesSelector(),
|
|
||||||
(
|
|
||||||
collection,
|
|
||||||
allMovies
|
|
||||||
) => {
|
|
||||||
// If a movie is deleted this selector may fire before the parent
|
|
||||||
// selecors, which will result in an undefined movie, if that happens
|
|
||||||
// we want to return early here and again in the render function to avoid
|
|
||||||
// trying to show a movie that has no information available.
|
|
||||||
|
|
||||||
if (!collection) {
|
|
||||||
return {};
|
|
||||||
}
|
|
||||||
|
|
||||||
let allGenres = [];
|
|
||||||
let libraryMovies = 0;
|
|
||||||
|
|
||||||
collection.movies.forEach((movie) => {
|
|
||||||
allGenres = allGenres.concat(movie.genres);
|
|
||||||
|
|
||||||
if (allMovies.find((libraryMovie) => libraryMovie.tmdbId === movie.tmdbId)) {
|
|
||||||
libraryMovies++;
|
|
||||||
}
|
|
||||||
});
|
|
||||||
|
|
||||||
return {
|
|
||||||
...collection,
|
|
||||||
genres: Array.from(new Set(allGenres)).slice(0, 3),
|
|
||||||
missingMovies: collection.movies.length - libraryMovies
|
|
||||||
};
|
|
||||||
}
|
|
||||||
);
|
|
||||||
}
|
|
||||||
|
|
||||||
class CollectionItemConnector extends Component {
|
|
||||||
|
|
||||||
//
|
|
||||||
// Render
|
|
||||||
|
|
||||||
render() {
|
|
||||||
const {
|
|
||||||
id,
|
|
||||||
component: ItemComponent,
|
|
||||||
...otherProps
|
|
||||||
} = this.props;
|
|
||||||
|
|
||||||
if (!id) {
|
|
||||||
return null;
|
|
||||||
}
|
|
||||||
|
|
||||||
return (
|
|
||||||
<ItemComponent
|
|
||||||
{...otherProps}
|
|
||||||
id={id}
|
|
||||||
/>
|
|
||||||
);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
CollectionItemConnector.propTypes = {
|
|
||||||
id: PropTypes.number,
|
|
||||||
component: PropTypes.elementType.isRequired
|
|
||||||
};
|
|
||||||
|
|
||||||
export default connect(createMapStateToProps)(CollectionItemConnector);
|
|
||||||
@@ -1,25 +0,0 @@
|
|||||||
import PropTypes from 'prop-types';
|
|
||||||
import React from 'react';
|
|
||||||
import Modal from 'Components/Modal/Modal';
|
|
||||||
import EditCollectionModalContentConnector from './EditCollectionModalContentConnector';
|
|
||||||
|
|
||||||
function EditCollectionModal({ isOpen, onModalClose, ...otherProps }) {
|
|
||||||
return (
|
|
||||||
<Modal
|
|
||||||
isOpen={isOpen}
|
|
||||||
onModalClose={onModalClose}
|
|
||||||
>
|
|
||||||
<EditCollectionModalContentConnector
|
|
||||||
{...otherProps}
|
|
||||||
onModalClose={onModalClose}
|
|
||||||
/>
|
|
||||||
</Modal>
|
|
||||||
);
|
|
||||||
}
|
|
||||||
|
|
||||||
EditCollectionModal.propTypes = {
|
|
||||||
isOpen: PropTypes.bool.isRequired,
|
|
||||||
onModalClose: PropTypes.func.isRequired
|
|
||||||
};
|
|
||||||
|
|
||||||
export default EditCollectionModal;
|
|
||||||
@@ -1,39 +0,0 @@
|
|||||||
import PropTypes from 'prop-types';
|
|
||||||
import React, { Component } from 'react';
|
|
||||||
import { connect } from 'react-redux';
|
|
||||||
import { clearPendingChanges } from 'Store/Actions/baseActions';
|
|
||||||
import EditCollectionModal from './EditCollectionModal';
|
|
||||||
|
|
||||||
const mapDispatchToProps = {
|
|
||||||
clearPendingChanges
|
|
||||||
};
|
|
||||||
|
|
||||||
class EditCollectionModalConnector extends Component {
|
|
||||||
|
|
||||||
//
|
|
||||||
// Listeners
|
|
||||||
|
|
||||||
onModalClose = () => {
|
|
||||||
this.props.clearPendingChanges({ section: 'movieCollections' });
|
|
||||||
this.props.onModalClose();
|
|
||||||
};
|
|
||||||
|
|
||||||
//
|
|
||||||
// Render
|
|
||||||
|
|
||||||
render() {
|
|
||||||
return (
|
|
||||||
<EditCollectionModal
|
|
||||||
{...this.props}
|
|
||||||
onModalClose={this.onModalClose}
|
|
||||||
/>
|
|
||||||
);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
EditCollectionModalConnector.propTypes = {
|
|
||||||
onModalClose: PropTypes.func.isRequired,
|
|
||||||
clearPendingChanges: PropTypes.func.isRequired
|
|
||||||
};
|
|
||||||
|
|
||||||
export default connect(undefined, mapDispatchToProps)(EditCollectionModalConnector);
|
|
||||||
@@ -1,17 +0,0 @@
|
|||||||
.container {
|
|
||||||
display: flex;
|
|
||||||
}
|
|
||||||
|
|
||||||
.poster {
|
|
||||||
flex: 0 0 170px;
|
|
||||||
margin-right: 20px;
|
|
||||||
height: 250px;
|
|
||||||
}
|
|
||||||
|
|
||||||
.info {
|
|
||||||
flex-grow: 1;
|
|
||||||
}
|
|
||||||
|
|
||||||
.overview {
|
|
||||||
margin-bottom: 30px;
|
|
||||||
}
|
|
||||||
@@ -1,178 +0,0 @@
|
|||||||
import PropTypes from 'prop-types';
|
|
||||||
import React, { Component } from 'react';
|
|
||||||
import Form from 'Components/Form/Form';
|
|
||||||
import FormGroup from 'Components/Form/FormGroup';
|
|
||||||
import FormInputGroup from 'Components/Form/FormInputGroup';
|
|
||||||
import FormLabel from 'Components/Form/FormLabel';
|
|
||||||
import Button from 'Components/Link/Button';
|
|
||||||
import SpinnerButton from 'Components/Link/SpinnerButton';
|
|
||||||
import ModalBody from 'Components/Modal/ModalBody';
|
|
||||||
import ModalContent from 'Components/Modal/ModalContent';
|
|
||||||
import ModalFooter from 'Components/Modal/ModalFooter';
|
|
||||||
import ModalHeader from 'Components/Modal/ModalHeader';
|
|
||||||
import { inputTypes } from 'Helpers/Props';
|
|
||||||
import MoviePoster from 'Movie/MoviePoster';
|
|
||||||
import translate from 'Utilities/String/translate';
|
|
||||||
import styles from './EditCollectionModalContent.css';
|
|
||||||
|
|
||||||
class EditCollectionModalContent extends Component {
|
|
||||||
|
|
||||||
//
|
|
||||||
// Listeners
|
|
||||||
|
|
||||||
onSavePress = () => {
|
|
||||||
const {
|
|
||||||
onSavePress
|
|
||||||
} = this.props;
|
|
||||||
|
|
||||||
onSavePress(false);
|
|
||||||
};
|
|
||||||
|
|
||||||
//
|
|
||||||
// Render
|
|
||||||
|
|
||||||
render() {
|
|
||||||
const {
|
|
||||||
title,
|
|
||||||
images,
|
|
||||||
overview,
|
|
||||||
item,
|
|
||||||
isSaving,
|
|
||||||
onInputChange,
|
|
||||||
onModalClose,
|
|
||||||
isSmallScreen,
|
|
||||||
...otherProps
|
|
||||||
} = this.props;
|
|
||||||
|
|
||||||
const {
|
|
||||||
monitored,
|
|
||||||
qualityProfileId,
|
|
||||||
minimumAvailability,
|
|
||||||
// Id,
|
|
||||||
rootFolderPath,
|
|
||||||
searchOnAdd
|
|
||||||
} = item;
|
|
||||||
|
|
||||||
return (
|
|
||||||
<ModalContent onModalClose={onModalClose}>
|
|
||||||
<ModalHeader>
|
|
||||||
{translate('Edit')} - {title}
|
|
||||||
</ModalHeader>
|
|
||||||
|
|
||||||
<ModalBody>
|
|
||||||
<div className={styles.container}>
|
|
||||||
{
|
|
||||||
!isSmallScreen &&
|
|
||||||
<div className={styles.poster}>
|
|
||||||
<MoviePoster
|
|
||||||
className={styles.poster}
|
|
||||||
images={images}
|
|
||||||
size={250}
|
|
||||||
/>
|
|
||||||
</div>
|
|
||||||
}
|
|
||||||
|
|
||||||
<div className={styles.info}>
|
|
||||||
<div className={styles.overview}>
|
|
||||||
{overview}
|
|
||||||
</div>
|
|
||||||
|
|
||||||
<Form
|
|
||||||
{...otherProps}
|
|
||||||
>
|
|
||||||
<FormGroup>
|
|
||||||
<FormLabel>{translate('Monitored')}</FormLabel>
|
|
||||||
|
|
||||||
<FormInputGroup
|
|
||||||
type={inputTypes.CHECK}
|
|
||||||
name="monitored"
|
|
||||||
helpText={translate('MonitoredCollectionHelpText')}
|
|
||||||
{...monitored}
|
|
||||||
onChange={onInputChange}
|
|
||||||
/>
|
|
||||||
</FormGroup>
|
|
||||||
|
|
||||||
<FormGroup>
|
|
||||||
<FormLabel>{translate('MinimumAvailability')}</FormLabel>
|
|
||||||
|
|
||||||
<FormInputGroup
|
|
||||||
type={inputTypes.AVAILABILITY_SELECT}
|
|
||||||
name="minimumAvailability"
|
|
||||||
{...minimumAvailability}
|
|
||||||
onChange={onInputChange}
|
|
||||||
/>
|
|
||||||
</FormGroup>
|
|
||||||
|
|
||||||
<FormGroup>
|
|
||||||
<FormLabel>{translate('QualityProfile')}</FormLabel>
|
|
||||||
|
|
||||||
<FormInputGroup
|
|
||||||
type={inputTypes.QUALITY_PROFILE_SELECT}
|
|
||||||
name="qualityProfileId"
|
|
||||||
{...qualityProfileId}
|
|
||||||
onChange={onInputChange}
|
|
||||||
/>
|
|
||||||
</FormGroup>
|
|
||||||
|
|
||||||
<FormGroup>
|
|
||||||
<FormLabel>{translate('RootFolder')}</FormLabel>
|
|
||||||
|
|
||||||
<FormInputGroup
|
|
||||||
type={inputTypes.ROOT_FOLDER_SELECT}
|
|
||||||
name="rootFolderPath"
|
|
||||||
{...rootFolderPath}
|
|
||||||
includeMissingValue={true}
|
|
||||||
onChange={onInputChange}
|
|
||||||
/>
|
|
||||||
</FormGroup>
|
|
||||||
|
|
||||||
<FormGroup>
|
|
||||||
<FormLabel>{translate('SearchOnAdd')}</FormLabel>
|
|
||||||
|
|
||||||
<FormInputGroup
|
|
||||||
type={inputTypes.CHECK}
|
|
||||||
name="searchOnAdd"
|
|
||||||
helpText={translate('SearchOnAddCollectionHelpText')}
|
|
||||||
{...searchOnAdd}
|
|
||||||
onChange={onInputChange}
|
|
||||||
/>
|
|
||||||
</FormGroup>
|
|
||||||
</Form>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
</ModalBody>
|
|
||||||
|
|
||||||
<ModalFooter>
|
|
||||||
<Button
|
|
||||||
onPress={onModalClose}
|
|
||||||
>
|
|
||||||
{translate('Cancel')}
|
|
||||||
</Button>
|
|
||||||
|
|
||||||
<SpinnerButton
|
|
||||||
isSpinning={isSaving}
|
|
||||||
onPress={this.onSavePress}
|
|
||||||
>
|
|
||||||
{translate('Save')}
|
|
||||||
</SpinnerButton>
|
|
||||||
</ModalFooter>
|
|
||||||
</ModalContent>
|
|
||||||
);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
EditCollectionModalContent.propTypes = {
|
|
||||||
collectionId: PropTypes.number.isRequired,
|
|
||||||
title: PropTypes.string.isRequired,
|
|
||||||
overview: PropTypes.string.isRequired,
|
|
||||||
images: PropTypes.arrayOf(PropTypes.object).isRequired,
|
|
||||||
item: PropTypes.object.isRequired,
|
|
||||||
isSaving: PropTypes.bool.isRequired,
|
|
||||||
isPathChanging: PropTypes.bool.isRequired,
|
|
||||||
isSmallScreen: PropTypes.bool.isRequired,
|
|
||||||
onInputChange: PropTypes.func.isRequired,
|
|
||||||
onSavePress: PropTypes.func.isRequired,
|
|
||||||
onModalClose: PropTypes.func.isRequired
|
|
||||||
};
|
|
||||||
|
|
||||||
export default EditCollectionModalContent;
|
|
||||||
@@ -1,119 +0,0 @@
|
|||||||
import PropTypes from 'prop-types';
|
|
||||||
import React, { Component } from 'react';
|
|
||||||
import { connect } from 'react-redux';
|
|
||||||
import { createSelector } from 'reselect';
|
|
||||||
import { saveMovieCollection, setMovieCollectionValue } from 'Store/Actions/movieCollectionActions';
|
|
||||||
import createCollectionSelector from 'Store/Selectors/createCollectionSelector';
|
|
||||||
import createDimensionsSelector from 'Store/Selectors/createDimensionsSelector';
|
|
||||||
import selectSettings from 'Store/Selectors/selectSettings';
|
|
||||||
import EditCollectionModalContent from './EditCollectionModalContent';
|
|
||||||
|
|
||||||
function createIsPathChangingSelector() {
|
|
||||||
return createSelector(
|
|
||||||
(state) => state.movieCollections.pendingChanges,
|
|
||||||
createCollectionSelector(),
|
|
||||||
(pendingChanges, collection) => {
|
|
||||||
const rootFolderPath = pendingChanges.rootFolderPath;
|
|
||||||
|
|
||||||
if (rootFolderPath == null) {
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
|
|
||||||
return collection.rootFolderPath !== rootFolderPath;
|
|
||||||
}
|
|
||||||
);
|
|
||||||
}
|
|
||||||
|
|
||||||
function createMapStateToProps() {
|
|
||||||
return createSelector(
|
|
||||||
(state) => state.movieCollections,
|
|
||||||
createCollectionSelector(),
|
|
||||||
createIsPathChangingSelector(),
|
|
||||||
createDimensionsSelector(),
|
|
||||||
(moviesState, collection, isPathChanging, dimensions) => {
|
|
||||||
const {
|
|
||||||
isSaving,
|
|
||||||
saveError,
|
|
||||||
pendingChanges
|
|
||||||
} = moviesState;
|
|
||||||
|
|
||||||
const movieSettings = {
|
|
||||||
monitored: collection.monitored,
|
|
||||||
qualityProfileId: collection.qualityProfileId,
|
|
||||||
minimumAvailability: collection.minimumAvailability,
|
|
||||||
rootFolderPath: collection.rootFolderPath,
|
|
||||||
searchOnAdd: collection.searchOnAdd
|
|
||||||
};
|
|
||||||
|
|
||||||
const settings = selectSettings(movieSettings, pendingChanges, saveError);
|
|
||||||
|
|
||||||
return {
|
|
||||||
title: collection.title,
|
|
||||||
images: collection.images,
|
|
||||||
overview: collection.overview,
|
|
||||||
isSaving,
|
|
||||||
saveError,
|
|
||||||
isPathChanging,
|
|
||||||
originalPath: collection.path,
|
|
||||||
item: settings.settings,
|
|
||||||
isSmallScreen: dimensions.isSmallScreen,
|
|
||||||
...settings
|
|
||||||
};
|
|
||||||
}
|
|
||||||
);
|
|
||||||
}
|
|
||||||
|
|
||||||
const mapDispatchToProps = {
|
|
||||||
dispatchSetMovieCollectionValue: setMovieCollectionValue,
|
|
||||||
dispatchSaveMovieCollection: saveMovieCollection
|
|
||||||
};
|
|
||||||
|
|
||||||
class EditCollectionModalContentConnector extends Component {
|
|
||||||
|
|
||||||
//
|
|
||||||
// Lifecycle
|
|
||||||
|
|
||||||
componentDidUpdate(prevProps, prevState) {
|
|
||||||
if (prevProps.isSaving && !this.props.isSaving && !this.props.saveError) {
|
|
||||||
this.props.onModalClose();
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
//
|
|
||||||
// Listeners
|
|
||||||
|
|
||||||
onInputChange = ({ name, value }) => {
|
|
||||||
this.props.dispatchSetMovieCollectionValue({ name, value });
|
|
||||||
};
|
|
||||||
|
|
||||||
onSavePress = () => {
|
|
||||||
this.props.dispatchSaveMovieCollection({
|
|
||||||
id: this.props.collectionId
|
|
||||||
});
|
|
||||||
};
|
|
||||||
|
|
||||||
//
|
|
||||||
// Render
|
|
||||||
|
|
||||||
render() {
|
|
||||||
return (
|
|
||||||
<EditCollectionModalContent
|
|
||||||
{...this.props}
|
|
||||||
onInputChange={this.onInputChange}
|
|
||||||
onSavePress={this.onSavePress}
|
|
||||||
onMoveMoviePress={this.onMoveMoviePress}
|
|
||||||
/>
|
|
||||||
);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
EditCollectionModalContentConnector.propTypes = {
|
|
||||||
collectionId: PropTypes.number,
|
|
||||||
isSaving: PropTypes.bool.isRequired,
|
|
||||||
saveError: PropTypes.object,
|
|
||||||
dispatchSetMovieCollectionValue: PropTypes.func.isRequired,
|
|
||||||
dispatchSaveMovieCollection: PropTypes.func.isRequired,
|
|
||||||
onModalClose: PropTypes.func.isRequired
|
|
||||||
};
|
|
||||||
|
|
||||||
export default connect(createMapStateToProps, mapDispatchToProps)(EditCollectionModalContentConnector);
|
|
||||||
@@ -1,41 +0,0 @@
|
|||||||
import PropTypes from 'prop-types';
|
|
||||||
import React from 'react';
|
|
||||||
import CollectionFilterModalConnector from 'Collection/CollectionFilterModalConnector';
|
|
||||||
import FilterMenu from 'Components/Menu/FilterMenu';
|
|
||||||
import { align } from 'Helpers/Props';
|
|
||||||
|
|
||||||
function CollectionFilterMenu(props) {
|
|
||||||
const {
|
|
||||||
selectedFilterKey,
|
|
||||||
filters,
|
|
||||||
customFilters,
|
|
||||||
isDisabled,
|
|
||||||
onFilterSelect
|
|
||||||
} = props;
|
|
||||||
|
|
||||||
return (
|
|
||||||
<FilterMenu
|
|
||||||
alignMenu={align.RIGHT}
|
|
||||||
isDisabled={isDisabled}
|
|
||||||
selectedFilterKey={selectedFilterKey}
|
|
||||||
filters={filters}
|
|
||||||
customFilters={customFilters}
|
|
||||||
filterModalConnectorComponent={CollectionFilterModalConnector}
|
|
||||||
onFilterSelect={onFilterSelect}
|
|
||||||
/>
|
|
||||||
);
|
|
||||||
}
|
|
||||||
|
|
||||||
CollectionFilterMenu.propTypes = {
|
|
||||||
selectedFilterKey: PropTypes.oneOfType([PropTypes.string, PropTypes.number]).isRequired,
|
|
||||||
filters: PropTypes.arrayOf(PropTypes.object).isRequired,
|
|
||||||
customFilters: PropTypes.arrayOf(PropTypes.object).isRequired,
|
|
||||||
isDisabled: PropTypes.bool.isRequired,
|
|
||||||
onFilterSelect: PropTypes.func.isRequired
|
|
||||||
};
|
|
||||||
|
|
||||||
CollectionFilterMenu.defaultProps = {
|
|
||||||
showCustomFilters: false
|
|
||||||
};
|
|
||||||
|
|
||||||
export default CollectionFilterMenu;
|
|
||||||
@@ -1,43 +0,0 @@
|
|||||||
import PropTypes from 'prop-types';
|
|
||||||
import React from 'react';
|
|
||||||
import MenuContent from 'Components/Menu/MenuContent';
|
|
||||||
import SortMenu from 'Components/Menu/SortMenu';
|
|
||||||
import SortMenuItem from 'Components/Menu/SortMenuItem';
|
|
||||||
import { align, sortDirections } from 'Helpers/Props';
|
|
||||||
import translate from 'Utilities/String/translate';
|
|
||||||
|
|
||||||
function CollectionSortMenu(props) {
|
|
||||||
const {
|
|
||||||
sortKey,
|
|
||||||
sortDirection,
|
|
||||||
isDisabled,
|
|
||||||
onSortSelect
|
|
||||||
} = props;
|
|
||||||
|
|
||||||
return (
|
|
||||||
<SortMenu
|
|
||||||
isDisabled={isDisabled}
|
|
||||||
alignMenu={align.RIGHT}
|
|
||||||
>
|
|
||||||
<MenuContent>
|
|
||||||
<SortMenuItem
|
|
||||||
name="sortTitle"
|
|
||||||
sortKey={sortKey}
|
|
||||||
sortDirection={sortDirection}
|
|
||||||
onPress={onSortSelect}
|
|
||||||
>
|
|
||||||
{translate('Title')}
|
|
||||||
</SortMenuItem>
|
|
||||||
</MenuContent>
|
|
||||||
</SortMenu>
|
|
||||||
);
|
|
||||||
}
|
|
||||||
|
|
||||||
CollectionSortMenu.propTypes = {
|
|
||||||
sortKey: PropTypes.string,
|
|
||||||
sortDirection: PropTypes.oneOf(sortDirections.all),
|
|
||||||
isDisabled: PropTypes.bool.isRequired,
|
|
||||||
onSortSelect: PropTypes.func.isRequired
|
|
||||||
};
|
|
||||||
|
|
||||||
export default CollectionSortMenu;
|
|
||||||
@@ -1,11 +0,0 @@
|
|||||||
.message {
|
|
||||||
margin-top: 10px;
|
|
||||||
margin-bottom: 30px;
|
|
||||||
text-align: center;
|
|
||||||
font-size: 20px;
|
|
||||||
}
|
|
||||||
|
|
||||||
.buttonContainer {
|
|
||||||
margin-top: 20px;
|
|
||||||
text-align: center;
|
|
||||||
}
|
|
||||||
@@ -1,52 +0,0 @@
|
|||||||
import PropTypes from 'prop-types';
|
|
||||||
import React from 'react';
|
|
||||||
import Button from 'Components/Link/Button';
|
|
||||||
import { kinds } from 'Helpers/Props';
|
|
||||||
import translate from 'Utilities/String/translate';
|
|
||||||
import styles from './NoCollection.css';
|
|
||||||
|
|
||||||
function NoCollection(props) {
|
|
||||||
const { totalItems } = props;
|
|
||||||
|
|
||||||
if (totalItems > 0) {
|
|
||||||
return (
|
|
||||||
<div>
|
|
||||||
<div className={styles.message}>
|
|
||||||
{translate('AllCollectionsHiddenDueToFilter')}
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
);
|
|
||||||
}
|
|
||||||
|
|
||||||
return (
|
|
||||||
<div>
|
|
||||||
<div className={styles.message}>
|
|
||||||
{translate('NoCollections')}
|
|
||||||
</div>
|
|
||||||
|
|
||||||
<div className={styles.buttonContainer}>
|
|
||||||
<Button
|
|
||||||
to="/add/import"
|
|
||||||
kind={kinds.PRIMARY}
|
|
||||||
>
|
|
||||||
{translate('ImportExistingMovies')}
|
|
||||||
</Button>
|
|
||||||
</div>
|
|
||||||
|
|
||||||
<div className={styles.buttonContainer}>
|
|
||||||
<Button
|
|
||||||
to="/add/new"
|
|
||||||
kind={kinds.PRIMARY}
|
|
||||||
>
|
|
||||||
{translate('AddNewMovie')}
|
|
||||||
</Button>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
);
|
|
||||||
}
|
|
||||||
|
|
||||||
NoCollection.propTypes = {
|
|
||||||
totalItems: PropTypes.number.isRequired
|
|
||||||
};
|
|
||||||
|
|
||||||
export default NoCollection;
|
|
||||||
@@ -1,117 +0,0 @@
|
|||||||
$hoverScale: 1.05;
|
|
||||||
|
|
||||||
.content {
|
|
||||||
border-radius: 5px;
|
|
||||||
transition: all 200ms ease-in;
|
|
||||||
|
|
||||||
&:hover {
|
|
||||||
z-index: 2;
|
|
||||||
box-shadow: 0 0 10px var(--black);
|
|
||||||
transition: all 200ms ease-in;
|
|
||||||
|
|
||||||
.poster {
|
|
||||||
opacity: 0.5;
|
|
||||||
transition: opacity 100ms linear 100ms;
|
|
||||||
}
|
|
||||||
|
|
||||||
.overlayTitle {
|
|
||||||
opacity: 1;
|
|
||||||
transition: opacity 100ms linear 100ms;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
.posterContainer {
|
|
||||||
position: relative;
|
|
||||||
}
|
|
||||||
|
|
||||||
.poster {
|
|
||||||
position: relative;
|
|
||||||
display: block;
|
|
||||||
background-color: var(--defaultColor);
|
|
||||||
}
|
|
||||||
|
|
||||||
.overlay {
|
|
||||||
position: absolute;
|
|
||||||
top: 0;
|
|
||||||
left: 0;
|
|
||||||
display: flex;
|
|
||||||
justify-content: flex-end;
|
|
||||||
flex-direction: column;
|
|
||||||
width: 100%;
|
|
||||||
height: 100%;
|
|
||||||
}
|
|
||||||
|
|
||||||
.overlayTitle {
|
|
||||||
padding: 5px;
|
|
||||||
color: var(--offWhite);
|
|
||||||
text-align: left;
|
|
||||||
font-weight: bold;
|
|
||||||
font-size: 15px;
|
|
||||||
opacity: 0;
|
|
||||||
transition: opacity 0;
|
|
||||||
}
|
|
||||||
|
|
||||||
.title {
|
|
||||||
@add-mixin truncate;
|
|
||||||
|
|
||||||
background-color: #fafbfc;
|
|
||||||
text-align: center;
|
|
||||||
font-size: $smallFontSize;
|
|
||||||
}
|
|
||||||
|
|
||||||
.controls {
|
|
||||||
position: absolute;
|
|
||||||
bottom: 10px;
|
|
||||||
left: 10px;
|
|
||||||
z-index: 3;
|
|
||||||
border-radius: 4px;
|
|
||||||
background-color: #707070;
|
|
||||||
color: var(--white);
|
|
||||||
font-size: $smallFontSize;
|
|
||||||
opacity: 0;
|
|
||||||
transition: opacity 0;
|
|
||||||
}
|
|
||||||
|
|
||||||
.action {
|
|
||||||
composes: button from '~Components/Link/IconButton.css';
|
|
||||||
|
|
||||||
&:hover {
|
|
||||||
color: var(--radarrYellow);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
@media only screen and (max-width: $breakpointSmall) {
|
|
||||||
.container {
|
|
||||||
padding: 5px;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
.editorSelect {
|
|
||||||
position: absolute;
|
|
||||||
top: 10px;
|
|
||||||
z-index: 3;
|
|
||||||
}
|
|
||||||
|
|
||||||
.externalLinks {
|
|
||||||
margin-left: 0.5em;
|
|
||||||
}
|
|
||||||
|
|
||||||
.link {
|
|
||||||
composes: link from '~Components/Link/Link.css';
|
|
||||||
|
|
||||||
position: relative;
|
|
||||||
display: block;
|
|
||||||
background-color: var(--defaultColor);
|
|
||||||
}
|
|
||||||
|
|
||||||
.monitorToggleButton {
|
|
||||||
composes: toggleButton from '~Components/MonitorToggleButton.css';
|
|
||||||
|
|
||||||
width: 25px;
|
|
||||||
color: var(--white);
|
|
||||||
|
|
||||||
&:hover {
|
|
||||||
color: var(--iconButtonHoverLightColor);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
@@ -1,191 +0,0 @@
|
|||||||
import PropTypes from 'prop-types';
|
|
||||||
import React, { Component } from 'react';
|
|
||||||
import Link from 'Components/Link/Link';
|
|
||||||
import MonitorToggleButton from 'Components/MonitorToggleButton';
|
|
||||||
import EditMovieModalConnector from 'Movie/Edit/EditMovieModalConnector';
|
|
||||||
import MovieIndexProgressBar from 'Movie/Index/ProgressBar/MovieIndexProgressBar';
|
|
||||||
import MoviePoster from 'Movie/MoviePoster';
|
|
||||||
import AddNewCollectionMovieModal from './../AddNewCollectionMovieModal';
|
|
||||||
import styles from './CollectionMovie.css';
|
|
||||||
|
|
||||||
class CollectionMovie extends Component {
|
|
||||||
|
|
||||||
//
|
|
||||||
// Lifecycle
|
|
||||||
|
|
||||||
constructor(props, context) {
|
|
||||||
super(props, context);
|
|
||||||
|
|
||||||
this.state = {
|
|
||||||
hasPosterError: false,
|
|
||||||
isEditMovieModalOpen: false,
|
|
||||||
isNewAddMovieModalOpen: false
|
|
||||||
};
|
|
||||||
}
|
|
||||||
|
|
||||||
//
|
|
||||||
// Listeners
|
|
||||||
|
|
||||||
onEditMoviePress = () => {
|
|
||||||
this.setState({ isEditMovieModalOpen: true });
|
|
||||||
};
|
|
||||||
|
|
||||||
onEditMovieModalClose = () => {
|
|
||||||
this.setState({ isEditMovieModalOpen: false });
|
|
||||||
};
|
|
||||||
|
|
||||||
onAddMoviePress = () => {
|
|
||||||
this.setState({ isNewAddMovieModalOpen: true });
|
|
||||||
};
|
|
||||||
|
|
||||||
onAddMovieModalClose = () => {
|
|
||||||
this.setState({ isNewAddMovieModalOpen: false });
|
|
||||||
};
|
|
||||||
|
|
||||||
onPosterLoad = () => {
|
|
||||||
if (this.state.hasPosterError) {
|
|
||||||
this.setState({ hasPosterError: false });
|
|
||||||
}
|
|
||||||
};
|
|
||||||
|
|
||||||
onPosterLoadError = () => {
|
|
||||||
if (!this.state.hasPosterError) {
|
|
||||||
this.setState({ hasPosterError: true });
|
|
||||||
}
|
|
||||||
};
|
|
||||||
|
|
||||||
//
|
|
||||||
// Render
|
|
||||||
|
|
||||||
render() {
|
|
||||||
const {
|
|
||||||
id,
|
|
||||||
title,
|
|
||||||
overview,
|
|
||||||
year,
|
|
||||||
tmdbId,
|
|
||||||
images,
|
|
||||||
monitored,
|
|
||||||
hasFile,
|
|
||||||
folder,
|
|
||||||
isAvailable,
|
|
||||||
isExistingMovie,
|
|
||||||
posterWidth,
|
|
||||||
posterHeight,
|
|
||||||
detailedProgressBar,
|
|
||||||
onMonitorTogglePress,
|
|
||||||
collectionId
|
|
||||||
} = this.props;
|
|
||||||
|
|
||||||
const {
|
|
||||||
isEditMovieModalOpen,
|
|
||||||
isNewAddMovieModalOpen
|
|
||||||
} = this.state;
|
|
||||||
|
|
||||||
const linkProps = id ? { to: `/movie/${tmdbId}` } : { onPress: this.onAddMoviePress };
|
|
||||||
|
|
||||||
const elementStyle = {
|
|
||||||
width: `${posterWidth}px`,
|
|
||||||
height: `${posterHeight}px`,
|
|
||||||
borderRadius: '5px'
|
|
||||||
};
|
|
||||||
|
|
||||||
return (
|
|
||||||
<div className={styles.content}>
|
|
||||||
<div className={styles.posterContainer}>
|
|
||||||
{
|
|
||||||
isExistingMovie &&
|
|
||||||
<div className={styles.editorSelect}>
|
|
||||||
<MonitorToggleButton
|
|
||||||
className={styles.monitorToggleButton}
|
|
||||||
monitored={monitored}
|
|
||||||
size={20}
|
|
||||||
onPress={onMonitorTogglePress}
|
|
||||||
/>
|
|
||||||
</div>
|
|
||||||
}
|
|
||||||
|
|
||||||
<Link
|
|
||||||
className={styles.link}
|
|
||||||
style={elementStyle}
|
|
||||||
{...linkProps}
|
|
||||||
>
|
|
||||||
<MoviePoster
|
|
||||||
className={styles.poster}
|
|
||||||
style={elementStyle}
|
|
||||||
images={images}
|
|
||||||
size={250}
|
|
||||||
lazy={false}
|
|
||||||
overflow={true}
|
|
||||||
onError={this.onPosterLoadError}
|
|
||||||
onLoad={this.onPosterLoad}
|
|
||||||
/>
|
|
||||||
|
|
||||||
<div className={styles.overlay}>
|
|
||||||
<div className={styles.overlayTitle}>
|
|
||||||
{title}
|
|
||||||
</div>
|
|
||||||
|
|
||||||
{
|
|
||||||
id &&
|
|
||||||
<div className={styles.overlayStatus}>
|
|
||||||
<MovieIndexProgressBar
|
|
||||||
monitored={monitored}
|
|
||||||
hasFile={hasFile}
|
|
||||||
status={status}
|
|
||||||
bottomRadius={true}
|
|
||||||
posterWidth={posterWidth}
|
|
||||||
detailedProgressBar={detailedProgressBar}
|
|
||||||
isAvailable={isAvailable}
|
|
||||||
/>
|
|
||||||
</div>
|
|
||||||
}
|
|
||||||
</div>
|
|
||||||
</Link>
|
|
||||||
</div>
|
|
||||||
|
|
||||||
<AddNewCollectionMovieModal
|
|
||||||
isOpen={isNewAddMovieModalOpen && !isExistingMovie}
|
|
||||||
tmdbId={tmdbId}
|
|
||||||
title={title}
|
|
||||||
year={year}
|
|
||||||
overview={overview}
|
|
||||||
images={images}
|
|
||||||
folder={folder}
|
|
||||||
onModalClose={this.onAddMovieModalClose}
|
|
||||||
collectionId={collectionId}
|
|
||||||
/>
|
|
||||||
|
|
||||||
<EditMovieModalConnector
|
|
||||||
isOpen={isEditMovieModalOpen}
|
|
||||||
movieId={id}
|
|
||||||
onModalClose={this.onEditMovieModalClose}
|
|
||||||
onDeleteMoviePress={this.onDeleteMoviePress}
|
|
||||||
/>
|
|
||||||
</div>
|
|
||||||
);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
CollectionMovie.propTypes = {
|
|
||||||
id: PropTypes.number,
|
|
||||||
title: PropTypes.string.isRequired,
|
|
||||||
year: PropTypes.number.isRequired,
|
|
||||||
overview: PropTypes.string.isRequired,
|
|
||||||
monitored: PropTypes.bool,
|
|
||||||
collectionId: PropTypes.number.isRequired,
|
|
||||||
hasFile: PropTypes.bool,
|
|
||||||
folder: PropTypes.string,
|
|
||||||
isAvailable: PropTypes.bool,
|
|
||||||
images: PropTypes.arrayOf(PropTypes.object).isRequired,
|
|
||||||
posterWidth: PropTypes.number.isRequired,
|
|
||||||
posterHeight: PropTypes.number.isRequired,
|
|
||||||
detailedProgressBar: PropTypes.bool.isRequired,
|
|
||||||
isExistingMovie: PropTypes.bool,
|
|
||||||
tmdbId: PropTypes.number.isRequired,
|
|
||||||
imdbId: PropTypes.string,
|
|
||||||
youTubeTrailerId: PropTypes.string,
|
|
||||||
onMonitorTogglePress: PropTypes.func.isRequired
|
|
||||||
};
|
|
||||||
|
|
||||||
export default CollectionMovie;
|
|
||||||
@@ -1,59 +0,0 @@
|
|||||||
import PropTypes from 'prop-types';
|
|
||||||
import React, { Component } from 'react';
|
|
||||||
import { connect } from 'react-redux';
|
|
||||||
import { createSelector } from 'reselect';
|
|
||||||
import { toggleMovieMonitored } from 'Store/Actions/movieActions';
|
|
||||||
import createCollectionExistingMovieSelector from 'Store/Selectors/createCollectionExistingMovieSelector';
|
|
||||||
import createDimensionsSelector from 'Store/Selectors/createDimensionsSelector';
|
|
||||||
import CollectionMovie from './CollectionMovie';
|
|
||||||
|
|
||||||
function createMapStateToProps() {
|
|
||||||
return createSelector(
|
|
||||||
createDimensionsSelector(),
|
|
||||||
createCollectionExistingMovieSelector(),
|
|
||||||
(dimensions, existingMovie) => {
|
|
||||||
return {
|
|
||||||
isSmallScreen: dimensions.isSmallScreen,
|
|
||||||
isExistingMovie: !!existingMovie,
|
|
||||||
...existingMovie
|
|
||||||
};
|
|
||||||
}
|
|
||||||
);
|
|
||||||
}
|
|
||||||
|
|
||||||
const mapDispatchToProps = {
|
|
||||||
toggleMovieMonitored
|
|
||||||
};
|
|
||||||
|
|
||||||
class CollectionMovieConnector extends Component {
|
|
||||||
|
|
||||||
//
|
|
||||||
// Listeners
|
|
||||||
|
|
||||||
onMonitorTogglePress = (monitored) => {
|
|
||||||
this.props.toggleMovieMonitored({
|
|
||||||
movieId: this.props.id,
|
|
||||||
monitored
|
|
||||||
});
|
|
||||||
};
|
|
||||||
|
|
||||||
//
|
|
||||||
// Render
|
|
||||||
|
|
||||||
render() {
|
|
||||||
return (
|
|
||||||
<CollectionMovie
|
|
||||||
{...this.props}
|
|
||||||
onMonitorTogglePress={this.onMonitorTogglePress}
|
|
||||||
/>
|
|
||||||
);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
CollectionMovieConnector.propTypes = {
|
|
||||||
id: PropTypes.number,
|
|
||||||
monitored: PropTypes.bool,
|
|
||||||
toggleMovieMonitored: PropTypes.func.isRequired
|
|
||||||
};
|
|
||||||
|
|
||||||
export default connect(createMapStateToProps, mapDispatchToProps)(CollectionMovieConnector);
|
|
||||||
@@ -1,50 +0,0 @@
|
|||||||
.movie {
|
|
||||||
display: flex;
|
|
||||||
align-items: stretch;
|
|
||||||
overflow: hidden;
|
|
||||||
margin: 2px 4px;
|
|
||||||
border: 1px solid var(--borderColor);
|
|
||||||
border-radius: 4px;
|
|
||||||
background-color: #eee;
|
|
||||||
cursor: default;
|
|
||||||
}
|
|
||||||
|
|
||||||
.movieTitle {
|
|
||||||
padding: 0 4px;
|
|
||||||
}
|
|
||||||
|
|
||||||
.movieStatus {
|
|
||||||
padding: 0 4px;
|
|
||||||
border-left: 4px;
|
|
||||||
border-left-style: solid;
|
|
||||||
background-color: var(--white);
|
|
||||||
color: var(--defaultColor);
|
|
||||||
}
|
|
||||||
|
|
||||||
.primary {
|
|
||||||
border-color: var(--primaryColor);
|
|
||||||
}
|
|
||||||
|
|
||||||
.danger {
|
|
||||||
border-color: var(--dangerColor);
|
|
||||||
}
|
|
||||||
|
|
||||||
.success {
|
|
||||||
border-color: var(--successColor);
|
|
||||||
}
|
|
||||||
|
|
||||||
.purple {
|
|
||||||
border-color: var(--purple);
|
|
||||||
}
|
|
||||||
|
|
||||||
.warning {
|
|
||||||
border-color: var(--warningColor);
|
|
||||||
}
|
|
||||||
|
|
||||||
.info {
|
|
||||||
border-color: var(--infoColor);
|
|
||||||
}
|
|
||||||
|
|
||||||
.queue {
|
|
||||||
border-color: var(--queueColor);
|
|
||||||
}
|
|
||||||
@@ -1,84 +0,0 @@
|
|||||||
import classNames from 'classnames';
|
|
||||||
import PropTypes from 'prop-types';
|
|
||||||
import React, { Component } from 'react';
|
|
||||||
import MonitorToggleButton from 'Components/MonitorToggleButton';
|
|
||||||
import getStatusStyle from 'Utilities/Movie/getStatusStyle';
|
|
||||||
import translate from 'Utilities/String/translate';
|
|
||||||
import styles from './CollectionMovieLabel.css';
|
|
||||||
|
|
||||||
class CollectionMovieLabel extends Component {
|
|
||||||
//
|
|
||||||
// Render
|
|
||||||
|
|
||||||
render() {
|
|
||||||
const {
|
|
||||||
id,
|
|
||||||
title,
|
|
||||||
status,
|
|
||||||
monitored,
|
|
||||||
isAvailable,
|
|
||||||
hasFile,
|
|
||||||
onMonitorTogglePress,
|
|
||||||
isSaving
|
|
||||||
} = this.props;
|
|
||||||
|
|
||||||
return (
|
|
||||||
<div className={styles.movie}>
|
|
||||||
<div className={styles.movieTitle}>
|
|
||||||
{
|
|
||||||
id &&
|
|
||||||
<MonitorToggleButton
|
|
||||||
monitored={monitored}
|
|
||||||
isSaving={isSaving}
|
|
||||||
onPress={onMonitorTogglePress}
|
|
||||||
/>
|
|
||||||
}
|
|
||||||
|
|
||||||
<span>
|
|
||||||
{
|
|
||||||
title
|
|
||||||
}
|
|
||||||
</span>
|
|
||||||
</div>
|
|
||||||
|
|
||||||
{
|
|
||||||
id &&
|
|
||||||
<div
|
|
||||||
className={classNames(
|
|
||||||
styles.movieStatus,
|
|
||||||
styles[getStatusStyle(status, monitored, hasFile, isAvailable, 'kinds')]
|
|
||||||
)}
|
|
||||||
>
|
|
||||||
{
|
|
||||||
hasFile ? translate('Downloaded') : translate('Missing')
|
|
||||||
}
|
|
||||||
</div>
|
|
||||||
}
|
|
||||||
</div>
|
|
||||||
);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
CollectionMovieLabel.propTypes = {
|
|
||||||
id: PropTypes.number,
|
|
||||||
title: PropTypes.string.isRequired,
|
|
||||||
status: PropTypes.string,
|
|
||||||
isAvailable: PropTypes.bool,
|
|
||||||
monitored: PropTypes.bool,
|
|
||||||
hasFile: PropTypes.bool,
|
|
||||||
isSaving: PropTypes.bool.isRequired,
|
|
||||||
movieFile: PropTypes.object,
|
|
||||||
movieFileId: PropTypes.number,
|
|
||||||
onMonitorTogglePress: PropTypes.func.isRequired
|
|
||||||
};
|
|
||||||
|
|
||||||
CollectionMovieLabel.defaultProps = {
|
|
||||||
isSaving: false,
|
|
||||||
statistics: {
|
|
||||||
episodeFileCount: 0,
|
|
||||||
totalEpisodeCount: 0,
|
|
||||||
percentOfEpisodes: 0
|
|
||||||
}
|
|
||||||
};
|
|
||||||
|
|
||||||
export default CollectionMovieLabel;
|
|
||||||
@@ -1,59 +0,0 @@
|
|||||||
import PropTypes from 'prop-types';
|
|
||||||
import React, { Component } from 'react';
|
|
||||||
import { connect } from 'react-redux';
|
|
||||||
import { createSelector } from 'reselect';
|
|
||||||
import { toggleMovieMonitored } from 'Store/Actions/movieActions';
|
|
||||||
import createCollectionExistingMovieSelector from 'Store/Selectors/createCollectionExistingMovieSelector';
|
|
||||||
import createDimensionsSelector from 'Store/Selectors/createDimensionsSelector';
|
|
||||||
import CollectionMovieLabel from './CollectionMovieLabel';
|
|
||||||
|
|
||||||
function createMapStateToProps() {
|
|
||||||
return createSelector(
|
|
||||||
createDimensionsSelector(),
|
|
||||||
createCollectionExistingMovieSelector(),
|
|
||||||
(dimensions, existingMovie) => {
|
|
||||||
return {
|
|
||||||
isSmallScreen: dimensions.isSmallScreen,
|
|
||||||
isExistingMovie: !!existingMovie,
|
|
||||||
...existingMovie
|
|
||||||
};
|
|
||||||
}
|
|
||||||
);
|
|
||||||
}
|
|
||||||
|
|
||||||
const mapDispatchToProps = {
|
|
||||||
toggleMovieMonitored
|
|
||||||
};
|
|
||||||
|
|
||||||
class CollectionMovieLabelConnector extends Component {
|
|
||||||
|
|
||||||
//
|
|
||||||
// Listeners
|
|
||||||
|
|
||||||
onMonitorTogglePress = (monitored) => {
|
|
||||||
this.props.toggleMovieMonitored({
|
|
||||||
movieId: this.props.id,
|
|
||||||
monitored
|
|
||||||
});
|
|
||||||
};
|
|
||||||
|
|
||||||
//
|
|
||||||
// Render
|
|
||||||
|
|
||||||
render() {
|
|
||||||
return (
|
|
||||||
<CollectionMovieLabel
|
|
||||||
{...this.props}
|
|
||||||
onMonitorTogglePress={this.onMonitorTogglePress}
|
|
||||||
/>
|
|
||||||
);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
CollectionMovieLabelConnector.propTypes = {
|
|
||||||
id: PropTypes.number,
|
|
||||||
monitored: PropTypes.bool,
|
|
||||||
toggleMovieMonitored: PropTypes.func.isRequired
|
|
||||||
};
|
|
||||||
|
|
||||||
export default connect(createMapStateToProps, mapDispatchToProps)(CollectionMovieLabelConnector);
|
|
||||||
@@ -1,137 +0,0 @@
|
|||||||
$hoverScale: 1.05;
|
|
||||||
|
|
||||||
.content {
|
|
||||||
display: flex;
|
|
||||||
flex-grow: 1;
|
|
||||||
}
|
|
||||||
|
|
||||||
.editorSelect {
|
|
||||||
position: relative;
|
|
||||||
top: 0;
|
|
||||||
left: 5px;
|
|
||||||
}
|
|
||||||
|
|
||||||
.titleRow {
|
|
||||||
position: relative;
|
|
||||||
display: flex;
|
|
||||||
justify-content: space-between;
|
|
||||||
flex: 0 0 auto;
|
|
||||||
}
|
|
||||||
|
|
||||||
.toggleMonitoredContainer {
|
|
||||||
align-self: center;
|
|
||||||
margin-right: 10px;
|
|
||||||
}
|
|
||||||
|
|
||||||
.titleContainer {
|
|
||||||
display: flex;
|
|
||||||
margin-bottom: 5px;
|
|
||||||
}
|
|
||||||
|
|
||||||
.sliderContainer {
|
|
||||||
display: block;
|
|
||||||
}
|
|
||||||
|
|
||||||
.labelsContainer {
|
|
||||||
display: flex;
|
|
||||||
flex-wrap: wrap;
|
|
||||||
}
|
|
||||||
|
|
||||||
.moviesContainer {
|
|
||||||
margin-bottom: 5px;
|
|
||||||
}
|
|
||||||
|
|
||||||
.movie {
|
|
||||||
padding: 7px;
|
|
||||||
}
|
|
||||||
|
|
||||||
.info {
|
|
||||||
display: flex;
|
|
||||||
flex: 1 0 1px;
|
|
||||||
flex-direction: column;
|
|
||||||
overflow: hidden;
|
|
||||||
padding-left: 10px;
|
|
||||||
}
|
|
||||||
|
|
||||||
.title {
|
|
||||||
@add-mixin truncate;
|
|
||||||
|
|
||||||
font-weight: 300;
|
|
||||||
font-size: 30px;
|
|
||||||
line-height: 40px;
|
|
||||||
}
|
|
||||||
|
|
||||||
.actions {
|
|
||||||
white-space: nowrap;
|
|
||||||
}
|
|
||||||
|
|
||||||
.details {
|
|
||||||
display: flex;
|
|
||||||
justify-content: space-between;
|
|
||||||
flex: 1 0 auto;
|
|
||||||
margin-bottom: 5px;
|
|
||||||
}
|
|
||||||
|
|
||||||
.defaults {
|
|
||||||
margin-bottom: 5px;
|
|
||||||
font-weight: 300;
|
|
||||||
font-size: 20px;
|
|
||||||
}
|
|
||||||
|
|
||||||
.detailsLabel {
|
|
||||||
composes: label from '~Components/Label.css';
|
|
||||||
|
|
||||||
margin: 5px 10px 5px 0;
|
|
||||||
}
|
|
||||||
|
|
||||||
.path,
|
|
||||||
.status,
|
|
||||||
.genres,
|
|
||||||
.qualityProfileName {
|
|
||||||
margin-left: 8px;
|
|
||||||
font-weight: 300;
|
|
||||||
font-size: 15px;
|
|
||||||
}
|
|
||||||
|
|
||||||
.overview {
|
|
||||||
overflow: hidden;
|
|
||||||
min-height: 0;
|
|
||||||
}
|
|
||||||
|
|
||||||
.monitorToggleButton {
|
|
||||||
composes: toggleButton from '~Components/MonitorToggleButton.css';
|
|
||||||
|
|
||||||
width: 25px;
|
|
||||||
|
|
||||||
&:hover {
|
|
||||||
color: var(--iconButtonHoverLightColor);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
@media only screen and (max-width: $breakpointSmall) {
|
|
||||||
.navigationButtons {
|
|
||||||
display: none;
|
|
||||||
}
|
|
||||||
|
|
||||||
.title {
|
|
||||||
@add-mixin truncate;
|
|
||||||
|
|
||||||
font-weight: 300;
|
|
||||||
font-size: 22px;
|
|
||||||
}
|
|
||||||
|
|
||||||
.toggleMonitoredContainer {
|
|
||||||
align-self: center;
|
|
||||||
margin-right: 5px;
|
|
||||||
}
|
|
||||||
|
|
||||||
.monitorToggleButton {
|
|
||||||
composes: toggleButton from '~Components/MonitorToggleButton.css';
|
|
||||||
|
|
||||||
width: 20px;
|
|
||||||
|
|
||||||
&:hover {
|
|
||||||
color: var(--iconButtonHoverLightColor);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
@@ -1,353 +0,0 @@
|
|||||||
import PropTypes from 'prop-types';
|
|
||||||
import React, { Component } from 'react';
|
|
||||||
import TextTruncate from 'react-text-truncate';
|
|
||||||
import { Navigation } from 'swiper';
|
|
||||||
import { Swiper, SwiperSlide } from 'swiper/react';
|
|
||||||
import EditCollectionModalConnector from 'Collection/Edit/EditCollectionModalConnector';
|
|
||||||
import CheckInput from 'Components/Form/CheckInput';
|
|
||||||
import Icon from 'Components/Icon';
|
|
||||||
import Label from 'Components/Label';
|
|
||||||
import IconButton from 'Components/Link/IconButton';
|
|
||||||
import MonitorToggleButton from 'Components/MonitorToggleButton';
|
|
||||||
import { icons, sizes } from 'Helpers/Props';
|
|
||||||
import QualityProfileNameConnector from 'Settings/Profiles/Quality/QualityProfileNameConnector';
|
|
||||||
import dimensions from 'Styles/Variables/dimensions';
|
|
||||||
import fonts from 'Styles/Variables/fonts';
|
|
||||||
import translate from 'Utilities/String/translate';
|
|
||||||
import CollectionMovieConnector from './CollectionMovieConnector';
|
|
||||||
import CollectionMovieLabelConnector from './CollectionMovieLabelConnector';
|
|
||||||
import styles from './CollectionOverview.css';
|
|
||||||
|
|
||||||
// Import Swiper styles
|
|
||||||
import 'swiper/css';
|
|
||||||
import 'swiper/css/navigation';
|
|
||||||
|
|
||||||
const columnPadding = parseInt(dimensions.movieIndexColumnPadding);
|
|
||||||
const columnPaddingSmallScreen = parseInt(dimensions.movieIndexColumnPaddingSmallScreen);
|
|
||||||
const defaultFontSize = parseInt(fonts.defaultFontSize);
|
|
||||||
const lineHeight = parseFloat(fonts.lineHeight);
|
|
||||||
|
|
||||||
// Hardcoded height beased on line-height of 32 + bottom margin of 10. 19 + 5 for List Row
|
|
||||||
// Less side-effecty than using react-measure.
|
|
||||||
const titleRowHeight = 100;
|
|
||||||
|
|
||||||
function getContentHeight(rowHeight, isSmallScreen) {
|
|
||||||
const padding = isSmallScreen ? columnPaddingSmallScreen : columnPadding;
|
|
||||||
|
|
||||||
return rowHeight - padding;
|
|
||||||
}
|
|
||||||
|
|
||||||
class CollectionOverview extends Component {
|
|
||||||
|
|
||||||
//
|
|
||||||
// Lifecycle
|
|
||||||
|
|
||||||
constructor(props, context) {
|
|
||||||
super(props, context);
|
|
||||||
|
|
||||||
this.state = {
|
|
||||||
isEditCollectionModalOpen: false,
|
|
||||||
isNewAddMovieModalOpen: false
|
|
||||||
};
|
|
||||||
}
|
|
||||||
|
|
||||||
//
|
|
||||||
// Control
|
|
||||||
|
|
||||||
setSliderPrevRef = (ref) => {
|
|
||||||
this._swiperPrevRef = ref;
|
|
||||||
};
|
|
||||||
|
|
||||||
setSliderNextRef = (ref) => {
|
|
||||||
this._swiperNextRef = ref;
|
|
||||||
};
|
|
||||||
|
|
||||||
//
|
|
||||||
// Listeners
|
|
||||||
|
|
||||||
onPress = () => {
|
|
||||||
this.setState({ isNewAddMovieModalOpen: true });
|
|
||||||
};
|
|
||||||
|
|
||||||
onEditCollectionPress = () => {
|
|
||||||
this.setState({ isEditCollectionModalOpen: true });
|
|
||||||
};
|
|
||||||
|
|
||||||
onEditCollectionModalClose = () => {
|
|
||||||
this.setState({ isEditCollectionModalOpen: false });
|
|
||||||
};
|
|
||||||
|
|
||||||
onAddMovieModalClose = () => {
|
|
||||||
this.setState({ isNewAddMovieModalOpen: false });
|
|
||||||
};
|
|
||||||
|
|
||||||
onChange = ({ value, shiftKey }) => {
|
|
||||||
const {
|
|
||||||
id,
|
|
||||||
onSelectedChange
|
|
||||||
} = this.props;
|
|
||||||
|
|
||||||
onSelectedChange({ id, value, shiftKey });
|
|
||||||
};
|
|
||||||
|
|
||||||
//
|
|
||||||
// Render
|
|
||||||
|
|
||||||
render() {
|
|
||||||
const {
|
|
||||||
monitored,
|
|
||||||
qualityProfileId,
|
|
||||||
rootFolderPath,
|
|
||||||
genres,
|
|
||||||
id,
|
|
||||||
title,
|
|
||||||
movies,
|
|
||||||
overview,
|
|
||||||
missingMovies,
|
|
||||||
posterHeight,
|
|
||||||
posterWidth,
|
|
||||||
rowHeight,
|
|
||||||
isSmallScreen,
|
|
||||||
isSelected,
|
|
||||||
onMonitorTogglePress
|
|
||||||
} = this.props;
|
|
||||||
|
|
||||||
const {
|
|
||||||
showDetails,
|
|
||||||
showOverview,
|
|
||||||
showPosters,
|
|
||||||
detailedProgressBar
|
|
||||||
} = this.props.overviewOptions;
|
|
||||||
|
|
||||||
const {
|
|
||||||
isEditCollectionModalOpen
|
|
||||||
} = this.state;
|
|
||||||
|
|
||||||
const contentHeight = getContentHeight(rowHeight, isSmallScreen);
|
|
||||||
const overviewHeight = contentHeight - titleRowHeight - posterHeight;
|
|
||||||
|
|
||||||
return (
|
|
||||||
<div className={styles.container}>
|
|
||||||
<div className={styles.content}>
|
|
||||||
<div className={styles.editorSelect}>
|
|
||||||
<CheckInput
|
|
||||||
className={styles.checkInput}
|
|
||||||
name={id.toString()}
|
|
||||||
value={isSelected}
|
|
||||||
onChange={this.onChange}
|
|
||||||
/>
|
|
||||||
</div>
|
|
||||||
<div className={styles.info} style={{ maxHeight: contentHeight }}>
|
|
||||||
|
|
||||||
<div className={styles.titleRow}>
|
|
||||||
<div className={styles.titleContainer}>
|
|
||||||
<div className={styles.toggleMonitoredContainer}>
|
|
||||||
<MonitorToggleButton
|
|
||||||
className={styles.monitorToggleButton}
|
|
||||||
monitored={monitored}
|
|
||||||
size={isSmallScreen ? 20 : 25}
|
|
||||||
onPress={onMonitorTogglePress}
|
|
||||||
/>
|
|
||||||
</div>
|
|
||||||
<div className={styles.title}>
|
|
||||||
{title}
|
|
||||||
</div>
|
|
||||||
|
|
||||||
<IconButton
|
|
||||||
name={icons.EDIT}
|
|
||||||
title={translate('EditCollection')}
|
|
||||||
onPress={this.onEditCollectionPress}
|
|
||||||
/>
|
|
||||||
</div>
|
|
||||||
|
|
||||||
{
|
|
||||||
showPosters &&
|
|
||||||
<div className={styles.navigationButtons}>
|
|
||||||
<span ref={this.setSliderPrevRef}>
|
|
||||||
<IconButton
|
|
||||||
name={icons.ARROW_LEFT}
|
|
||||||
title={translate('ScrollMovies')}
|
|
||||||
size={20}
|
|
||||||
/>
|
|
||||||
</span>
|
|
||||||
|
|
||||||
<span ref={this.setSliderNextRef}>
|
|
||||||
<IconButton
|
|
||||||
name={icons.ARROW_RIGHT}
|
|
||||||
title={translate('ScrollMovies')}
|
|
||||||
size={20}
|
|
||||||
/>
|
|
||||||
</span>
|
|
||||||
</div>
|
|
||||||
}
|
|
||||||
|
|
||||||
</div>
|
|
||||||
|
|
||||||
{
|
|
||||||
showDetails &&
|
|
||||||
<div className={styles.defaults}>
|
|
||||||
<Label
|
|
||||||
className={styles.detailsLabel}
|
|
||||||
size={sizes.MEDIUM}
|
|
||||||
>
|
|
||||||
<Icon
|
|
||||||
name={icons.DRIVE}
|
|
||||||
size={13}
|
|
||||||
/>
|
|
||||||
<span className={styles.status}>
|
|
||||||
{`${missingMovies} missing movie(s)`}
|
|
||||||
</span>
|
|
||||||
</Label>
|
|
||||||
|
|
||||||
{
|
|
||||||
!isSmallScreen &&
|
|
||||||
<Label
|
|
||||||
className={styles.detailsLabel}
|
|
||||||
size={sizes.MEDIUM}
|
|
||||||
>
|
|
||||||
<Icon
|
|
||||||
name={icons.PROFILE}
|
|
||||||
size={13}
|
|
||||||
/>
|
|
||||||
<span className={styles.qualityProfileName}>
|
|
||||||
{
|
|
||||||
<QualityProfileNameConnector
|
|
||||||
qualityProfileId={qualityProfileId}
|
|
||||||
/>
|
|
||||||
}
|
|
||||||
</span>
|
|
||||||
</Label>
|
|
||||||
}
|
|
||||||
|
|
||||||
{
|
|
||||||
!isSmallScreen &&
|
|
||||||
<Label
|
|
||||||
className={styles.detailsLabel}
|
|
||||||
size={sizes.MEDIUM}
|
|
||||||
>
|
|
||||||
<Icon
|
|
||||||
name={icons.FOLDER}
|
|
||||||
size={13}
|
|
||||||
/>
|
|
||||||
<span className={styles.path}>
|
|
||||||
{rootFolderPath}
|
|
||||||
</span>
|
|
||||||
</Label>
|
|
||||||
}
|
|
||||||
|
|
||||||
{
|
|
||||||
!isSmallScreen &&
|
|
||||||
<Label
|
|
||||||
className={styles.detailsLabel}
|
|
||||||
size={sizes.MEDIUM}
|
|
||||||
>
|
|
||||||
<Icon
|
|
||||||
name={icons.PROFILE}
|
|
||||||
size={13}
|
|
||||||
/>
|
|
||||||
<span className={styles.genres}>
|
|
||||||
{genres.join(', ')}
|
|
||||||
</span>
|
|
||||||
</Label>
|
|
||||||
}
|
|
||||||
|
|
||||||
</div>
|
|
||||||
}
|
|
||||||
|
|
||||||
{
|
|
||||||
showOverview &&
|
|
||||||
<div className={styles.details}>
|
|
||||||
<div className={styles.overview}>
|
|
||||||
<TextTruncate
|
|
||||||
line={Math.floor(overviewHeight / (defaultFontSize * lineHeight))}
|
|
||||||
text={overview}
|
|
||||||
/>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
}
|
|
||||||
|
|
||||||
{
|
|
||||||
showPosters ?
|
|
||||||
<div className={styles.sliderContainer}>
|
|
||||||
<Swiper
|
|
||||||
slidesPerView='auto'
|
|
||||||
spaceBetween={10}
|
|
||||||
slidesPerGroup={3}
|
|
||||||
loop={false}
|
|
||||||
loopFillGroupWithBlank={true}
|
|
||||||
className="mySwiper"
|
|
||||||
modules={[Navigation]}
|
|
||||||
onInit={(swiper) => {
|
|
||||||
swiper.params.navigation.prevEl = this._swiperPrevRef;
|
|
||||||
swiper.params.navigation.nextEl = this._swiperNextRef;
|
|
||||||
swiper.navigation.init();
|
|
||||||
swiper.navigation.update();
|
|
||||||
}}
|
|
||||||
>
|
|
||||||
{movies.map((movie) => (
|
|
||||||
<SwiperSlide key={movie.tmdbId} style={{ width: posterWidth }}>
|
|
||||||
<CollectionMovieConnector
|
|
||||||
key={movie.tmdbId}
|
|
||||||
posterWidth={posterWidth}
|
|
||||||
posterHeight={posterHeight}
|
|
||||||
detailedProgressBar={detailedProgressBar}
|
|
||||||
collectionId={id}
|
|
||||||
{...movie}
|
|
||||||
/>
|
|
||||||
</SwiperSlide>
|
|
||||||
))}
|
|
||||||
</Swiper>
|
|
||||||
</div> :
|
|
||||||
<div className={styles.labelsContainer}>
|
|
||||||
{movies.map((movie) => (
|
|
||||||
<CollectionMovieLabelConnector
|
|
||||||
key={movie.tmdbId}
|
|
||||||
collectionId={id}
|
|
||||||
{...movie}
|
|
||||||
/>
|
|
||||||
))}
|
|
||||||
</div>
|
|
||||||
}
|
|
||||||
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
|
|
||||||
<EditCollectionModalConnector
|
|
||||||
isOpen={isEditCollectionModalOpen}
|
|
||||||
collectionId={id}
|
|
||||||
onModalClose={this.onEditCollectionModalClose}
|
|
||||||
/>
|
|
||||||
</div>
|
|
||||||
);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
CollectionOverview.propTypes = {
|
|
||||||
id: PropTypes.number.isRequired,
|
|
||||||
monitored: PropTypes.bool.isRequired,
|
|
||||||
qualityProfileId: PropTypes.number.isRequired,
|
|
||||||
minimumAvailability: PropTypes.string.isRequired,
|
|
||||||
searchOnAdd: PropTypes.bool.isRequired,
|
|
||||||
rootFolderPath: PropTypes.string.isRequired,
|
|
||||||
tmdbId: PropTypes.number.isRequired,
|
|
||||||
title: PropTypes.string.isRequired,
|
|
||||||
overview: PropTypes.string.isRequired,
|
|
||||||
movies: PropTypes.arrayOf(PropTypes.object).isRequired,
|
|
||||||
genres: PropTypes.arrayOf(PropTypes.string).isRequired,
|
|
||||||
missingMovies: PropTypes.number.isRequired,
|
|
||||||
images: PropTypes.arrayOf(PropTypes.object).isRequired,
|
|
||||||
rowHeight: PropTypes.number.isRequired,
|
|
||||||
posterHeight: PropTypes.number.isRequired,
|
|
||||||
posterWidth: PropTypes.number.isRequired,
|
|
||||||
overviewOptions: PropTypes.object.isRequired,
|
|
||||||
showRelativeDates: PropTypes.bool.isRequired,
|
|
||||||
shortDateFormat: PropTypes.string.isRequired,
|
|
||||||
longDateFormat: PropTypes.string.isRequired,
|
|
||||||
timeFormat: PropTypes.string.isRequired,
|
|
||||||
isSmallScreen: PropTypes.bool.isRequired,
|
|
||||||
isSelected: PropTypes.bool,
|
|
||||||
onMonitorTogglePress: PropTypes.func.isRequired,
|
|
||||||
onSelectedChange: PropTypes.func.isRequired
|
|
||||||
};
|
|
||||||
|
|
||||||
export default CollectionOverview;
|
|
||||||
@@ -1,55 +0,0 @@
|
|||||||
import PropTypes from 'prop-types';
|
|
||||||
import React, { Component } from 'react';
|
|
||||||
import { connect } from 'react-redux';
|
|
||||||
import { createSelector } from 'reselect';
|
|
||||||
import { toggleCollectionMonitored } from 'Store/Actions/movieCollectionActions';
|
|
||||||
import createDimensionsSelector from 'Store/Selectors/createDimensionsSelector';
|
|
||||||
import CollectionOverview from './CollectionOverview';
|
|
||||||
|
|
||||||
function createMapStateToProps() {
|
|
||||||
return createSelector(
|
|
||||||
createDimensionsSelector(),
|
|
||||||
(dimensions) => {
|
|
||||||
return {
|
|
||||||
isSmallScreen: dimensions.isSmallScreen
|
|
||||||
};
|
|
||||||
}
|
|
||||||
);
|
|
||||||
}
|
|
||||||
|
|
||||||
const mapDispatchToProps = {
|
|
||||||
toggleCollectionMonitored
|
|
||||||
};
|
|
||||||
|
|
||||||
class CollectionOverviewConnector extends Component {
|
|
||||||
|
|
||||||
//
|
|
||||||
// Listeners
|
|
||||||
|
|
||||||
onMonitorTogglePress = (monitored) => {
|
|
||||||
this.props.toggleCollectionMonitored({
|
|
||||||
collectionId: this.props.collectionId,
|
|
||||||
monitored
|
|
||||||
});
|
|
||||||
};
|
|
||||||
|
|
||||||
//
|
|
||||||
// Render
|
|
||||||
|
|
||||||
render() {
|
|
||||||
return (
|
|
||||||
<CollectionOverview
|
|
||||||
{...this.props}
|
|
||||||
onMonitorTogglePress={this.onMonitorTogglePress}
|
|
||||||
/>
|
|
||||||
);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
CollectionOverviewConnector.propTypes = {
|
|
||||||
collectionId: PropTypes.number.isRequired,
|
|
||||||
monitored: PropTypes.bool.isRequired,
|
|
||||||
toggleCollectionMonitored: PropTypes.func.isRequired
|
|
||||||
};
|
|
||||||
|
|
||||||
export default connect(createMapStateToProps, mapDispatchToProps)(CollectionOverviewConnector);
|
|
||||||
@@ -1,15 +0,0 @@
|
|||||||
.grid {
|
|
||||||
flex: 1 0 auto;
|
|
||||||
}
|
|
||||||
|
|
||||||
.container {
|
|
||||||
&:hover {
|
|
||||||
.content {
|
|
||||||
background-color: var(--tableRowHoverBackgroundColor);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
.externalLinks {
|
|
||||||
margin-right: 0.5em;
|
|
||||||
}
|
|
||||||
@@ -1,272 +0,0 @@
|
|||||||
import PropTypes from 'prop-types';
|
|
||||||
import React, { Component } from 'react';
|
|
||||||
import { Grid, WindowScroller } from 'react-virtualized';
|
|
||||||
import CollectionItemConnector from 'Collection/CollectionItemConnector';
|
|
||||||
import Measure from 'Components/Measure';
|
|
||||||
import dimensions from 'Styles/Variables/dimensions';
|
|
||||||
import getIndexOfFirstCharacter from 'Utilities/Array/getIndexOfFirstCharacter';
|
|
||||||
import hasDifferentItemsOrOrder from 'Utilities/Object/hasDifferentItemsOrOrder';
|
|
||||||
import CollectionOverviewConnector from './CollectionOverviewConnector';
|
|
||||||
import styles from './CollectionOverviews.css';
|
|
||||||
|
|
||||||
// Poster container dimensions
|
|
||||||
const columnPadding = parseInt(dimensions.movieIndexColumnPadding);
|
|
||||||
const columnPaddingSmallScreen = parseInt(dimensions.movieIndexColumnPaddingSmallScreen);
|
|
||||||
|
|
||||||
function calculatePosterWidth(posterSize, isSmallScreen) {
|
|
||||||
const maxiumPosterWidth = isSmallScreen ? 152 : 162;
|
|
||||||
|
|
||||||
if (posterSize === 'large') {
|
|
||||||
return maxiumPosterWidth;
|
|
||||||
}
|
|
||||||
|
|
||||||
if (posterSize === 'medium') {
|
|
||||||
return Math.floor(maxiumPosterWidth * 0.75);
|
|
||||||
}
|
|
||||||
|
|
||||||
return Math.floor(maxiumPosterWidth * 0.5);
|
|
||||||
}
|
|
||||||
|
|
||||||
function calculateRowHeight(posterHeight, sortKey, isSmallScreen, overviewOptions) {
|
|
||||||
|
|
||||||
const heights = [
|
|
||||||
overviewOptions.showPosters ? posterHeight : 75,
|
|
||||||
isSmallScreen ? columnPaddingSmallScreen : columnPadding
|
|
||||||
];
|
|
||||||
|
|
||||||
return heights.reduce((acc, height) => acc + height + 80, 0);
|
|
||||||
}
|
|
||||||
|
|
||||||
function calculatePosterHeight(posterWidth) {
|
|
||||||
return Math.ceil((250 / 170) * posterWidth);
|
|
||||||
}
|
|
||||||
|
|
||||||
class CollectionOverviews extends Component {
|
|
||||||
|
|
||||||
//
|
|
||||||
// Lifecycle
|
|
||||||
|
|
||||||
constructor(props, context) {
|
|
||||||
super(props, context);
|
|
||||||
|
|
||||||
this.state = {
|
|
||||||
width: 0,
|
|
||||||
columnCount: 1,
|
|
||||||
posterWidth: 162,
|
|
||||||
posterHeight: 238,
|
|
||||||
rowHeight: calculateRowHeight(238, null, props.isSmallScreen, {})
|
|
||||||
};
|
|
||||||
|
|
||||||
this._grid = null;
|
|
||||||
}
|
|
||||||
|
|
||||||
componentDidUpdate(prevProps, prevState) {
|
|
||||||
const {
|
|
||||||
items,
|
|
||||||
sortKey,
|
|
||||||
overviewOptions,
|
|
||||||
jumpToCharacter,
|
|
||||||
scrollTop,
|
|
||||||
isSmallScreen
|
|
||||||
} = this.props;
|
|
||||||
|
|
||||||
const {
|
|
||||||
width,
|
|
||||||
rowHeight,
|
|
||||||
scrollRestored
|
|
||||||
} = this.state;
|
|
||||||
|
|
||||||
if (prevProps.sortKey !== sortKey ||
|
|
||||||
prevProps.overviewOptions !== overviewOptions) {
|
|
||||||
this.calculateGrid(this.state.width, isSmallScreen);
|
|
||||||
}
|
|
||||||
|
|
||||||
if (
|
|
||||||
this._grid &&
|
|
||||||
(prevState.width !== width ||
|
|
||||||
prevState.rowHeight !== rowHeight ||
|
|
||||||
hasDifferentItemsOrOrder(prevProps.items, items) ||
|
|
||||||
prevProps.overviewOptions !== overviewOptions)) {
|
|
||||||
// recomputeGridSize also forces Grid to discard its cache of rendered cells
|
|
||||||
this._grid.recomputeGridSize();
|
|
||||||
}
|
|
||||||
|
|
||||||
if (this._grid && scrollTop !== 0 && !scrollRestored) {
|
|
||||||
this.setState({ scrollRestored: true });
|
|
||||||
this._grid.scrollToPosition({ scrollTop });
|
|
||||||
}
|
|
||||||
|
|
||||||
if (jumpToCharacter != null && jumpToCharacter !== prevProps.jumpToCharacter) {
|
|
||||||
const index = getIndexOfFirstCharacter(items, jumpToCharacter);
|
|
||||||
|
|
||||||
if (this._grid && index != null) {
|
|
||||||
|
|
||||||
this._grid.scrollToCell({
|
|
||||||
rowIndex: index,
|
|
||||||
columnIndex: 0
|
|
||||||
});
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
//
|
|
||||||
// Control
|
|
||||||
|
|
||||||
setGridRef = (ref) => {
|
|
||||||
this._grid = ref;
|
|
||||||
};
|
|
||||||
|
|
||||||
calculateGrid = (width = this.state.width, isSmallScreen) => {
|
|
||||||
const {
|
|
||||||
sortKey,
|
|
||||||
overviewOptions
|
|
||||||
} = this.props;
|
|
||||||
|
|
||||||
const posterWidth = calculatePosterWidth(overviewOptions.size, isSmallScreen);
|
|
||||||
const posterHeight = calculatePosterHeight(posterWidth);
|
|
||||||
const rowHeight = calculateRowHeight(posterHeight, sortKey, isSmallScreen, overviewOptions);
|
|
||||||
|
|
||||||
this.setState({
|
|
||||||
width,
|
|
||||||
posterWidth,
|
|
||||||
posterHeight,
|
|
||||||
rowHeight
|
|
||||||
});
|
|
||||||
};
|
|
||||||
|
|
||||||
cellRenderer = ({ key, rowIndex, style }) => {
|
|
||||||
const {
|
|
||||||
items,
|
|
||||||
sortKey,
|
|
||||||
overviewOptions,
|
|
||||||
showRelativeDates,
|
|
||||||
shortDateFormat,
|
|
||||||
longDateFormat,
|
|
||||||
timeFormat,
|
|
||||||
isSmallScreen,
|
|
||||||
selectedState,
|
|
||||||
onSelectedChange
|
|
||||||
} = this.props;
|
|
||||||
|
|
||||||
const {
|
|
||||||
posterWidth,
|
|
||||||
posterHeight,
|
|
||||||
rowHeight
|
|
||||||
} = this.state;
|
|
||||||
|
|
||||||
const collection = items[rowIndex];
|
|
||||||
|
|
||||||
if (!collection) {
|
|
||||||
return null;
|
|
||||||
}
|
|
||||||
|
|
||||||
return (
|
|
||||||
<div
|
|
||||||
className={styles.container}
|
|
||||||
key={key}
|
|
||||||
style={style}
|
|
||||||
>
|
|
||||||
<CollectionItemConnector
|
|
||||||
key={collection.id}
|
|
||||||
component={CollectionOverviewConnector}
|
|
||||||
sortKey={sortKey}
|
|
||||||
posterWidth={posterWidth}
|
|
||||||
posterHeight={posterHeight}
|
|
||||||
rowHeight={rowHeight}
|
|
||||||
overviewOptions={overviewOptions}
|
|
||||||
showRelativeDates={showRelativeDates}
|
|
||||||
shortDateFormat={shortDateFormat}
|
|
||||||
longDateFormat={longDateFormat}
|
|
||||||
timeFormat={timeFormat}
|
|
||||||
isSmallScreen={isSmallScreen}
|
|
||||||
collectionId={collection.id}
|
|
||||||
isSelected={selectedState[collection.id]}
|
|
||||||
onSelectedChange={onSelectedChange}
|
|
||||||
/>
|
|
||||||
</div>
|
|
||||||
);
|
|
||||||
};
|
|
||||||
|
|
||||||
//
|
|
||||||
// Listeners
|
|
||||||
|
|
||||||
onMeasure = ({ width }) => {
|
|
||||||
this.calculateGrid(width, this.props.isSmallScreen);
|
|
||||||
};
|
|
||||||
|
|
||||||
//
|
|
||||||
// Render
|
|
||||||
|
|
||||||
render() {
|
|
||||||
const {
|
|
||||||
isSmallScreen,
|
|
||||||
scroller,
|
|
||||||
items,
|
|
||||||
selectedState
|
|
||||||
} = this.props;
|
|
||||||
|
|
||||||
const {
|
|
||||||
width,
|
|
||||||
rowHeight
|
|
||||||
} = this.state;
|
|
||||||
|
|
||||||
return (
|
|
||||||
<Measure
|
|
||||||
whitelist={['width']}
|
|
||||||
onMeasure={this.onMeasure}
|
|
||||||
>
|
|
||||||
<WindowScroller
|
|
||||||
scrollElement={isSmallScreen ? undefined : scroller}
|
|
||||||
>
|
|
||||||
{({ height, registerChild, onChildScroll, scrollTop }) => {
|
|
||||||
if (!height) {
|
|
||||||
return <div />;
|
|
||||||
}
|
|
||||||
|
|
||||||
return (
|
|
||||||
<div ref={registerChild}>
|
|
||||||
<Grid
|
|
||||||
ref={this.setGridRef}
|
|
||||||
className={styles.grid}
|
|
||||||
autoHeight={true}
|
|
||||||
height={height}
|
|
||||||
columnCount={1}
|
|
||||||
columnWidth={width}
|
|
||||||
rowCount={items.length}
|
|
||||||
rowHeight={rowHeight}
|
|
||||||
width={width}
|
|
||||||
onScroll={onChildScroll}
|
|
||||||
scrollTop={scrollTop}
|
|
||||||
overscanRowCount={2}
|
|
||||||
cellRenderer={this.cellRenderer}
|
|
||||||
selectedState={selectedState}
|
|
||||||
scrollToAlignment={'start'}
|
|
||||||
isScrollingOptout={true}
|
|
||||||
/>
|
|
||||||
</div>
|
|
||||||
);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
</WindowScroller>
|
|
||||||
</Measure>
|
|
||||||
);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
CollectionOverviews.propTypes = {
|
|
||||||
items: PropTypes.arrayOf(PropTypes.object).isRequired,
|
|
||||||
sortKey: PropTypes.string,
|
|
||||||
overviewOptions: PropTypes.object.isRequired,
|
|
||||||
jumpToCharacter: PropTypes.string,
|
|
||||||
scrollTop: PropTypes.number.isRequired,
|
|
||||||
scroller: PropTypes.instanceOf(Element).isRequired,
|
|
||||||
showRelativeDates: PropTypes.bool.isRequired,
|
|
||||||
shortDateFormat: PropTypes.string.isRequired,
|
|
||||||
longDateFormat: PropTypes.string.isRequired,
|
|
||||||
isSmallScreen: PropTypes.bool.isRequired,
|
|
||||||
timeFormat: PropTypes.string.isRequired,
|
|
||||||
selectedState: PropTypes.object.isRequired,
|
|
||||||
onSelectedChange: PropTypes.func.isRequired
|
|
||||||
};
|
|
||||||
|
|
||||||
export default CollectionOverviews;
|
|
||||||
@@ -1,25 +0,0 @@
|
|||||||
import { connect } from 'react-redux';
|
|
||||||
import { createSelector } from 'reselect';
|
|
||||||
import createDimensionsSelector from 'Store/Selectors/createDimensionsSelector';
|
|
||||||
import createUISettingsSelector from 'Store/Selectors/createUISettingsSelector';
|
|
||||||
import CollectionOverviews from './CollectionOverviews';
|
|
||||||
|
|
||||||
function createMapStateToProps() {
|
|
||||||
return createSelector(
|
|
||||||
(state) => state.movieCollections.overviewOptions,
|
|
||||||
createUISettingsSelector(),
|
|
||||||
createDimensionsSelector(),
|
|
||||||
(overviewOptions, uiSettings, dimensions) => {
|
|
||||||
return {
|
|
||||||
overviewOptions,
|
|
||||||
showRelativeDates: uiSettings.showRelativeDates,
|
|
||||||
shortDateFormat: uiSettings.shortDateFormat,
|
|
||||||
longDateFormat: uiSettings.longDateFormat,
|
|
||||||
timeFormat: uiSettings.timeFormat,
|
|
||||||
isSmallScreen: dimensions.isSmallScreen
|
|
||||||
};
|
|
||||||
}
|
|
||||||
);
|
|
||||||
}
|
|
||||||
|
|
||||||
export default connect(createMapStateToProps)(CollectionOverviews);
|
|
||||||
@@ -1,25 +0,0 @@
|
|||||||
import PropTypes from 'prop-types';
|
|
||||||
import React from 'react';
|
|
||||||
import Modal from 'Components/Modal/Modal';
|
|
||||||
import CollectionOverviewOptionsModalContentConnector from './CollectionOverviewOptionsModalContentConnector';
|
|
||||||
|
|
||||||
function CollectionOverviewOptionsModal({ isOpen, onModalClose, ...otherProps }) {
|
|
||||||
return (
|
|
||||||
<Modal
|
|
||||||
isOpen={isOpen}
|
|
||||||
onModalClose={onModalClose}
|
|
||||||
>
|
|
||||||
<CollectionOverviewOptionsModalContentConnector
|
|
||||||
{...otherProps}
|
|
||||||
onModalClose={onModalClose}
|
|
||||||
/>
|
|
||||||
</Modal>
|
|
||||||
);
|
|
||||||
}
|
|
||||||
|
|
||||||
CollectionOverviewOptionsModal.propTypes = {
|
|
||||||
isOpen: PropTypes.bool.isRequired,
|
|
||||||
onModalClose: PropTypes.func.isRequired
|
|
||||||
};
|
|
||||||
|
|
||||||
export default CollectionOverviewOptionsModal;
|
|
||||||
@@ -1,205 +0,0 @@
|
|||||||
import _ from 'lodash';
|
|
||||||
import PropTypes from 'prop-types';
|
|
||||||
import React, { Component } from 'react';
|
|
||||||
import Form from 'Components/Form/Form';
|
|
||||||
import FormGroup from 'Components/Form/FormGroup';
|
|
||||||
import FormInputGroup from 'Components/Form/FormInputGroup';
|
|
||||||
import FormLabel from 'Components/Form/FormLabel';
|
|
||||||
import Button from 'Components/Link/Button';
|
|
||||||
import ModalBody from 'Components/Modal/ModalBody';
|
|
||||||
import ModalContent from 'Components/Modal/ModalContent';
|
|
||||||
import ModalFooter from 'Components/Modal/ModalFooter';
|
|
||||||
import ModalHeader from 'Components/Modal/ModalHeader';
|
|
||||||
import { inputTypes } from 'Helpers/Props';
|
|
||||||
import translate from 'Utilities/String/translate';
|
|
||||||
|
|
||||||
const posterSizeOptions = [
|
|
||||||
{ key: 'small', value: translate('Small') },
|
|
||||||
{ key: 'medium', value: translate('Medium') },
|
|
||||||
{ key: 'large', value: translate('Large') }
|
|
||||||
];
|
|
||||||
|
|
||||||
class CollectionOverviewOptionsModalContent extends Component {
|
|
||||||
|
|
||||||
//
|
|
||||||
// Lifecycle
|
|
||||||
|
|
||||||
constructor(props, context) {
|
|
||||||
super(props, context);
|
|
||||||
|
|
||||||
this.state = {
|
|
||||||
detailedProgressBar: props.detailedProgressBar,
|
|
||||||
size: props.size,
|
|
||||||
showDetails: props.showDetails,
|
|
||||||
showOverview: props.showOverview,
|
|
||||||
showPosters: props.showPosters
|
|
||||||
};
|
|
||||||
}
|
|
||||||
|
|
||||||
componentDidUpdate(prevProps) {
|
|
||||||
const {
|
|
||||||
detailedProgressBar,
|
|
||||||
size,
|
|
||||||
showDetails,
|
|
||||||
showOverview,
|
|
||||||
showPosters
|
|
||||||
} = this.props;
|
|
||||||
|
|
||||||
const state = {};
|
|
||||||
|
|
||||||
if (detailedProgressBar !== prevProps.detailedProgressBar) {
|
|
||||||
state.detailedProgressBar = detailedProgressBar;
|
|
||||||
}
|
|
||||||
|
|
||||||
if (size !== prevProps.size) {
|
|
||||||
state.size = size;
|
|
||||||
}
|
|
||||||
|
|
||||||
if (showDetails !== prevProps.showDetails) {
|
|
||||||
state.showDetails = showDetails;
|
|
||||||
}
|
|
||||||
|
|
||||||
if (showOverview !== prevProps.showOverview) {
|
|
||||||
state.showOverview = showOverview;
|
|
||||||
}
|
|
||||||
|
|
||||||
if (showPosters !== prevProps.showPosters) {
|
|
||||||
state.showPosters = showPosters;
|
|
||||||
}
|
|
||||||
|
|
||||||
if (!_.isEmpty(state)) {
|
|
||||||
this.setState(state);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
//
|
|
||||||
// Listeners
|
|
||||||
|
|
||||||
onChangeOverviewOption = ({ name, value }) => {
|
|
||||||
this.setState({
|
|
||||||
[name]: value
|
|
||||||
}, () => {
|
|
||||||
this.props.onChangeOverviewOption({ [name]: value });
|
|
||||||
});
|
|
||||||
};
|
|
||||||
|
|
||||||
onChangeOption = ({ name, value }) => {
|
|
||||||
this.setState({
|
|
||||||
[name]: value
|
|
||||||
}, () => {
|
|
||||||
this.props.onChangeOption({
|
|
||||||
[name]: value
|
|
||||||
});
|
|
||||||
});
|
|
||||||
};
|
|
||||||
|
|
||||||
//
|
|
||||||
// Render
|
|
||||||
|
|
||||||
render() {
|
|
||||||
const {
|
|
||||||
onModalClose
|
|
||||||
} = this.props;
|
|
||||||
|
|
||||||
const {
|
|
||||||
size,
|
|
||||||
detailedProgressBar,
|
|
||||||
showDetails,
|
|
||||||
showPosters,
|
|
||||||
showOverview
|
|
||||||
} = this.state;
|
|
||||||
|
|
||||||
return (
|
|
||||||
<ModalContent onModalClose={onModalClose}>
|
|
||||||
<ModalHeader>
|
|
||||||
{translate('CollectionOptions')}
|
|
||||||
</ModalHeader>
|
|
||||||
|
|
||||||
<ModalBody>
|
|
||||||
<Form>
|
|
||||||
<FormGroup>
|
|
||||||
<FormLabel>{translate('PosterSize')}</FormLabel>
|
|
||||||
|
|
||||||
<FormInputGroup
|
|
||||||
type={inputTypes.SELECT}
|
|
||||||
name="size"
|
|
||||||
value={size}
|
|
||||||
values={posterSizeOptions}
|
|
||||||
onChange={this.onChangeOverviewOption}
|
|
||||||
/>
|
|
||||||
</FormGroup>
|
|
||||||
|
|
||||||
<FormGroup>
|
|
||||||
<FormLabel>{translate('DetailedProgressBar')}</FormLabel>
|
|
||||||
|
|
||||||
<FormInputGroup
|
|
||||||
type={inputTypes.CHECK}
|
|
||||||
name="detailedProgressBar"
|
|
||||||
value={detailedProgressBar}
|
|
||||||
helpText={translate('DetailedProgressBarHelpText')}
|
|
||||||
onChange={this.onChangeOverviewOption}
|
|
||||||
/>
|
|
||||||
</FormGroup>
|
|
||||||
|
|
||||||
<FormGroup>
|
|
||||||
<FormLabel>{translate('ShowCollectionDetails')}</FormLabel>
|
|
||||||
|
|
||||||
<FormInputGroup
|
|
||||||
type={inputTypes.CHECK}
|
|
||||||
name="showDetails"
|
|
||||||
value={showDetails}
|
|
||||||
helpText={translate('CollectionShowDetailsHelpText')}
|
|
||||||
onChange={this.onChangeOverviewOption}
|
|
||||||
/>
|
|
||||||
</FormGroup>
|
|
||||||
|
|
||||||
<FormGroup>
|
|
||||||
<FormLabel>{translate('ShowOverview')}</FormLabel>
|
|
||||||
|
|
||||||
<FormInputGroup
|
|
||||||
type={inputTypes.CHECK}
|
|
||||||
name="showOverview"
|
|
||||||
value={showOverview}
|
|
||||||
helpText={translate('CollectionShowOverviewsHelpText')}
|
|
||||||
onChange={this.onChangeOverviewOption}
|
|
||||||
/>
|
|
||||||
</FormGroup>
|
|
||||||
|
|
||||||
<FormGroup>
|
|
||||||
<FormLabel>{translate('ShowPosters')}</FormLabel>
|
|
||||||
|
|
||||||
<FormInputGroup
|
|
||||||
type={inputTypes.CHECK}
|
|
||||||
name="showPosters"
|
|
||||||
value={showPosters}
|
|
||||||
helpText={translate('CollectionShowPostersHelpText')}
|
|
||||||
onChange={this.onChangeOverviewOption}
|
|
||||||
/>
|
|
||||||
</FormGroup>
|
|
||||||
</Form>
|
|
||||||
</ModalBody>
|
|
||||||
|
|
||||||
<ModalFooter>
|
|
||||||
<Button
|
|
||||||
onPress={onModalClose}
|
|
||||||
>
|
|
||||||
{translate('Close')}
|
|
||||||
</Button>
|
|
||||||
</ModalFooter>
|
|
||||||
</ModalContent>
|
|
||||||
);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
CollectionOverviewOptionsModalContent.propTypes = {
|
|
||||||
detailedProgressBar: PropTypes.bool.isRequired,
|
|
||||||
size: PropTypes.string.isRequired,
|
|
||||||
showDetails: PropTypes.bool.isRequired,
|
|
||||||
showOverview: PropTypes.bool.isRequired,
|
|
||||||
showPosters: PropTypes.bool.isRequired,
|
|
||||||
onChangeOverviewOption: PropTypes.func.isRequired,
|
|
||||||
onChangeOption: PropTypes.func.isRequired,
|
|
||||||
onModalClose: PropTypes.func.isRequired
|
|
||||||
};
|
|
||||||
|
|
||||||
export default CollectionOverviewOptionsModalContent;
|
|
||||||
@@ -1,29 +0,0 @@
|
|||||||
import { connect } from 'react-redux';
|
|
||||||
import { createSelector } from 'reselect';
|
|
||||||
import { setMovieCollectionsOption, setMovieCollectionsOverviewOption } from 'Store/Actions/movieCollectionActions';
|
|
||||||
import CollectionOverviewOptionsModalContent from './CollectionOverviewOptionsModalContent';
|
|
||||||
|
|
||||||
function createMapStateToProps() {
|
|
||||||
return createSelector(
|
|
||||||
(state) => state.movieCollections,
|
|
||||||
(movieCollections) => {
|
|
||||||
return {
|
|
||||||
...movieCollections.options,
|
|
||||||
...movieCollections.overviewOptions
|
|
||||||
};
|
|
||||||
}
|
|
||||||
);
|
|
||||||
}
|
|
||||||
|
|
||||||
function createMapDispatchToProps(dispatch, props) {
|
|
||||||
return {
|
|
||||||
onChangeOverviewOption(payload) {
|
|
||||||
dispatch(setMovieCollectionsOverviewOption(payload));
|
|
||||||
},
|
|
||||||
onChangeOption(payload) {
|
|
||||||
dispatch(setMovieCollectionsOption(payload));
|
|
||||||
}
|
|
||||||
};
|
|
||||||
}
|
|
||||||
|
|
||||||
export default connect(createMapStateToProps, createMapDispatchToProps)(CollectionOverviewOptionsModalContent);
|
|
||||||
@@ -10,12 +10,10 @@ export const DOWNLOADED_MOVIES_SCAN = 'DownloadedMoviesScan';
|
|||||||
export const INTERACTIVE_IMPORT = 'ManualImport';
|
export const INTERACTIVE_IMPORT = 'ManualImport';
|
||||||
export const MISSING_MOVIES_SEARCH = 'MissingMoviesSearch';
|
export const MISSING_MOVIES_SEARCH = 'MissingMoviesSearch';
|
||||||
export const MOVE_MOVIE = 'MoveMovie';
|
export const MOVE_MOVIE = 'MoveMovie';
|
||||||
export const REFRESH_COLLECTIONS = 'RefreshCollections';
|
|
||||||
export const REFRESH_MOVIE = 'RefreshMovie';
|
export const REFRESH_MOVIE = 'RefreshMovie';
|
||||||
export const RENAME_FILES = 'RenameFiles';
|
export const RENAME_FILES = 'RenameFiles';
|
||||||
export const RENAME_MOVIE = 'RenameMovie';
|
export const RENAME_MOVIE = 'RenameMovie';
|
||||||
export const RESET_API_KEY = 'ResetApiKey';
|
export const RESET_API_KEY = 'ResetApiKey';
|
||||||
export const RESET_QUALITY_DEFINITIONS = 'ResetQualityDefinitions';
|
|
||||||
export const RSS_SYNC = 'RssSync';
|
export const RSS_SYNC = 'RssSync';
|
||||||
export const MOVIE_SEARCH = 'MoviesSearch';
|
export const MOVIE_SEARCH = 'MoviesSearch';
|
||||||
export const IMPORT_LIST_SYNC = 'ImportListSync';
|
export const IMPORT_LIST_SYNC = 'ImportListSync';
|
||||||
|
|||||||
@@ -7,25 +7,25 @@
|
|||||||
}
|
}
|
||||||
|
|
||||||
.danger {
|
.danger {
|
||||||
border-color: var(--alertDangerBorderColor);
|
border-color: $alertDangerBorderColor;
|
||||||
background-color: var(--alertDangerBackgroundColor);
|
background-color: $alertDangerBackgroundColor;
|
||||||
color: var(--alertDangerColor);
|
color: $alertDangerColor;
|
||||||
}
|
}
|
||||||
|
|
||||||
.info {
|
.info {
|
||||||
border-color: var(--alertInfoBorderColor);
|
border-color: $alertInfoBorderColor;
|
||||||
background-color: var(--alertInfoBackgroundColor);
|
background-color: $alertInfoBackgroundColor;
|
||||||
color: var(--alertInfoColor);
|
color: $alertInfoColor;
|
||||||
}
|
}
|
||||||
|
|
||||||
.success {
|
.success {
|
||||||
border-color: var(--alertSuccessBorderColor);
|
border-color: $alertSuccessBorderColor;
|
||||||
background-color: var(--alertSuccessBackgroundColor);
|
background-color: $alertSuccessBackgroundColor;
|
||||||
color: var(--alertSuccessColor);
|
color: $alertSuccessColor;
|
||||||
}
|
}
|
||||||
|
|
||||||
.warning {
|
.warning {
|
||||||
border-color: var(--alertWarningBorderColor);
|
border-color: $alertWarningBorderColor;
|
||||||
background-color: var(--alertWarningBackgroundColor);
|
background-color: $alertWarningBackgroundColor;
|
||||||
color: var(--alertWarningColor);
|
color: $alertWarningColor;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -3,9 +3,9 @@
|
|||||||
margin: 10px;
|
margin: 10px;
|
||||||
padding: 10px;
|
padding: 10px;
|
||||||
border-radius: 3px;
|
border-radius: 3px;
|
||||||
background-color: var(--cardBackgroundColor);
|
background-color: $white;
|
||||||
box-shadow: 0 0 10px 1px var(--cardShadowColor);
|
box-shadow: 0 0 10px 1px $cardShadowColor;
|
||||||
color: var(--defaultColor);
|
color: $defaultColor;
|
||||||
}
|
}
|
||||||
|
|
||||||
.underlay {
|
.underlay {
|
||||||
|
|||||||
@@ -1,5 +1,6 @@
|
|||||||
import PropTypes from 'prop-types';
|
import PropTypes from 'prop-types';
|
||||||
import React, { Component } from 'react';
|
import React, { Component } from 'react';
|
||||||
|
import colors from 'Styles/Variables/colors';
|
||||||
import styles from './CircularProgressBar.css';
|
import styles from './CircularProgressBar.css';
|
||||||
|
|
||||||
class CircularProgressBar extends Component {
|
class CircularProgressBar extends Component {
|
||||||
@@ -131,7 +132,7 @@ CircularProgressBar.defaultProps = {
|
|||||||
containerClassName: styles.circularProgressBarContainer,
|
containerClassName: styles.circularProgressBarContainer,
|
||||||
size: 60,
|
size: 60,
|
||||||
strokeWidth: 5,
|
strokeWidth: 5,
|
||||||
strokeColor: '#ffc230',
|
strokeColor: colors.radarrYellow,
|
||||||
showProgressText: false
|
showProgressText: false
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|||||||
@@ -13,7 +13,7 @@
|
|||||||
width: 100%;
|
width: 100%;
|
||||||
border: 0;
|
border: 0;
|
||||||
border-bottom: 1px solid #e5e5e5;
|
border-bottom: 1px solid #e5e5e5;
|
||||||
color: var(--textColor);
|
color: #3a3f51;
|
||||||
font-size: 21px;
|
font-size: 21px;
|
||||||
line-height: inherit;
|
line-height: inherit;
|
||||||
|
|
||||||
|
|||||||
@@ -13,7 +13,7 @@
|
|||||||
}
|
}
|
||||||
|
|
||||||
.faqLink {
|
.faqLink {
|
||||||
color: var(--alertWarningColor);
|
color: $alertWarningColor;
|
||||||
font-weight: bold;
|
font-weight: bold;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -3,7 +3,7 @@
|
|||||||
margin-bottom: 5px;
|
margin-bottom: 5px;
|
||||||
|
|
||||||
&:hover {
|
&:hover {
|
||||||
background-color: var(--tableRowHoverBackgroundColor);
|
background-color: $tableRowHoverBackgroundColor;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -17,5 +17,5 @@
|
|||||||
|
|
||||||
.or {
|
.or {
|
||||||
margin: 0 3px;
|
margin: 0 3px;
|
||||||
color: var(--themeDarkColor);
|
color: $themeDarkColor;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -4,7 +4,7 @@
|
|||||||
padding: 5px;
|
padding: 5px;
|
||||||
|
|
||||||
&:hover {
|
&:hover {
|
||||||
background-color: var(--tableRowHoverBackgroundColor);
|
background-color: $tableRowHoverBackgroundColor;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -27,10 +27,10 @@
|
|||||||
overflow-y: auto;
|
overflow-y: auto;
|
||||||
max-height: 200px;
|
max-height: 200px;
|
||||||
width: 100%;
|
width: 100%;
|
||||||
border: 1px solid var(--inputBorderColor);
|
border: 1px solid $inputBorderColor;
|
||||||
border-radius: 4px;
|
border-radius: 4px;
|
||||||
background-color: var(--inputBackgroundColor);
|
background-color: $white;
|
||||||
box-shadow: inset 0 1px 1px var(--inputBoxShadowColor);
|
box-shadow: inset 0 1px 1px $inputBoxShadowColor;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -46,5 +46,5 @@
|
|||||||
}
|
}
|
||||||
|
|
||||||
.suggestionHighlighted {
|
.suggestionHighlighted {
|
||||||
background-color: var(--menuItemHoverBackgroundColor);
|
background-color: $menuItemHoverBackgroundColor;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -32,21 +32,21 @@
|
|||||||
height: 20px;
|
height: 20px;
|
||||||
border: 1px solid #ccc;
|
border: 1px solid #ccc;
|
||||||
border-radius: 2px;
|
border-radius: 2px;
|
||||||
background-color: var(--white);
|
background-color: $white;
|
||||||
color: var(--white);
|
color: $white;
|
||||||
text-align: center;
|
text-align: center;
|
||||||
line-height: 20px;
|
line-height: 20px;
|
||||||
}
|
}
|
||||||
|
|
||||||
.checkbox:focus + .input {
|
.checkbox:focus + .input {
|
||||||
outline: 0;
|
outline: 0;
|
||||||
border-color: var(--inputFocusBorderColor);
|
border-color: $inputFocusBorderColor;
|
||||||
box-shadow: inset 0 1px 1px var(--inputBoxShadowColor), 0 0 8px var(--inputFocusBoxShadowColor);
|
box-shadow: inset 0 1px 1px $inputBoxShadowColor, 0 0 8px $inputFocusBoxShadowColor;
|
||||||
}
|
}
|
||||||
|
|
||||||
.dangerIsChecked {
|
.dangerIsChecked {
|
||||||
border-color: var(--dangerColor);
|
border-color: $dangerColor;
|
||||||
background-color: var(--dangerColor);
|
background-color: $dangerColor;
|
||||||
|
|
||||||
&.isDisabled {
|
&.isDisabled {
|
||||||
opacity: 0.7;
|
opacity: 0.7;
|
||||||
@@ -54,8 +54,8 @@
|
|||||||
}
|
}
|
||||||
|
|
||||||
.primaryIsChecked {
|
.primaryIsChecked {
|
||||||
border-color: var(--primaryColor);
|
border-color: $primaryColor;
|
||||||
background-color: var(--primaryColor);
|
background-color: $primaryColor;
|
||||||
|
|
||||||
&.isDisabled {
|
&.isDisabled {
|
||||||
opacity: 0.7;
|
opacity: 0.7;
|
||||||
@@ -63,8 +63,8 @@
|
|||||||
}
|
}
|
||||||
|
|
||||||
.successIsChecked {
|
.successIsChecked {
|
||||||
border-color: var(--successColor);
|
border-color: $successColor;
|
||||||
background-color: var(--successColor);
|
background-color: $successColor;
|
||||||
|
|
||||||
&.isDisabled {
|
&.isDisabled {
|
||||||
opacity: 0.7;
|
opacity: 0.7;
|
||||||
@@ -72,8 +72,8 @@
|
|||||||
}
|
}
|
||||||
|
|
||||||
.warningIsChecked {
|
.warningIsChecked {
|
||||||
border-color: var(--warningColor);
|
border-color: $warningColor;
|
||||||
background-color: var(--warningColor);
|
background-color: $warningColor;
|
||||||
|
|
||||||
&.isDisabled {
|
&.isDisabled {
|
||||||
opacity: 0.7;
|
opacity: 0.7;
|
||||||
@@ -82,15 +82,15 @@
|
|||||||
|
|
||||||
.isNotChecked {
|
.isNotChecked {
|
||||||
&.isDisabled {
|
&.isDisabled {
|
||||||
border-color: var(--disabledCheckInputColor);
|
border-color: $disabledCheckInputColor;
|
||||||
background-color: var(--disabledCheckInputColor);
|
background-color: $disabledCheckInputColor;
|
||||||
opacity: 0.7;
|
opacity: 0.7;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
.isIndeterminate {
|
.isIndeterminate {
|
||||||
border-color: var(--gray);
|
border-color: $gray;
|
||||||
background-color: var(--gray);
|
background-color: $gray;
|
||||||
}
|
}
|
||||||
|
|
||||||
.helpText {
|
.helpText {
|
||||||
|
|||||||
@@ -39,7 +39,7 @@
|
|||||||
.dropdownArrowContainerDisabled {
|
.dropdownArrowContainerDisabled {
|
||||||
composes: dropdownArrowContainer;
|
composes: dropdownArrowContainer;
|
||||||
|
|
||||||
color: var(--disabledInputColor);
|
color: $disabledInputColor;
|
||||||
}
|
}
|
||||||
|
|
||||||
.optionsContainer {
|
.optionsContainer {
|
||||||
@@ -50,9 +50,9 @@
|
|||||||
.options {
|
.options {
|
||||||
composes: scroller from '~Components/Scroller/Scroller.css';
|
composes: scroller from '~Components/Scroller/Scroller.css';
|
||||||
|
|
||||||
border: 1px solid var(--inputBorderColor);
|
border: 1px solid $inputBorderColor;
|
||||||
border-radius: 4px;
|
border-radius: 4px;
|
||||||
background-color: var(--inputBackgroundColor);
|
background-color: $white;
|
||||||
}
|
}
|
||||||
|
|
||||||
.optionsModal {
|
.optionsModal {
|
||||||
@@ -76,9 +76,9 @@
|
|||||||
.optionsModalScroller {
|
.optionsModalScroller {
|
||||||
composes: scroller from '~Components/Scroller/Scroller.css';
|
composes: scroller from '~Components/Scroller/Scroller.css';
|
||||||
|
|
||||||
border: 1px solid var(--inputBorderColor);
|
border: 1px solid $inputBorderColor;
|
||||||
border-radius: 4px;
|
border-radius: 4px;
|
||||||
background-color: var(--inputBackgroundColor);
|
background-color: $white;
|
||||||
}
|
}
|
||||||
|
|
||||||
.loading {
|
.loading {
|
||||||
@@ -90,7 +90,7 @@
|
|||||||
display: flex;
|
display: flex;
|
||||||
justify-content: flex-end;
|
justify-content: flex-end;
|
||||||
height: 40px;
|
height: 40px;
|
||||||
border-bottom: 1px solid var(--borderColor);
|
border-bottom: 1px solid $borderColor;
|
||||||
}
|
}
|
||||||
|
|
||||||
.mobileCloseButton {
|
.mobileCloseButton {
|
||||||
@@ -100,6 +100,6 @@
|
|||||||
line-height: 40px;
|
line-height: 40px;
|
||||||
|
|
||||||
&:hover {
|
&:hover {
|
||||||
color: var(--modalCloseButtonHoverColor);
|
color: $modalCloseButtonHoverColor;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -113,12 +113,10 @@ class EnhancedSelectInput extends Component {
|
|||||||
this._scheduleUpdate();
|
this._scheduleUpdate();
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!Array.isArray(this.props.value)) {
|
if (!Array.isArray(this.props.value) && prevProps.value !== this.props.value) {
|
||||||
if (prevProps.value !== this.props.value || prevProps.values !== this.props.values) {
|
this.setState({
|
||||||
this.setState({
|
selectedIndex: getSelectedIndex(this.props)
|
||||||
selectedIndex: getSelectedIndex(this.props)
|
});
|
||||||
});
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -334,11 +332,6 @@ class EnhancedSelectInput extends Component {
|
|||||||
|
|
||||||
const isMultiSelect = Array.isArray(value);
|
const isMultiSelect = Array.isArray(value);
|
||||||
const selectedOption = getSelectedOption(selectedIndex, values);
|
const selectedOption = getSelectedOption(selectedIndex, values);
|
||||||
let selectedValue = value;
|
|
||||||
|
|
||||||
if (!values.length) {
|
|
||||||
selectedValue = isMultiSelect ? [] : '';
|
|
||||||
}
|
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<div>
|
<div>
|
||||||
@@ -379,17 +372,15 @@ class EnhancedSelectInput extends Component {
|
|||||||
onPress={this.onPress}
|
onPress={this.onPress}
|
||||||
>
|
>
|
||||||
{
|
{
|
||||||
isFetching ?
|
isFetching &&
|
||||||
<LoadingIndicator
|
<LoadingIndicator
|
||||||
className={styles.loading}
|
className={styles.loading}
|
||||||
size={20}
|
size={20}
|
||||||
/> :
|
/>
|
||||||
null
|
|
||||||
}
|
}
|
||||||
|
|
||||||
{
|
{
|
||||||
isFetching ?
|
!isFetching &&
|
||||||
null :
|
|
||||||
<Icon
|
<Icon
|
||||||
name={icons.CARET_DOWN}
|
name={icons.CARET_DOWN}
|
||||||
/>
|
/>
|
||||||
@@ -409,7 +400,7 @@ class EnhancedSelectInput extends Component {
|
|||||||
onPress={this.onPress}
|
onPress={this.onPress}
|
||||||
>
|
>
|
||||||
<SelectedValueComponent
|
<SelectedValueComponent
|
||||||
value={selectedValue}
|
value={value}
|
||||||
values={values}
|
values={values}
|
||||||
{...selectedValueOptions}
|
{...selectedValueOptions}
|
||||||
{...selectedOption}
|
{...selectedOption}
|
||||||
@@ -427,17 +418,15 @@ class EnhancedSelectInput extends Component {
|
|||||||
>
|
>
|
||||||
|
|
||||||
{
|
{
|
||||||
isFetching ?
|
isFetching &&
|
||||||
<LoadingIndicator
|
<LoadingIndicator
|
||||||
className={styles.loading}
|
className={styles.loading}
|
||||||
size={20}
|
size={20}
|
||||||
/> :
|
/>
|
||||||
null
|
|
||||||
}
|
}
|
||||||
|
|
||||||
{
|
{
|
||||||
isFetching ?
|
!isFetching &&
|
||||||
null :
|
|
||||||
<Icon
|
<Icon
|
||||||
name={icons.CARET_DOWN}
|
name={icons.CARET_DOWN}
|
||||||
/>
|
/>
|
||||||
@@ -517,7 +506,7 @@ class EnhancedSelectInput extends Component {
|
|||||||
</Manager>
|
</Manager>
|
||||||
|
|
||||||
{
|
{
|
||||||
isMobile ?
|
isMobile &&
|
||||||
<Modal
|
<Modal
|
||||||
className={styles.optionsModal}
|
className={styles.optionsModal}
|
||||||
size={sizes.EXTRA_SMALL}
|
size={sizes.EXTRA_SMALL}
|
||||||
@@ -568,8 +557,7 @@ class EnhancedSelectInput extends Component {
|
|||||||
}
|
}
|
||||||
</Scroller>
|
</Scroller>
|
||||||
</ModalBody>
|
</ModalBody>
|
||||||
</Modal> :
|
</Modal>
|
||||||
null
|
|
||||||
}
|
}
|
||||||
</div>
|
</div>
|
||||||
);
|
);
|
||||||
|
|||||||
@@ -7,7 +7,7 @@
|
|||||||
cursor: default;
|
cursor: default;
|
||||||
|
|
||||||
&:hover {
|
&:hover {
|
||||||
background-color: var(--inputHoverBackgroundColor);
|
background-color: #f8f8f8;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -24,17 +24,17 @@
|
|||||||
}
|
}
|
||||||
|
|
||||||
.isSelected {
|
.isSelected {
|
||||||
background-color: var(--inputSelectedBackgroundColor);
|
background-color: #e2e2e2;
|
||||||
|
|
||||||
&:hover {
|
&:hover {
|
||||||
background-color: var(--inputSelectedBackgroundColor);
|
background-color: #e2e2e2;
|
||||||
}
|
}
|
||||||
|
|
||||||
&.isMobile {
|
&.isMobile {
|
||||||
background-color: inherit;
|
background-color: inherit;
|
||||||
|
|
||||||
.iconContainer {
|
.iconContainer {
|
||||||
color: var(--primaryColor);
|
color: $primaryColor;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -49,7 +49,7 @@
|
|||||||
|
|
||||||
.isMobile {
|
.isMobile {
|
||||||
height: 50px;
|
height: 50px;
|
||||||
border-bottom: 1px solid var(--borderColor);
|
border-bottom: 1px solid $borderColor;
|
||||||
|
|
||||||
&:last-child {
|
&:last-child {
|
||||||
border: none;
|
border: none;
|
||||||
|
|||||||
@@ -3,5 +3,5 @@
|
|||||||
}
|
}
|
||||||
|
|
||||||
.isDisabled {
|
.isDisabled {
|
||||||
color: var(--disabledInputColor);
|
color: $disabledInputColor;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -40,7 +40,7 @@
|
|||||||
}
|
}
|
||||||
|
|
||||||
.pendingChangesIcon {
|
.pendingChangesIcon {
|
||||||
color: var(--warningColor);
|
color: $warningColor;
|
||||||
font-size: 20px;
|
font-size: 20px;
|
||||||
line-height: 35px;
|
line-height: 35px;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,14 +1,14 @@
|
|||||||
.helpText {
|
.helpText {
|
||||||
margin-top: 5px;
|
margin-top: 5px;
|
||||||
color: var(--helpTextColor);
|
color: $helpTextColor;
|
||||||
line-height: 20px;
|
line-height: 20px;
|
||||||
}
|
}
|
||||||
|
|
||||||
.isError {
|
.isError {
|
||||||
color: var(--dangerColor);
|
color: $dangerColor;
|
||||||
|
|
||||||
.link {
|
.link {
|
||||||
color: var(--dangerColor);
|
color: $dangerColor;
|
||||||
|
|
||||||
&:hover {
|
&:hover {
|
||||||
color: #e01313;
|
color: #e01313;
|
||||||
@@ -17,10 +17,10 @@
|
|||||||
}
|
}
|
||||||
|
|
||||||
.isWarning {
|
.isWarning {
|
||||||
color: var(--warningColor);
|
color: $warningColor;
|
||||||
|
|
||||||
.link {
|
.link {
|
||||||
color: var(--warningColor);
|
color: $warningColor;
|
||||||
|
|
||||||
&:hover {
|
&:hover {
|
||||||
color: #e36c00;
|
color: #e36c00;
|
||||||
|
|||||||
@@ -7,11 +7,11 @@
|
|||||||
}
|
}
|
||||||
|
|
||||||
.hasError {
|
.hasError {
|
||||||
color: var(--dangerColor);
|
color: $dangerColor;
|
||||||
}
|
}
|
||||||
|
|
||||||
.isAdvanced {
|
.isAdvanced {
|
||||||
color: var(--advancedFormLabelColor);
|
color: $advancedFormLabelColor;
|
||||||
}
|
}
|
||||||
|
|
||||||
@media only screen and (max-width: $breakpointLarge) {
|
@media only screen and (max-width: $breakpointLarge) {
|
||||||
|
|||||||
@@ -18,11 +18,11 @@
|
|||||||
@add-mixin truncate;
|
@add-mixin truncate;
|
||||||
|
|
||||||
margin-left: 15px;
|
margin-left: 15px;
|
||||||
color: var(--darkGray);
|
color: $darkGray;
|
||||||
font-size: $smallFontSize;
|
font-size: $smallFontSize;
|
||||||
}
|
}
|
||||||
|
|
||||||
.divider {
|
.divider {
|
||||||
border: none;
|
border: none;
|
||||||
border-bottom: 1px solid var(--lightGray);
|
border-bottom: 1px solid $lightGray;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -18,7 +18,7 @@
|
|||||||
|
|
||||||
flex: 1 10 0;
|
flex: 1 10 0;
|
||||||
margin-left: 15px;
|
margin-left: 15px;
|
||||||
color: var(--gray);
|
color: $gray;
|
||||||
text-align: right;
|
text-align: right;
|
||||||
font-size: $smallFontSize;
|
font-size: $smallFontSize;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -24,7 +24,7 @@ function HintedSelectInputSelectedValue(props) {
|
|||||||
>
|
>
|
||||||
<div className={styles.valueText}>
|
<div className={styles.valueText}>
|
||||||
{
|
{
|
||||||
isMultiSelect ?
|
isMultiSelect &&
|
||||||
value.map((key, index) => {
|
value.map((key, index) => {
|
||||||
const v = valuesMap[key];
|
const v = valuesMap[key];
|
||||||
return (
|
return (
|
||||||
@@ -32,28 +32,26 @@ function HintedSelectInputSelectedValue(props) {
|
|||||||
{v ? v.value : key}
|
{v ? v.value : key}
|
||||||
</Label>
|
</Label>
|
||||||
);
|
);
|
||||||
}) :
|
})
|
||||||
null
|
|
||||||
}
|
}
|
||||||
|
|
||||||
{
|
{
|
||||||
isMultiSelect ? null : value
|
!isMultiSelect && value
|
||||||
}
|
}
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
{
|
{
|
||||||
hint != null && includeHint ?
|
hint != null && includeHint &&
|
||||||
<div className={styles.hintText}>
|
<div className={styles.hintText}>
|
||||||
{hint}
|
{hint}
|
||||||
</div> :
|
</div>
|
||||||
null
|
|
||||||
}
|
}
|
||||||
</EnhancedSelectInputSelectedValue>
|
</EnhancedSelectInputSelectedValue>
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
HintedSelectInputSelectedValue.propTypes = {
|
HintedSelectInputSelectedValue.propTypes = {
|
||||||
value: PropTypes.oneOfType([PropTypes.number, PropTypes.string, PropTypes.arrayOf(PropTypes.oneOfType([PropTypes.string, PropTypes.number]))]).isRequired,
|
value: PropTypes.oneOfType([PropTypes.string, PropTypes.arrayOf(PropTypes.oneOfType([PropTypes.string, PropTypes.number]))]).isRequired,
|
||||||
values: PropTypes.arrayOf(PropTypes.object).isRequired,
|
values: PropTypes.arrayOf(PropTypes.object).isRequired,
|
||||||
hint: PropTypes.string,
|
hint: PropTypes.string,
|
||||||
isMultiSelect: PropTypes.bool.isRequired,
|
isMultiSelect: PropTypes.bool.isRequired,
|
||||||
|
|||||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user