Compare commits

..

1 Commits

Author SHA1 Message Date
Qstick
70bc943c17 Fixed: Correctly combine HttpUri paths with dot segment 2023-01-10 21:45:43 -06:00
1150 changed files with 12009 additions and 23018 deletions

View File

@@ -40,9 +40,6 @@ csharp_style_var_for_built_in_types = true:suggestion
csharp_style_var_when_type_is_apparent = true:suggestion
csharp_style_var_elsewhere = true:suggestion
# Using directive is unnecessary.
dotnet_diagnostic.IDE0005.severity = error
# Stylecop Rules
dotnet_diagnostic.SA0001.severity = none
dotnet_diagnostic.SA1005.severity = none

9
.esprintrc Normal file
View File

@@ -0,0 +1,9 @@
{
"paths": [
"frontend/src/**/*.js"
],
"ignored": [
"**/node_modules/**/*"
],
"port": 5004
}

View File

@@ -73,10 +73,3 @@ body:
Additionally, any additional info? Screenshots? References? Anything that will give us more context about the issue you are encountering!
validations:
required: true
- type: checkboxes
attributes:
label: Trace Logs have been provided as applicable. Reports may be closed if the required logs are not provided.
description: Trace logs are generally required for all bug reports
options:
- label: I have followed the steps in the wiki link above and provided the required trace logs that are relevant and show this issue.
required: true

28
.github/labeler.yml vendored
View File

@@ -1,28 +0,0 @@
'Area: API':
- src/Readarr.Api.V1/**/*
'Area: Db-migration':
- src/NzbDrone.Core/Datastore/Migration/*
'Area: Download Clients':
- src/NzbDrone.Core/Download/Clients/**/*
'Area: Import Lists':
- src/NzbDrone.Core/ImportLists/**/*
'Area: Indexer':
- src/NzbDrone.Core/Indexers/**/*
'Area: Notifications':
- src/NzbDrone.Core/Notifications/**/*
'Area: Organizer':
- src/NzbDrone.Core/Organizer/**/*
'Area: Parser':
- src/NzbDrone.Core/Parser/**/*
'Area: UI':
- frontend/**/*
- package.json
- yarn.lock

41
.github/workflows/azuresync.yml vendored Normal file
View 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\\Readarr"
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\\Readarr"
ado_wit: "User Story"
ado_new_state: "New"
ado_active_state: "Active"
ado_close_state: "Closed"
ado_bypassrules: true
log_level: 100

View File

@@ -1,12 +0,0 @@
name: "Pull Request Labeler"
on:
- pull_request_target
jobs:
triage:
permissions:
contents: read
pull-requests: write
runs-on: ubuntu-latest
steps:
- uses: actions/labeler@v4

View File

@@ -9,13 +9,13 @@ jobs:
lock:
runs-on: ubuntu-latest
steps:
- uses: dessant/lock-threads@v4
- uses: dessant/lock-threads@v2
with:
github-token: ${{ github.token }}
issue-inactive-days: '90'
exclude-issue-created-before: ''
exclude-any-issue-labels: ''
add-issue-labels: ''
issue-comment: ''
issue-lock-inactive-days: '90'
issue-exclude-created-before: ''
issue-exclude-labels: ''
issue-lock-labels: ''
issue-lock-comment: ''
issue-lock-reason: 'resolved'
process-only: ''

View File

