From 1d5931c3740927dd4cbe8dd9157b302432c33d65 Mon Sep 17 00:00:00 2001 From: George Adams Date: Mon, 18 Sep 2023 12:53:08 +0100 Subject: [PATCH] linter fixes --- .github/linters/.markdown-lint.yml | 24 ++++++++++++++ 404.html | 44 ------------------------- README.md | 7 ++-- index.html | 1 + src/Graph/Trends.js | 52 ++++++++++++++++-------------- 5 files changed, 57 insertions(+), 71 deletions(-) create mode 100644 .github/linters/.markdown-lint.yml delete mode 100644 404.html diff --git a/.github/linters/.markdown-lint.yml b/.github/linters/.markdown-lint.yml new file mode 100644 index 00000000..5ffc9263 --- /dev/null +++ b/.github/linters/.markdown-lint.yml @@ -0,0 +1,24 @@ +########################### +########################### +## Markdown Linter rules ## +########################### +########################### + +# Linter rules doc: +# - https://github.com/DavidAnson/markdownlint +# +# Note: +# To comment out a single error: +# +# any violations you want +# +# + +############### +# Rules by id # +############### +MD013: false # Line length is usually not important and the 80 char limit is way too small anyway +MD026: false # Trailing punctuation in header +MD033: false # Inline HTML is important for multilines and checkboxes within markdown tables +MD034: false # no-bare-urls Bare URL used +MD029: false # Markdown automatically calculates the ordered list order diff --git a/404.html b/404.html deleted file mode 100644 index 0bc72060..00000000 --- a/404.html +++ /dev/null @@ -1,44 +0,0 @@ - - - - - - Single Page Apps for GitHub Pages - - - - - - - diff --git a/README.md b/README.md index 2a7c48f2..3e8c6ec3 100644 --- a/README.md +++ b/README.md @@ -7,7 +7,8 @@ The next gen download dashboard ## Local run/development steps - start DownloadStats -``` + +```bash npm install npm start ``` @@ -17,9 +18,9 @@ npm start ## Deployment - Compile and generate static files -``` + +```bash npm run-script build ``` - serve ./dist - diff --git a/index.html b/index.html index 05e0ef8e..712cae2e 100644 --- a/index.html +++ b/index.html @@ -1,3 +1,4 @@ + diff --git a/src/Graph/Trends.js b/src/Graph/Trends.js index 35ca60de..89d283cb 100644 --- a/src/Graph/Trends.js +++ b/src/Graph/Trends.js @@ -7,6 +7,18 @@ import moment from 'moment' import { Radio, Slider, Checkbox } from 'antd' import './Trends.css' +const TypeFilter = ({ defaultValue, onChange, options }) => ( +
+
Type
+ +
+); + export default class Trends extends Component { state = { series: undefined, @@ -146,18 +158,14 @@ export default class Trends extends Component { onChange={e => { args.visible = e.target.checked; updateFunc() }} /> -
-
Type
- { args.type = e.target.value; updateFunc() }} - options={[ - { label: 'Daily', value: 'daily' }, - { label: 'Total', value: 'total' } - ]} - /> -
+ { args.type = e.target.value; updateFunc() }} + options={[ + { label: 'Daily', value: 'daily' }, + { label: 'Total', value: 'total' } + ]} + /> {this.renderFilters(args, updateFunc)} ) @@ -166,18 +174,14 @@ export default class Trends extends Component { renderMonthlyFilters (args, updateFunc) { return (
-
-
Type
- { args.type = e.target.value; updateFunc() }} - options={[ - { label: 'Monthly', value: 'monthly' }, - { label: 'Total', value: 'total' } - ]} - /> -
+ { args.type = e.target.value; updateFunc() }} + options={[ + { label: 'Monthly', value: 'monthly' }, + { label: 'Total', value: 'total' } + ]} + /> {this.renderFilters(args, updateFunc)}
)