@@ -8,7 +8,7 @@ jobs:
support:
runs-on: ubuntu-latest
steps:
- uses: dessant/support-requests@v3
- uses: dessant/support-requests@v2
with:
github-token: ${{ github.token }}
support-label: 'Type: Support'
@@ -18,15 +18,4 @@ jobs:
to be a support request. Please hop over onto our [Discord](https://readarr.com/discord)
or [Subreddit](https://reddit.com/r/readarr)
close-issue: true
lock-issue: false
- uses: dessant/support-requests@v3
with:
github-token: ${{ github.token }}
support-label: 'Status: Logs Needed'
issue-comment: >
:wave: @{issue-author}, In order to help you further we'll need to see logs.
You'll need to enable trace logging and replicate the problem that you encountered.
Guidance on how to enable trace logging can be found in
our [troubleshooting guide](https://wiki.servarr.com/readarr/troubleshooting#logging-and-log-files).
close-issue: false
lock-issue: false
lock-issue: false

3
.gitignore vendored
View File

@@ -148,6 +148,3 @@ _temp_*/**/*
## Merge any idea folder
*/**/.idea
*.iml
# API doc generation
.config/

View File

@@ -9,14 +9,13 @@ variables:
testsFolder: './_tests'
yarnCacheFolder: $(Pipeline.Workspace)/.yarn
nugetCacheFolder: $(Pipeline.Workspace)/.nuget/packages
majorVersion: '0.1.5'
majorVersion: '0.1.1'
minorVersion: $[counter('minorVersion', 1)]
readarrVersion: '$(majorVersion).$(minorVersion)'
buildName: '$(Build.SourceBranchName).$(readarrVersion)'
sentryOrg: 'servarr'
sentryUrl: 'https://sentry.servarr.com'
dotnetVersion: '6.0.408'
nodeVersion: '16.X'
dotnetVersion: '6.0.302'
innoVersion: '6.2.0'
windowsImage: 'windows-2022'
linuxImage: 'ubuntu-20.04'
@@ -183,7 +182,7 @@ stages:
- task: NodeTool@0
displayName: Set Node.js version
inputs:
versionSpec: $(nodeVersion)
versionSpec: '12.x'
- checkout: self
submodules: true
fetchDepth: 1
@@ -918,7 +917,7 @@ stages:
- task: NodeTool@0
displayName: Set Node.js version
inputs:
versionSpec: $(nodeVersion)
versionSpec: '12.x'
- checkout: self
submodules: true
fetchDepth: 1
@@ -956,55 +955,6 @@ stages:
cliProjectVersion: '$(readarrVersion)'
cliSources: './frontend'
- task: SonarCloudAnalyze@1
- job: Api_Docs
displayName: API Docs
condition: |
and(succeeded(), eq(variables['Build.SourceBranch'], 'refs/heads/develop'))
pool:
vmImage: ${{ variables.windowsImage }}
steps:
- task: UseDotNet@2
displayName: 'Install .net core'
inputs:
version: $(dotnetVersion)
- checkout: self
submodules: true
persistCredentials: true
fetchDepth: 1
- bash: ./docs.sh Windows
displayName: Create openapi.json
- bash: |
git config --global user.email "development@lidarr.audio"
git config --global user.name "Servarr"
git checkout -b api-docs
git add .
git status
if git status | grep modified
then
git commit -am 'Automated API Docs update'
git push -f --set-upstream origin api-docs
curl -X POST -H "Authorization: token ${GITHUBTOKEN}" -H "Accept: application/vnd.github.v3+json" https://api.github.com/repos/readarr/readarr/pulls -d '{"head":"api-docs","base":"develop","title":"Update API docs"}'
else
echo "No changes since last run"
fi
displayName: Commit API Doc Change
continueOnError: true
env:
GITHUBTOKEN: $(githubToken)
- task: CopyFiles@2
displayName: 'Copy openapi.json to: $(Build.ArtifactStagingDirectory)'
inputs:
SourceFolder: '$(Build.SourcesDirectory)'
Contents: |
**/*openapi.json
TargetFolder: '$(Build.ArtifactStagingDirectory)/api_docs'
- publish: $(Build.ArtifactStagingDirectory)/api_docs
artifact: 'APIDocs'
displayName: Publish API Docs Bundle
condition: and(succeeded(), eq(variables['System.JobAttempt'], '1'))
- job: Analyze_Backend
displayName: Backend

38
docs.sh
View File

@@ -1,38 +0,0 @@
PLATFORM=$1
if [ "$PLATFORM" = "Windows" ]; then
RUNTIME="win-x64"
elif [ "$PLATFORM" = "Linux" ]; then
RUNTIME="linux-x64"
elif [ "$PLATFORM" = "Mac" ]; then
RUNTIME="osx-x64"
else
echo "Platform must be provided as first arguement: Windows, Linux or Mac"
exit 1
fi
outputFolder='_output'
testPackageFolder='_tests'
rm -rf $outputFolder
rm -rf $testPackageFolder
slnFile=src/Readarr.sln
platform=Posix
dotnet clean $slnFile -c Debug
dotnet clean $slnFile -c Release
dotnet msbuild -restore $slnFile -p:Configuration=Debug -p:Platform=$platform -p:RuntimeIdentifiers=$RUNTIME -t:PublishAllRids
dotnet new tool-manifest
dotnet tool install --version 6.5.0 Swashbuckle.AspNetCore.Cli
dotnet tool run swagger tofile --output ./src/Readarr.Api.V1/openapi.json "$outputFolder/net6.0/$RUNTIME/Readarr.console.dll" v1 &
sleep 45
kill %1
exit 0

25
frontend/.csscomb.json Normal file
View File

@@ -0,0 +1,25 @@
{
"remove-empty-rulesets": true,
"always-semicolon": true,
"color-case": "lower",
"block-indent": " ",
"color-shorthand": false,
"element-case": "lower",
"eof-newline": true,
"leading-zero": true,
"quotes": "double",
"sort-order-fallback": "abc",
"space-before-colon": "",
"space-after-colon": " ",
"space-before-combinator": " ",
"space-after-combinator": " ",
"space-between-declarations": "\n",
"space-before-opening-brace": " ",
"space-after-opening-brace": "\n",
"space-after-selector-delimiter": " ",
"space-before-selector-delimiter": "",
"space-before-closing-brace": "\n",
"strip-spaces": true,
"tab-size": true,
"unitless-zero": false
}

335
frontend/.esformatter Normal file
View File

@@ -0,0 +1,335 @@
{
"indent": {
"value": " ",
"FunctionExpression": 1,
"ArrayExpression": 1,
"ObjectExpression": 1
},
"lineBreak": {
"value": "\n",
"before": {
"ArrayPatternClosing": 0,
"ArrayPatternComma": 0,
"ArrayPatternOpening": 0,
"ArrowFunctionExpressionArrow": 0,
"ArrowFunctionExpressionClosingBrace": ">=1",
"ArrowFunctionExpressionOpeningBrace": 0,
"AssignmentExpression": ">=1",
"AssignmentOperator": 0,
"BlockStatement": 0,
"BreakKeyword": ">=1",
"CallExpression": -1,
"CallExpressionClosingParentheses": -1,
"CallExpressionOpeningParentheses": 0,
"CatchClosingBrace": ">=1",
"CatchKeyword": 0,
"CatchOpeningBrace": 0,
"ClassDeclaration": ">=1",
"ClassDeclarationClosingBrace": ">=1",
"ClassDeclarationOpeningBrace": 0,
"ConditionalExpression": ">=1",
"DeleteOperator": ">=1",
"DoWhileStatement": ">=1",
"DoWhileStatementClosingBrace": ">=1",
"DoWhileStatementOpeningBrace": 0,
"ElseIfStatement": 0,
"ElseIfStatementClosingBrace": ">=1",
"ElseIfStatementOpeningBrace": 0,
"ElseStatement": 0,
"ElseStatementClosingBrace": ">=1",
"ElseStatementOpeningBrace": 0,
"EmptyStatement": -1,
"EndOfFile": -1,
"FinallyClosingBrace": ">=1",
"FinallyKeyword": -1,
"FinallyOpeningBrace": 0,
"ForInStatement": ">=1",
"ForInStatementClosingBrace": ">=1",
"ForInStatementExpressionClosing": 0,
"ForInStatementExpressionOpening": 0,
"ForInStatementOpeningBrace": 0,
"ForStatement": ">=1",
"ForStatementClosingBrace": ">=1",
"ForStatementExpressionClosing": "<2",
"ForStatementExpressionOpening": 0,
"ForStatementOpeningBrace": 0,
"FunctionDeclaration": ">=1",
"FunctionDeclarationClosingBrace": ">=1",
"FunctionDeclarationOpeningBrace": 0,
"FunctionExpression": 0,
"FunctionExpressionClosingBrace": 1,
"FunctionExpressionOpeningBrace":0,
"IIFEClosingParentheses": 0,
"IfStatement": ">=1",
"IfStatementClosingBrace": ">=1",
"IfStatementOpeningBrace": 0,
"LogicalExpression": -1,
"MemberExpressionClosing": 0,
"MemberExpressionOpening": 0,
"MemberExpressionPeriod": -1,
"MethodDefinition": ">=1",
"ObjectExpressionClosingBrace": "<=1",
"ObjectPatternClosingBrace": 0,
"ObjectPatternComma": 0,
"ObjectPatternOpeningBrace": 0,
"ParameterDefault": 0,
"Property": "<=2",
"PropertyValue": 0,
"ReturnStatement": -1,
"SwitchClosingBrace": ">=1",
"SwitchOpeningBrace": 0,
"ThisExpression": -1,
"ThrowStatement": ">=1",
"TryClosingBrace": ">=1",
"TryKeyword": -1,
"TryOpeningBrace": 0,
"VariableDeclaration": ">=1",
"VariableDeclarationSemiColon": 0,
"VariableDeclarationWithoutInit": ">=1",
"VariableName": ">=1",
"VariableValue": 0,
"WhileStatement": ">=1",
"WhileStatementClosingBrace": ">=1",
"WhileStatementOpeningBrace": 0
},
"after": {
"ArrayPatternClosing": 0,
"ArrayPatternComma": 0,
"ArrayPatternOpening": 0,
"ArrowFunctionExpressionArrow": 0,
"ArrowFunctionExpressionClosingBrace": -1,
"ArrowFunctionExpressionOpeningBrace": ">=1",
"AssignmentExpression": ">=1",
"AssignmentOperator": 0,
"BlockStatement": 0,
"BreakKeyword": -1,
"CallExpression": -1,
"CallExpressionClosingParentheses": -1,
"CallExpressionOpeningParentheses": -1,
"CatchClosingBrace": ">=0",
"CatchKeyword": 0,
"CatchOpeningBrace": ">=1",
"ClassDeclaration": ">=1",
"ClassDeclarationClosingBrace": ">=1",
"ClassDeclarationOpeningBrace": ">=1",
"ConditionalExpression": ">=1",
"DeleteOperator": ">=1",
"DoWhileStatement": ">=1",
"DoWhileStatementClosingBrace": 0,
"DoWhileStatementOpeningBrace": ">=1",
"ElseIfStatement": ">=1",
"ElseIfStatementClosingBrace": ">=1",
"ElseIfStatementOpeningBrace": ">=1",
"ElseStatement": ">=1",
"ElseStatementClosingBrace": ">=1",
"ElseStatementOpeningBrace": ">=1",
"EmptyStatement": -1,
"FinallyClosingBrace": ">=1",
"FinallyKeyword": -1,
"FinallyOpeningBrace": ">=1",
"ForInStatement": ">=1",
"ForInStatementClosingBrace": ">=1",
"ForInStatementExpressionClosing": -1,
"ForInStatementExpressionOpening": "<2",
"ForInStatementOpeningBrace": ">=1",
"ForStatement": ">=1",
"ForStatementClosingBrace": ">=1",
"ForStatementExpressionClosing": -1,
"ForStatementExpressionOpening": "<2",
"ForStatementOpeningBrace": ">=1",
"FunctionDeclaration": ">=1",
"FunctionDeclarationClosingBrace": ">=1",
"FunctionDeclarationOpeningBrace": ">=1",
"FunctionExpression": 0,
"FunctionExpressionClosingBrace": -1,
"FunctionExpressionOpeningBrace": 1,
"IIFEOpeningParentheses": 0,
"IfStatement": ">=1",
"IfStatementClosingBrace": ">=1",
"IfStatementOpeningBrace": ">=1",
"LogicalExpression": -1,
"MemberExpressionClosing": 0,
"MemberExpressionOpening": 0,
"MemberExpressionPeriod": 0,
"MethodDefinition": ">=1",
"ObjectExpressionOpeningBrace": "<=1",
"ObjectPatternClosingBrace": 0,
"ObjectPatternComma": 0,
"ObjectPatternOpeningBrace": 0,
"ParameterDefault": 0,
"Property": -1,
"PropertyName": 0,
"ReturnStatement": -1,
"SwitchCaseColon": ">=1",
"SwitchClosingBrace": ">=1",
"SwitchOpeningBrace": ">=1",
"ThisExpression": 0,
"ThrowStatement": ">=1",
"TryClosingBrace": 0,
"TryKeyword": -1,
"TryOpeningBrace": ">=1",
"VariableDeclaration": ">=1",
"VariableDeclarationSemiColon": ">=1",
"VariableValue": -1,
"WhileStatement": ">=1",
"WhileStatementClosingBrace": ">=1",
"WhileStatementOpeningBrace": ">=1"
}
},
"whiteSpace": {
"value": " ",
"removeTrailing": 1,
"before": {
"ArgumentComma": 0,
"ArgumentList": 0,
"ArgumentListArrayExpression": 0,
"ArgumentListFunctionExpression": 1,
"ArgumentListObjectExpression": 0,
"ArrayExpressionClosing": 0,
"ArrayExpressionComma": 0,
"ArrayExpressionOpening": 1,
"AssignmentOperator": 1,
"BinaryExpression": 0,
"BinaryExpressionOperator": 1,
"BlockComment": 1,
"CallExpression": 1,
"CatchClosingBrace": 1,
"CatchKeyword": 1,
"CatchOpeningBrace": 1,
"CatchParameterList": 0,
"CommaOperator": 0,
"ConditionalExpressionAlternate": 1,
"ConditionalExpressionConsequent": 1,
"DoWhileStatementClosingBrace": 1,
"DoWhileStatementConditional": 1,
"DoWhileStatementOpeningBrace": 1,
"ElseIfStatementClosingBrace": 1,
"ElseIfStatementOpeningBrace": 1,
"ElseStatementClosingBrace": 1,
"ElseStatementOpeningBrace": 1,
"EmptyStatement": 0,
"ExpressionClosingParentheses": 0,
"FinallyClosingBrace": 1,
"FinallyKeyword": -1,
"FinallyOpeningBrace": 1,
"ForInStatement": 1,
"ForInStatementClosingBrace": 1,
"ForInStatementExpressionClosing": 0,
"ForInStatementExpressionOpening": 1,
"ForInStatementOpeningBrace": 1,
"ForStatement": 1,
"ForStatementClosingBrace": 1,
"ForStatementExpressionClosing": 0,
"ForStatementExpressionOpening": 1,
"ForStatementOpeningBrace": 1,
"ForStatementSemicolon": 0,
"FunctionDeclarationClosingBrace": 1,
"FunctionDeclarationOpeningBrace": 1,
"FunctionExpressionClosingBrace": 1,
"FunctionExpressionOpeningBrace": 1,
"IfStatementClosingBrace": 1,
"IfStatementConditionalClosing": 0,
"IfStatementConditionalOpening": 1,
"IfStatementOpeningBrace": 1,
"LineComment": 1,
"LogicalExpressionOperator": 1,
"MemberExpressionClosing": 0,
"ObjectExpressionClosingBrace": 1,
"ParameterComma": 0,
"ParameterList": 0,
"Property": 1,
"PropertyName": 1,
"PropertyValue": 1,
"SwitchDiscriminantClosing": 0,
"SwitchDiscriminantOpening": 1,
"ThrowKeyword": 1,
"TryClosingBrace": 1,
"TryKeyword": -1,
"TryOpeningBrace": 1,
"UnaryExpressionOperator": 0,
"VariableName": 1,
"VariableValue": 1,
"WhileStatementClosingBrace": 1,
"WhileStatementConditionalClosing": 0,
"WhileStatementConditionalOpening": 1,
"WhileStatementOpeningBrace": 1
},
"after": {
"ArgumentComma": 1,
"ArgumentList": 0,
"ArgumentListArrayExpression": 1,
"ArgumentListFunctionExpression": 1,
"ArgumentListObjectExpression": 0,
"ArrayExpressionClosing": 0,
"ArrayExpressionComma": 1,
"ArrayExpressionOpening": 0,
"AssignmentOperator": 1,
"BinaryExpression": 0,
"BinaryExpressionOperator": 1,
"BlockComment": 1,
"CallExpression": 0,
"CatchClosingBrace": 1,
"CatchKeyword": 1,
"CatchOpeningBrace": 1,
"CatchParameterList": 0,
"CommaOperator": 1,
"ConditionalExpressionConsequent": 1,
"ConditionalExpressionTest": 1,
"DoWhileStatementBody": 1,
"DoWhileStatementClosingBrace": 1,
"DoWhileStatementOpeningBrace": 1,
"ElseIfStatementClosingBrace": 1,
"ElseIfStatementOpeningBrace": 1,
"ElseStatementClosingBrace": 1,
"ElseStatementOpeningBrace": 1,
"EmptyStatement": 0,
"ExpressionOpeningParentheses": 0,
"FinallyClosingBrace": 1,
"FinallyKeyword": -1,
"FinallyOpeningBrace": 1,
"ForInStatement": 1,
"ForInStatementClosingBrace": 1,
"ForInStatementExpressionClosing": 1,
"ForInStatementExpressionOpening": 0,
"ForInStatementOpeningBrace": 1,
"ForStatement": 1,
"ForStatementClosingBrace": 1,
"ForStatementExpressionClosing": 1,
"ForStatementExpressionOpening": 0,
"ForStatementOpeningBrace": 1,
"ForStatementSemicolon": 1,
"FunctionDeclarationClosingBrace": 0,
"FunctionDeclarationOpeningBrace": 0,
"FunctionExpressionClosingBrace": 0,
"FunctionExpressionOpeningBrace": 0,
"FunctionName": 0,
"FunctionReservedWord": 0,
"IfStatementClosingBrace": 1,
"IfStatementConditionalClosing": 0,
"IfStatementConditionalOpening": 0,
"IfStatementOpeningBrace": 1,
"LogicalExpressionOperator": 1,
"MemberExpressionOpening": 0,
"ObjectExpressionClosingBrace": 0,
"ObjectExpressionOpeningBrace": 1,
"ParameterComma": 1,
"ParameterList": 0,
"PropertyName": 0,
"PropertyValue": 0,
"SwitchDiscriminantClosing": 1,
"SwitchDiscriminantOpening": 0,
"ThrowKeyword": 1,
"TryClosingBrace": 1,
"TryKeyword": -1,
"TryOpeningBrace": 1,
"UnaryExpressionOperator": 0,
"VariableName": 1,
"WhileStatementClosingBrace": 1,
"WhileStatementConditionalClosing": 1,
"WhileStatementConditionalOpening": 0,
"WhileStatementOpeningBrace": 1
}
}
}

View File

@@ -1,17 +1,14 @@
const fs = require('fs');
const path = require('path');
const frontendFolder = __dirname;
const dirs = fs
.readdirSync(path.join(frontendFolder, 'src'), { withFileTypes: true })
.readdirSync('frontend/src', { withFileTypes: true })
.filter((dirent) => dirent.isDirectory())
.map((dirent) => dirent.name)
.join('|');
module.exports = {
root: true,
const frontendFolder = __dirname;
module.exports = {
parser: '@babel/eslint-parser',
env: {
@@ -31,7 +28,7 @@ module.exports = {
ecmaVersion: 6,
sourceType: 'module',
babelOptions: {
configFile: `${frontendFolder}/babel.config.js`
configFile: `${frontendFolder}/babel.config.js`,
},
ecmaFeatures: {
modules: true,

12
frontend/.jsbeautifyrc Normal file
View File

@@ -0,0 +1,12 @@
{
"js": {
"indent_size": 2,
"indent_char": " ",
"indent_level": 2,
"indent_with_tabs": false,
"preserve_newlines": true,
"brace_style": "collapse",
"max_preserve_newlines": 2,
"jslint_happy": true
}
}

View File

@@ -1,12 +1,12 @@
{
"plugins": [
"stylelint-order"
],
"ignoreFiles": [
"frontend/src/Styles/scaffolding.css",
"**/*.js"
],
"rules": {
"plugins": [
"stylelint-order"
],
"ignoreFiles": [
"frontend/src/Styles/scaffolding.css",
"**/*.js"
],
"rules": {
"at-rule-empty-line-before": [
"always",
{
@@ -15,6 +15,9 @@
]
}
],
"at-rule-name-case": "lower",
"at-rule-name-newline-after": "always-multi-line",
"at-rule-name-space-after": "always",
"at-rule-no-unknown": [
true,
{
@@ -25,36 +28,83 @@
}
],
"at-rule-no-vendor-prefix": true,
"at-rule-semicolon-newline-after": "always",
"at-rule-semicolon-space-before": "never",
"block-closing-brace-empty-line-before": "never",
"block-closing-brace-newline-after": "always",
"block-closing-brace-newline-before": "always",
"block-closing-brace-space-after": "always-single-line",
"block-closing-brace-space-before": "always-single-line",
"block-no-empty": true,
"block-opening-brace-newline-after": "always",
"block-opening-brace-newline-before": "never-single-line",
"block-opening-brace-space-after": "always-single-line",
"block-opening-brace-space-before": "always",
"color-hex-case": "lower",
"color-hex-length": "short",
"color-named": "never",
"color-no-invalid-hex": true,
"comment-whitespace-inside": "always",
"declaration-bang-space-after": "never",
"declaration-bang-space-before": "always",
"declaration-block-no-duplicate-properties": [
true,
{
"ignoreProperties": [
"composes"
"composes"
]
}
],
"declaration-block-no-redundant-longhand-properties": true,
"declaration-block-no-shorthand-property-overrides": true,
"declaration-block-semicolon-newline-after": "always",
"declaration-block-semicolon-newline-before": "never-multi-line",
"declaration-block-semicolon-space-before": "never",
"declaration-block-single-line-max-declarations": 1,
"declaration-block-trailing-semicolon": "always",
"declaration-colon-space-after": "always",
"declaration-colon-space-before": "never",
"font-family-name-quotes": "always-unless-keyword",
"function-calc-no-unspaced-operator": true,
"function-comma-newline-after": "never-multi-line",
"function-comma-newline-before": "never-multi-line",
"function-comma-space-after": "always",
"function-comma-space-before": "never",
"function-linear-gradient-no-nonstandard-direction": true,
"function-name-case": "lower",
"function-parentheses-newline-inside": "never-multi-line",
"function-parentheses-space-inside": "never",
"function-url-quotes": "always",
"function-url-scheme-disallowed-list": [
"data"
],
"function-whitespace-after": "always",
"indentation": 2,
"keyframe-declaration-no-important": true,
"length-zero-no-unit": true,
"max-empty-lines": 1,
"max-line-length": [
100,
{
"ignore": [
"non-comments"
]
}
],
"max-nesting-depth": 2,
"media-feature-colon-space-after": "always",
"media-feature-colon-space-before": "never",
"media-feature-name-case": "lower",
"media-feature-name-no-vendor-prefix": true,
"media-feature-range-operator-space-after": "always",
"media-feature-range-operator-space-before": "always",
"no-empty-source": true,
"no-eol-whitespace": true,
"no-extra-semicolons": true,
"no-invalid-double-slash-comments": true,
"no-missing-end-of-source-newline": true,
"number-leading-zero": "always",
"number-no-trailing-zeros": true,
"order/order": [
"custom-properties",
"dollar-variables",
@@ -82,7 +132,6 @@
"right",
"bottom",
"left",
"inset",
"z-index",
"display",
"visibility",
@@ -294,33 +343,54 @@
]
}
],
"property-case": "lower",
"property-no-vendor-prefix": true,
"rule-empty-line-before": [
"always",
{
"except": [
"first-nested"
"first-nested"
],
"ignore": [
"after-comment"
"after-comment"
]
}
],
"selector-attribute-brackets-space-inside": "never",
"selector-attribute-operator-space-after": "never",
"selector-attribute-operator-space-before": "never",
"selector-attribute-quotes": "never",
"selector-class-pattern": "^[A-Za-z0-9]+$",
"selector-combinator-space-after": "always",
"selector-combinator-space-before": "always",
"selector-descendant-combinator-no-non-space": true,
"selector-list-comma-newline-after": "always",
"selector-list-comma-newline-before": "never-multi-line",
"selector-list-comma-space-before": "never",
"selector-max-attribute": 0,
"selector-max-class": 3,
"selector-max-compound-selectors": 3,
"selector-max-empty-lines": 0,
"selector-max-id": 0,
"selector-max-universal": 0,
"selector-pseudo-class-case": "lower",
"selector-pseudo-class-parentheses-space-inside": "never",
"selector-pseudo-element-case": "lower",
"selector-pseudo-element-colon-notation": "double",
"selector-pseudo-element-no-unknown": true,
"selector-type-case": "lower",
"selector-type-no-unknown": true,
"shorthand-property-no-redundant-values": true,
"string-no-newline": true,
"string-quotes": "single",
"time-min-milliseconds": 100,
"unit-case": "lower",
"unit-no-unknown": true,
"value-list-comma-newline-after": "never-multi-line",
"value-list-comma-newline-before": "never-multi-line",
"value-list-comma-space-after": "always",
"value-list-comma-space-before": "never",
"value-list-max-empty-lines": 0,
"value-no-vendor-prefix": true
}
}
}

View File

@@ -1,7 +0,0 @@
{
"recommendations": [
"stylelint.vscode-stylelint",
"dbaeumer.vscode-eslint",
"esbenp.prettier-vscode"
]
}

View File

@@ -44,8 +44,7 @@ module.exports = (env) => {
'node_modules'
],
alias: {
jquery: 'jquery/dist/jquery.min',
'react-middle-truncate': 'react-middle-truncate/lib/react-middle-truncate'
jquery: 'jquery/src/jquery'
},
fallback: {
buffer: false,
@@ -253,19 +252,18 @@ module.exports = (env) => {
config.resolve.alias['react-dom$'] = 'react-dom/profiling';
config.resolve.alias['scheduler/tracing'] = 'scheduler/tracing-profiling';
config.optimization = {
minimize: true,
minimizer: [
new TerserPlugin({
terserOptions: {
sourceMap: true, // Must be set to true if using source-maps in production
mangle: false,
keep_classnames: true,
keep_fnames: true
}
})
]
};
config.optimization.minimizer = [
new TerserPlugin({
cache: true,
parallel: true,
sourceMap: true, // Must be set to true if using source-maps in production
terserOptions: {
mangle: false,
keep_classnames: true,
keep_fnames: true
}
})
];
}
return config;

View File

@@ -1,4 +1,3 @@
// eslint-disable-next-line filenames/match-exported
const loaderUtils = require('loader-utils');
module.exports = function cssVariablesLoader(source) {

View File

@@ -1,6 +1,7 @@
const reload = require('require-nocache')(module);
const cssVarsFiles = [
'./src/Styles/Variables/colors',
'./src/Styles/Variables/dimensions',
'./src/Styles/Variables/fonts',
'./src/Styles/Variables/animations',

View File

@@ -61,33 +61,33 @@ class Blocklist extends Component {
getSelectedIds = () => {
return getSelectedIds(this.state.selectedState);
};
}
//
// Listeners
onSelectAllChange = ({ value }) => {
this.setState(selectAll(this.state.selectedState, value));
};
}
onSelectedChange = ({ id, value, shiftKey = false }) => {
this.setState((state) => {
return toggleSelected(state, this.props.items, id, value, shiftKey);
});
};
}
onRemoveSelectedPress = () => {
this.setState({ isConfirmRemoveModalOpen: true });
};
}
onRemoveSelectedConfirmed = () => {
this.props.onRemoveSelected(this.getSelectedIds());
this.setState({ isConfirmRemoveModalOpen: false });
};
}
onConfirmRemoveModalClose = () => {
this.setState({ isConfirmRemoveModalOpen: false });
};
}
//
// Render

View File

@@ -68,37 +68,37 @@ class BlocklistConnector extends Component {
repopulate = () => {
this.props.fetchBlocklist();
};
}
//
// Listeners
onFirstPagePress = () => {
this.props.gotoBlocklistFirstPage();
};
}
onPreviousPagePress = () => {
this.props.gotoBlocklistPreviousPage();
};
}
onNextPagePress = () => {
this.props.gotoBlocklistNextPage();
};
}
onLastPagePress = () => {
this.props.gotoBlocklistLastPage();
};
}
onPageSelect = (page) => {
this.props.gotoBlocklistPage({ page });
};
}
onRemoveSelected = (ids) => {
this.props.removeBlocklistItems({ ids });
};
}
onSortPress = (sortKey) => {
this.props.setBlocklistSort({ sortKey });
};
}
onTableOptionChange = (payload) => {
this.props.setBlocklistTableOption(payload);
@@ -106,11 +106,11 @@ class BlocklistConnector extends Component {
if (payload.pageSize) {
this.props.gotoBlocklistFirstPage();
}
};
}
onClearBlocklistPress = () => {
this.props.executeCommand({ name: commandNames.CLEAR_BLOCKLIST });
};
}
//
// Render

View File

@@ -1,7 +1,6 @@
import PropTypes from 'prop-types';
import React, { Component } from 'react';
import AuthorNameLink from 'Author/AuthorNameLink';
import BookFormats from 'Book/BookFormats';
import BookQuality from 'Book/BookQuality';
import IconButton from 'Components/Link/IconButton';
import RelativeDateCellConnector from 'Components/Table/Cells/RelativeDateCellConnector';
@@ -31,11 +30,11 @@ class BlocklistRow extends Component {
onDetailsPress = () => {
this.setState({ isDetailsModalOpen: true });
};
}
onDetailsModalClose = () => {
this.setState({ isDetailsModalOpen: false });
};
}
//
// Render
@@ -46,7 +45,6 @@ class BlocklistRow extends Component {
author,
sourceTitle,
quality,
customFormats,
date,
protocol,
indexer,
@@ -112,16 +110,6 @@ class BlocklistRow extends Component {
);
}
if (name === 'customFormats') {
return (
<TableRowCell key={name}>
<BookFormats
formats={customFormats}
/>
</TableRowCell>
);
}
if (name === 'date') {
return (
<RelativeDateCellConnector
@@ -186,7 +174,6 @@ BlocklistRow.propTypes = {
author: PropTypes.object.isRequired,
sourceTitle: PropTypes.string.isRequired,
quality: PropTypes.object.isRequired,
customFormats: PropTypes.arrayOf(PropTypes.object).isRequired,
date: PropTypes.string.isRequired,
protocol: PropTypes.string.isRequired,
indexer: PropTypes.string,

View File

@@ -9,7 +9,6 @@ import Link from 'Components/Link/Link';
import { icons } from 'Helpers/Props';
import formatDateTime from 'Utilities/Date/formatDateTime';
import formatAge from 'Utilities/Number/formatAge';
import formatPreferredWordScore from 'Utilities/Number/formatPreferredWordScore';
import translate from 'Utilities/String/translate';
import styles from './HistoryDetails.css';
@@ -66,10 +65,8 @@ function HistoryDetails(props) {
const {
indexer,
releaseGroup,
customFormatScore,
nzbInfoUrl,
downloadClient,
downloadClientName,
downloadId,
age,
ageHours,
@@ -77,8 +74,6 @@ function HistoryDetails(props) {
publishedDate
} = data;
const downloadClientNameInfo = downloadClientName ?? downloadClient;
return (
<DescriptionList>
<DescriptionListItem
@@ -105,16 +100,7 @@ function HistoryDetails(props) {
}
{
customFormatScore && customFormatScore !== '0' ?
<DescriptionListItem
title={translate('CustomFormatScore')}
data={formatPreferredWordScore(customFormatScore)}
/> :
null
}
{
nzbInfoUrl ?
!!nzbInfoUrl &&
<span>
<DescriptionListItemTitle>
Info URL
@@ -123,17 +109,15 @@ function HistoryDetails(props) {
<DescriptionListItemDescription>
<Link to={nzbInfoUrl}>{nzbInfoUrl}</Link>
</DescriptionListItemDescription>
</span> :
null
</span>
}
{
downloadClientNameInfo ?
!!downloadClient &&
<DescriptionListItem
title={translate('DownloadClient')}
data={downloadClientNameInfo}
/> :
null
data={downloadClient}
/>
}
{
@@ -189,7 +173,6 @@ function HistoryDetails(props) {
if (eventType === 'bookFileImported') {
const {
customFormatScore,
droppedPath,
importedPath
} = data;
@@ -212,22 +195,12 @@ function HistoryDetails(props) {
}
{
importedPath ?
!!importedPath &&
<DescriptionListItem
descriptionClassName={styles.description}
title={translate('ImportedTo')}
data={importedPath}
/> :
null
}
{
customFormatScore && customFormatScore !== '0' ?
<DescriptionListItem
title={translate('CustomFormatScore')}
data={formatPreferredWordScore(customFormatScore)}
/> :
null
/>
}
</DescriptionList>
);
@@ -235,8 +208,7 @@ function HistoryDetails(props) {
if (eventType === 'bookFileDeleted') {
const {
reason,
customFormatScore
reason
} = data;
let reasonMessage = '';
@@ -266,15 +238,6 @@ function HistoryDetails(props) {
title={translate('Reason')}
data={reasonMessage}
/>
{
customFormatScore && customFormatScore !== '0' ?
<DescriptionListItem
title={translate('CustomFormatScore')}
data={formatPreferredWordScore(customFormatScore)}
/> :
null
}
</DescriptionList>
);
}

View File

@@ -60,38 +60,38 @@ class HistoryConnector extends Component {
repopulate = () => {
this.props.fetchHistory();
};
}
//
// Listeners
onFirstPagePress = () => {
this.props.gotoHistoryFirstPage();
};
}
onPreviousPagePress = () => {
this.props.gotoHistoryPreviousPage();
};
}
onNextPagePress = () => {
this.props.gotoHistoryNextPage();
};
}
onLastPagePress = () => {
this.props.gotoHistoryLastPage();
};
}
onPageSelect = (page) => {
this.props.gotoHistoryPage({ page });
};
}
onSortPress = (sortKey) => {
this.props.setHistorySort({ sortKey });
};
}
onFilterSelect = (selectedFilterKey) => {
this.props.setHistoryFilter({ selectedFilterKey });
};
}
onTableOptionChange = (payload) => {
this.props.setHistoryTableOption(payload);
@@ -99,7 +99,7 @@ class HistoryConnector extends Component {
if (payload.pageSize) {
this.props.gotoHistoryFirstPage();
}
};
}
//
// Render

View File

@@ -10,12 +10,6 @@
width: 80px;
}
.customFormatScore {
composes: cell from '~Components/Table/Cells/TableRowCell.css';
width: 55px;
}
.releaseGroup {
composes: cell from '~Components/Table/Cells/TableRowCell.css';

View File

@@ -1,7 +1,6 @@
import PropTypes from 'prop-types';
import React, { Component } from 'react';
import AuthorNameLink from 'Author/AuthorNameLink';
import BookFormats from 'Book/BookFormats';
import BookQuality from 'Book/BookQuality';
import BookTitleLink from 'Book/BookTitleLink';
import IconButton from 'Components/Link/IconButton';
@@ -9,7 +8,6 @@ import RelativeDateCellConnector from 'Components/Table/Cells/RelativeDateCellCo
import TableRowCell from 'Components/Table/Cells/TableRowCell';
import TableRow from 'Components/Table/TableRow';
import { icons } from 'Helpers/Props';
import formatPreferredWordScore from 'Utilities/Number/formatPreferredWordScore';
import HistoryDetailsModal from './Details/HistoryDetailsModal';
import HistoryEventTypeCell from './HistoryEventTypeCell';
import styles from './HistoryRow.css';
@@ -42,11 +40,11 @@ class HistoryRow extends Component {
onDetailsPress = () => {
this.setState({ isDetailsModalOpen: true });
};
}
onDetailsModalClose = () => {
this.setState({ isDetailsModalOpen: false });
};
}
//
// Render
@@ -56,7 +54,6 @@ class HistoryRow extends Component {
author,
book,
quality,
customFormats,
qualityCutoffNotMet,
eventType,
sourceTitle,
@@ -130,16 +127,6 @@ class HistoryRow extends Component {
);
}
if (name === 'customFormats') {
return (
<TableRowCell key={name}>
<BookFormats
formats={customFormats}
/>
</TableRowCell>
);
}
if (name === 'date') {
return (
<RelativeDateCellConnector
@@ -171,17 +158,6 @@ class HistoryRow extends Component {
);
}
if (name === 'customFormatScore') {
return (
<TableRowCell
key={name}
className={styles.customFormatScore}
>
{formatPreferredWordScore(data.customFormatScore)}
</TableRowCell>
);
}
if (name === 'releaseGroup') {
return (
<TableRowCell
@@ -243,7 +219,6 @@ HistoryRow.propTypes = {
author: PropTypes.object.isRequired,
book: PropTypes.object,
quality: PropTypes.object.isRequired,
customFormats: PropTypes.arrayOf(PropTypes.object),
qualityCutoffNotMet: PropTypes.bool.isRequired,
eventType: PropTypes.string.isRequired,
sourceTitle: PropTypes.string.isRequired,

View File

@@ -49,7 +49,7 @@ class HistoryRowConnector extends Component {
onMarkAsFailedPress = () => {
this.props.markAsFailed({ id: this.props.id });
};
}
//
// Render

View File

@@ -1,13 +1,13 @@
.torrent {
composes: label from '~Components/Label.css';
border-color: var(--torrentColor);
background-color: var(--torrentColor);
border-color: $torrentColor;
background-color: $torrentColor;
}
.usenet {
composes: label from '~Components/Label.css';
border-color: var(--usenetColor);
background-color: var(--usenetColor);
border-color: $usenetColor;
background-color: $usenetColor;
}

View File

@@ -75,23 +75,13 @@ class Queue extends Component {
return;
}
const nextState = {};
if (prevProps.items !== items) {
nextState.items = items;
}
const selectedIds = this.getSelectedIds();
const isPendingSelected = _.some(this.props.items, (item) => {
return selectedIds.indexOf(item.id) > -1 && item.status === 'delay';
});
if (isPendingSelected !== this.state.isPendingSelected) {
nextState.isPendingSelected = isPendingSelected;
}
if (!_.isEmpty(nextState)) {
this.setState(nextState);
this.setState({ isPendingSelected });
}
}
@@ -100,45 +90,45 @@ class Queue extends Component {
getSelectedIds = () => {
return getSelectedIds(this.state.selectedState);
};
}
//
// Listeners
onQueueRowModalOpenOrClose = (isOpen) => {
this._shouldBlockRefresh = isOpen;
};
}
onSelectAllChange = ({ value }) => {
this.setState(selectAll(this.state.selectedState, value));
};
}
onSelectedChange = ({ id, value, shiftKey = false }) => {
this.setState((state) => {
return toggleSelected(state, this.props.items, id, value, shiftKey);
});
};
}
onGrabSelectedPress = () => {
this.props.onGrabSelectedPress(this.getSelectedIds());
};
}
onRemoveSelectedPress = () => {
this.setState({ isConfirmRemoveModalOpen: true }, () => {
this._shouldBlockRefresh = true;
});
};
}
onRemoveSelectedConfirmed = (payload) => {
this._shouldBlockRefresh = false;
this.props.onRemoveSelectedPress({ ids: this.getSelectedIds(), ...payload });
this.setState({ isConfirmRemoveModalOpen: false });
};
}
onConfirmRemoveModalClose = () => {
this._shouldBlockRefresh = false;
this.setState({ isConfirmRemoveModalOpen: false });
};
}
//
// Render
@@ -226,29 +216,26 @@ class Queue extends Component {
<PageContentBody>
{
isRefreshing && !isAllPopulated ?
<LoadingIndicator /> :
null
isRefreshing && !isAllPopulated &&
<LoadingIndicator />
}
{
!isRefreshing && hasError ?
!isRefreshing && hasError &&
<div>
{translate('FailedToLoadQueue')}
</div> :
null
</div>
}
{
isAllPopulated && !hasError && !items.length ?
isAllPopulated && !hasError && !items.length &&
<div>
{translate('QueueIsEmpty')}
</div> :
null
</div>
}
{
isAllPopulated && !hasError && !!items.length ?
isAllPopulated && !hasError && !!items.length &&
<div>
<Table
columns={columns}
@@ -283,8 +270,7 @@ class Queue extends Component {
isFetching={isRefreshing}
{...otherProps}
/>
</div> :
null
</div>
}
</PageContentBody>

View File

@@ -79,34 +79,34 @@ class QueueConnector extends Component {
repopulate = () => {
this.props.fetchQueue();
};
}
//
// Listeners
onFirstPagePress = () => {
this.props.gotoQueueFirstPage();
};
}
onPreviousPagePress = () => {
this.props.gotoQueuePreviousPage();
};
}
onNextPagePress = () => {
this.props.gotoQueueNextPage();
};
}
onLastPagePress = () => {
this.props.gotoQueueLastPage();
};
}
onPageSelect = (page) => {
this.props.gotoQueuePage({ page });
};
}
onSortPress = (sortKey) => {
this.props.setQueueSort({ sortKey });
};
}
onTableOptionChange = (payload) => {
this.props.setQueueTableOption(payload);
@@ -114,21 +114,21 @@ class QueueConnector extends Component {
if (payload.pageSize) {
this.props.gotoQueueFirstPage();
}
};
}
onRefreshPress = () => {
this.props.executeCommand({
name: commandNames.REFRESH_MONITORED_DOWNLOADS
});
};
}
onGrabSelectedPress = (ids) => {
this.props.grabQueueItems({ ids });
};
}
onRemoveSelectedPress = (payload) => {
this.props.removeQueueItems(payload);
};
}
//
// Render

View File

@@ -42,7 +42,7 @@ class QueueOptions extends Component {
[name]: value
});
});
};
}
//
// Render

View File

@@ -2,7 +2,6 @@ import PropTypes from 'prop-types';
import React, { Component } from 'react';
import ProtocolLabel from 'Activity/Queue/ProtocolLabel';
import AuthorNameLink from 'Author/AuthorNameLink';
import BookFormats from 'Book/BookFormats';
import BookQuality from 'Book/BookQuality';
import BookTitleLink from 'Book/BookTitleLink';
import Icon from 'Components/Icon';
@@ -42,7 +41,7 @@ class QueueRow extends Component {
onRemoveQueueItemPress = () => {
this.setState({ isRemoveQueueItemModalOpen: true });
};
}
onRemoveQueueItemModalConfirmed = (blocklist, skipredownload) => {
const {
@@ -54,25 +53,25 @@ class QueueRow extends Component {
onRemoveQueueItemPress(blocklist, skipredownload);
this.setState({ isRemoveQueueItemModalOpen: false });
};
}
onRemoveQueueItemModalClose = () => {
this.props.onQueueRowModalOpenOrClose(false);
this.setState({ isRemoveQueueItemModalOpen: false });
};
}
onInteractiveImportPress = () => {
this.props.onQueueRowModalOpenOrClose(true);
this.setState({ isInteractiveImportModalOpen: true });
};
}
onInteractiveImportModalClose = () => {
this.props.onQueueRowModalOpenOrClose(false);
this.setState({ isInteractiveImportModalOpen: false });
};
}
//
// Render
@@ -90,7 +89,6 @@ class QueueRow extends Component {
author,
book,
quality,
customFormats,
protocol,
indexer,
outputPath,
@@ -212,16 +210,6 @@ class QueueRow extends Component {
);
}
if (name === 'customFormats') {
return (
<TableRowCell key={name}>
<BookFormats
formats={customFormats}
/>
</TableRowCell>
);
}
if (name === 'protocol') {
return (
<TableRowCell key={name}>
@@ -391,7 +379,6 @@ QueueRow.propTypes = {
author: PropTypes.object,
book: PropTypes.object,
quality: PropTypes.object.isRequired,
customFormats: PropTypes.arrayOf(PropTypes.object),
protocol: PropTypes.string.isRequired,
indexer: PropTypes.string,
outputPath: PropTypes.string,

View File

@@ -41,11 +41,11 @@ class QueueRowConnector extends Component {
onGrabPress = () => {
this.props.grabQueueItem({ id: this.props.id });
};
}
onRemoveQueueItemPress = (payload) => {
this.props.removeQueueItem({ id: this.props.id, ...payload });
};
}
//
// Render

View File

@@ -36,34 +36,34 @@ class RemoveQueueItemModal extends Component {
blocklist: false,
skipredownload: false
});
};
}
//
// Listeners
onRemoveChange = ({ value }) => {
this.setState({ remove: value });
};
}
onBlocklistChange = ({ value }) => {
this.setState({ blocklist: value });
};
}
onSkipReDownloadChange = ({ value }) => {
this.setState({ skipredownload: value });
};
}
onRemoveConfirmed = () => {
const state = this.state;
this.resetState();
this.props.onRemovePress(state);
};
}
onModalClose = () => {
this.resetState();
this.props.onModalClose();
};
}
//
// Render

View File

@@ -31,40 +31,40 @@ class RemoveQueueItemsModal extends Component {
//
// Control
resetState = function() {
this.setState({
remove: true,
blocklist: false,
skipredownload: false
});
};
resetState = function() {
this.setState({
remove: true,
blocklist: false,
skipredownload: false
});
}
//
// Listeners
//
// Listeners
onRemoveChange = ({ value }) => {
this.setState({ remove: value });
};
onRemoveChange = ({ value }) => {
this.setState({ remove: value });
}
onBlocklistChange = ({ value }) => {
this.setState({ blocklist: value });
};
}
onSkipReDownloadChange = ({ value }) => {
this.setState({ skipredownload: value });
};
}
onRemoveConfirmed = () => {
const state = this.state;
this.resetState();
this.props.onRemovePress(state);
};
}
onModalClose = () => {
this.resetState();
this.props.onModalClose();
};
}
//
// Render

View File

@@ -4,7 +4,6 @@ import React from 'react';
import DocumentTitle from 'react-document-title';
import { Provider } from 'react-redux';
import PageConnector from 'Components/Page/PageConnector';
import ApplyTheme from './ApplyTheme';
import AppRoutes from './AppRoutes';
function App({ store, history }) {
@@ -12,11 +11,9 @@ function App({ store, history }) {
<DocumentTitle title={window.Readarr.instanceName}>
<Provider store={store}>
<ConnectedRouter history={history}>
<ApplyTheme>
<PageConnector>
<AppRoutes app={App} />
</PageConnector>
</ApplyTheme>
<PageConnector>
<AppRoutes app={App} />
</PageConnector>
</ConnectedRouter>
</Provider>
</DocumentTitle>

View File

@@ -13,7 +13,6 @@ import CalendarPageConnector from 'Calendar/CalendarPageConnector';
import NotFound from 'Components/NotFound';
import Switch from 'Components/Router/Switch';
import AddNewItemConnector from 'Search/AddNewItemConnector';
import CustomFormatSettingsConnector from 'Settings/CustomFormats/CustomFormatSettingsConnector';
import DevelopmentSettingsConnector from 'Settings/Development/DevelopmentSettingsConnector';
import DownloadClientSettingsConnector from 'Settings/DownloadClients/DownloadClientSettingsConnector';
import GeneralSettingsConnector from 'Settings/General/GeneralSettingsConnector';
@@ -23,7 +22,7 @@ import MediaManagementConnector from 'Settings/MediaManagement/MediaManagementCo
import MetadataSettings from 'Settings/Metadata/MetadataSettings';
import NotificationSettings from 'Settings/Notifications/NotificationSettings';
import Profiles from 'Settings/Profiles/Profiles';
import QualityConnector from 'Settings/Quality/QualityConnector';
import Quality from 'Settings/Quality/Quality';
import Settings from 'Settings/Settings';
import TagSettings from 'Settings/Tags/TagSettings';
import UISettingsConnector from 'Settings/UI/UISettingsConnector';
@@ -173,12 +172,7 @@ function AppRoutes(props) {
<Route
path="/settings/quality"
component={QualityConnector}
/>
<Route
path="/settings/customformats"
component={CustomFormatSettingsConnector}
component={Quality}
/>
<Route

View File

@@ -11,47 +11,9 @@ import UpdateChanges from 'System/Updates/UpdateChanges';
import translate from 'Utilities/String/translate';
import styles from './AppUpdatedModalContent.css';
function mergeUpdates(items, version, prevVersion) {
let installedIndex = items.findIndex((u) => u.version === version);
let installedPreviouslyIndex = items.findIndex((u) => u.version === prevVersion);
if (installedIndex === -1) {
installedIndex = 0;
}
if (installedPreviouslyIndex === -1) {
installedPreviouslyIndex = items.length;
} else if (installedPreviouslyIndex === installedIndex && items.length) {
installedPreviouslyIndex += 1;
}
const appliedUpdates = items.slice(installedIndex, installedPreviouslyIndex);
if (!appliedUpdates.length) {
return null;
}
const appliedChanges = { new: [], fixed: [] };
appliedUpdates.forEach((u) => {
if (u.changes) {
appliedChanges.new.push(... u.changes.new);
appliedChanges.fixed.push(... u.changes.fixed);
}
});
const mergedUpdate = Object.assign({}, appliedUpdates[0], { changes: appliedChanges });
if (!appliedChanges.new.length && !appliedChanges.fixed.length) {
mergedUpdate.changes = null;
}
return mergedUpdate;
}
function AppUpdatedModalContent(props) {
const {
version,
prevVersion,
isPopulated,
error,
items,
@@ -59,7 +21,7 @@ function AppUpdatedModalContent(props) {
onModalClose
} = props;
const update = mergeUpdates(items, version, prevVersion);
const update = items[0];
return (
<ModalContent onModalClose={onModalClose}>
@@ -129,7 +91,6 @@ function AppUpdatedModalContent(props) {
AppUpdatedModalContent.propTypes = {
version: PropTypes.string.isRequired,
prevVersion: PropTypes.string,
isPopulated: PropTypes.bool.isRequired,
error: PropTypes.object,
items: PropTypes.arrayOf(PropTypes.object).isRequired,

View File

@@ -8,9 +8,8 @@ import AppUpdatedModalContent from './AppUpdatedModalContent';
function createMapStateToProps() {
return createSelector(
(state) => state.app.version,
(state) => state.app.prevVersion,
(state) => state.system.updates,
(version, prevVersion, updates) => {
(version, updates) => {
const {
isPopulated,
error,
@@ -19,7 +18,6 @@ function createMapStateToProps() {
return {
version,
prevVersion,
isPopulated,
error,
items

View File

@@ -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.Readarr.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);

View File

@@ -99,7 +99,7 @@ class AuthorImage extends Component {
if (this.props.onError) {
this.props.onError();
}
};
}
onLoad = () => {
this.setState({
@@ -110,7 +110,7 @@ class AuthorImage extends Component {
if (this.props.onLoad) {
this.props.onLoad();
}
};
}
//
// Render

View File

@@ -8,5 +8,5 @@
.deleteFilesMessage {
margin-top: 20px;
color: var(--dangerColor);
color: $dangerColor;
}

View File

@@ -33,11 +33,11 @@ class DeleteAuthorModalContent extends Component {
onDeleteFilesChange = ({ value }) => {
this.setState({ deleteFiles: value });
};
}
onAddImportListExclusionChange = ({ value }) => {
this.setState({ addImportListExclusion: value });
};
}
onDeleteAuthorConfirmed = () => {
const deleteFiles = this.state.deleteFiles;
@@ -46,7 +46,7 @@ class DeleteAuthorModalContent extends Component {
this.setState({ deleteFiles: false });
this.setState({ addImportListExclusion: false });
this.props.onDeletePress(deleteFiles, addImportListExclusion);
};
}
//
// Render

View File

@@ -32,7 +32,7 @@ class DeleteAuthorModalContentConnector extends Component {
});
this.props.onModalClose(true);
};
}
//
// Render

View File

@@ -9,7 +9,7 @@
}
.metadataMessage {
color: var(--helpTextColor);
color: $helpTextColor;
text-align: center;
font-weight: 300;
font-size: 20px;
@@ -22,7 +22,7 @@
.tabList {
margin: 0;
padding: 0;
border-bottom: 1px solid var(--lightGray);
border-bottom: 1px solid $lightGray;
}
.tab {
@@ -37,7 +37,7 @@
}
.selectedTab {
border-bottom: 4px solid var(--linkColor);
border-bottom: 4px solid $linkColor;
}
.tabContent {
@@ -63,7 +63,7 @@
white-space: nowrap;
&:hover {
color: var(--iconButtonHoverLightColor);
color: $iconButtonHoverLightColor;
}
}

View File

@@ -99,69 +99,69 @@ class AuthorDetails extends Component {
}
this.setState({ selectedState: newSelectedState, allSelected: isAllSelected, allUnselected: isAllUnselected });
};
}
getSelectedIds = () => {
return getSelectedIds(this.state.selectedState);
};
}
//
// Listeners
onOrganizePress = () => {
this.setState({ isOrganizeModalOpen: true });
};
}
onOrganizeModalClose = () => {
this.setState({ isOrganizeModalOpen: false });
};
}
onRetagPress = () => {
this.setState({ isRetagModalOpen: true });
};
}
onRetagModalClose = () => {
this.setState({ isRetagModalOpen: false });
};
}
onInteractiveImportPress = () => {
this.setState({ isInteractiveImportModalOpen: true });
};
}
onInteractiveImportModalClose = () => {
this.setState({ isInteractiveImportModalOpen: false });
};
}
onEditAuthorPress = () => {
this.setState({ isEditAuthorModalOpen: true });
};
}
onEditAuthorModalClose = () => {
this.setState({ isEditAuthorModalOpen: false });
};
}
onDeleteAuthorPress = () => {
this.setState({
isEditAuthorModalOpen: false,
isDeleteAuthorModalOpen: true
});
};
}
onDeleteAuthorModalClose = () => {
this.setState({ isDeleteAuthorModalOpen: false });
};
}
onMonitorOptionsPress = () => {
this.setState({ isMonitorOptionsModalOpen: true });
};
}
onMonitorOptionsClose = () => {
this.setState({ isMonitorOptionsModalOpen: false });
};
}
onBookEditorTogglePress = () => {
this.setState({ isEditorActive: !this.state.isEditorActive });
};
}
onExpandAllPress = () => {
const {
@@ -170,7 +170,7 @@ class AuthorDetails extends Component {
} = this.state;
this.setState(getExpandedState(selectAll(expandedState, !allExpanded)));
};
}
onExpandPress = (bookId, isExpanded) => {
this.setState((state) => {
@@ -184,32 +184,32 @@ class AuthorDetails extends Component {
return getExpandedState(newState);
});
};
}
onSelectAllChange = ({ value }) => {
this.setState(selectAll(this.state.selectedState, value));
};
}
onSelectAllPress = () => {
this.onSelectAllChange({ value: !this.state.allSelected });
};
}
onSelectedChange = (items, id, value, shiftKey = false) => {
this.setState((state) => {
return toggleSelected(state, items, id, value, shiftKey);
});
};
}
onSaveSelected = (changes) => {
this.props.onSaveSelected({
bookIds: this.getSelectedIds(),
...changes
});
};
}
onTabSelect = (index, lastIndex) => {
this.setState({ selectedTabIndex: index });
};
}
//
// Render

View File

@@ -270,7 +270,7 @@ class AuthorDetailsConnector extends Component {
this.props.fetchSeries({ authorId });
this.props.fetchBookFiles({ authorId });
this.props.fetchQueueDetails({ authorId });
};
}
unpopulate = () => {
this.props.cancelFetchReleases();
@@ -278,7 +278,7 @@ class AuthorDetailsConnector extends Component {
this.props.clearBookFiles();
this.props.clearQueueDetails();
this.props.clearReleases();
};
}
//
// Listeners
@@ -288,25 +288,25 @@ class AuthorDetailsConnector extends Component {
authorId: this.props.id,
monitored
});
};
}
onRefreshPress = () => {
this.props.executeCommand({
name: commandNames.REFRESH_AUTHOR,
authorId: this.props.id
});
};
}
onSearchPress = () => {
this.props.executeCommand({
name: commandNames.AUTHOR_SEARCH,
authorId: this.props.id
});
};
}
onSaveSelected = (payload) => {
this.props.saveBookEditor(payload);
};
}
//
// Render

View File

@@ -16,7 +16,7 @@
position: absolute;
width: 100%;
height: 100%;
background: var(--black);
background: $black;
opacity: 0.7;
}
@@ -25,7 +25,7 @@
padding: 30px;
width: 100%;
height: 100%;
color: var(--white);
color: $white;
}
.poster {
@@ -69,7 +69,7 @@
width: 40px;
&:hover {
color: var(--iconButtonHoverLightColor);
color: $iconButtonHoverLightColor;
}
}
@@ -97,7 +97,7 @@
white-space: nowrap;
&:hover {
color: var(--iconButtonHoverLightColor);
color: $iconButtonHoverLightColor;
}
}

View File

@@ -52,11 +52,11 @@ class AuthorDetailsHeader extends Component {
onOverviewMeasure = ({ height }) => {
this.setState({ overviewHeight: height });
};
}
onTitleMeasure = ({ width }) => {
this.setState({ titleWidth: width });
};
}
//
// Render

View File

@@ -48,7 +48,7 @@ class AuthorDetailsHeaderConnector extends Component {
authorId: this.props.authorId,
monitored
});
};
}
//
// Render

View File

@@ -74,7 +74,7 @@ class AuthorDetailsPageConnector extends Component {
if (isFetching && !isPopulated) {
return (
<PageContent title={translate('Loading')}>
<PageContent title='loading'>
<PageContentBody>
<LoadingIndicator />
</PageContentBody>

View File

@@ -1,8 +1,8 @@
.bookType {
margin-bottom: 20px;
border: 1px solid var(--borderColor);
border: 1px solid $borderColor;
border-radius: 4px;
background-color: var(--cardBackgroundColor);
background-color: $white;
&:last-of-type {
margin-bottom: 0;
@@ -77,7 +77,7 @@
.books {
padding-top: 15px;
border-top: 1px solid var(--borderColor);
border-top: 1px solid $borderColor;
}
.collapseButtonContainer {
@@ -86,10 +86,10 @@
justify-content: center;
padding: 10px 15px;
width: 100%;
border-top: 1px solid var(--borderColor);
border-top: 1px solid $borderColor;
border-bottom-right-radius: 4px;
border-bottom-left-radius: 4px;
background-color: var(--collapseButtonBackgroundColor);
background-color: #fafafa;
}
.collapseButtonIcon {

View File

@@ -61,7 +61,7 @@ class AuthorDetailsSeason extends Component {
this.setState({ lastToggledBook: bookId });
this.props.onMonitorBookPress(_.uniq(bookIds), monitored);
};
}
onSelectedChange = ({ id, value, shiftKey = false }) => {
const {
@@ -70,7 +70,7 @@ class AuthorDetailsSeason extends Component {
} = this.props;
return onSelectedChange(items, id, value, shiftKey);
};
}
//
// Render

View File

@@ -66,18 +66,18 @@ class AuthorDetailsSeasonConnector extends Component {
onTableOptionChange = (payload) => {
this.props.setBooksTableOption(payload);
};
}
onSortPress = (sortKey) => {
this.props.setAuthorDetailsSort({ sortKey });
};
}
onMonitorBookPress = (bookIds, monitored) => {
this.props.toggleBooksMonitored({
bookIds,
monitored
});
};
}
//
// Render

View File

@@ -1,8 +1,8 @@
.bookType {
margin-bottom: 20px;
border: 1px solid var(--borderColor);
border: 1px solid $borderColor;
border-radius: 4px;
background-color: var(--cardBackgroundColor);
background-color: $white;
&:last-of-type {
margin-bottom: 0;
@@ -77,7 +77,7 @@
.books {
padding-top: 15px;
border-top: 1px solid var(--borderColor);
border-top: 1px solid $borderColor;
}
.collapseButtonContainer {
@@ -86,10 +86,10 @@
justify-content: center;
padding: 10px 15px;
width: 100%;
border-top: 1px solid var(--borderColor);
border-top: 1px solid $borderColor;
border-bottom-right-radius: 4px;
border-bottom-left-radius: 4px;
background-color: var(--cardBackgroundColor);
background-color: #fafafa;
}
.collapseButtonIcon {

View File

@@ -73,7 +73,7 @@ class AuthorDetailsSeries extends Component {
} = this.props;
this.props.onExpandPress(id, !isExpanded);
};
}
onMonitorBookPress = (bookId, monitored, { shiftKey }) => {
const lastToggled = this.state.lastToggledBook;
@@ -91,13 +91,13 @@ class AuthorDetailsSeries extends Component {
this.setState({ lastToggledBook: bookId });
this.props.onMonitorBookPress(_.uniq(bookIds), monitored);
};
}
onMonitorSeriesPress = (monitored, { shiftKey }) => {
const bookIds = this.props.items.map((book) => book.id);
this.props.onMonitorBookPress(_.uniq(bookIds), monitored);
};
}
//
// Render

View File

@@ -81,18 +81,18 @@ class AuthorDetailsSeasonConnector extends Component {
onTableOptionChange = (payload) => {
this.props.setSeriesTableOption(payload);
};
}
onSortPress = (sortKey) => {
this.props.dispatchSetSeriesSort({ sortKey });
};
}
onMonitorBookPress = (bookIds, monitored) => {
this.props.toggleBooksMonitored({
bookIds,
monitored
});
};
}
//
// Render

View File

@@ -1,3 +1,4 @@
import _ from 'lodash';
import { connect } from 'react-redux';
import { createSelector } from 'reselect';
import createAuthorSelector from 'Store/Selectors/createAuthorSelector';
@@ -9,11 +10,15 @@ function createMapStateToProps() {
createAuthorSelector(),
createTagsSelector(),
(author, tagList) => {
const tags = author.tags
.map((tagId) => tagList.find((tag) => tag.id === tagId))
.filter((tag) => !!tag)
.map((tag) => tag.label)
.sort((a, b) => a.localeCompare(b));
const tags = _.reduce(author.tags, (acc, tag) => {
const matchingTag = _.find(tagList, { id: tag });
if (matchingTag) {
acc.push(matchingTag.label);
}
return acc;
}, []);
return {
tags

View File

@@ -30,23 +30,23 @@ class BookRow extends Component {
onManualSearchPress = () => {
this.setState({ isDetailsModalOpen: true });
};
}
onDetailsModalClose = () => {
this.setState({ isDetailsModalOpen: false });
};
}
onEditBookPress = () => {
this.setState({ isEditBookModalOpen: true });
};
}
onEditBookModalClose = () => {
this.setState({ isEditBookModalOpen: false });
};
}
onMonitorBookPress = (monitored, options) => {
this.props.onMonitorBookPress(this.props.id, monitored, options);
};
}
//
// Render

View File

@@ -16,7 +16,7 @@ class EditAuthorModalConnector extends Component {
onModalClose = () => {
this.props.clearPendingChanges({ section: 'author' });
this.props.onModalClose();
};
}
//
// Render

View File

@@ -48,13 +48,13 @@ class EditAuthorModalContent extends Component {
onSavePress(false);
}
};
}
onMoveAuthorPress = () => {
this.setState({ isConfirmMoveModalOpen: false });
this.props.onSavePress(true);
};
}
//
// Render

View File

@@ -83,14 +83,14 @@ class EditAuthorModalContentConnector extends Component {
onInputChange = ({ name, value }) => {
this.props.dispatchSetAuthorValue({ name, value });
};
}
onSavePress = (moveFiles) => {
this.props.dispatchSaveAuthor({
id: this.props.authorId,
moveFiles
});
};
}
//
// Render

View File

@@ -30,11 +30,11 @@ class RetagAuthorModalContent extends Component {
onCheckInputChange = ({ name, value }) => {
this.setState({ [name]: value });
};
}
onRetagAuthorPress = () => {
this.props.onRetagAuthorPress(this.state.updateCovers, this.state.embedMetadata);
};
}
//
// Render

View File

@@ -45,7 +45,7 @@ class RetagAuthorModalContentConnector extends Component {
});
this.props.onModalClose(true);
};
}
//
// Render

View File

@@ -80,7 +80,7 @@ class AuthorEditorFooter extends Component {
default:
this.props.onSaveSelected({ [name]: value });
}
};
}
onApplyTagsPress = (tags, applyTags) => {
this.setState({
@@ -92,23 +92,23 @@ class AuthorEditorFooter extends Component {
tags,
applyTags
});
};
}
onDeleteSelectedPress = () => {
this.setState({ isDeleteAuthorModalOpen: true });
};
}
onDeleteAuthorModalClose = () => {
this.setState({ isDeleteAuthorModalOpen: false });
};
}
onTagsPress = () => {
this.setState({ isTagsModalOpen: true });
};
}
onTagsModalClose = () => {
this.setState({ isTagsModalOpen: false });
};
}
onSaveRootFolderPress = () => {
this.setState({
@@ -117,7 +117,7 @@ class AuthorEditorFooter extends Component {
});
this.props.onSaveSelected({ rootFolderPath: this.state.destinationRootFolder });
};
}
onMoveAuthorPress = () => {
this.setState({
@@ -129,7 +129,7 @@ class AuthorEditorFooter extends Component {
rootFolderPath: this.state.destinationRootFolder,
moveFiles: true
});
};
}
//
// Render

View File

@@ -16,7 +16,7 @@ class AuthorEditorRow extends Component {
onBookFolderChange = () => {
// Mock handler to satisfy `onChange` being required for `CheckInput`.
//
};
}
//
// Render

View File

@@ -9,5 +9,5 @@
.path {
margin-left: 5px;
color: var(--dangerColor);
color: $dangerColor;
}

View File

@@ -29,14 +29,14 @@ class DeleteAuthorModalContent extends Component {
onDeleteFilesChange = ({ value }) => {
this.setState({ deleteFiles: value });
};
}
onDeleteAuthorConfirmed = () => {
const deleteFiles = this.state.deleteFiles;
this.setState({ deleteFiles: false });
this.props.onDeleteSelectedPress(deleteFiles);
};
}
//
// Render

View File

@@ -43,7 +43,7 @@ class OrganizeAuthorModalContentConnector extends Component {
});
this.props.onModalClose(true);
};
}
//
// Render

View File

@@ -34,7 +34,7 @@ class TagsModalContent extends Component {
onInputChange = ({ name, value }) => {
this.setState({ [name]: value });
};
}
onApplyTagsPress = () => {
const {
@@ -43,7 +43,7 @@ class TagsModalContent extends Component {
} = this.state;
this.props.onApplyTagsPress(tags, applyTags);
};
}
//
// Render

View File

@@ -54,7 +54,7 @@ class AuthorHistoryContentConnector extends Component {
authorId,
bookId
});
};
}
//
// Render

View File

@@ -55,16 +55,16 @@ class AuthorHistoryRow extends Component {
onMarkAsFailedPress = () => {
this.setState({ isMarkAsFailedModalOpen: true });
};
}
onConfirmMarkAsFailed = () => {
this.props.onMarkAsFailedPress(this.props.id);
this.setState({ isMarkAsFailedModalOpen: false });
};
}
onMarkAsFailedModalClose = () => {
this.setState({ isMarkAsFailedModalOpen: false });
};
}
//
// Render

View File

@@ -99,14 +99,14 @@ class AuthorIndex extends Component {
setScrollerRef = (ref) => {
this.setState({ scroller: ref });
};
}
getSelectedIds = () => {
if (this.state.allUnselected) {
return [];
}
return getSelectedIds(this.state.selectedState);
};
}
setSelectedState() {
const {
@@ -192,19 +192,19 @@ class AuthorIndex extends Component {
onPosterOptionsPress = () => {
this.setState({ isPosterOptionsModalOpen: true });
};
}
onPosterOptionsModalClose = () => {
this.setState({ isPosterOptionsModalOpen: false });
};
}
onOverviewOptionsPress = () => {
this.setState({ isOverviewOptionsModalOpen: true });
};
}
onOverviewOptionsModalClose = () => {
this.setState({ isOverviewOptionsModalOpen: false });
};
}
onEditorTogglePress = () => {
if (this.state.isEditorActive) {
@@ -214,36 +214,36 @@ class AuthorIndex extends Component {
newState.isEditorActive = true;
this.setState(newState);
}
};
}
onJumpBarItemPress = (jumpToCharacter) => {
this.setState({ jumpToCharacter });
};
}
onSelectAllChange = ({ value }) => {
this.setState(selectAll(this.state.selectedState, value));
};
}
onSelectAllPress = () => {
this.onSelectAllChange({ value: !this.state.allSelected });
};
}
onSelectedChange = ({ id, value, shiftKey = false }) => {
this.setState((state) => {
return toggleSelected(state, this.props.items, id, value, shiftKey);
});
};
}
onSaveSelected = (changes) => {
this.props.onSaveSelected({
authorIds: this.getSelectedIds(),
...changes
});
};
}
onOrganizeAuthorPress = () => {
this.setState({ isOrganizingAuthorModalOpen: true });
};
}
onOrganizeAuthorModalClose = (organized) => {
this.setState({ isOrganizingAuthorModalOpen: false });
@@ -251,11 +251,11 @@ class AuthorIndex extends Component {
if (organized === true) {
this.onSelectAllChange({ value: false });
}
};
}
onRetagAuthorPress = () => {
this.setState({ isRetaggingAuthorModalOpen: true });
};
}
onRetagAuthorModalClose = (organized) => {
this.setState({ isRetaggingAuthorModalOpen: false });
@@ -263,14 +263,14 @@ class AuthorIndex extends Component {
if (organized === true) {
this.onSelectAllChange({ value: false });
}
};
}
onRefreshAuthorPress = () => {
const selectedIds = this.getSelectedIds();
const refreshIds = this.state.isEditorActive && selectedIds.length > 0 ? selectedIds : [];
this.props.onRefreshAuthorPress(refreshIds);
};
}
//
// Render

View File

@@ -85,15 +85,15 @@ class AuthorIndexConnector extends Component {
onViewSelect = (view) => {
this.props.dispatchSetAuthorView(view);
};
}
onSaveSelected = (payload) => {
this.props.dispatchSaveAuthorEditor(payload);
};
}
onScroll = ({ scrollTop }) => {
scrollPositions.authorIndex = scrollTop;
};
}
//
// Render

View File

@@ -21,32 +21,32 @@
.continuing {
composes: legendItemColor;
background-color: var(--primaryColor);
background-color: $primaryColor;
}
.ended {
composes: legendItemColor;
background-color: var(--successColor);
background-color: $successColor;
}
.missingMonitored {
composes: legendItemColor;
background-color: var(--dangerColor);
background-color: $dangerColor;
&:global(.colorImpaired) {
background: repeating-linear-gradient(90deg, color(#f05050 shade(5%)), color(#f05050 shade(5%)) 5px, color(#f05050 shade(15%)) 5px, color(#f05050 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 {
composes: legendItemColor;
background-color: var(--warningColor);
background-color: $warningColor;
&:global(.colorImpaired) {
background: repeating-linear-gradient(45deg, #ffa500, #ffa500 5px, color(#ffa500 tint(15%)) 5px, color(#ffa500 tint(15%)) 10px);
background: repeating-linear-gradient(45deg, $warningColor, $warningColor 5px, color($warningColor tint(15%)) 5px, color($warningColor tint(15%)) 10px);
}
}

View File

@@ -98,14 +98,14 @@ class AuthorIndexItemConnector extends Component {
name: commandNames.REFRESH_AUTHOR,
authorId: this.props.id
});
};
}
onSearchPress = () => {
this.props.dispatchExecuteCommand({
name: commandNames.AUTHOR_SEARCH,
authorId: this.props.id
});
};
}
//
// Render

View File

@@ -3,7 +3,7 @@ $hoverScale: 1.05;
.container {
&:hover {
.content {
background-color: var(--tableRowHoverBackgroundColor);
background-color: $tableRowHoverBackgroundColor;
}
}
}
@@ -35,10 +35,10 @@ $hoverScale: 1.05;
composes: link from '~Components/Link/Link.css';
display: block;
color: var(--defaultColor);
color: $defaultColor;
&:hover {
color: var(--defaultColor);
color: $defaultColor;
text-decoration: none;
}
}
@@ -52,8 +52,8 @@ $hoverScale: 1.05;
height: 0;
border-width: 0 25px 25px 0;
border-style: solid;
border-color: transparent var(--dangerColor) transparent transparent;
color: var(--white);
border-color: transparent $dangerColor transparent transparent;
color: $white;
}
.info {

View File

@@ -51,22 +51,22 @@ class AuthorIndexOverview extends Component {
onEditAuthorPress = () => {
this.setState({ isEditAuthorModalOpen: true });
};
}
onEditAuthorModalClose = () => {
this.setState({ isEditAuthorModalOpen: false });
};
}
onDeleteAuthorPress = () => {
this.setState({
isEditAuthorModalOpen: false,
isDeleteAuthorModalOpen: true
});
};
}
onDeleteAuthorModalClose = () => {
this.setState({ isDeleteAuthorModalOpen: false });
};
}
onChange = ({ value, shiftKey }) => {
const {
@@ -75,7 +75,7 @@ class AuthorIndexOverview extends Component {
} = this.props;
onSelectedChange({ id, value, shiftKey });
};
}
//
// Render

View File

@@ -123,7 +123,7 @@ class AuthorIndexOverviews extends Component {
setGridRef = (ref) => {
this._grid = ref;
};
}
calculateGrid = (width = this.state.width, isSmallScreen) => {
const {
@@ -141,7 +141,7 @@ class AuthorIndexOverviews extends Component {
posterHeight,
rowHeight
});
};
}
cellRenderer = ({ key, rowIndex, style }) => {
const {
@@ -197,14 +197,14 @@ class AuthorIndexOverviews extends Component {
/>
</div>
);
};
}
//
// Listeners
onMeasure = ({ width }) => {
this.calculateGrid(width, this.props.isSmallScreen);
};
}
//
// Render

View File

@@ -122,7 +122,7 @@ class AuthorIndexOverviewOptionsModalContent extends Component {
}, () => {
this.props.onChangeOverviewOption({ [name]: value });
});
};
}
//
// Render

View File

@@ -5,7 +5,7 @@ $hoverScale: 1.05;
&:hover {
z-index: 2;
box-shadow: 0 0 12px var(--black);
box-shadow: 0 0 12px $black;
transition: all 200ms ease-in;
.controls {
@@ -32,7 +32,7 @@ $hoverScale: 1.05;
position: relative;
display: block;
height: 70px;
background-color: var(--defaultColor);
background-color: $defaultColor;
}
.overlayTitle {
@@ -45,13 +45,13 @@ $hoverScale: 1.05;
padding: 5px;
width: 100%;
height: 100%;
color: var(--offWhite);
color: $offWhite;
text-align: center;
font-size: 20px;
}
.nextAiring {
background-color: var(--seriesBackgroundColor);
background-color: #fafbfc;
text-align: center;
font-size: $smallFontSize;
}
@@ -59,7 +59,8 @@ $hoverScale: 1.05;
.title {
@add-mixin truncate;
background-color: var(--seriesBackgroundColor);
background-color: $defaultColor;
color: $white;
text-align: center;
font-size: $smallFontSize;
}
@@ -73,8 +74,8 @@ $hoverScale: 1.05;
height: 0;
border-width: 0 25px 25px 0;
border-style: solid;
border-color: transparent var(--dangerColor) transparent transparent;
color: var(--white);
border-color: transparent $dangerColor transparent transparent;
color: $white;
}
.editorSelect {
@@ -90,8 +91,8 @@ $hoverScale: 1.05;
left: 10px;
z-index: 3;
border-radius: 4px;
background-color: var(--readarrRed);
color: var(--white);
background-color: $themeLightColor;
color: $white;
font-size: $smallFontSize;
opacity: 0;
transition: opacity 0;

View File

@@ -35,34 +35,34 @@ class AuthorIndexPoster extends Component {
onEditAuthorPress = () => {
this.setState({ isEditAuthorModalOpen: true });
};
}
onEditAuthorModalClose = () => {
this.setState({ isEditAuthorModalOpen: false });
};
}
onDeleteAuthorPress = () => {
this.setState({
isEditAuthorModalOpen: false,
isDeleteAuthorModalOpen: true
});
};
}
onDeleteAuthorModalClose = () => {
this.setState({ isDeleteAuthorModalOpen: false });
};
}
onPosterLoad = () => {
if (this.state.hasPosterError) {
this.setState({ hasPosterError: false });
}
};
}
onPosterLoadError = () => {
if (!this.state.hasPosterError) {
this.setState({ hasPosterError: true });
}
};
}
onChange = ({ value, shiftKey }) => {
const {
@@ -71,7 +71,7 @@ class AuthorIndexPoster extends Component {
} = this.props;
onSelectedChange({ id, value, shiftKey });
};
}
//
// Render

View File

@@ -1,5 +1,5 @@
.info {
background-color: var(--seriesBackgroundColor);
background-color: #fafbfc;
text-align: center;
font-size: $smallFontSize;
}

View File

@@ -171,7 +171,7 @@ class AuthorIndexPosters extends Component {
setGridRef = (ref) => {
this._grid = ref;
};
}
calculateGrid = (width = this.state.width, isSmallScreen) => {
const {
@@ -193,7 +193,7 @@ class AuthorIndexPosters extends Component {
posterHeight,
rowHeight
});
};
}
cellRenderer = ({ key, rowIndex, columnIndex, style }) => {
const {
@@ -259,14 +259,14 @@ class AuthorIndexPosters extends Component {
/>
</div>
);
};
}
//
// Listeners
onMeasure = ({ width }) => {
this.calculateGrid(width, this.props.isSmallScreen);
};
}
//
// Render

View File

@@ -93,7 +93,7 @@ class AuthorIndexPosterOptionsModalContent extends Component {
}, () => {
this.props.onChangePosterOption({ [name]: value });
});
};
}
//
// Render

View File

@@ -3,7 +3,7 @@
border-radius: 0;
background-color: #5b5b5b;
color: var(--white);
color: $white;
transition: width 200ms ease;
}

View File

@@ -27,22 +27,22 @@ class AuthorIndexActionsCell extends Component {
onEditAuthorPress = () => {
this.setState({ isEditAuthorModalOpen: true });
};
}
onEditAuthorModalClose = () => {
this.setState({ isEditAuthorModalOpen: false });
};
}
onDeleteAuthorPress = () => {
this.setState({
isEditAuthorModalOpen: false,
isDeleteAuthorModalOpen: true
});
};
}
onDeleteAuthorModalClose = () => {
this.setState({ isDeleteAuthorModalOpen: false });
};
}
//
// Render

View File

@@ -31,7 +31,7 @@
position: relative;
display: block;
height: 70px;
background-color: var(--defaultColor);
background-color: $defaultColor;
}
.bannerImage {
@@ -49,7 +49,7 @@
padding: 5px;
width: 100%;
height: 100%;
color: var(--offWhite);
color: $offWhite;
text-align: center;
font-size: 20px;
}
@@ -92,7 +92,7 @@
}
.ratings {
composes: cell from '~Components/Table/Cells/VirtualTableRowCell.css';
composes: headerCell from '~Components/Table/VirtualTableHeaderCell.css';
flex: 0 0 80px;
}

View File

@@ -40,39 +40,39 @@ class AuthorIndexRow extends Component {
onEditAuthorPress = () => {
this.setState({ isEditAuthorModalOpen: true });
};
}
onEditAuthorModalClose = () => {
this.setState({ isEditAuthorModalOpen: false });
};
}
onDeleteAuthorPress = () => {
this.setState({
isEditAuthorModalOpen: false,
isDeleteAuthorModalOpen: true
});
};
}
onDeleteAuthorModalClose = () => {
this.setState({ isDeleteAuthorModalOpen: false });
};
}
onUseSceneNumberingChange = () => {
// Mock handler to satisfy `onChange` being required for `CheckInput`.
//
};
}
onBannerLoad = () => {
if (this.state.hasBannerError) {
this.setState({ hasBannerError: false });
}
};
}
onBannerLoadError = () => {
if (!this.state.hasBannerError) {
this.setState({ hasBannerError: true });
}
};
}
//
// Render

View File

@@ -78,7 +78,7 @@ class AuthorIndexTable extends Component {
/>
</VirtualTableRow>
);
};
}
//
// Render

View File

@@ -60,7 +60,7 @@ class AuthorIndexTableOptions extends Component {
}
});
});
};
}
//
// Render

View File

@@ -16,7 +16,7 @@ class MonitoringOptionsModalConnector extends Component {
onModalClose = () => {
this.props.clearPendingChanges({ section: 'authors' });
this.props.onModalClose();
};
}
//
// Render

View File

@@ -44,7 +44,7 @@ class MonitoringOptionsModalContent extends Component {
onInputChange = ({ name, value }) => {
this.setState({ [name]: value });
};
}
//
// Listeners
@@ -65,11 +65,11 @@ class MonitoringOptionsModalContent extends Component {
if (!isSaving) {
this.onModalClose();
}
};
}
onModalClose = () => {
this.props.onModalClose();
};
}
//
// Render

View File

@@ -42,14 +42,14 @@ class MonitoringOptionsModalContentConnector extends Component {
onInputChange = ({ name, value }) => {
this.setState({ name, value });
};
}
onSavePress = ({ monitor }) => {
this.props.dispatchUpdateMonitoringOptions({
id: this.props.authorId,
monitor
});
};
}
//
// Render

View File

@@ -1,33 +0,0 @@
import PropTypes from 'prop-types';
import React from 'react';
import Label from 'Components/Label';
import { kinds } from 'Helpers/Props';
function BookFormats({ formats }) {
return (
<div>
{
formats.map((format) => {
return (
<Label
key={format.id}
kind={kinds.INFO}
>
{format.name}
</Label>
);
})
}
</div>
);
}
BookFormats.propTypes = {
formats: PropTypes.arrayOf(PropTypes.object).isRequired
};
BookFormats.defaultProps = {
formats: []
};
export default BookFormats;

View File

@@ -25,11 +25,11 @@ class BookSearchCell extends Component {
onManualSearchPress = () => {
this.setState({ isDetailsModalOpen: true });
};
}
onDetailsModalClose = () => {
this.setState({ isDetailsModalOpen: false });
};
}
//
// Render

View File

@@ -2,7 +2,7 @@
composes: link from '~Components/Link/Link.css';
&:hover {
color: var(--linkHoverColor);
color: $linkHoverColor;
text-decoration: underline;
}
}

View File

@@ -8,5 +8,5 @@
.deleteFilesMessage {
margin-top: 20px;
color: var(--dangerColor);
color: $dangerColor;
}

Some files were not shown because too many files have changed in this diff Show More