From d80426cdab110dee7effa94300ea18b35c2c6657 Mon Sep 17 00:00:00 2001 From: Patrick Connolly Date: Tue, 30 Jun 2020 19:21:03 -0300 Subject: [PATCH 001/106] Updated eslint. Migrated away from deprecated packages of eslint standards. Fixed errors. --- client-admin/.eslintrc | 6 +- client-admin/package-lock.json | 1607 ++++++++++++++++++-------------- client-admin/package.json | 10 +- 3 files changed, 928 insertions(+), 695 deletions(-) diff --git a/client-admin/.eslintrc b/client-admin/.eslintrc index 8e7457083..9d9b73d10 100644 --- a/client-admin/.eslintrc +++ b/client-admin/.eslintrc @@ -6,9 +6,5 @@ extends: - standard - standard-jsx - standard-react - - defaults/configurations/walmart/es6-react rules: - - comma-dangle: ["error", "never"] -parserOptions: - - ecmaFeatures: - - jsx: true + comma-dangle: ["error", "never"] diff --git a/client-admin/package-lock.json b/client-admin/package-lock.json index f03b4aeb7..885569832 100644 --- a/client-admin/package-lock.json +++ b/client-admin/package-lock.json @@ -2837,6 +2837,18 @@ "@theme-ui/mdx": "^0.3.0" } }, + "@types/color-name": { + "version": "1.1.1", + "resolved": "https://registry.npmjs.org/@types/color-name/-/color-name-1.1.1.tgz", + "integrity": "sha512-rr+OQyAjxze7GgWrSaJwydHStIhHq2lvY3BOC2Mj7KnzI7XK0Uw1TOOdI9lDoajEbSWLiYgoo4f1R51erQfhPQ==", + "dev": true + }, + "@types/json5": { + "version": "0.0.29", + "resolved": "https://registry.npmjs.org/@types/json5/-/json5-0.0.29.tgz", + "integrity": "sha1-7ihweulOEdK4J7y+UnC86n8+ce4=", + "dev": true + }, "@types/mdast": { "version": "3.0.3", "resolved": "https://registry.npmjs.org/@types/mdast/-/mdast-3.0.3.tgz", @@ -3079,9 +3091,9 @@ "dev": true }, "acorn": { - "version": "5.7.4", - "resolved": "https://registry.npmjs.org/acorn/-/acorn-5.7.4.tgz", - "integrity": "sha512-1D++VG7BhrtvQpNbBzovKNc1FLGGEE/oGe7b9xJm/RFHMBeUaUGpluV9RLjZa47YFdPcDAenEYuq9pQPcMdLJg==", + "version": "7.3.1", + "resolved": "https://registry.npmjs.org/acorn/-/acorn-7.3.1.tgz", + "integrity": "sha512-tLc0wSnatxAQHVHUapaHdz72pi9KUyHjq5KyHjGg9Y8Ifdc79pTh2XvI6I1/chZbnM7QtNKzh66ooDogPZSleA==", "dev": true }, "acorn-globals": { @@ -3102,21 +3114,10 @@ } }, "acorn-jsx": { - "version": "3.0.1", - "resolved": "https://registry.npmjs.org/acorn-jsx/-/acorn-jsx-3.0.1.tgz", - "integrity": "sha1-r9+UiPsezvyDSPb7IvRk4ypYs2s=", - "dev": true, - "requires": { - "acorn": "^3.0.4" - }, - "dependencies": { - "acorn": { - "version": "3.3.0", - "resolved": "https://registry.npmjs.org/acorn/-/acorn-3.3.0.tgz", - "integrity": "sha1-ReN/s56No/JbruP/U2niu18iAXo=", - "dev": true - } - } + "version": "5.2.0", + "resolved": "https://registry.npmjs.org/acorn-jsx/-/acorn-jsx-5.2.0.tgz", + "integrity": "sha512-HiUX/+K2YpkpJ+SzBffkM/AQ2YE03S0U1kjTLVpoJdhZMOWy8qvXVN9JdLqv2QsaQ6MPYQIuNmwD8zOiYUofLQ==", + "dev": true }, "acorn-walk": { "version": "7.1.1", @@ -3125,29 +3126,15 @@ "dev": true }, "ajv": { - "version": "5.5.2", - "resolved": "https://registry.npmjs.org/ajv/-/ajv-5.5.2.tgz", - "integrity": "sha1-c7Xuyj+rZT49P5Qis0GtQiBdyWU=", + "version": "6.12.2", + "resolved": "https://registry.npmjs.org/ajv/-/ajv-6.12.2.tgz", + "integrity": "sha512-k+V+hzjm5q/Mr8ef/1Y9goCmlsK4I6Sm74teeyGvFk1XrOsbsKLjEdrvny42CZ+a8sXbk8KWpY/bDwS+FLL2UQ==", "dev": true, "requires": { - "co": "^4.6.0", - "fast-deep-equal": "^1.0.0", + "fast-deep-equal": "^3.1.1", "fast-json-stable-stringify": "^2.0.0", - "json-schema-traverse": "^0.3.0" - }, - "dependencies": { - "fast-deep-equal": { - "version": "1.1.0", - "resolved": "https://registry.npmjs.org/fast-deep-equal/-/fast-deep-equal-1.1.0.tgz", - "integrity": "sha1-wFNHeBfIa1HaqFPIHgWbcz0CNhQ=", - "dev": true - }, - "json-schema-traverse": { - "version": "0.3.1", - "resolved": "https://registry.npmjs.org/json-schema-traverse/-/json-schema-traverse-0.3.1.tgz", - "integrity": "sha1-NJptRMU6Ud6JtAgFxdXlm0F9M0A=", - "dev": true - } + "json-schema-traverse": "^0.4.1", + "uri-js": "^4.2.2" } }, "ajv-errors": { @@ -3156,12 +3143,6 @@ "integrity": "sha512-DCRfO/4nQ+89p/RK43i8Ezd41EqdGIU4ld7nGF8OQ14oc/we5rEntLCUa7+jrn3nn83BosfwZA0wb4pon2o8iQ==", "dev": true }, - "ajv-keywords": { - "version": "2.1.1", - "resolved": "https://registry.npmjs.org/ajv-keywords/-/ajv-keywords-2.1.1.tgz", - "integrity": "sha1-YXmX/F9gV2iUxDX5QNgZ4TW4B2I=", - "dev": true - }, "align-text": { "version": "0.1.4", "resolved": "https://registry.npmjs.org/align-text/-/align-text-0.1.4.tgz", @@ -3180,6 +3161,12 @@ "integrity": "sha1-SlKCrBZHKek2Gbz9OtFR+BfOkfU=", "dev": true }, + "ansi-colors": { + "version": "3.2.4", + "resolved": "https://registry.npmjs.org/ansi-colors/-/ansi-colors-3.2.4.tgz", + "integrity": "sha512-hHUXGagefjN2iRrID63xckIvotOXOojhQKWIPUZ4mNUZ9nLZW+7FMNoE1lOkEhNWYsx/7ysGIuJYCiMAA9FnrA==", + "dev": true + }, "ansi-escapes": { "version": "1.4.0", "resolved": "https://registry.npmjs.org/ansi-escapes/-/ansi-escapes-1.4.0.tgz", @@ -3285,6 +3272,17 @@ "integrity": "sha1-ml9pkFGx5wczKPKgCJaLZOopVdI=", "dev": true }, + "array-includes": { + "version": "3.1.1", + "resolved": "https://registry.npmjs.org/array-includes/-/array-includes-3.1.1.tgz", + "integrity": "sha512-c2VXaCHl7zPsvpkFsw4nxvFie4fh1ur9bpcgsVkIjqn0H/Xwdg+7fv3n2r/isyS8EBj5b06M9kHyZuIr4El6WQ==", + "dev": true, + "requires": { + "define-properties": "^1.1.3", + "es-abstract": "^1.17.0", + "is-string": "^1.0.5" + } + }, "array-slice": { "version": "1.1.0", "resolved": "https://registry.npmjs.org/array-slice/-/array-slice-1.1.0.tgz", @@ -3312,6 +3310,16 @@ "integrity": "sha1-odl8yvy8JiXMcPrc6zalDFiwGlM=", "dev": true }, + "array.prototype.flat": { + "version": "1.2.3", + "resolved": "https://registry.npmjs.org/array.prototype.flat/-/array.prototype.flat-1.2.3.tgz", + "integrity": "sha512-gBlRZV0VSmfPIeWfuuy56XZMvbVfbEUnOXUvt3F/eUUUSyzlgLxhEX4YAEpxNAogRGehPSnfXyPtYyKAhkzQhQ==", + "dev": true, + "requires": { + "define-properties": "^1.1.3", + "es-abstract": "^1.17.0-next.1" + } + }, "arrify": { "version": "1.0.1", "resolved": "https://registry.npmjs.org/arrify/-/arrify-1.0.1.tgz", @@ -3391,6 +3399,12 @@ "integrity": "sha1-WWZ/QfrdTyDMvCu5a41Pf3jsA2c=", "dev": true }, + "astral-regex": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/astral-regex/-/astral-regex-1.0.0.tgz", + "integrity": "sha512-+Ryf6g3BKoRc7jfp7ad8tM4TtMiaWvbF/1/sQcZPkkS7ag3D5nMBCe2UfOTONtAkaG0tO0ij3C5Lwmf1EiyjHg==", + "dev": true + }, "async": { "version": "1.5.2", "resolved": "https://registry.npmjs.org/async/-/async-1.5.2.tgz", @@ -4949,23 +4963,6 @@ } } }, - "caller-path": { - "version": "0.1.0", - "resolved": "https://registry.npmjs.org/caller-path/-/caller-path-0.1.0.tgz", - "integrity": "sha1-lAhe9jWB7NPaqSREqP6U6CV3dR8=", - "dev": true, - "requires": { - "callsites": "^0.2.0" - }, - "dependencies": { - "callsites": { - "version": "0.2.0", - "resolved": "https://registry.npmjs.org/callsites/-/callsites-0.2.0.tgz", - "integrity": "sha1-r6uWJikQp/M8GaV3WCXGnzTjUMo=", - "dev": true - } - } - }, "callsites": { "version": "2.0.0", "resolved": "https://registry.npmjs.org/callsites/-/callsites-2.0.0.tgz", @@ -5068,12 +5065,6 @@ "resolved": "https://registry.npmjs.org/character-reference-invalid/-/character-reference-invalid-1.1.4.tgz", "integrity": "sha512-mKKUkUbhPpQlCOfIuZkvSEgktjPFIsZKRRbC6KWVEMvlzblj3i3asQv5ODsrwt0N3pHAEvjP8KTQPHkp0+6jOg==" }, - "chardet": { - "version": "0.4.2", - "resolved": "https://registry.npmjs.org/chardet/-/chardet-0.4.2.tgz", - "integrity": "sha1-tUc7M9yXxCTl2Y3IfVXU2KKci/I=", - "dev": true - }, "check-types": { "version": "8.0.3", "resolved": "https://registry.npmjs.org/check-types/-/check-types-8.0.3.tgz", @@ -5111,12 +5102,6 @@ "safe-buffer": "^5.0.1" } }, - "circular-json": { - "version": "0.3.3", - "resolved": "https://registry.npmjs.org/circular-json/-/circular-json-0.3.3.tgz", - "integrity": "sha512-UZK3NBx2Mca+b5LsG7bY183pHWt5Y1xts4P3Pz7ENTwGVnJOUWbRb3ocjvX7hx9tq/yTAdclXm9sZ38gNuem4A==", - "dev": true - }, "class-utils": { "version": "0.3.6", "resolved": "https://registry.npmjs.org/class-utils/-/class-utils-0.3.6.tgz", @@ -5146,15 +5131,6 @@ } } }, - "cli-cursor": { - "version": "2.1.0", - "resolved": "https://registry.npmjs.org/cli-cursor/-/cli-cursor-2.1.0.tgz", - "integrity": "sha1-s12sN2R5+sw+lHR9QdDQ9SOP/LU=", - "dev": true, - "requires": { - "restore-cursor": "^2.0.0" - } - }, "cli-table": { "version": "0.3.1", "resolved": "https://registry.npmjs.org/cli-table/-/cli-table-0.3.1.tgz", @@ -5182,12 +5158,6 @@ "marked-terminal": "^1.6.2" } }, - "cli-width": { - "version": "2.2.1", - "resolved": "https://registry.npmjs.org/cli-width/-/cli-width-2.2.1.tgz", - "integrity": "sha512-GRMWDxpOB6Dgk2E5Uo+3eEBvtOOlimMmpbFiKuLFnQzYDavtLFY3K5ona41jgN/WdRZtG7utuVSVTL4HbZHGkw==", - "dev": true - }, "cliui": { "version": "2.1.0", "resolved": "https://registry.npmjs.org/cliui/-/cliui-2.1.0.tgz", @@ -5217,12 +5187,6 @@ "resolved": "https://registry.npmjs.org/clsx/-/clsx-1.1.0.tgz", "integrity": "sha512-3avwM37fSK5oP6M5rQ9CNe99lwxhXDOeSWVPAOYF6OazUTgZCMb0yWlJpmdD74REy1gkEaFiub2ULv4fq9GUhA==" }, - "co": { - "version": "4.6.0", - "resolved": "https://registry.npmjs.org/co/-/co-4.6.0.tgz", - "integrity": "sha1-bqa989hTrlTMuOR7+gvz+QMfsYQ=", - "dev": true - }, "code-point-at": { "version": "1.1.0", "resolved": "https://registry.npmjs.org/code-point-at/-/code-point-at-1.1.0.tgz", @@ -5350,6 +5314,12 @@ "integrity": "sha1-wguW2MYXdIqvHBYCF2DNJ/y4y3U=", "dev": true }, + "contains-path": { + "version": "0.1.0", + "resolved": "https://registry.npmjs.org/contains-path/-/contains-path-0.1.0.tgz", + "integrity": "sha1-/ozxhP9mcLa67wGp1IYaXL7EEgo=", + "dev": true + }, "content-type-parser": { "version": "1.0.1", "resolved": "https://registry.npmjs.org/content-type-parser/-/content-type-parser-1.0.1.tgz", @@ -5532,31 +5502,30 @@ } }, "cross-spawn": { - "version": "5.1.0", - "resolved": "https://registry.npmjs.org/cross-spawn/-/cross-spawn-5.1.0.tgz", - "integrity": "sha1-6L0O/uWPz/b4+UUQoKVUu/ojVEk=", + "version": "7.0.3", + "resolved": "https://registry.npmjs.org/cross-spawn/-/cross-spawn-7.0.3.tgz", + "integrity": "sha512-iRDPJKUPVEND7dHPO8rkbOnPpyDygcDFtWjpeWNCgy8WP2rXcxXL8TskReQl6OrB2G7+UJrags1q15Fudc7G6w==", "dev": true, "requires": { - "lru-cache": "^4.0.1", - "shebang-command": "^1.2.0", - "which": "^1.2.9" + "path-key": "^3.1.0", + "shebang-command": "^2.0.0", + "which": "^2.0.1" }, "dependencies": { - "lru-cache": { - "version": "4.1.5", - "resolved": "https://registry.npmjs.org/lru-cache/-/lru-cache-4.1.5.tgz", - "integrity": "sha512-sWZlbEP2OsHNkXrMl5GYk/jKk70MBng6UU4YI/qGDYbgf6YbP4EvmqISbXCoJiRKs+1bSpFHVgQxvJ17F2li5g==", + "isexe": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/isexe/-/isexe-2.0.0.tgz", + "integrity": "sha1-6PvzdNxVb/iUehDcsFctYz8s+hA=", + "dev": true + }, + "which": { + "version": "2.0.2", + "resolved": "https://registry.npmjs.org/which/-/which-2.0.2.tgz", + "integrity": "sha512-BLI3Tl1TW3Pvl70l3yq3Y64i+awpwXqsGBYWkkqMtnbXgrMD+yj7rhW0kuEDxzJaYXGjEW5ogapKNMEKNMjibA==", "dev": true, "requires": { - "pseudomap": "^1.0.2", - "yallist": "^2.1.2" + "isexe": "^2.0.0" } - }, - "yallist": { - "version": "2.1.2", - "resolved": "https://registry.npmjs.org/yallist/-/yallist-2.1.2.tgz", - "integrity": "sha1-HBH5IY8HYImkfdUS+TxmmaaoHVI=", - "dev": true } } }, @@ -6144,9 +6113,9 @@ } }, "doctrine": { - "version": "2.1.0", - "resolved": "https://registry.npmjs.org/doctrine/-/doctrine-2.1.0.tgz", - "integrity": "sha512-35mSku4ZXK0vfCuHEDAwt55dg2jNajHZ1odvF+8SSr82EsZY4QmXfuWso8oEd8zRhVObSN18aM0CjSdoBX7zIw==", + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/doctrine/-/doctrine-3.0.0.tgz", + "integrity": "sha512-yS+Q5i3hBf7GBkd4KG8a7eBNNWNGLTaEwwYWUijIYM7zrlYDM0BFXHjjPWlWZ1Rg7UaddZeIDmi9jF3HmqiQ2w==", "dev": true, "requires": { "esutils": "^2.0.2" @@ -6323,6 +6292,12 @@ } } }, + "emoji-regex": { + "version": "7.0.3", + "resolved": "https://registry.npmjs.org/emoji-regex/-/emoji-regex-7.0.3.tgz", + "integrity": "sha512-CwBLREIQ7LvYFB0WyRvwhq5N5qPhc6PMjD6bYggFlI5YyDgl+0vxq5VHbMOFqLg7hfWzmu8T5Z1QofhmTIhItA==", + "dev": true + }, "emojis-list": { "version": "2.1.0", "resolved": "https://registry.npmjs.org/emojis-list/-/emojis-list-2.1.0.tgz", @@ -6380,6 +6355,15 @@ } } }, + "enquirer": { + "version": "2.3.5", + "resolved": "https://registry.npmjs.org/enquirer/-/enquirer-2.3.5.tgz", + "integrity": "sha512-BNT1C08P9XD0vNg3J475yIUG+mVdp9T6towYFHUv897X0KoHBjB1shyrNmhmtHWKP17iSWgo7Gqh7BBuzLZMSA==", + "dev": true, + "requires": { + "ansi-colors": "^3.2.1" + } + }, "entities": { "version": "2.0.2", "resolved": "https://registry.npmjs.org/entities/-/entities-2.0.2.tgz", @@ -6412,6 +6396,36 @@ "stackframe": "^0.3.1" } }, + "es-abstract": { + "version": "1.17.6", + "resolved": "https://registry.npmjs.org/es-abstract/-/es-abstract-1.17.6.tgz", + "integrity": "sha512-Fr89bON3WFyUi5EvAeI48QTWX0AyekGgLA8H+c+7fbfCkJwRWRMLd8CQedNEyJuoYYhmtEqY92pgte1FAhBlhw==", + "dev": true, + "requires": { + "es-to-primitive": "^1.2.1", + "function-bind": "^1.1.1", + "has": "^1.0.3", + "has-symbols": "^1.0.1", + "is-callable": "^1.2.0", + "is-regex": "^1.1.0", + "object-inspect": "^1.7.0", + "object-keys": "^1.1.1", + "object.assign": "^4.1.0", + "string.prototype.trimend": "^1.0.1", + "string.prototype.trimstart": "^1.0.1" + } + }, + "es-to-primitive": { + "version": "1.2.1", + "resolved": "https://registry.npmjs.org/es-to-primitive/-/es-to-primitive-1.2.1.tgz", + "integrity": "sha512-QCOllgZJtaUo9miYBcLChTUaHNjJF3PYs1VidD7AwiEj1kYxKeQTctLAezAOH5ZKRH0g2IgPn6KwB4IT8iRpvA==", + "dev": true, + "requires": { + "is-callable": "^1.1.4", + "is-date-object": "^1.0.1", + "is-symbol": "^1.0.2" + } + }, "es6-promise": { "version": "4.2.8", "resolved": "https://registry.npmjs.org/es6-promise/-/es6-promise-4.2.8.tgz", @@ -6503,174 +6517,170 @@ } }, "eslint": { - "version": "4.18.2", - "resolved": "https://registry.npmjs.org/eslint/-/eslint-4.18.2.tgz", - "integrity": "sha512-qy4i3wODqKMYfz9LUI8N2qYDkHkoieTbiHpMrYUI/WbjhXJQr7lI4VngixTgaG+yHX+NBCv7nW4hA0ShbvaNKw==", - "dev": true, - "requires": { - "ajv": "^5.3.0", - "babel-code-frame": "^6.22.0", - "chalk": "^2.1.0", - "concat-stream": "^1.6.0", - "cross-spawn": "^5.1.0", - "debug": "^3.1.0", - "doctrine": "^2.1.0", - "eslint-scope": "^3.7.1", - "eslint-visitor-keys": "^1.0.0", - "espree": "^3.5.2", - "esquery": "^1.0.0", + "version": "7.3.1", + "resolved": "https://registry.npmjs.org/eslint/-/eslint-7.3.1.tgz", + "integrity": "sha512-cQC/xj9bhWUcyi/RuMbRtC3I0eW8MH0jhRELSvpKYkWep3C6YZ2OkvcvJVUeO6gcunABmzptbXBuDoXsjHmfTA==", + "dev": true, + "requires": { + "@babel/code-frame": "^7.0.0", + "ajv": "^6.10.0", + "chalk": "^4.0.0", + "cross-spawn": "^7.0.2", + "debug": "^4.0.1", + "doctrine": "^3.0.0", + "enquirer": "^2.3.5", + "eslint-scope": "^5.1.0", + "eslint-utils": "^2.0.0", + "eslint-visitor-keys": "^1.2.0", + "espree": "^7.1.0", + "esquery": "^1.2.0", "esutils": "^2.0.2", - "file-entry-cache": "^2.0.0", + "file-entry-cache": "^5.0.1", "functional-red-black-tree": "^1.0.1", - "glob": "^7.1.2", - "globals": "^11.0.1", - "ignore": "^3.3.3", + "glob-parent": "^5.0.0", + "globals": "^12.1.0", + "ignore": "^4.0.6", + "import-fresh": "^3.0.0", "imurmurhash": "^0.1.4", - "inquirer": "^3.0.6", - "is-resolvable": "^1.0.0", - "js-yaml": "^3.9.1", + "is-glob": "^4.0.0", + "js-yaml": "^3.13.1", "json-stable-stringify-without-jsonify": "^1.0.1", - "levn": "^0.3.0", - "lodash": "^4.17.4", - "minimatch": "^3.0.2", - "mkdirp": "^0.5.1", + "levn": "^0.4.1", + "lodash": "^4.17.14", + "minimatch": "^3.0.4", "natural-compare": "^1.4.0", - "optionator": "^0.8.2", - "path-is-inside": "^1.0.2", - "pluralize": "^7.0.0", + "optionator": "^0.9.1", "progress": "^2.0.0", - "require-uncached": "^1.0.3", - "semver": "^5.3.0", - "strip-ansi": "^4.0.0", - "strip-json-comments": "~2.0.1", - "table": "4.0.2", - "text-table": "~0.2.0" + "regexpp": "^3.1.0", + "semver": "^7.2.1", + "strip-ansi": "^6.0.0", + "strip-json-comments": "^3.1.0", + "table": "^5.2.3", + "text-table": "^0.2.0", + "v8-compile-cache": "^2.0.3" }, "dependencies": { - "babel-code-frame": { - "version": "6.26.0", - "resolved": "https://registry.npmjs.org/babel-code-frame/-/babel-code-frame-6.26.0.tgz", - "integrity": "sha1-Y/1D99weO7fONZR9uP42mj9Yx0s=", + "ansi-regex": { + "version": "5.0.0", + "resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-5.0.0.tgz", + "integrity": "sha512-bY6fj56OUQ0hU1KjFNDQuJFezqKdrAyFdIevADiqrWHwSlbmBNMHp5ak2f40Pm8JTFyM2mqxkG6ngkHO11f/lg==", + "dev": true + }, + "ansi-styles": { + "version": "4.2.1", + "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-4.2.1.tgz", + "integrity": "sha512-9VGjrMsG1vePxcSweQsN20KY/c4zN0h9fLjqAbwbPfahM3t+NL+M9HC8xeXG2I8pX5NoamTGNuomEUFI7fcUjA==", "dev": true, "requires": { - "chalk": "^1.1.3", - "esutils": "^2.0.2", - "js-tokens": "^3.0.2" - }, - "dependencies": { - "chalk": { - "version": "1.1.3", - "resolved": "https://registry.npmjs.org/chalk/-/chalk-1.1.3.tgz", - "integrity": "sha1-qBFcVeSnAv5NFQq9OHKCKn4J/Jg=", - "dev": true, - "requires": { - "ansi-styles": "^2.2.1", - "escape-string-regexp": "^1.0.2", - "has-ansi": "^2.0.0", - "strip-ansi": "^3.0.0", - "supports-color": "^2.0.0" - } - }, - "strip-ansi": { - "version": "3.0.1", - "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-3.0.1.tgz", - "integrity": "sha1-ajhfuIU9lS1f8F0Oiq+UJ43GPc8=", - "dev": true, - "requires": { - "ansi-regex": "^2.0.0" - } - } + "@types/color-name": "^1.1.1", + "color-convert": "^2.0.1" + } + }, + "balanced-match": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/balanced-match/-/balanced-match-1.0.0.tgz", + "integrity": "sha1-ibTRmasr7kneFk6gK4nORi1xt2c=", + "dev": true + }, + "brace-expansion": { + "version": "1.1.11", + "resolved": "https://registry.npmjs.org/brace-expansion/-/brace-expansion-1.1.11.tgz", + "integrity": "sha512-iCuPHDFgrHX7H2vEI/5xpz07zSHB00TpugqhmYtVmMO6518mCuRMoOYFldEBl0g187ufozdaHgWKcYFb61qGiA==", + "dev": true, + "requires": { + "balanced-match": "^1.0.0", + "concat-map": "0.0.1" } }, "chalk": { - "version": "2.4.2", - "resolved": "https://registry.npmjs.org/chalk/-/chalk-2.4.2.tgz", - "integrity": "sha512-Mti+f9lpJNcwF4tWV8/OrTTtF1gZi+f8FqlyAdouralcFWFQWF2+NgCHShjkCb+IFBLq9buZwE1xckQU4peSuQ==", + "version": "4.1.0", + "resolved": "https://registry.npmjs.org/chalk/-/chalk-4.1.0.tgz", + "integrity": "sha512-qwx12AxXe2Q5xQ43Ac//I6v5aXTipYrSESdOgzrN+9XjgEpyjpKuvSGaN4qE93f7TQTlerQQ8S+EQ0EyDoVL1A==", "dev": true, "requires": { - "ansi-styles": "^3.2.1", - "escape-string-regexp": "^1.0.5", - "supports-color": "^5.3.0" - }, - "dependencies": { - "ansi-styles": { - "version": "3.2.1", - "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-3.2.1.tgz", - "integrity": "sha512-VT0ZI6kZRdTh8YyJw3SMbYm/u+NqfsAxEpWO0Pf9sq8/e94WxxOpPKx9FR1FlyCtOVDNOQ+8ntlqFxiRc+r5qA==", - "dev": true, - "requires": { - "color-convert": "^1.9.0" - } - }, - "supports-color": { - "version": "5.5.0", - "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-5.5.0.tgz", - "integrity": "sha512-QjVjwdXIt408MIiAqCX4oUKsgU2EqAGzs2Ppkm4aQYbjm+ZEWEcW4SfFNTr4uMNZma0ey4f5lgLrkB0aX0QMow==", - "dev": true, - "requires": { - "has-flag": "^3.0.0" - } - } + "ansi-styles": "^4.1.0", + "supports-color": "^7.1.0" } }, "color-convert": { - "version": "1.9.3", - "resolved": "https://registry.npmjs.org/color-convert/-/color-convert-1.9.3.tgz", - "integrity": "sha512-QfAUtd+vFdAtFQcC8CCyYt1fYWxSqAiK2cSD6zDB8N3cpsEBAvRxp9zOGg6G/SHHJYAT88/az/IuDGALsNVbGg==", + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/color-convert/-/color-convert-2.0.1.tgz", + "integrity": "sha512-RRECPsj7iu/xb5oKYcsFHSppFNnsj/52OVTRKb4zP5onXwVF3zVmmToNcOfGC+CRDpfK/U584fMg38ZHCaElKQ==", "dev": true, "requires": { - "color-name": "1.1.3" + "color-name": "~1.1.4" } }, "color-name": { - "version": "1.1.3", - "resolved": "https://registry.npmjs.org/color-name/-/color-name-1.1.3.tgz", - "integrity": "sha1-p9BVi9icQveV3UIyj3QIMcpTvCU=", + "version": "1.1.4", + "resolved": "https://registry.npmjs.org/color-name/-/color-name-1.1.4.tgz", + "integrity": "sha512-dOy+3AuW3a2wNbZHIuMZpTcgjGuLU/uBL/ubcZF9OXbDo8ff4O8yVp5Bf0efS8uEoYo5q4Fx7dY9OgQGXgAsQA==", "dev": true }, - "concat-stream": { - "version": "1.6.2", - "resolved": "https://registry.npmjs.org/concat-stream/-/concat-stream-1.6.2.tgz", - "integrity": "sha512-27HBghJxjiZtIk3Ycvn/4kbJk/1uZuJFfuPEns6LaEvpvG1f0hTea8lilrouyo9mVc2GWdcEZ8OLoGmSADlrCw==", - "dev": true, - "requires": { - "buffer-from": "^1.0.0", - "inherits": "^2.0.3", - "readable-stream": "^2.2.2", - "typedarray": "^0.0.6" - } - }, "debug": { - "version": "3.2.6", - "resolved": "https://registry.npmjs.org/debug/-/debug-3.2.6.tgz", - "integrity": "sha512-mel+jf7nrtEl5Pn1Qx46zARXKDpBbvzezse7p7LqINmdoIk8PYP5SySaxEmYv6TZ0JyEKA1hsCId6DIhgITtWQ==", + "version": "4.1.1", + "resolved": "https://registry.npmjs.org/debug/-/debug-4.1.1.tgz", + "integrity": "sha512-pYAIzeRo8J6KPEaJ0VWOh5Pzkbw/RetuzehGM7QRRX5he4fPHx2rdKMB256ehJCkX+XRQm16eZLqLNS8RSZXZw==", "dev": true, "requires": { "ms": "^2.1.1" } }, "eslint-scope": { - "version": "3.7.3", - "resolved": "https://registry.npmjs.org/eslint-scope/-/eslint-scope-3.7.3.tgz", - "integrity": "sha512-W+B0SvF4gamyCTmUc+uITPY0989iXVfKvhwtmJocTaYoc/3khEHmEmvfY/Gn9HA9VV75jrQECsHizkNw1b68FA==", + "version": "5.1.0", + "resolved": "https://registry.npmjs.org/eslint-scope/-/eslint-scope-5.1.0.tgz", + "integrity": "sha512-iiGRvtxWqgtx5m8EyQUJihBloE4EnYeGE/bz1wSPwJE6tZuJUtHlhqDM4Xj2ukE8Dyy1+HCZ4hE0fzIVMzb58w==", "dev": true, "requires": { "esrecurse": "^4.1.0", "estraverse": "^4.1.1" } }, + "eslint-visitor-keys": { + "version": "1.3.0", + "resolved": "https://registry.npmjs.org/eslint-visitor-keys/-/eslint-visitor-keys-1.3.0.tgz", + "integrity": "sha512-6J72N8UNa462wa/KFODt/PJ3IU60SDpC3QXC1Hjc1BXXpfL2C9R5+AU7jhe0F6GREqVMh4Juu+NY7xn+6dipUQ==", + "dev": true + }, + "glob-parent": { + "version": "5.1.1", + "resolved": "https://registry.npmjs.org/glob-parent/-/glob-parent-5.1.1.tgz", + "integrity": "sha512-FnI+VGOpnlGHWZxthPGR+QhR78fuiK0sNLkHQv+bL9fQi57lNNdquIbna/WrfROrolq8GK5Ek6BiMwqL/voRYQ==", + "dev": true, + "requires": { + "is-glob": "^4.0.1" + } + }, + "globals": { + "version": "12.4.0", + "resolved": "https://registry.npmjs.org/globals/-/globals-12.4.0.tgz", + "integrity": "sha512-BWICuzzDvDoH54NHKCseDanAhE3CeDorgDL5MT6LMXXj2WCnd9UC2szdk4AWLfjdgNBCXLUanXYcpBBKOSWGwg==", + "dev": true, + "requires": { + "type-fest": "^0.8.1" + } + }, "has-flag": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/has-flag/-/has-flag-3.0.0.tgz", - "integrity": "sha1-tdRU3CGZriJWmfNGfloH87lVuv0=", + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/has-flag/-/has-flag-4.0.0.tgz", + "integrity": "sha512-EykJT/Q1KjTWctppgIAgfSO0tKVuZUjhgMr17kqTumMl6Afv3EISleU7qZUzoXDFTAHTDC4NOoG/ZxU3EvlMPQ==", "dev": true }, - "js-tokens": { - "version": "3.0.2", - "resolved": "https://registry.npmjs.org/js-tokens/-/js-tokens-3.0.2.tgz", - "integrity": "sha1-mGbfOVECEw449/mWvOtlRDIJwls=", + "is-extglob": { + "version": "2.1.1", + "resolved": "https://registry.npmjs.org/is-extglob/-/is-extglob-2.1.1.tgz", + "integrity": "sha1-qIwCU1eR8C7TfHahueqXc8gz+MI=", "dev": true }, + "is-glob": { + "version": "4.0.1", + "resolved": "https://registry.npmjs.org/is-glob/-/is-glob-4.0.1.tgz", + "integrity": "sha512-5G0tKtBTFImOqDnLB2hG6Bp2qcKEFduo4tZu9MT/H6NQv/ghhy30o55ufafxJ/LdH79LLs2Kfrn85TLKyA7BUg==", + "dev": true, + "requires": { + "is-extglob": "^2.1.1" + } + }, "js-yaml": { "version": "3.14.0", "resolved": "https://registry.npmjs.org/js-yaml/-/js-yaml-3.14.0.tgz", @@ -6681,11 +6691,14 @@ "esprima": "^4.0.0" } }, - "lodash": { - "version": "4.17.15", - "resolved": "https://registry.npmjs.org/lodash/-/lodash-4.17.15.tgz", - "integrity": "sha512-8xOcRHvCjnocdS5cpwXQXVzmmh5e5+saE2QGoeQmbKmRS6J3VQppPOIt0MnmE+4xlZoumy0GPG0D0MVIQbNA1A==", - "dev": true + "minimatch": { + "version": "3.0.4", + "resolved": "https://registry.npmjs.org/minimatch/-/minimatch-3.0.4.tgz", + "integrity": "sha512-yJHVQEhyqPLUTgt9B83PXu6W3rx4MvvHvSUvToogpwoGDOUQ+yDrR0HRot+yOCdCO7u4hX3pWft6kWBBcqh0UA==", + "dev": true, + "requires": { + "brace-expansion": "^1.1.7" + } }, "ms": { "version": "2.1.2", @@ -6693,66 +6706,158 @@ "integrity": "sha512-sGkPx+VjMtmA6MX27oA4FBFELFCZZ4S4XqeGOXCv68tT+jb3vk/RyaKWP0PTKyWtmLSM0b+adUTEvbs1PEaH2w==", "dev": true }, - "process-nextick-args": { - "version": "2.0.1", - "resolved": "https://registry.npmjs.org/process-nextick-args/-/process-nextick-args-2.0.1.tgz", - "integrity": "sha512-3ouUOpQhtgrbOa17J7+uxOTpITYWaGP7/AhoR3+A+/1e9skrzelGi/dXzEYyvbxubEF6Wn2ypscTKiKJFFn1ag==", + "semver": { + "version": "7.3.2", + "resolved": "https://registry.npmjs.org/semver/-/semver-7.3.2.tgz", + "integrity": "sha512-OrOb32TeeambH6UrhtShmF7CRDqhL6/5XpPNp2DuRH6+9QLw/orhp72j87v8Qa1ScDkvrrBNpZcDejAirJmfXQ==", "dev": true }, - "readable-stream": { - "version": "2.3.7", - "resolved": "https://registry.npmjs.org/readable-stream/-/readable-stream-2.3.7.tgz", - "integrity": "sha512-Ebho8K4jIbHAxnuxi7o42OrZgF/ZTNcsZj6nRKyUmkhLFq8CHItp/fy6hQZuZmP/n3yZ9VBUbp4zz/mX8hmYPw==", + "strip-ansi": { + "version": "6.0.0", + "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-6.0.0.tgz", + "integrity": "sha512-AuvKTrTfQNYNIctbR1K/YGTR1756GycPsg7b9bdV9Duqur4gv6aKqHXah67Z8ImS7WEz5QVcOtlfW2rZEugt6w==", "dev": true, "requires": { - "core-util-is": "~1.0.0", - "inherits": "~2.0.3", - "isarray": "~1.0.0", - "process-nextick-args": "~2.0.0", - "safe-buffer": "~5.1.1", - "string_decoder": "~1.1.1", - "util-deprecate": "~1.0.1" + "ansi-regex": "^5.0.0" } }, - "semver": { - "version": "5.7.1", - "resolved": "https://registry.npmjs.org/semver/-/semver-5.7.1.tgz", - "integrity": "sha512-sauaDf/PZdVgrLTNYHRtpXa1iRiKcaebiKQ1BJdpQlWH2lCvexQdX55snPFyK7QzpudqbCI0qXFfOasHdyNDGQ==", + "supports-color": { + "version": "7.1.0", + "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-7.1.0.tgz", + "integrity": "sha512-oRSIpR8pxT1Wr2FquTNnGet79b3BWljqOuoW/h4oBhxJ/HUbX5nX6JSruTkvXDCFMwDPvsaTTbvMLKZWSy0R5g==", + "dev": true, + "requires": { + "has-flag": "^4.0.0" + } + } + } + }, + "eslint-config-standard": { + "version": "14.1.1", + "resolved": "https://registry.npmjs.org/eslint-config-standard/-/eslint-config-standard-14.1.1.tgz", + "integrity": "sha512-Z9B+VR+JIXRxz21udPTL9HpFMyoMUEeX1G251EQ6e05WD9aPVtVBn09XUmZ259wCMlCDmYDSZG62Hhm+ZTJcUg==", + "dev": true + }, + "eslint-config-standard-jsx": { + "version": "8.1.0", + "resolved": "https://registry.npmjs.org/eslint-config-standard-jsx/-/eslint-config-standard-jsx-8.1.0.tgz", + "integrity": "sha512-ULVC8qH8qCqbU792ZOO6DaiaZyHNS/5CZt3hKqHkEhVlhPEPN3nfBqqxJCyp59XrjIBZPu1chMYe9T2DXZ7TMw==", + "dev": true + }, + "eslint-config-standard-react": { + "version": "9.2.0", + "resolved": "https://registry.npmjs.org/eslint-config-standard-react/-/eslint-config-standard-react-9.2.0.tgz", + "integrity": "sha512-u+KRP2uCtthZ/W4DlLWCC59GZNV/y9k9yicWWammgTs/Omh8ZUUPF3EnYm81MAcbkYQq2Wg0oxutAhi/FQ8mIw==", + "dev": true, + "requires": { + "eslint-config-standard-jsx": "^8.0.0" + } + }, + "eslint-import-resolver-node": { + "version": "0.3.4", + "resolved": "https://registry.npmjs.org/eslint-import-resolver-node/-/eslint-import-resolver-node-0.3.4.tgz", + "integrity": "sha512-ogtf+5AB/O+nM6DIeBUNr2fuT7ot9Qg/1harBfBtaP13ekEWFQEEMP94BCB7zaNW3gyY+8SHYF00rnqYwXKWOA==", + "dev": true, + "requires": { + "debug": "^2.6.9", + "resolve": "^1.13.1" + }, + "dependencies": { + "debug": { + "version": "2.6.9", + "resolved": "https://registry.npmjs.org/debug/-/debug-2.6.9.tgz", + "integrity": "sha512-bC7ElrdJaJnPbAP+1EotYvqZsb3ecl5wi6Bfi6BJTUcNowp6cvspg0jXznRTKDjm/E7AdgFBVeAPVMNcKGsHMA==", + "dev": true, + "requires": { + "ms": "2.0.0" + } + }, + "ms": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/ms/-/ms-2.0.0.tgz", + "integrity": "sha1-VgiurfwAvmwpAd9fmGF4jeDVl8g=", "dev": true }, - "string_decoder": { - "version": "1.1.1", - "resolved": "https://registry.npmjs.org/string_decoder/-/string_decoder-1.1.1.tgz", - "integrity": "sha512-n/ShnvDi6FHbbVfviro+WojiFzv+s8MPMHBczVePfUpDJLwoLT0ht1l4YwBCbi8pJAveEEdnkHyPyTP/mzRfwg==", + "path-parse": { + "version": "1.0.6", + "resolved": "https://registry.npmjs.org/path-parse/-/path-parse-1.0.6.tgz", + "integrity": "sha512-GSmOT2EbHrINBf9SR7CDELwlJ8AENk3Qn7OikK4nFYAu3Ote2+JYNVvkpAEQm3/TLNEJFD/xZJjzyxg3KBWOzw==", + "dev": true + }, + "resolve": { + "version": "1.17.0", + "resolved": "https://registry.npmjs.org/resolve/-/resolve-1.17.0.tgz", + "integrity": "sha512-ic+7JYiV8Vi2yzQGFWOkiZD5Z9z7O2Zhm9XMaTxdJExKasieFCr+yXZ/WmXsckHiKl12ar0y6XiXDx3m4RHn1w==", "dev": true, "requires": { - "safe-buffer": "~5.1.0" + "path-parse": "^1.0.6" + } + } + } + }, + "eslint-module-utils": { + "version": "2.6.0", + "resolved": "https://registry.npmjs.org/eslint-module-utils/-/eslint-module-utils-2.6.0.tgz", + "integrity": "sha512-6j9xxegbqe8/kZY8cYpcp0xhbK0EgJlg3g9mib3/miLaExuuwc3n5UEfSnU6hWMbT0FAYVvDbL9RrRgpUeQIvA==", + "dev": true, + "requires": { + "debug": "^2.6.9", + "pkg-dir": "^2.0.0" + }, + "dependencies": { + "debug": { + "version": "2.6.9", + "resolved": "https://registry.npmjs.org/debug/-/debug-2.6.9.tgz", + "integrity": "sha512-bC7ElrdJaJnPbAP+1EotYvqZsb3ecl5wi6Bfi6BJTUcNowp6cvspg0jXznRTKDjm/E7AdgFBVeAPVMNcKGsHMA==", + "dev": true, + "requires": { + "ms": "2.0.0" } }, - "strip-ansi": { - "version": "4.0.0", - "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-4.0.0.tgz", - "integrity": "sha1-qEeQIusaw2iocTibY1JixQXuNo8=", + "find-up": { + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/find-up/-/find-up-2.1.0.tgz", + "integrity": "sha1-RdG35QbHF93UgndaK3eSCjwMV6c=", "dev": true, "requires": { - "ansi-regex": "^3.0.0" - }, - "dependencies": { - "ansi-regex": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-3.0.0.tgz", - "integrity": "sha1-7QMXwyIGT3lGbAKWa922Bas32Zg=", - "dev": true - } + "locate-path": "^2.0.0" + } + }, + "ms": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/ms/-/ms-2.0.0.tgz", + "integrity": "sha1-VgiurfwAvmwpAd9fmGF4jeDVl8g=", + "dev": true + }, + "pkg-dir": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/pkg-dir/-/pkg-dir-2.0.0.tgz", + "integrity": "sha1-9tXREJ4Z1j7fQo4L1X4Sd3YVM0s=", + "dev": true, + "requires": { + "find-up": "^2.1.0" } } } }, - "eslint-config-defaults": { - "version": "7.1.1", - "resolved": "https://registry.npmjs.org/eslint-config-defaults/-/eslint-config-defaults-7.1.1.tgz", - "integrity": "sha1-6kvJ3TxZURXHUIyE72r4eYyLCjQ=", - "dev": true + "eslint-plugin-babel": { + "version": "5.3.1", + "resolved": "https://registry.npmjs.org/eslint-plugin-babel/-/eslint-plugin-babel-5.3.1.tgz", + "integrity": "sha512-VsQEr6NH3dj664+EyxJwO4FCYm/00JhYb3Sk3ft8o+fpKuIfQ9TaW6uVUfvwMXHcf/lsnRIoyFPsLMyiWCSL/g==", + "dev": true, + "requires": { + "eslint-rule-composer": "^0.3.0" + } + }, + "eslint-plugin-es": { + "version": "3.0.1", + "resolved": "https://registry.npmjs.org/eslint-plugin-es/-/eslint-plugin-es-3.0.1.tgz", + "integrity": "sha512-GUmAsJaN4Fc7Gbtl8uOBlayo2DqhwWvEzykMHSCZHU3XdJ+NSzzZcVhXh3VxX5icqQ+oQdIEawXX8xkR3mIFmQ==", + "dev": true, + "requires": { + "eslint-utils": "^2.0.0", + "regexpp": "^3.0.0" + } }, "eslint-plugin-filenames": { "version": "1.3.2", @@ -6766,12 +6871,243 @@ "lodash.upperfirst": "4.3.1" } }, + "eslint-plugin-import": { + "version": "2.22.0", + "resolved": "https://registry.npmjs.org/eslint-plugin-import/-/eslint-plugin-import-2.22.0.tgz", + "integrity": "sha512-66Fpf1Ln6aIS5Gr/55ts19eUuoDhAbZgnr6UxK5hbDx6l/QgQgx61AePq+BV4PP2uXQFClgMVzep5zZ94qqsxg==", + "dev": true, + "requires": { + "array-includes": "^3.1.1", + "array.prototype.flat": "^1.2.3", + "contains-path": "^0.1.0", + "debug": "^2.6.9", + "doctrine": "1.5.0", + "eslint-import-resolver-node": "^0.3.3", + "eslint-module-utils": "^2.6.0", + "has": "^1.0.3", + "minimatch": "^3.0.4", + "object.values": "^1.1.1", + "read-pkg-up": "^2.0.0", + "resolve": "^1.17.0", + "tsconfig-paths": "^3.9.0" + }, + "dependencies": { + "balanced-match": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/balanced-match/-/balanced-match-1.0.0.tgz", + "integrity": "sha1-ibTRmasr7kneFk6gK4nORi1xt2c=", + "dev": true + }, + "brace-expansion": { + "version": "1.1.11", + "resolved": "https://registry.npmjs.org/brace-expansion/-/brace-expansion-1.1.11.tgz", + "integrity": "sha512-iCuPHDFgrHX7H2vEI/5xpz07zSHB00TpugqhmYtVmMO6518mCuRMoOYFldEBl0g187ufozdaHgWKcYFb61qGiA==", + "dev": true, + "requires": { + "balanced-match": "^1.0.0", + "concat-map": "0.0.1" + } + }, + "debug": { + "version": "2.6.9", + "resolved": "https://registry.npmjs.org/debug/-/debug-2.6.9.tgz", + "integrity": "sha512-bC7ElrdJaJnPbAP+1EotYvqZsb3ecl5wi6Bfi6BJTUcNowp6cvspg0jXznRTKDjm/E7AdgFBVeAPVMNcKGsHMA==", + "dev": true, + "requires": { + "ms": "2.0.0" + } + }, + "doctrine": { + "version": "1.5.0", + "resolved": "https://registry.npmjs.org/doctrine/-/doctrine-1.5.0.tgz", + "integrity": "sha1-N53Ocw9hZvds76TmcHoVmwLFpvo=", + "dev": true, + "requires": { + "esutils": "^2.0.2", + "isarray": "^1.0.0" + } + }, + "find-up": { + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/find-up/-/find-up-2.1.0.tgz", + "integrity": "sha1-RdG35QbHF93UgndaK3eSCjwMV6c=", + "dev": true, + "requires": { + "locate-path": "^2.0.0" + } + }, + "load-json-file": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/load-json-file/-/load-json-file-2.0.0.tgz", + "integrity": "sha1-eUfkIUmvgNaWy/eXvKq8/h/inKg=", + "dev": true, + "requires": { + "graceful-fs": "^4.1.2", + "parse-json": "^2.2.0", + "pify": "^2.0.0", + "strip-bom": "^3.0.0" + } + }, + "minimatch": { + "version": "3.0.4", + "resolved": "https://registry.npmjs.org/minimatch/-/minimatch-3.0.4.tgz", + "integrity": "sha512-yJHVQEhyqPLUTgt9B83PXu6W3rx4MvvHvSUvToogpwoGDOUQ+yDrR0HRot+yOCdCO7u4hX3pWft6kWBBcqh0UA==", + "dev": true, + "requires": { + "brace-expansion": "^1.1.7" + } + }, + "ms": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/ms/-/ms-2.0.0.tgz", + "integrity": "sha1-VgiurfwAvmwpAd9fmGF4jeDVl8g=", + "dev": true + }, + "path-parse": { + "version": "1.0.6", + "resolved": "https://registry.npmjs.org/path-parse/-/path-parse-1.0.6.tgz", + "integrity": "sha512-GSmOT2EbHrINBf9SR7CDELwlJ8AENk3Qn7OikK4nFYAu3Ote2+JYNVvkpAEQm3/TLNEJFD/xZJjzyxg3KBWOzw==", + "dev": true + }, + "path-type": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/path-type/-/path-type-2.0.0.tgz", + "integrity": "sha1-8BLMuEFbcJb8LaoQVMPXI4lZTHM=", + "dev": true, + "requires": { + "pify": "^2.0.0" + } + }, + "read-pkg": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/read-pkg/-/read-pkg-2.0.0.tgz", + "integrity": "sha1-jvHAYjxqbbDcZxPEv6xGMysjaPg=", + "dev": true, + "requires": { + "load-json-file": "^2.0.0", + "normalize-package-data": "^2.3.2", + "path-type": "^2.0.0" + } + }, + "read-pkg-up": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/read-pkg-up/-/read-pkg-up-2.0.0.tgz", + "integrity": "sha1-a3KoBImE4MQeeVEP1en6mbO1Sb4=", + "dev": true, + "requires": { + "find-up": "^2.0.0", + "read-pkg": "^2.0.0" + } + }, + "resolve": { + "version": "1.17.0", + "resolved": "https://registry.npmjs.org/resolve/-/resolve-1.17.0.tgz", + "integrity": "sha512-ic+7JYiV8Vi2yzQGFWOkiZD5Z9z7O2Zhm9XMaTxdJExKasieFCr+yXZ/WmXsckHiKl12ar0y6XiXDx3m4RHn1w==", + "dev": true, + "requires": { + "path-parse": "^1.0.6" + } + }, + "strip-bom": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/strip-bom/-/strip-bom-3.0.0.tgz", + "integrity": "sha1-IzTBjpx1n3vdVv3vfprj1YjmjtM=", + "dev": true + } + } + }, + "eslint-plugin-node": { + "version": "11.1.0", + "resolved": "https://registry.npmjs.org/eslint-plugin-node/-/eslint-plugin-node-11.1.0.tgz", + "integrity": "sha512-oUwtPJ1W0SKD0Tr+wqu92c5xuCeQqB3hSCHasn/ZgjFdA9iDGNkNf2Zi9ztY7X+hNuMib23LNGRm6+uN+KLE3g==", + "dev": true, + "requires": { + "eslint-plugin-es": "^3.0.0", + "eslint-utils": "^2.0.0", + "ignore": "^5.1.1", + "minimatch": "^3.0.4", + "resolve": "^1.10.1", + "semver": "^6.1.0" + }, + "dependencies": { + "balanced-match": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/balanced-match/-/balanced-match-1.0.0.tgz", + "integrity": "sha1-ibTRmasr7kneFk6gK4nORi1xt2c=", + "dev": true + }, + "brace-expansion": { + "version": "1.1.11", + "resolved": "https://registry.npmjs.org/brace-expansion/-/brace-expansion-1.1.11.tgz", + "integrity": "sha512-iCuPHDFgrHX7H2vEI/5xpz07zSHB00TpugqhmYtVmMO6518mCuRMoOYFldEBl0g187ufozdaHgWKcYFb61qGiA==", + "dev": true, + "requires": { + "balanced-match": "^1.0.0", + "concat-map": "0.0.1" + } + }, + "ignore": { + "version": "5.1.8", + "resolved": "https://registry.npmjs.org/ignore/-/ignore-5.1.8.tgz", + "integrity": "sha512-BMpfD7PpiETpBl/A6S498BaIJ6Y/ABT93ETbby2fP00v4EbvPBXWEoaR1UBPKs3iR53pJY7EtZk5KACI57i1Uw==", + "dev": true + }, + "minimatch": { + "version": "3.0.4", + "resolved": "https://registry.npmjs.org/minimatch/-/minimatch-3.0.4.tgz", + "integrity": "sha512-yJHVQEhyqPLUTgt9B83PXu6W3rx4MvvHvSUvToogpwoGDOUQ+yDrR0HRot+yOCdCO7u4hX3pWft6kWBBcqh0UA==", + "dev": true, + "requires": { + "brace-expansion": "^1.1.7" + } + }, + "path-parse": { + "version": "1.0.6", + "resolved": "https://registry.npmjs.org/path-parse/-/path-parse-1.0.6.tgz", + "integrity": "sha512-GSmOT2EbHrINBf9SR7CDELwlJ8AENk3Qn7OikK4nFYAu3Ote2+JYNVvkpAEQm3/TLNEJFD/xZJjzyxg3KBWOzw==", + "dev": true + }, + "resolve": { + "version": "1.17.0", + "resolved": "https://registry.npmjs.org/resolve/-/resolve-1.17.0.tgz", + "integrity": "sha512-ic+7JYiV8Vi2yzQGFWOkiZD5Z9z7O2Zhm9XMaTxdJExKasieFCr+yXZ/WmXsckHiKl12ar0y6XiXDx3m4RHn1w==", + "dev": true, + "requires": { + "path-parse": "^1.0.6" + } + }, + "semver": { + "version": "6.3.0", + "resolved": "https://registry.npmjs.org/semver/-/semver-6.3.0.tgz", + "integrity": "sha512-b39TBaTSfV6yBrapU89p5fKekE2m/NwnDocOVruQFS1/veMgdzuPcnOM34M6CwxW8jH/lxEa5rBoDeUwu5HHTw==", + "dev": true + } + } + }, + "eslint-plugin-promise": { + "version": "4.2.1", + "resolved": "https://registry.npmjs.org/eslint-plugin-promise/-/eslint-plugin-promise-4.2.1.tgz", + "integrity": "sha512-VoM09vT7bfA7D+upt+FjeBO5eHIJQBUWki1aPvB+vbNiHS3+oGIJGIeyBtKQTME6UPXXy3vV07OL1tHd3ANuDw==", + "dev": true + }, "eslint-plugin-react": { "version": "3.16.1", "resolved": "https://registry.npmjs.org/eslint-plugin-react/-/eslint-plugin-react-3.16.1.tgz", "integrity": "sha1-Ji2Wt318SkKvgJpzwOUnpYYSKTw=", "dev": true }, + "eslint-plugin-standard": { + "version": "4.0.1", + "resolved": "https://registry.npmjs.org/eslint-plugin-standard/-/eslint-plugin-standard-4.0.1.tgz", + "integrity": "sha512-v/KBnfyaOMPmZc/dmc6ozOdWqekGp7bBGq4jLAecEfPGmfKiWS4sA8sC0LqiV9w5qmXAtXVn4M3p1jSyhY85SQ==", + "dev": true + }, + "eslint-rule-composer": { + "version": "0.3.0", + "resolved": "https://registry.npmjs.org/eslint-rule-composer/-/eslint-rule-composer-0.3.0.tgz", + "integrity": "sha512-bt+Sh8CtDmn2OajxvNO+BX7Wn4CIWMpTRm3MaiKPCQcnnlm0CS2mhui6QaoeQugs+3Kj2ESKEEGJUdVafwhiCg==", + "dev": true + }, "eslint-scope": { "version": "4.0.3", "resolved": "https://registry.npmjs.org/eslint-scope/-/eslint-scope-4.0.3.tgz", @@ -6782,6 +7118,15 @@ "estraverse": "^4.1.1" } }, + "eslint-utils": { + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/eslint-utils/-/eslint-utils-2.1.0.tgz", + "integrity": "sha512-w94dQYoauyvlDc43XnGB8lU3Zt713vNChgt4EWwhXAP2XkBvndfxF0AgIqKOOasjPIPzj9JqgwkwbCYD0/V3Zg==", + "dev": true, + "requires": { + "eslint-visitor-keys": "^1.1.0" + } + }, "eslint-visitor-keys": { "version": "1.1.0", "resolved": "https://registry.npmjs.org/eslint-visitor-keys/-/eslint-visitor-keys-1.1.0.tgz", @@ -6789,13 +7134,22 @@ "dev": true }, "espree": { - "version": "3.5.4", - "resolved": "https://registry.npmjs.org/espree/-/espree-3.5.4.tgz", - "integrity": "sha512-yAcIQxtmMiB/jL32dzEp2enBeidsB7xWPLNiw3IIkpVds1P+h7qF9YwJq1yUNzp2OKXgAprs4F61ih66UsoD1A==", + "version": "7.1.0", + "resolved": "https://registry.npmjs.org/espree/-/espree-7.1.0.tgz", + "integrity": "sha512-dcorZSyfmm4WTuTnE5Y7MEN1DyoPYy1ZR783QW1FJoenn7RailyWFsq/UL6ZAAA7uXurN9FIpYyUs3OfiIW+Qw==", "dev": true, "requires": { - "acorn": "^5.5.0", - "acorn-jsx": "^3.0.0" + "acorn": "^7.2.0", + "acorn-jsx": "^5.2.0", + "eslint-visitor-keys": "^1.2.0" + }, + "dependencies": { + "eslint-visitor-keys": { + "version": "1.3.0", + "resolved": "https://registry.npmjs.org/eslint-visitor-keys/-/eslint-visitor-keys-1.3.0.tgz", + "integrity": "sha512-6J72N8UNa462wa/KFODt/PJ3IU60SDpC3QXC1Hjc1BXXpfL2C9R5+AU7jhe0F6GREqVMh4Juu+NY7xn+6dipUQ==", + "dev": true + } } }, "esprima": { @@ -7237,28 +7591,6 @@ } } }, - "external-editor": { - "version": "2.2.0", - "resolved": "https://registry.npmjs.org/external-editor/-/external-editor-2.2.0.tgz", - "integrity": "sha512-bSn6gvGxKt+b7+6TKEv1ZycHleA7aHhRHyAqJyp5pbUFuYYNIzpZnQDk7AsYckyWdEnTeAnay0aCy2aV6iTk9A==", - "dev": true, - "requires": { - "chardet": "^0.4.0", - "iconv-lite": "^0.4.17", - "tmp": "^0.0.33" - }, - "dependencies": { - "iconv-lite": { - "version": "0.4.24", - "resolved": "https://registry.npmjs.org/iconv-lite/-/iconv-lite-0.4.24.tgz", - "integrity": "sha512-v3MXnZAcvnywkTUEZomIActle7RXXeedOR31wwl7VlyoXO4Qi9arvSenNQWne1TcRwhCL1HwLI21bEqdpj8/rA==", - "dev": true, - "requires": { - "safer-buffer": ">= 2.1.2 < 3" - } - } - } - }, "extglob": { "version": "0.3.2", "resolved": "https://registry.npmjs.org/extglob/-/extglob-0.3.2.tgz", @@ -7330,23 +7662,13 @@ "integrity": "sha512-0btnI/H8f2pavGMN8w40mlSKOfTK2SVJmBfBeVIj3kNw0swwgzyRq0d5TJVOwodFmtvpPeWPN/MCcfuWF0Ezbw==", "dev": true }, - "figures": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/figures/-/figures-2.0.0.tgz", - "integrity": "sha1-OrGi0qYsi/tDGgyUy3l6L84nyWI=", - "dev": true, - "requires": { - "escape-string-regexp": "^1.0.5" - } - }, "file-entry-cache": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/file-entry-cache/-/file-entry-cache-2.0.0.tgz", - "integrity": "sha1-w5KZDD5oR4PYOLjISkXYoEhFg2E=", + "version": "5.0.1", + "resolved": "https://registry.npmjs.org/file-entry-cache/-/file-entry-cache-5.0.1.tgz", + "integrity": "sha512-bCg29ictuBaKUwwArK4ouCaqDgLZcysCFLmM/Yn/FDoqndh/9vNuQfXRDvTuXKLxfD/JtZQGKFT8MGcJBK644g==", "dev": true, "requires": { - "flat-cache": "^1.2.1", - "object-assign": "^4.0.1" + "flat-cache": "^2.0.1" } }, "file-loader": { @@ -7520,15 +7842,14 @@ "dev": true }, "flat-cache": { - "version": "1.3.4", - "resolved": "https://registry.npmjs.org/flat-cache/-/flat-cache-1.3.4.tgz", - "integrity": "sha512-VwyB3Lkgacfik2vhqR4uv2rvebqmDvFu4jlN/C1RzWoJEo8I7z4Q404oiqYCkq41mni8EzQnm95emU9seckwtg==", + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/flat-cache/-/flat-cache-2.0.1.tgz", + "integrity": "sha512-LoQe6yDuUMDzQAEH8sgmh4Md6oZnc/7PjtwjNFSzveXqSHt6ka9fPBuso7IGf9Rz4uqnSnWiFH2B/zj24a5ReA==", "dev": true, "requires": { - "circular-json": "^0.3.1", - "graceful-fs": "^4.1.2", - "rimraf": "~2.6.2", - "write": "^0.2.1" + "flatted": "^2.0.0", + "rimraf": "2.6.3", + "write": "1.0.3" }, "dependencies": { "rimraf": { @@ -7542,6 +7863,12 @@ } } }, + "flatted": { + "version": "2.0.2", + "resolved": "https://registry.npmjs.org/flatted/-/flatted-2.0.2.tgz", + "integrity": "sha512-r5wGx7YeOwNWNlCA0wQ86zKyDLMQr+/RB8xy74M4hTphfmjlijTSSXGuH8rnvKZnfT9i+75zmd8jcKdMR4O6jA==", + "dev": true + }, "flush-write-stream": { "version": "1.1.1", "resolved": "https://registry.npmjs.org/flush-write-stream/-/flush-write-stream-1.1.1.tgz", @@ -7671,6 +7998,12 @@ "integrity": "sha1-FQStJSMVjKpA20onh8sBQRmU6k8=", "dev": true }, + "function-bind": { + "version": "1.1.1", + "resolved": "https://registry.npmjs.org/function-bind/-/function-bind-1.1.1.tgz", + "integrity": "sha512-yIovAzMX49sF8Yl58fSCWJ5svSLuaibPxXQJFLmBObTuCr0Mf1KiPopGM9NiFjiYBCbfaa2Fh6breQ6ANVTI0A==", + "dev": true + }, "functional-red-black-tree": { "version": "1.0.1", "resolved": "https://registry.npmjs.org/functional-red-black-tree/-/functional-red-black-tree-1.0.1.tgz", @@ -8491,6 +8824,15 @@ "pinkie-promise": "^2.0.0" } }, + "has": { + "version": "1.0.3", + "resolved": "https://registry.npmjs.org/has/-/has-1.0.3.tgz", + "integrity": "sha512-f2dvO0VU6Oej7RkWJGrehjbzMAjFp5/VKPp5tTpWIV4JHHZK1/BxbFRtf/siA2SWTe09caDmVtYYzWEIbBS4zw==", + "dev": true, + "requires": { + "function-bind": "^1.1.1" + } + }, "has-ansi": { "version": "2.0.0", "resolved": "https://registry.npmjs.org/has-ansi/-/has-ansi-2.0.0.tgz", @@ -8877,9 +9219,9 @@ "dev": true }, "ignore": { - "version": "3.3.10", - "resolved": "https://registry.npmjs.org/ignore/-/ignore-3.3.10.tgz", - "integrity": "sha512-Pgs951kaMm5GXP7MOvxERINe3gsaVjUWFm+UZPSq9xYriQAksyhg0csnS0KXSNRD5NmNdapXEpjxG49+AKh/ug==", + "version": "4.0.6", + "resolved": "https://registry.npmjs.org/ignore/-/ignore-4.0.6.tgz", + "integrity": "sha512-cyFDKrqc/YdcWFniJhzI42+AzS+gNwmUzOSFcRCQYwySuBBBy/KjuxWLZ/FHEH6Moq1NizMOBWyTcv8O4OZIMg==", "dev": true }, "import-fresh": { @@ -8942,137 +9284,20 @@ }, "inherits": { "version": "2.0.3", - "resolved": "https://registry.npmjs.org/inherits/-/inherits-2.0.3.tgz", - "integrity": "sha1-Yzwsg+PaQqUC9SRmAiSA9CCCYd4=" - }, - "ini": { - "version": "1.3.4", - "resolved": "https://registry.npmjs.org/ini/-/ini-1.3.4.tgz", - "integrity": "sha1-BTfLedr1m1mhpRff9wbIbsA5Fi4=", - "dev": true - }, - "inline-style-parser": { - "version": "0.1.1", - "resolved": "https://registry.npmjs.org/inline-style-parser/-/inline-style-parser-0.1.1.tgz", - "integrity": "sha512-7NXolsK4CAS5+xvdj5OMMbI962hU/wvwoxk+LWR9Ek9bVtyuuYScDN6eS0rUm6TxApFpw7CX1o4uJzcd4AyD3Q==", - "dev": true - }, - "inquirer": { - "version": "3.3.0", - "resolved": "https://registry.npmjs.org/inquirer/-/inquirer-3.3.0.tgz", - "integrity": "sha512-h+xtnyk4EwKvFWHrUYsWErEVR+igKtLdchu+o0Z1RL7VU/jVMFbYir2bp6bAj8efFNxWqHX0dIss6fJQ+/+qeQ==", - "dev": true, - "requires": { - "ansi-escapes": "^3.0.0", - "chalk": "^2.0.0", - "cli-cursor": "^2.1.0", - "cli-width": "^2.0.0", - "external-editor": "^2.0.4", - "figures": "^2.0.0", - "lodash": "^4.3.0", - "mute-stream": "0.0.7", - "run-async": "^2.2.0", - "rx-lite": "^4.0.8", - "rx-lite-aggregates": "^4.0.8", - "string-width": "^2.1.0", - "strip-ansi": "^4.0.0", - "through": "^2.3.6" - }, - "dependencies": { - "ansi-escapes": { - "version": "3.2.0", - "resolved": "https://registry.npmjs.org/ansi-escapes/-/ansi-escapes-3.2.0.tgz", - "integrity": "sha512-cBhpre4ma+U0T1oM5fXg7Dy1Jw7zzwv7lt/GoCpr+hDQJoYnKVPLL4dCvSEFMmQurOQvSrwT7SL/DAlhBI97RQ==", - "dev": true - }, - "ansi-regex": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-3.0.0.tgz", - "integrity": "sha1-7QMXwyIGT3lGbAKWa922Bas32Zg=", - "dev": true - }, - "ansi-styles": { - "version": "3.2.1", - "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-3.2.1.tgz", - "integrity": "sha512-VT0ZI6kZRdTh8YyJw3SMbYm/u+NqfsAxEpWO0Pf9sq8/e94WxxOpPKx9FR1FlyCtOVDNOQ+8ntlqFxiRc+r5qA==", - "dev": true, - "requires": { - "color-convert": "^1.9.0" - } - }, - "chalk": { - "version": "2.4.2", - "resolved": "https://registry.npmjs.org/chalk/-/chalk-2.4.2.tgz", - "integrity": "sha512-Mti+f9lpJNcwF4tWV8/OrTTtF1gZi+f8FqlyAdouralcFWFQWF2+NgCHShjkCb+IFBLq9buZwE1xckQU4peSuQ==", - "dev": true, - "requires": { - "ansi-styles": "^3.2.1", - "escape-string-regexp": "^1.0.5", - "supports-color": "^5.3.0" - } - }, - "color-convert": { - "version": "1.9.3", - "resolved": "https://registry.npmjs.org/color-convert/-/color-convert-1.9.3.tgz", - "integrity": "sha512-QfAUtd+vFdAtFQcC8CCyYt1fYWxSqAiK2cSD6zDB8N3cpsEBAvRxp9zOGg6G/SHHJYAT88/az/IuDGALsNVbGg==", - "dev": true, - "requires": { - "color-name": "1.1.3" - } - }, - "color-name": { - "version": "1.1.3", - "resolved": "https://registry.npmjs.org/color-name/-/color-name-1.1.3.tgz", - "integrity": "sha1-p9BVi9icQveV3UIyj3QIMcpTvCU=", - "dev": true - }, - "has-flag": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/has-flag/-/has-flag-3.0.0.tgz", - "integrity": "sha1-tdRU3CGZriJWmfNGfloH87lVuv0=", - "dev": true - }, - "is-fullwidth-code-point": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/is-fullwidth-code-point/-/is-fullwidth-code-point-2.0.0.tgz", - "integrity": "sha1-o7MKXE8ZkYMWeqq5O+764937ZU8=", - "dev": true - }, - "lodash": { - "version": "4.17.15", - "resolved": "https://registry.npmjs.org/lodash/-/lodash-4.17.15.tgz", - "integrity": "sha512-8xOcRHvCjnocdS5cpwXQXVzmmh5e5+saE2QGoeQmbKmRS6J3VQppPOIt0MnmE+4xlZoumy0GPG0D0MVIQbNA1A==", - "dev": true - }, - "string-width": { - "version": "2.1.1", - "resolved": "https://registry.npmjs.org/string-width/-/string-width-2.1.1.tgz", - "integrity": "sha512-nOqH59deCq9SRHlxq1Aw85Jnt4w6KvLKqWVik6oA9ZklXLNIOlqg4F2yrT1MVaTjAqvVwdfeZ7w7aCvJD7ugkw==", - "dev": true, - "requires": { - "is-fullwidth-code-point": "^2.0.0", - "strip-ansi": "^4.0.0" - } - }, - "strip-ansi": { - "version": "4.0.0", - "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-4.0.0.tgz", - "integrity": "sha1-qEeQIusaw2iocTibY1JixQXuNo8=", - "dev": true, - "requires": { - "ansi-regex": "^3.0.0" - } - }, - "supports-color": { - "version": "5.5.0", - "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-5.5.0.tgz", - "integrity": "sha512-QjVjwdXIt408MIiAqCX4oUKsgU2EqAGzs2Ppkm4aQYbjm+ZEWEcW4SfFNTr4uMNZma0ey4f5lgLrkB0aX0QMow==", - "dev": true, - "requires": { - "has-flag": "^3.0.0" - } - } - } + "resolved": "https://registry.npmjs.org/inherits/-/inherits-2.0.3.tgz", + "integrity": "sha1-Yzwsg+PaQqUC9SRmAiSA9CCCYd4=" + }, + "ini": { + "version": "1.3.4", + "resolved": "https://registry.npmjs.org/ini/-/ini-1.3.4.tgz", + "integrity": "sha1-BTfLedr1m1mhpRff9wbIbsA5Fi4=", + "dev": true + }, + "inline-style-parser": { + "version": "0.1.1", + "resolved": "https://registry.npmjs.org/inline-style-parser/-/inline-style-parser-0.1.1.tgz", + "integrity": "sha512-7NXolsK4CAS5+xvdj5OMMbI962hU/wvwoxk+LWR9Ek9bVtyuuYScDN6eS0rUm6TxApFpw7CX1o4uJzcd4AyD3Q==", + "dev": true }, "interpret": { "version": "1.0.1", @@ -9156,6 +9381,12 @@ "builtin-modules": "^1.0.0" } }, + "is-callable": { + "version": "1.2.0", + "resolved": "https://registry.npmjs.org/is-callable/-/is-callable-1.2.0.tgz", + "integrity": "sha512-pyVD9AaGLxtg6srb2Ng6ynWJqkHU9bEM087AKck0w8QwDarTfNcpIYoU8x8Hv2Icm8u6kFJM18Dag8lyqGkviw==", + "dev": true + }, "is-ci": { "version": "1.0.10", "resolved": "https://registry.npmjs.org/is-ci/-/is-ci-1.0.10.tgz", @@ -9174,6 +9405,12 @@ "kind-of": "^3.0.2" } }, + "is-date-object": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/is-date-object/-/is-date-object-1.0.2.tgz", + "integrity": "sha512-USlDT524woQ08aoZFzh3/Z6ch9Y/EWXEHQ/AaRN0SkKq4t2Jw2R2339tSXmwuVoY7LLlBCbOIlx2myP/L5zk0g==", + "dev": true + }, "is-decimal": { "version": "1.0.4", "resolved": "https://registry.npmjs.org/is-decimal/-/is-decimal-1.0.4.tgz", @@ -9321,6 +9558,15 @@ "resolved": "https://registry.npmjs.org/is-property/-/is-property-1.0.2.tgz", "integrity": "sha1-V/4cTkhHTt1lsJkR8msc1Ald2oQ=" }, + "is-regex": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/is-regex/-/is-regex-1.1.0.tgz", + "integrity": "sha512-iI97M8KTWID2la5uYXlkbSDQIg4F6o1sYboZKKTDpnDQMLtUL86zxhgDet3Q2SriaYsyGqZ6Mn2SjbRKeLHdqw==", + "dev": true, + "requires": { + "has-symbols": "^1.0.1" + } + }, "is-relative": { "version": "0.2.1", "resolved": "https://registry.npmjs.org/is-relative/-/is-relative-0.2.1.tgz", @@ -9330,17 +9576,26 @@ "is-unc-path": "^0.1.1" } }, - "is-resolvable": { - "version": "1.1.0", - "resolved": "https://registry.npmjs.org/is-resolvable/-/is-resolvable-1.1.0.tgz", - "integrity": "sha512-qgDYXFSR5WvEfuS5dMj6oTMEbrrSaM0CrFk2Yiq/gXnBvD9pMa2jGXxyhGLfvhZpuMZe18CJpFxAt3CRs42NMg==", - "dev": true - }, "is-stream": { "version": "1.1.0", "resolved": "https://registry.npmjs.org/is-stream/-/is-stream-1.1.0.tgz", "integrity": "sha1-EtSj3U5o4Lec6428hBc66A2RykQ=" }, + "is-string": { + "version": "1.0.5", + "resolved": "https://registry.npmjs.org/is-string/-/is-string-1.0.5.tgz", + "integrity": "sha512-buY6VNRjhQMiF1qWDouloZlQbRhDPCebwxSjxMjxgemYT46YMd2NR0/H+fBhEfWX4A/w9TBJ+ol+okqJKFE6vQ==", + "dev": true + }, + "is-symbol": { + "version": "1.0.3", + "resolved": "https://registry.npmjs.org/is-symbol/-/is-symbol-1.0.3.tgz", + "integrity": "sha512-OwijhaRSgqvhm/0ZdAcXNZt9lYdKFpcRDT5ULUuYXPoT794UNOdU+gpT6Rzo7b4V2HUl/op6GqY894AZwv9faQ==", + "dev": true, + "requires": { + "has-symbols": "^1.0.1" + } + }, "is-typedarray": { "version": "1.0.0", "resolved": "https://registry.npmjs.org/is-typedarray/-/is-typedarray-1.0.0.tgz", @@ -10501,13 +10756,30 @@ } }, "levn": { - "version": "0.3.0", - "resolved": "https://registry.npmjs.org/levn/-/levn-0.3.0.tgz", - "integrity": "sha1-OwmSTt+fCDwEkP3UwLxEIeBHZO4=", + "version": "0.4.1", + "resolved": "https://registry.npmjs.org/levn/-/levn-0.4.1.tgz", + "integrity": "sha512-+bT2uH4E5LGE7h/n3evcS/sQlJXCpIp6ym8OWJ5eV6+67Dsql/LaaT7qJBAt2rzfoa/5QBGBhxDix1dMt2kQKQ==", "dev": true, "requires": { - "prelude-ls": "~1.1.2", - "type-check": "~0.3.2" + "prelude-ls": "^1.2.1", + "type-check": "~0.4.0" + }, + "dependencies": { + "prelude-ls": { + "version": "1.2.1", + "resolved": "https://registry.npmjs.org/prelude-ls/-/prelude-ls-1.2.1.tgz", + "integrity": "sha512-vkcDPrRZo1QZLbn5RLGPpg/WmIQ65qoWWhcGKf/b5eplkkarX0m9z8ppCat4mlOqUsWpyNuYgO3VRyrYHSzX5g==", + "dev": true + }, + "type-check": { + "version": "0.4.0", + "resolved": "https://registry.npmjs.org/type-check/-/type-check-0.4.0.tgz", + "integrity": "sha512-XleUoc9uwGXqjWwXaUTZAmzMcFZ5858QA2vvx1Ur5xIcixXIP+8LnFDgRplU30us6teqdlskFfu+ae4K79Ooew==", + "dev": true, + "requires": { + "prelude-ls": "^1.2.1" + } + } } }, "liftoff": { @@ -11402,12 +11674,6 @@ "mime-db": "~1.24.0" } }, - "mimic-fn": { - "version": "1.2.0", - "resolved": "https://registry.npmjs.org/mimic-fn/-/mimic-fn-1.2.0.tgz", - "integrity": "sha512-jf84uxzwiuiIVKiOLpfYk7N46TSy8ubTonmneY9vrpHNAnp0QBt2BxWV9dO3/j+BoVAb+a5G6YDPW3M5HOdMWQ==", - "dev": true - }, "min-document": { "version": "2.19.0", "resolved": "https://registry.npmjs.org/min-document/-/min-document-2.19.0.tgz", @@ -11588,12 +11854,6 @@ "integrity": "sha512-kDcwXR4PS7caBpuRYYBUz9iVixUk3anO3f5OYFiIPwK/20vCzKCHyKoulbiDY1S53zD2bxUpxN/IJ+TnXjfvxg==", "dev": true }, - "mute-stream": { - "version": "0.0.7", - "resolved": "https://registry.npmjs.org/mute-stream/-/mute-stream-0.0.7.tgz", - "integrity": "sha1-MHXOk7whuPq0PhvE2n6BFe0ee6s=", - "dev": true - }, "nanomatch": { "version": "1.2.13", "resolved": "https://registry.npmjs.org/nanomatch/-/nanomatch-1.2.13.tgz", @@ -11873,6 +12133,12 @@ } } }, + "object-inspect": { + "version": "1.8.0", + "resolved": "https://registry.npmjs.org/object-inspect/-/object-inspect-1.8.0.tgz", + "integrity": "sha512-jLdtEOB112fORuypAyl/50VRVIBIdVQOSUUGQHzJ4xBSbit81zRarz7GThkEFZy1RceYrWYcPcBFPQwHyAc1gA==", + "dev": true + }, "object-keys": { "version": "1.1.1", "resolved": "https://registry.npmjs.org/object-keys/-/object-keys-1.1.1.tgz", @@ -11978,6 +12244,18 @@ } } }, + "object.values": { + "version": "1.1.1", + "resolved": "https://registry.npmjs.org/object.values/-/object.values-1.1.1.tgz", + "integrity": "sha512-WTa54g2K8iu0kmS/us18jEmdv1a4Wi//BZ/DTVYEcH0XhLM5NYdpDHja3gt57VrZLcNAO2WGA+KpWsDBaHt6eA==", + "dev": true, + "requires": { + "define-properties": "^1.1.3", + "es-abstract": "^1.17.0-next.1", + "function-bind": "^1.1.1", + "has": "^1.0.3" + } + }, "on-finished": { "version": "2.3.0", "resolved": "https://registry.npmjs.org/on-finished/-/on-finished-2.3.0.tgz", @@ -11996,15 +12274,6 @@ "wrappy": "1" } }, - "onetime": { - "version": "2.0.1", - "resolved": "http://registry.npmjs.org/onetime/-/onetime-2.0.1.tgz", - "integrity": "sha1-BnQoIw/WdEOyeUsiu6UotoZ5YtQ=", - "dev": true, - "requires": { - "mimic-fn": "^1.0.0" - } - }, "opener": { "version": "1.5.1", "resolved": "https://registry.npmjs.org/opener/-/opener-1.5.1.tgz", @@ -12030,17 +12299,34 @@ } }, "optionator": { - "version": "0.8.3", - "resolved": "https://registry.npmjs.org/optionator/-/optionator-0.8.3.tgz", - "integrity": "sha512-+IW9pACdk3XWmmTXG8m3upGUJst5XRGzxMRjXzAuJ1XnIFNvfhjjIuYkDvysnPQ7qzqVzLt78BCruntqRhWQbA==", + "version": "0.9.1", + "resolved": "https://registry.npmjs.org/optionator/-/optionator-0.9.1.tgz", + "integrity": "sha512-74RlY5FCnhq4jRxVUPKDaRwrVNXMqsGsiW6AJw4XK8hmtm10wC0ypZBLw5IIp85NZMr91+qd1RvvENwg7jjRFw==", "dev": true, "requires": { - "deep-is": "~0.1.3", - "fast-levenshtein": "~2.0.6", - "levn": "~0.3.0", - "prelude-ls": "~1.1.2", - "type-check": "~0.3.2", - "word-wrap": "~1.2.3" + "deep-is": "^0.1.3", + "fast-levenshtein": "^2.0.6", + "levn": "^0.4.1", + "prelude-ls": "^1.2.1", + "type-check": "^0.4.0", + "word-wrap": "^1.2.3" + }, + "dependencies": { + "prelude-ls": { + "version": "1.2.1", + "resolved": "https://registry.npmjs.org/prelude-ls/-/prelude-ls-1.2.1.tgz", + "integrity": "sha512-vkcDPrRZo1QZLbn5RLGPpg/WmIQ65qoWWhcGKf/b5eplkkarX0m9z8ppCat4mlOqUsWpyNuYgO3VRyrYHSzX5g==", + "dev": true + }, + "type-check": { + "version": "0.4.0", + "resolved": "https://registry.npmjs.org/type-check/-/type-check-0.4.0.tgz", + "integrity": "sha512-XleUoc9uwGXqjWwXaUTZAmzMcFZ5858QA2vvx1Ur5xIcixXIP+8LnFDgRplU30us6teqdlskFfu+ae4K79Ooew==", + "dev": true, + "requires": { + "prelude-ls": "^1.2.1" + } + } } }, "orchestrator": { @@ -12243,10 +12529,10 @@ "integrity": "sha1-F0uSaHNVNP+8es5r9TpanhtcX18=", "dev": true }, - "path-is-inside": { - "version": "1.0.2", - "resolved": "https://registry.npmjs.org/path-is-inside/-/path-is-inside-1.0.2.tgz", - "integrity": "sha1-NlQX3t5EQw0cEa9hAn+s8HS9/FM=", + "path-key": { + "version": "3.1.1", + "resolved": "https://registry.npmjs.org/path-key/-/path-key-3.1.1.tgz", + "integrity": "sha512-ojmeN0qd+y0jszEtoY48r0Peq5dwMEkIlCOu6Q5f41lfkswXuKtYrhgoTpLnyIcHm24Uhqx+5Tqm2InSwLhE6Q==", "dev": true }, "path-parse": { @@ -12415,12 +12701,6 @@ } } }, - "pluralize": { - "version": "7.0.0", - "resolved": "https://registry.npmjs.org/pluralize/-/pluralize-7.0.0.tgz", - "integrity": "sha512-ARhBOdzS3e41FbkW/XWrTEtukqqLoK5+Z/4UeDaLuSW+39JPeFgs4gCGqsrJHVZX0fUrx//4OF0K1CUGwlIFow==", - "dev": true - }, "popper.js": { "version": "1.16.1", "resolved": "https://registry.npmjs.org/popper.js/-/popper.js-1.16.1.tgz", @@ -12533,12 +12813,6 @@ "integrity": "sha1-GoS4WQgyVQFBGFPQCB7j+obikmo=", "dev": true }, - "pseudomap": { - "version": "1.0.2", - "resolved": "https://registry.npmjs.org/pseudomap/-/pseudomap-1.0.2.tgz", - "integrity": "sha1-8FKijacOYYkX7wqKw0wa5aaChrM=", - "dev": true - }, "public-encrypt": { "version": "4.0.3", "resolved": "https://registry.npmjs.org/public-encrypt/-/public-encrypt-4.0.3.tgz", @@ -13323,6 +13597,12 @@ "safe-regex": "^1.1.0" } }, + "regexpp": { + "version": "3.1.0", + "resolved": "https://registry.npmjs.org/regexpp/-/regexpp-3.1.0.tgz", + "integrity": "sha512-ZOIzd8yVsQQA7j8GCSlPGXwg5PfmA1mrq0JP4nGhh54LaKN3xdai/vHUDu74pKwV8OxseMS65u2NImosQcSD0Q==", + "dev": true + }, "remark-footnotes": { "version": "1.0.0", "resolved": "https://registry.npmjs.org/remark-footnotes/-/remark-footnotes-1.0.0.tgz", @@ -13672,16 +13952,6 @@ "integrity": "sha1-wR6XJ2tluOKSP3Xav1+y7ww4Qbk=", "dev": true }, - "require-uncached": { - "version": "1.0.3", - "resolved": "https://registry.npmjs.org/require-uncached/-/require-uncached-1.0.3.tgz", - "integrity": "sha1-Tg1W1slmL9MeQwEcS5WqSZVUIdM=", - "dev": true, - "requires": { - "caller-path": "^0.1.0", - "resolve-from": "^1.0.0" - } - }, "resolve": { "version": "1.1.7", "resolved": "https://registry.npmjs.org/resolve/-/resolve-1.1.7.tgz", @@ -13698,12 +13968,6 @@ "global-modules": "^0.2.3" } }, - "resolve-from": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/resolve-from/-/resolve-from-1.0.1.tgz", - "integrity": "sha1-Jsv+k10a7uq7Kbw/5a6wHpPUQiY=", - "dev": true - }, "resolve-pathname": { "version": "3.0.0", "resolved": "https://registry.npmjs.org/resolve-pathname/-/resolve-pathname-3.0.0.tgz", @@ -13715,24 +13979,6 @@ "integrity": "sha1-LGN/53yJOv0qZj/iGqkIAGjiBSo=", "dev": true }, - "restore-cursor": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/restore-cursor/-/restore-cursor-2.0.0.tgz", - "integrity": "sha1-n37ih/gv0ybU/RYpI9YhKe7g368=", - "dev": true, - "requires": { - "onetime": "^2.0.0", - "signal-exit": "^3.0.2" - }, - "dependencies": { - "signal-exit": { - "version": "3.0.3", - "resolved": "https://registry.npmjs.org/signal-exit/-/signal-exit-3.0.3.tgz", - "integrity": "sha512-VUJ49FC8U1OxwZLxIbTTrDvLnf/6TDgxZcK8wxR8zs13xpx7xbG60ndBlhNrFi2EMuFRoeDoJO7wthSLq42EjA==", - "dev": true - } - } - }, "ret": { "version": "0.1.15", "resolved": "https://registry.npmjs.org/ret/-/ret-0.1.15.tgz", @@ -13768,12 +14014,6 @@ "inherits": "^2.0.1" } }, - "run-async": { - "version": "2.4.1", - "resolved": "https://registry.npmjs.org/run-async/-/run-async-2.4.1.tgz", - "integrity": "sha512-tvVnVv01b8c1RrA6Ep7JkStj85Guv/YrMcwqYQnwjsAS2cTmmPGBBjAjpCW7RrSodNSoE2/qg9O4bceNvUuDgQ==", - "dev": true - }, "run-queue": { "version": "1.0.3", "resolved": "https://registry.npmjs.org/run-queue/-/run-queue-1.0.3.tgz", @@ -13797,21 +14037,6 @@ "resolved": "https://registry.npmjs.org/rw/-/rw-1.3.3.tgz", "integrity": "sha1-P4Yt+pGrdmsUiF700BEkv9oHT7Q=" }, - "rx-lite": { - "version": "4.0.8", - "resolved": "https://registry.npmjs.org/rx-lite/-/rx-lite-4.0.8.tgz", - "integrity": "sha1-Cx4Rr4vESDbwSmQH6S2kJGe3lEQ=", - "dev": true - }, - "rx-lite-aggregates": { - "version": "4.0.8", - "resolved": "https://registry.npmjs.org/rx-lite-aggregates/-/rx-lite-aggregates-4.0.8.tgz", - "integrity": "sha1-dTuHqJoRyVRnxKwWJsTvxOBcZ74=", - "dev": true, - "requires": { - "rx-lite": "*" - } - }, "safe-buffer": { "version": "5.1.1", "resolved": "https://registry.npmjs.org/safe-buffer/-/safe-buffer-5.1.1.tgz", @@ -13826,12 +14051,6 @@ "ret": "~0.1.10" } }, - "safer-buffer": { - "version": "2.1.2", - "resolved": "https://registry.npmjs.org/safer-buffer/-/safer-buffer-2.1.2.tgz", - "integrity": "sha512-YZo3K82SD7Riyi0E1EQPojLz7kpepnSQI9IyPbHHg1XXXevb5dJI7tpyN2ADxGcQbHG7vcyRHk0cbwqcQriUtg==", - "dev": true - }, "sane": { "version": "1.4.1", "resolved": "https://registry.npmjs.org/sane/-/sane-1.4.1.tgz", @@ -14054,18 +14273,18 @@ } }, "shebang-command": { - "version": "1.2.0", - "resolved": "https://registry.npmjs.org/shebang-command/-/shebang-command-1.2.0.tgz", - "integrity": "sha1-RKrGW2lbAzmJaMOfNj/uXer98eo=", + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/shebang-command/-/shebang-command-2.0.0.tgz", + "integrity": "sha512-kHxr2zZpYtdmrN1qDjrrX/Z1rR1kG8Dx+gkpK1G4eXmvXswmcE1hTWBWYUzlraYw1/yZp6YuDY77YtvbN0dmDA==", "dev": true, "requires": { - "shebang-regex": "^1.0.0" + "shebang-regex": "^3.0.0" } }, "shebang-regex": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/shebang-regex/-/shebang-regex-1.0.0.tgz", - "integrity": "sha1-2kL0l0DAtC2yypcoVxyxkMmO/qM=", + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/shebang-regex/-/shebang-regex-3.0.0.tgz", + "integrity": "sha512-7++dFhtcx3353uBaq8DDR4NuxBetBzC7ZQOhmTQInHEd6bSrXdiEyzCvG07Z44UYdLShWUyXt5M/yhz8ekcb1A==", "dev": true }, "shellwords": { @@ -14093,14 +14312,40 @@ "dev": true }, "slice-ansi": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/slice-ansi/-/slice-ansi-1.0.0.tgz", - "integrity": "sha512-POqxBK6Lb3q6s047D/XsDVNPnF9Dl8JSaqe9h9lURl0OdNqy/ujDrOiIHtsqXMGbWWTIomRzAMaTyawAU//Reg==", + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/slice-ansi/-/slice-ansi-2.1.0.tgz", + "integrity": "sha512-Qu+VC3EwYLldKa1fCxuuvULvSJOKEgk9pi8dZeCVK7TqBfUNTH4sFkk4joj8afVSfAYgJoSOetjx9QWOJ5mYoQ==", "dev": true, "requires": { + "ansi-styles": "^3.2.0", + "astral-regex": "^1.0.0", "is-fullwidth-code-point": "^2.0.0" }, "dependencies": { + "ansi-styles": { + "version": "3.2.1", + "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-3.2.1.tgz", + "integrity": "sha512-VT0ZI6kZRdTh8YyJw3SMbYm/u+NqfsAxEpWO0Pf9sq8/e94WxxOpPKx9FR1FlyCtOVDNOQ+8ntlqFxiRc+r5qA==", + "dev": true, + "requires": { + "color-convert": "^1.9.0" + } + }, + "color-convert": { + "version": "1.9.3", + "resolved": "https://registry.npmjs.org/color-convert/-/color-convert-1.9.3.tgz", + "integrity": "sha512-QfAUtd+vFdAtFQcC8CCyYt1fYWxSqAiK2cSD6zDB8N3cpsEBAvRxp9zOGg6G/SHHJYAT88/az/IuDGALsNVbGg==", + "dev": true, + "requires": { + "color-name": "1.1.3" + } + }, + "color-name": { + "version": "1.1.3", + "resolved": "https://registry.npmjs.org/color-name/-/color-name-1.1.3.tgz", + "integrity": "sha1-p9BVi9icQveV3UIyj3QIMcpTvCU=", + "dev": true + }, "is-fullwidth-code-point": { "version": "2.0.0", "resolved": "https://registry.npmjs.org/is-fullwidth-code-point/-/is-fullwidth-code-point-2.0.0.tgz", @@ -14598,6 +14843,26 @@ "integrity": "sha1-aybpvTr8qnvjtCabUm3huCAArHg=", "dev": true }, + "string.prototype.trimend": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/string.prototype.trimend/-/string.prototype.trimend-1.0.1.tgz", + "integrity": "sha512-LRPxFUaTtpqYsTeNKaFOw3R4bxIzWOnbQ837QfBylo8jIxtcbK/A/sMV7Q+OAV/vWo+7s25pOE10KYSjaSO06g==", + "dev": true, + "requires": { + "define-properties": "^1.1.3", + "es-abstract": "^1.17.5" + } + }, + "string.prototype.trimstart": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/string.prototype.trimstart/-/string.prototype.trimstart-1.0.1.tgz", + "integrity": "sha512-XxZn+QpvrBI1FOcg6dIpxUPgWCPuNXvMD72aaRaUQv1eD4e/Qy8i/hFTe0BUmD60p/QA6bh1avmuPTfNjqVWRw==", + "dev": true, + "requires": { + "define-properties": "^1.1.3", + "es-abstract": "^1.17.5" + } + }, "string_decoder": { "version": "0.10.31", "resolved": "https://registry.npmjs.org/string_decoder/-/string_decoder-0.10.31.tgz", @@ -14636,9 +14901,9 @@ } }, "strip-json-comments": { - "version": "2.0.1", - "resolved": "https://registry.npmjs.org/strip-json-comments/-/strip-json-comments-2.0.1.tgz", - "integrity": "sha1-PFMZQukIwml8DsNEhYwobHygpgo=", + "version": "3.1.0", + "resolved": "https://registry.npmjs.org/strip-json-comments/-/strip-json-comments-3.1.0.tgz", + "integrity": "sha512-e6/d0eBu7gHtdCqFt0xJr642LdToM5/cN4Qb9DbHjVx1CP5RyeM+zH7pbecEmDv/lBqb0QH+6Uqq75rxFPkM0w==", "dev": true }, "style-to-object": { @@ -14748,64 +15013,21 @@ "dev": true }, "table": { - "version": "4.0.2", - "resolved": "https://registry.npmjs.org/table/-/table-4.0.2.tgz", - "integrity": "sha512-UUkEAPdSGxtRpiV9ozJ5cMTtYiqz7Ni1OGqLXRCynrvzdtR1p+cfOWe2RJLwvUG8hNanaSRjecIqwOjqeatDsA==", + "version": "5.4.6", + "resolved": "https://registry.npmjs.org/table/-/table-5.4.6.tgz", + "integrity": "sha512-wmEc8m4fjnob4gt5riFRtTu/6+4rSe12TpAELNSqHMfF3IqnA+CH37USM6/YR3qRZv7e56kAEAtd6nKZaxe0Ug==", "dev": true, "requires": { - "ajv": "^5.2.3", - "ajv-keywords": "^2.1.0", - "chalk": "^2.1.0", - "lodash": "^4.17.4", - "slice-ansi": "1.0.0", - "string-width": "^2.1.1" + "ajv": "^6.10.2", + "lodash": "^4.17.14", + "slice-ansi": "^2.1.0", + "string-width": "^3.0.0" }, "dependencies": { "ansi-regex": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-3.0.0.tgz", - "integrity": "sha1-7QMXwyIGT3lGbAKWa922Bas32Zg=", - "dev": true - }, - "ansi-styles": { - "version": "3.2.1", - "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-3.2.1.tgz", - "integrity": "sha512-VT0ZI6kZRdTh8YyJw3SMbYm/u+NqfsAxEpWO0Pf9sq8/e94WxxOpPKx9FR1FlyCtOVDNOQ+8ntlqFxiRc+r5qA==", - "dev": true, - "requires": { - "color-convert": "^1.9.0" - } - }, - "chalk": { - "version": "2.4.2", - "resolved": "https://registry.npmjs.org/chalk/-/chalk-2.4.2.tgz", - "integrity": "sha512-Mti+f9lpJNcwF4tWV8/OrTTtF1gZi+f8FqlyAdouralcFWFQWF2+NgCHShjkCb+IFBLq9buZwE1xckQU4peSuQ==", - "dev": true, - "requires": { - "ansi-styles": "^3.2.1", - "escape-string-regexp": "^1.0.5", - "supports-color": "^5.3.0" - } - }, - "color-convert": { - "version": "1.9.3", - "resolved": "https://registry.npmjs.org/color-convert/-/color-convert-1.9.3.tgz", - "integrity": "sha512-QfAUtd+vFdAtFQcC8CCyYt1fYWxSqAiK2cSD6zDB8N3cpsEBAvRxp9zOGg6G/SHHJYAT88/az/IuDGALsNVbGg==", - "dev": true, - "requires": { - "color-name": "1.1.3" - } - }, - "color-name": { - "version": "1.1.3", - "resolved": "https://registry.npmjs.org/color-name/-/color-name-1.1.3.tgz", - "integrity": "sha1-p9BVi9icQveV3UIyj3QIMcpTvCU=", - "dev": true - }, - "has-flag": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/has-flag/-/has-flag-3.0.0.tgz", - "integrity": "sha1-tdRU3CGZriJWmfNGfloH87lVuv0=", + "version": "4.1.0", + "resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-4.1.0.tgz", + "integrity": "sha512-1apePfXM1UOSqw0o9IiFAovVz9M5S1Dg+4TrDwfMewQ6p/rmMueb7tWZjQ1rx4Loy1ArBggoqGpfqqdI4rondg==", "dev": true }, "is-fullwidth-code-point": { @@ -14814,38 +15036,24 @@ "integrity": "sha1-o7MKXE8ZkYMWeqq5O+764937ZU8=", "dev": true }, - "lodash": { - "version": "4.17.15", - "resolved": "https://registry.npmjs.org/lodash/-/lodash-4.17.15.tgz", - "integrity": "sha512-8xOcRHvCjnocdS5cpwXQXVzmmh5e5+saE2QGoeQmbKmRS6J3VQppPOIt0MnmE+4xlZoumy0GPG0D0MVIQbNA1A==", - "dev": true - }, "string-width": { - "version": "2.1.1", - "resolved": "https://registry.npmjs.org/string-width/-/string-width-2.1.1.tgz", - "integrity": "sha512-nOqH59deCq9SRHlxq1Aw85Jnt4w6KvLKqWVik6oA9ZklXLNIOlqg4F2yrT1MVaTjAqvVwdfeZ7w7aCvJD7ugkw==", + "version": "3.1.0", + "resolved": "https://registry.npmjs.org/string-width/-/string-width-3.1.0.tgz", + "integrity": "sha512-vafcv6KjVZKSgz06oM/H6GDBrAtz8vdhQakGjFIvNrHA6y3HCF1CInLy+QLq8dTJPQ1b+KDUqDFctkdRW44e1w==", "dev": true, "requires": { + "emoji-regex": "^7.0.1", "is-fullwidth-code-point": "^2.0.0", - "strip-ansi": "^4.0.0" + "strip-ansi": "^5.1.0" } }, "strip-ansi": { - "version": "4.0.0", - "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-4.0.0.tgz", - "integrity": "sha1-qEeQIusaw2iocTibY1JixQXuNo8=", - "dev": true, - "requires": { - "ansi-regex": "^3.0.0" - } - }, - "supports-color": { - "version": "5.5.0", - "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-5.5.0.tgz", - "integrity": "sha512-QjVjwdXIt408MIiAqCX4oUKsgU2EqAGzs2Ppkm4aQYbjm+ZEWEcW4SfFNTr4uMNZma0ey4f5lgLrkB0aX0QMow==", + "version": "5.2.0", + "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-5.2.0.tgz", + "integrity": "sha512-DuRs1gKbBqsMKIZlrffwlug8MHkcnpjs5VPmL1PAh+mA30U0DTotfDZ0d2UUsXpPmPmMMJ6W773MaA3J+lbiWA==", "dev": true, "requires": { - "has-flag": "^3.0.0" + "ansi-regex": "^4.1.0" } } } @@ -15044,15 +15252,6 @@ "resolved": "https://registry.npmjs.org/tiny-warning/-/tiny-warning-1.0.3.tgz", "integrity": "sha512-lBN9zLN/oAf68o3zNXYrdCt1kP8WsiGW8Oo2ka41b2IM5JL/S1CTyX1rW0mb/zSuJun0ZUrDxx4sqvYS2FWzPA==" }, - "tmp": { - "version": "0.0.33", - "resolved": "https://registry.npmjs.org/tmp/-/tmp-0.0.33.tgz", - "integrity": "sha512-jRCJlojKnZ3addtTOjdIqoRuPEKBvNXcGYqzO6zWZX8KfKEpnGY5jfggJQ3EjKuu8D4bJRr0y+cYJFmYbImXGw==", - "dev": true, - "requires": { - "os-tmpdir": "~1.0.2" - } - }, "tmpl": { "version": "1.0.4", "resolved": "https://registry.npmjs.org/tmpl/-/tmpl-1.0.4.tgz", @@ -15166,6 +15365,26 @@ "integrity": "sha512-c3zayb8/kWWpycWYg87P71E1S1ZL6b6IJxfb5fvsUgsf0S2MVGaDhDXXjDMpdCpfWXqptc+4mXwmiy1ypXqRAA==", "dev": true }, + "tsconfig-paths": { + "version": "3.9.0", + "resolved": "https://registry.npmjs.org/tsconfig-paths/-/tsconfig-paths-3.9.0.tgz", + "integrity": "sha512-dRcuzokWhajtZWkQsDVKbWyY+jgcLC5sqJhg2PSgf4ZkH2aHPvaOY8YWGhmjb68b5qqTfasSsDO9k7RUiEmZAw==", + "dev": true, + "requires": { + "@types/json5": "^0.0.29", + "json5": "^1.0.1", + "minimist": "^1.2.0", + "strip-bom": "^3.0.0" + }, + "dependencies": { + "strip-bom": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/strip-bom/-/strip-bom-3.0.0.tgz", + "integrity": "sha1-IzTBjpx1n3vdVv3vfprj1YjmjtM=", + "dev": true + } + } + }, "tslib": { "version": "1.13.0", "resolved": "https://registry.npmjs.org/tslib/-/tslib-1.13.0.tgz", @@ -15204,6 +15423,12 @@ "prelude-ls": "~1.1.2" } }, + "type-fest": { + "version": "0.8.1", + "resolved": "https://registry.npmjs.org/type-fest/-/type-fest-0.8.1.tgz", + "integrity": "sha512-4dbzIzqvjtgiM5rw1k5rEHtBANKmdudhGyBEajN01fEyhaAIhsoKNy6y7+IN93IfpFtwY9iqi7kD+xwKhQsNJA==", + "dev": true + }, "typedarray": { "version": "0.0.6", "resolved": "https://registry.npmjs.org/typedarray/-/typedarray-0.0.6.tgz", @@ -15559,6 +15784,12 @@ "integrity": "sha1-RQ1Nyfpw3nMnYvvS1KKJgUGaDM8=", "dev": true }, + "v8-compile-cache": { + "version": "2.1.1", + "resolved": "https://registry.npmjs.org/v8-compile-cache/-/v8-compile-cache-2.1.1.tgz", + "integrity": "sha512-8OQ9CL+VWyt3JStj7HX7/ciTL2V3Rl1Wf5OL+SNTm0yK1KvtReVulksyeRnCANHHuUxHlQig+JJDlUhBt1NQDQ==", + "dev": true + }, "v8flags": { "version": "2.0.11", "resolved": "https://registry.npmjs.org/v8flags/-/v8flags-2.0.11.tgz", @@ -19486,9 +19717,9 @@ } }, "write": { - "version": "0.2.1", - "resolved": "https://registry.npmjs.org/write/-/write-0.2.1.tgz", - "integrity": "sha1-X8A4KOJkzqP+kUVUdvejxWbLB1c=", + "version": "1.0.3", + "resolved": "https://registry.npmjs.org/write/-/write-1.0.3.tgz", + "integrity": "sha512-/lg70HAjtkUgWPVZhZcm+T4hkL8Zbtp1nFNOn3lRrxnlv50SRBv7cR7RqR+GMsd3hUXy9hWBo4CHTbFTcOYwig==", "dev": true, "requires": { "mkdirp": "^0.5.1" diff --git a/client-admin/package.json b/client-admin/package.json index b50c9fe26..eeeede449 100644 --- a/client-admin/package.json +++ b/client-admin/package.json @@ -39,10 +39,16 @@ "babel-plugin-transform-decorators": "^6.24.1", "bluebird": "^3.7.2", "es6-promise": "~4.2.8", - "eslint": "4.18.2", - "eslint-config-defaults": "^7.0.1", + "eslint": "^7.3.1", + "eslint-config-standard": "^14.1.1", + "eslint-config-standard-react": "^9.2.0", + "eslint-plugin-babel": "^5.3.1", "eslint-plugin-filenames": "^1.3.2", + "eslint-plugin-import": "^2.22.0", + "eslint-plugin-node": "^11.1.0", + "eslint-plugin-promise": "^4.2.1", "eslint-plugin-react": "^3.5.1", + "eslint-plugin-standard": "^4.0.1", "express": "^4.13.3", "file-loader": "https://registry.npmjs.org/file-loader/-/file-loader-0.8.5.tgz", "glob": "^7.1.2", From 63d8bf794e7d5b990775ca09cd01f1ddd7a7670f Mon Sep 17 00:00:00 2001 From: Patrick Connolly Date: Tue, 30 Jun 2020 22:59:34 -0300 Subject: [PATCH 002/106] Migrated to using standard js and prettier extension. --- client-admin/.eslintrc | 10 -- client-admin/.eslintrc.yml | 18 +++ client-admin/package-lock.json | 246 +++++++++++++++++++++++++-------- client-admin/package.json | 9 +- 4 files changed, 215 insertions(+), 68 deletions(-) delete mode 100644 client-admin/.eslintrc create mode 100644 client-admin/.eslintrc.yml diff --git a/client-admin/.eslintrc b/client-admin/.eslintrc deleted file mode 100644 index 9d9b73d10..000000000 --- a/client-admin/.eslintrc +++ /dev/null @@ -1,10 +0,0 @@ ---- -plugins: - - babel - - react -extends: - - standard - - standard-jsx - - standard-react -rules: - comma-dangle: ["error", "never"] diff --git a/client-admin/.eslintrc.yml b/client-admin/.eslintrc.yml new file mode 100644 index 000000000..f6c0eddc4 --- /dev/null +++ b/client-admin/.eslintrc.yml @@ -0,0 +1,18 @@ +env: + browser: true + es2020: true +plugins: + - babel + - react +extends: + - standard + - prettier-standard + - eslint:recommended + - plugin:react/recommended + - prettier/react +rules: {} +parserOptions: + ecmaFeatures: + jsx: true + ecmaVersion: 11 + sourceType: module diff --git a/client-admin/package-lock.json b/client-admin/package-lock.json index 885569832..c5d1f320f 100644 --- a/client-admin/package-lock.json +++ b/client-admin/package-lock.json @@ -3320,6 +3320,17 @@ "es-abstract": "^1.17.0-next.1" } }, + "array.prototype.flatmap": { + "version": "1.2.3", + "resolved": "https://registry.npmjs.org/array.prototype.flatmap/-/array.prototype.flatmap-1.2.3.tgz", + "integrity": "sha512-OOEk+lkePcg+ODXIpvuU9PAryCikCJyo7GlDG1upleEpQRx6mzL9puEBkozQ5iAx20KV0l3DbyQwqciJtqe5Pg==", + "dev": true, + "requires": { + "define-properties": "^1.1.3", + "es-abstract": "^1.17.0-next.1", + "function-bind": "^1.1.1" + } + }, "arrify": { "version": "1.0.1", "resolved": "https://registry.npmjs.org/arrify/-/arrify-1.0.1.tgz", @@ -6732,27 +6743,35 @@ } } }, + "eslint-config-prettier": { + "version": "6.11.0", + "resolved": "https://registry.npmjs.org/eslint-config-prettier/-/eslint-config-prettier-6.11.0.tgz", + "integrity": "sha512-oB8cpLWSAjOVFEJhhyMZh6NOEOtBVziaqdDQ86+qhDHFbZXoRTM7pNSvFRfW/W/L/LrQ38C99J5CGuRBBzBsdA==", + "dev": true, + "requires": { + "get-stdin": "^6.0.0" + }, + "dependencies": { + "get-stdin": { + "version": "6.0.0", + "resolved": "https://registry.npmjs.org/get-stdin/-/get-stdin-6.0.0.tgz", + "integrity": "sha512-jp4tHawyV7+fkkSKyvjuLZswblUtz+SQKzSWnBbii16BuZksJlU1wuBYXY75r+duh/llF1ur6oNwi+2ZzjKZ7g==", + "dev": true + } + } + }, + "eslint-config-prettier-standard": { + "version": "3.0.1", + "resolved": "https://registry.npmjs.org/eslint-config-prettier-standard/-/eslint-config-prettier-standard-3.0.1.tgz", + "integrity": "sha512-myiM0WllCOBNYi1gI4AuI128eb7QVOE74H4bUVqS7oChRzbTIyHPwJwvrt/7QF++2NDNiDHAjsDVhdXtOrJyag==", + "dev": true + }, "eslint-config-standard": { "version": "14.1.1", "resolved": "https://registry.npmjs.org/eslint-config-standard/-/eslint-config-standard-14.1.1.tgz", "integrity": "sha512-Z9B+VR+JIXRxz21udPTL9HpFMyoMUEeX1G251EQ6e05WD9aPVtVBn09XUmZ259wCMlCDmYDSZG62Hhm+ZTJcUg==", "dev": true }, - "eslint-config-standard-jsx": { - "version": "8.1.0", - "resolved": "https://registry.npmjs.org/eslint-config-standard-jsx/-/eslint-config-standard-jsx-8.1.0.tgz", - "integrity": "sha512-ULVC8qH8qCqbU792ZOO6DaiaZyHNS/5CZt3hKqHkEhVlhPEPN3nfBqqxJCyp59XrjIBZPu1chMYe9T2DXZ7TMw==", - "dev": true - }, - "eslint-config-standard-react": { - "version": "9.2.0", - "resolved": "https://registry.npmjs.org/eslint-config-standard-react/-/eslint-config-standard-react-9.2.0.tgz", - "integrity": "sha512-u+KRP2uCtthZ/W4DlLWCC59GZNV/y9k9yicWWammgTs/Omh8ZUUPF3EnYm81MAcbkYQq2Wg0oxutAhi/FQ8mIw==", - "dev": true, - "requires": { - "eslint-config-standard-jsx": "^8.0.0" - } - }, "eslint-import-resolver-node": { "version": "0.3.4", "resolved": "https://registry.npmjs.org/eslint-import-resolver-node/-/eslint-import-resolver-node-0.3.4.tgz", @@ -6859,18 +6878,6 @@ "regexpp": "^3.0.0" } }, - "eslint-plugin-filenames": { - "version": "1.3.2", - "resolved": "https://registry.npmjs.org/eslint-plugin-filenames/-/eslint-plugin-filenames-1.3.2.tgz", - "integrity": "sha512-tqxJTiEM5a0JmRCUYQmxw23vtTxrb2+a3Q2mMOPhFxvt7ZQQJmdiuMby9B/vUAuVMghyP7oET+nIf6EO6CBd/w==", - "dev": true, - "requires": { - "lodash.camelcase": "4.3.0", - "lodash.kebabcase": "4.1.1", - "lodash.snakecase": "4.1.1", - "lodash.upperfirst": "4.3.1" - } - }, "eslint-plugin-import": { "version": "2.22.0", "resolved": "https://registry.npmjs.org/eslint-plugin-import/-/eslint-plugin-import-2.22.0.tgz", @@ -7084,6 +7091,15 @@ } } }, + "eslint-plugin-prettier": { + "version": "3.1.4", + "resolved": "https://registry.npmjs.org/eslint-plugin-prettier/-/eslint-plugin-prettier-3.1.4.tgz", + "integrity": "sha512-jZDa8z76klRqo+TdGDTFJSavwbnWK2ZpqGKNZ+VvweMW516pDUMmQ2koXvxEE4JhzNvTv+radye/bWGBmA6jmg==", + "dev": true, + "requires": { + "prettier-linter-helpers": "^1.0.0" + } + }, "eslint-plugin-promise": { "version": "4.2.1", "resolved": "https://registry.npmjs.org/eslint-plugin-promise/-/eslint-plugin-promise-4.2.1.tgz", @@ -7091,10 +7107,49 @@ "dev": true }, "eslint-plugin-react": { - "version": "3.16.1", - "resolved": "https://registry.npmjs.org/eslint-plugin-react/-/eslint-plugin-react-3.16.1.tgz", - "integrity": "sha1-Ji2Wt318SkKvgJpzwOUnpYYSKTw=", - "dev": true + "version": "7.20.3", + "resolved": "https://registry.npmjs.org/eslint-plugin-react/-/eslint-plugin-react-7.20.3.tgz", + "integrity": "sha512-txbo090buDeyV0ugF3YMWrzLIUqpYTsWSDZV9xLSmExE1P/Kmgg9++PD931r+KEWS66O1c9R4srLVVHmeHpoAg==", + "dev": true, + "requires": { + "array-includes": "^3.1.1", + "array.prototype.flatmap": "^1.2.3", + "doctrine": "^2.1.0", + "has": "^1.0.3", + "jsx-ast-utils": "^2.4.1", + "object.entries": "^1.1.2", + "object.fromentries": "^2.0.2", + "object.values": "^1.1.1", + "prop-types": "^15.7.2", + "resolve": "^1.17.0", + "string.prototype.matchall": "^4.0.2" + }, + "dependencies": { + "doctrine": { + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/doctrine/-/doctrine-2.1.0.tgz", + "integrity": "sha512-35mSku4ZXK0vfCuHEDAwt55dg2jNajHZ1odvF+8SSr82EsZY4QmXfuWso8oEd8zRhVObSN18aM0CjSdoBX7zIw==", + "dev": true, + "requires": { + "esutils": "^2.0.2" + } + }, + "path-parse": { + "version": "1.0.6", + "resolved": "https://registry.npmjs.org/path-parse/-/path-parse-1.0.6.tgz", + "integrity": "sha512-GSmOT2EbHrINBf9SR7CDELwlJ8AENk3Qn7OikK4nFYAu3Ote2+JYNVvkpAEQm3/TLNEJFD/xZJjzyxg3KBWOzw==", + "dev": true + }, + "resolve": { + "version": "1.17.0", + "resolved": "https://registry.npmjs.org/resolve/-/resolve-1.17.0.tgz", + "integrity": "sha512-ic+7JYiV8Vi2yzQGFWOkiZD5Z9z7O2Zhm9XMaTxdJExKasieFCr+yXZ/WmXsckHiKl12ar0y6XiXDx3m4RHn1w==", + "dev": true, + "requires": { + "path-parse": "^1.0.6" + } + } + } }, "eslint-plugin-standard": { "version": "4.0.1", @@ -7621,6 +7676,12 @@ "integrity": "sha512-8UEa58QDLauDNfpbrX55Q9jrGHThw2ZMdOky5Gl1CDtVeJDPVrG4Jxx1N8jw2gkWaff5UUuX1KJd+9zGe2B+ZA==", "dev": true }, + "fast-diff": { + "version": "1.2.0", + "resolved": "https://registry.npmjs.org/fast-diff/-/fast-diff-1.2.0.tgz", + "integrity": "sha512-xJuoT5+L99XlZ8twedaRf6Ax2TgQVxvgZOYoPKqZufmJib0tL2tegPBOZb1pVNgIhlqDlA0eO0c3wBvQcmzx4w==", + "dev": true + }, "fast-json-stable-stringify": { "version": "2.1.0", "resolved": "https://registry.npmjs.org/fast-json-stable-stringify/-/fast-json-stable-stringify-2.1.0.tgz", @@ -9299,6 +9360,17 @@ "integrity": "sha512-7NXolsK4CAS5+xvdj5OMMbI962hU/wvwoxk+LWR9Ek9bVtyuuYScDN6eS0rUm6TxApFpw7CX1o4uJzcd4AyD3Q==", "dev": true }, + "internal-slot": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/internal-slot/-/internal-slot-1.0.2.tgz", + "integrity": "sha512-2cQNfwhAfJIkU4KZPkDI+Gj5yNNnbqi40W9Gge6dfnk4TocEVm00B3bdiL+JINrbGJil2TeHvM4rETGzk/f/0g==", + "dev": true, + "requires": { + "es-abstract": "^1.17.0-next.1", + "has": "^1.0.3", + "side-channel": "^1.0.2" + } + }, "interpret": { "version": "1.0.1", "resolved": "https://registry.npmjs.org/interpret/-/interpret-1.0.1.tgz", @@ -10683,6 +10755,16 @@ "jss": "10.1.1" } }, + "jsx-ast-utils": { + "version": "2.4.1", + "resolved": "https://registry.npmjs.org/jsx-ast-utils/-/jsx-ast-utils-2.4.1.tgz", + "integrity": "sha512-z1xSldJ6imESSzOjd3NNkieVJKRlKYSOtMG8SFyCj2FIrvSaSuli/WjpBkEzCBoR9bYYYFgqJw61Xhu7Lcgk+w==", + "dev": true, + "requires": { + "array-includes": "^3.1.1", + "object.assign": "^4.1.0" + } + }, "kind-of": { "version": "3.0.4", "resolved": "https://registry.npmjs.org/kind-of/-/kind-of-3.0.4.tgz", @@ -11068,12 +11150,6 @@ "integrity": "sha1-EnqX8CrcQXUalU0ksN4X4QDgOOs=", "dev": true }, - "lodash.camelcase": { - "version": "4.3.0", - "resolved": "https://registry.npmjs.org/lodash.camelcase/-/lodash.camelcase-4.3.0.tgz", - "integrity": "sha1-soqmKIorn8ZRA1x3EfZathkDMaY=", - "dev": true - }, "lodash.clonedeep": { "version": "3.0.2", "resolved": "https://registry.npmjs.org/lodash.clonedeep/-/lodash.clonedeep-3.0.2.tgz", @@ -11167,12 +11243,6 @@ "resolved": "https://registry.npmjs.org/lodash.isstring/-/lodash.isstring-4.0.1.tgz", "integrity": "sha1-1SfftUVuynzJu5XV2ur4i6VKVFE=" }, - "lodash.kebabcase": { - "version": "4.1.1", - "resolved": "https://registry.npmjs.org/lodash.kebabcase/-/lodash.kebabcase-4.1.1.tgz", - "integrity": "sha1-hImxyw0p/4gZXM7KRI/21swpXDY=", - "dev": true - }, "lodash.keys": { "version": "3.1.2", "resolved": "https://registry.npmjs.org/lodash.keys/-/lodash.keys-3.1.2.tgz", @@ -11205,12 +11275,6 @@ "integrity": "sha1-k2pOMJ7zMKdkXtQUWYbIWuWyCAU=", "dev": true }, - "lodash.snakecase": { - "version": "4.1.1", - "resolved": "https://registry.npmjs.org/lodash.snakecase/-/lodash.snakecase-4.1.1.tgz", - "integrity": "sha1-OdcUo1NXFHg3rv1ktdy7Fr7Nj40=", - "dev": true - }, "lodash.sortby": { "version": "4.7.0", "resolved": "https://registry.npmjs.org/lodash.sortby/-/lodash.sortby-4.7.0.tgz", @@ -11250,12 +11314,6 @@ "integrity": "sha1-0CJTc662Uq3BvILklFM5qEJ1R3M=", "dev": true }, - "lodash.upperfirst": { - "version": "4.3.1", - "resolved": "https://registry.npmjs.org/lodash.upperfirst/-/lodash.upperfirst-4.3.1.tgz", - "integrity": "sha1-E2Xt9DFIBIHvDRxolXpe2Z1J984=", - "dev": true - }, "lodash.values": { "version": "2.4.1", "resolved": "https://registry.npmjs.org/lodash.values/-/lodash.values-2.4.1.tgz", @@ -12217,6 +12275,29 @@ } } }, + "object.entries": { + "version": "1.1.2", + "resolved": "https://registry.npmjs.org/object.entries/-/object.entries-1.1.2.tgz", + "integrity": "sha512-BQdB9qKmb/HyNdMNWVr7O3+z5MUIx3aiegEIJqjMBbBf0YT9RRxTJSim4mzFqtyr7PDAHigq0N9dO0m0tRakQA==", + "dev": true, + "requires": { + "define-properties": "^1.1.3", + "es-abstract": "^1.17.5", + "has": "^1.0.3" + } + }, + "object.fromentries": { + "version": "2.0.2", + "resolved": "https://registry.npmjs.org/object.fromentries/-/object.fromentries-2.0.2.tgz", + "integrity": "sha512-r3ZiBH7MQppDJVLx6fhD618GKNG40CZYH9wgwdhKxBDDbQgjeWGGd4AtkZad84d291YxvWe7bJGuE65Anh0dxQ==", + "dev": true, + "requires": { + "define-properties": "^1.1.3", + "es-abstract": "^1.17.0-next.1", + "function-bind": "^1.1.1", + "has": "^1.0.3" + } + }, "object.omit": { "version": "2.0.1", "resolved": "https://registry.npmjs.org/object.omit/-/object.omit-2.0.1.tgz", @@ -12724,6 +12805,27 @@ "integrity": "sha1-gV7R9uvGWSb4ZbMQwHE7yzMVzks=", "dev": true }, + "prettier": { + "version": "2.0.5", + "resolved": "https://registry.npmjs.org/prettier/-/prettier-2.0.5.tgz", + "integrity": "sha512-7PtVymN48hGcO4fGjybyBSIWDsLU4H4XlvOHfq91pz9kkGlonzwTfYkaIEwiRg/dAJF9YlbsduBAgtYLi+8cFg==", + "dev": true + }, + "prettier-config-standard": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/prettier-config-standard/-/prettier-config-standard-1.0.1.tgz", + "integrity": "sha512-S0zuixvAFlc0zruhYEDMsjt2VG/e5S5hSbqGuxTMWA0ygjII8EP9U7c/wsCQyjjAoaYG82bUsVmaSQ6veQ+u6g==", + "dev": true + }, + "prettier-linter-helpers": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/prettier-linter-helpers/-/prettier-linter-helpers-1.0.0.tgz", + "integrity": "sha512-GbK2cP9nraSSUF9N2XwUwqfzlAFlMNYYl+ShE/V+H8a9uNl/oUqB1w2EL54Jh0OlyRSd8RfWYJ3coVS4TROP2w==", + "dev": true, + "requires": { + "fast-diff": "^1.1.2" + } + }, "pretty-format": { "version": "4.2.2", "resolved": "https://registry.npmjs.org/pretty-format/-/pretty-format-4.2.2.tgz", @@ -13597,6 +13699,16 @@ "safe-regex": "^1.1.0" } }, + "regexp.prototype.flags": { + "version": "1.3.0", + "resolved": "https://registry.npmjs.org/regexp.prototype.flags/-/regexp.prototype.flags-1.3.0.tgz", + "integrity": "sha512-2+Q0C5g951OlYlJz6yu5/M33IcsESLlLfsyIaLJaG4FA2r4yP8MvVMJUUP/fVBkSpbbbZlS5gynbEWLipiiXiQ==", + "dev": true, + "requires": { + "define-properties": "^1.1.3", + "es-abstract": "^1.17.0-next.1" + } + }, "regexpp": { "version": "3.1.0", "resolved": "https://registry.npmjs.org/regexpp/-/regexpp-3.1.0.tgz", @@ -14293,6 +14405,16 @@ "integrity": "sha1-Zq/Ue2oSky2Qccv9mKUueFzQuhQ=", "dev": true }, + "side-channel": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/side-channel/-/side-channel-1.0.2.tgz", + "integrity": "sha512-7rL9YlPHg7Ancea1S96Pa8/QWb4BtXL/TZvS6B8XFetGBeuhAsfmUspK6DokBeZ64+Kj9TCNRD/30pVz1BvQNA==", + "dev": true, + "requires": { + "es-abstract": "^1.17.0-next.1", + "object-inspect": "^1.7.0" + } + }, "sigmund": { "version": "1.0.1", "resolved": "https://registry.npmjs.org/sigmund/-/sigmund-1.0.1.tgz", @@ -14843,6 +14965,20 @@ "integrity": "sha1-aybpvTr8qnvjtCabUm3huCAArHg=", "dev": true }, + "string.prototype.matchall": { + "version": "4.0.2", + "resolved": "https://registry.npmjs.org/string.prototype.matchall/-/string.prototype.matchall-4.0.2.tgz", + "integrity": "sha512-N/jp6O5fMf9os0JU3E72Qhf590RSRZU/ungsL/qJUYVTNv7hTG0P/dbPjxINVN9jpscu3nzYwKESU3P3RY5tOg==", + "dev": true, + "requires": { + "define-properties": "^1.1.3", + "es-abstract": "^1.17.0", + "has-symbols": "^1.0.1", + "internal-slot": "^1.0.2", + "regexp.prototype.flags": "^1.3.0", + "side-channel": "^1.0.2" + } + }, "string.prototype.trimend": { "version": "1.0.1", "resolved": "https://registry.npmjs.org/string.prototype.trimend/-/string.prototype.trimend-1.0.1.tgz", diff --git a/client-admin/package.json b/client-admin/package.json index eeeede449..b8949ccb8 100644 --- a/client-admin/package.json +++ b/client-admin/package.json @@ -40,14 +40,15 @@ "bluebird": "^3.7.2", "es6-promise": "~4.2.8", "eslint": "^7.3.1", + "eslint-config-prettier": "^6.11.0", + "eslint-config-prettier-standard": "^3.0.1", "eslint-config-standard": "^14.1.1", - "eslint-config-standard-react": "^9.2.0", "eslint-plugin-babel": "^5.3.1", - "eslint-plugin-filenames": "^1.3.2", "eslint-plugin-import": "^2.22.0", "eslint-plugin-node": "^11.1.0", + "eslint-plugin-prettier": "^3.1.4", "eslint-plugin-promise": "^4.2.1", - "eslint-plugin-react": "^3.5.1", + "eslint-plugin-react": "^7.20.3", "eslint-plugin-standard": "^4.0.1", "express": "^4.13.3", "file-loader": "https://registry.npmjs.org/file-loader/-/file-loader-0.8.5.tgz", @@ -61,6 +62,8 @@ "jest": "^17.0.0", "json-loader": "^0.5.1", "lodash-webpack-plugin": "^0.11.5", + "prettier": "2.0.5", + "prettier-config-standard": "^1.0.1", "react-test-renderer": "^15.3.2", "react-transform-catch-errors": "1.0.0", "react-transform-hmr": "1.0.1", From 6c76d21ad71fddc27e2a46a80454fe0cbb28427b Mon Sep 17 00:00:00 2001 From: Patrick Connolly Date: Tue, 30 Jun 2020 23:02:53 -0300 Subject: [PATCH 003/106] Auto-detected react version for estlint-plugin-react. --- client-admin/.eslintrc.yml | 3 +++ 1 file changed, 3 insertions(+) diff --git a/client-admin/.eslintrc.yml b/client-admin/.eslintrc.yml index f6c0eddc4..a7cd1032b 100644 --- a/client-admin/.eslintrc.yml +++ b/client-admin/.eslintrc.yml @@ -16,3 +16,6 @@ parserOptions: jsx: true ecmaVersion: 11 sourceType: module +settings: + react: + version: detect From 741b72d1a225a3f107879b542fcf8fb4bf589bb6 Mon Sep 17 00:00:00 2001 From: Patrick Connolly Date: Tue, 30 Jun 2020 23:06:58 -0300 Subject: [PATCH 004/106] Auto-fixed all eslint issues. --- client-admin/src/actions/index.js | 1885 +++++++++-------- .../conversation-admin/no-permission.js | 10 +- .../conversation-admin/report/reports.js | 10 +- .../conversation-admin/stats/commenters.js | 30 +- .../conversation-stats-commenters-voters.js | 39 +- .../conversation-stats-comments-timescale.js | 27 +- .../stats/conversation-stats-number-card.js | 8 +- .../stats/conversation-stats-number-cards.js | 26 +- .../conversation-stats-vote-distribution.js | 54 +- .../conversation-stats-votes-timescale.js | 27 +- .../conversation-admin/stats/victoryTheme.js | 188 +- .../conversation-admin/stats/voters.js | 31 +- .../conversations-and-account/conversation.js | 11 +- .../src/components/framework/colors.js | 4 +- client-admin/src/components/framework/flex.js | 22 +- .../src/components/framework/global-styles.js | 84 +- .../src/components/framework/logomark.js | 16 +- .../src/components/framework/spinner.js | 11 +- .../framework/verified-twitter-icon.js | 10 +- .../src/components/interior-header.js | 38 +- .../landers/exploreKnowledgeBase.js | 26 +- client-admin/src/components/landers/home.js | 44 +- .../src/components/landers/knowledgeBase.js | 12 +- .../src/components/landers/lander-footer.js | 26 +- .../src/components/landers/lander-header.js | 33 +- .../src/components/landers/lander-layout.js | 21 +- client-admin/src/components/landers/press.js | 54 +- .../src/components/landers/privacy.js | 12 +- client-admin/src/components/landers/tos.js | 12 +- client-admin/src/index.js | 28 +- client-admin/src/reducers/REDUCER_TEMPLATE.js | 55 +- client-admin/src/reducers/comments.js | 57 +- .../src/reducers/conversation_config.js | 24 +- client-admin/src/reducers/conversations.js | 57 +- client-admin/src/reducers/index.js | 41 +- client-admin/src/reducers/math.js | 59 +- .../src/reducers/mod_comments_accepted.js | 39 +- .../src/reducers/mod_comments_rejected.js | 39 +- .../src/reducers/mod_comments_unmoderated.js | 39 +- client-admin/src/reducers/mod_ptpt_default.js | 39 +- .../src/reducers/mod_ptpt_featured.js | 39 +- client-admin/src/reducers/mod_ptpt_hidden.js | 39 +- client-admin/src/reducers/participants.js | 55 +- client-admin/src/reducers/seed_comments.js | 77 +- .../src/reducers/seed_comments_tweet.js | 75 +- client-admin/src/reducers/signin.js | 50 +- client-admin/src/reducers/signout.js | 57 +- client-admin/src/reducers/stats.js | 39 +- client-admin/src/reducers/user.js | 63 +- client-admin/src/reducers/zid_metadata.js | 107 +- client-admin/src/settings.js | 54 +- client-admin/src/store/index.js | 16 +- client-admin/src/strings/en_us.js | 35 +- client-admin/src/strings/footer.js | 33 +- client-admin/src/strings/pt_br.js | 38 +- client-admin/src/strings/strings.js | 19 +- client-admin/src/theme/index.js | 140 +- client-admin/src/util/component-helpers.js | 13 +- .../src/util/data-export-date-setup.js | 185 +- client-admin/src/util/isUnlocked.js | 8 +- client-admin/src/util/net.js | 70 +- client-admin/src/util/url.js | 20 +- 62 files changed, 2313 insertions(+), 2167 deletions(-) diff --git a/client-admin/src/actions/index.js b/client-admin/src/actions/index.js index 84c3046f8..c4aca0460 100644 --- a/client-admin/src/actions/index.js +++ b/client-admin/src/actions/index.js @@ -1,152 +1,156 @@ // Copyright (C) 2012-present, The Authors. This program is free software: you can redistribute it and/or modify it under the terms of the GNU Affero General Public License, version 3, as published by the Free Software Foundation. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Affero General Public License for more details. You should have received a copy of the GNU Affero General Public License along with this program. If not, see . -import $ from "jquery"; -import PolisNet from "../util/net"; +import $ from 'jquery' +import PolisNet from '../util/net' /* ======= Types ======= */ -export const REQUEST_USER = "REQUEST_USER"; -export const RECEIVE_USER = "RECEIVE_USER"; -export const USER_FETCH_ERROR = "USER_FETCH_ERROR"; +export const REQUEST_USER = 'REQUEST_USER' +export const RECEIVE_USER = 'RECEIVE_USER' +export const USER_FETCH_ERROR = 'USER_FETCH_ERROR' -export const CREATE_NEW_CONVERSATION = "CREATE_NEW_CONVERSATION"; -export const CREATE_NEW_CONVERSATION_SUCCESS = "CREATE_NEW_CONVERSATION_SUCCESS"; -export const CREATE_NEW_CONVERSATION_ERROR = "CREATE_NEW_CONVERSATION_ERROR"; +export const CREATE_NEW_CONVERSATION = 'CREATE_NEW_CONVERSATION' +export const CREATE_NEW_CONVERSATION_SUCCESS = 'CREATE_NEW_CONVERSATION_SUCCESS' +export const CREATE_NEW_CONVERSATION_ERROR = 'CREATE_NEW_CONVERSATION_ERROR' -export const REQUEST_CONVERSATIONS = "REQUEST_CONVERSATIONS"; -export const RECEIVE_CONVERSATIONS = "RECEIVE_CONVERSATIONS"; -export const CONVERSATIONS_FETCH_ERROR = "CONVERSATIONS_FETCH_ERROR"; +export const REQUEST_CONVERSATIONS = 'REQUEST_CONVERSATIONS' +export const RECEIVE_CONVERSATIONS = 'RECEIVE_CONVERSATIONS' +export const CONVERSATIONS_FETCH_ERROR = 'CONVERSATIONS_FETCH_ERROR' /* zid for clarity - this is conversation config */ -export const REQUEST_ZID_METADATA = "REQUEST_ZID_METADATA"; -export const RECEIVE_ZID_METADATA = "RECEIVE_ZID_METADATA"; -export const ZID_METADATA_FETCH_ERROR = "ZID_METADATA_FETCH_ERROR"; -export const ZID_METADATA_RESET = "ZID_METADATA_RESET"; +export const REQUEST_ZID_METADATA = 'REQUEST_ZID_METADATA' +export const RECEIVE_ZID_METADATA = 'RECEIVE_ZID_METADATA' +export const ZID_METADATA_FETCH_ERROR = 'ZID_METADATA_FETCH_ERROR' +export const ZID_METADATA_RESET = 'ZID_METADATA_RESET' -export const UPDATE_ZID_METADATA_STARTED = "UPDATE_ZID_METADATA_STARTED"; -export const UPDATE_ZID_METADATA_SUCCESS = "UPDATE_ZID_METADATA_SUCCESS"; -export const UPDATE_ZID_METADATA_ERROR = "UPDATE_ZID_METADATA_ERROR"; +export const UPDATE_ZID_METADATA_STARTED = 'UPDATE_ZID_METADATA_STARTED' +export const UPDATE_ZID_METADATA_SUCCESS = 'UPDATE_ZID_METADATA_SUCCESS' +export const UPDATE_ZID_METADATA_ERROR = 'UPDATE_ZID_METADATA_ERROR' -export const OPTIMISTIC_ZID_METADATA_UPDATE = "OPTIMISTIC_ZID_METADATA_UPDATE"; +export const OPTIMISTIC_ZID_METADATA_UPDATE = 'OPTIMISTIC_ZID_METADATA_UPDATE' /* report */ -export const UPDATE_REPORT_STARTED = "UPDATE_REPORT_STARTED"; -export const UPDATE_REPORT_SUCCESS = "UPDATE_REPORT_SUCCESS"; -export const UPDATE_REPORT_ERROR = "UPDATE_REPORT_ERROR"; +export const UPDATE_REPORT_STARTED = 'UPDATE_REPORT_STARTED' +export const UPDATE_REPORT_SUCCESS = 'UPDATE_REPORT_SUCCESS' +export const UPDATE_REPORT_ERROR = 'UPDATE_REPORT_ERROR' -export const OPTIMISTIC_REPORT_UPDATE = "OPTIMISTIC_REPORT_UPDATE"; +export const OPTIMISTIC_REPORT_UPDATE = 'OPTIMISTIC_REPORT_UPDATE' /* moderation */ -export const REQUEST_COMMENTS = "REQUEST_COMMENTS"; -export const RECEIVE_COMMENTS = "RECEIVE_COMMENTS"; -export const COMMENTS_FETCH_ERROR = "COMMENTS_FETCH_ERROR"; +export const REQUEST_COMMENTS = 'REQUEST_COMMENTS' +export const RECEIVE_COMMENTS = 'RECEIVE_COMMENTS' +export const COMMENTS_FETCH_ERROR = 'COMMENTS_FETCH_ERROR' -export const REQUEST_UNMODERATED_COMMENTS = "REQUEST_UNMODERATED_COMMENTS"; -export const RECEIVE_UNMODERATED_COMMENTS = "RECEIVE_UNMODERATED_COMMENTS"; -export const UNMODERATED_COMMENTS_FETCH_ERROR = "UNMODERATED_COMMENTS_FETCH_ERROR"; +export const REQUEST_UNMODERATED_COMMENTS = 'REQUEST_UNMODERATED_COMMENTS' +export const RECEIVE_UNMODERATED_COMMENTS = 'RECEIVE_UNMODERATED_COMMENTS' +export const UNMODERATED_COMMENTS_FETCH_ERROR = + 'UNMODERATED_COMMENTS_FETCH_ERROR' -export const REQUEST_ACCEPTED_COMMENTS = "REQUEST_ACCEPTED_COMMENTS"; -export const RECEIVE_ACCEPTED_COMMENTS = "RECEIVE_ACCEPTED_COMMENTS"; -export const ACCEPTED_COMMENTS_FETCH_ERROR = "ACCEPTED_COMMENTS_FETCH_ERROR"; +export const REQUEST_ACCEPTED_COMMENTS = 'REQUEST_ACCEPTED_COMMENTS' +export const RECEIVE_ACCEPTED_COMMENTS = 'RECEIVE_ACCEPTED_COMMENTS' +export const ACCEPTED_COMMENTS_FETCH_ERROR = 'ACCEPTED_COMMENTS_FETCH_ERROR' -export const REQUEST_REJECTED_COMMENTS = "REQUEST_REJECTED_COMMENTS"; -export const RECEIVE_REJECTED_COMMENTS = "RECEIVE_REJECTED_COMMENTS"; -export const REJECTED_COMMENTS_FETCH_ERROR = "REJECTED_COMMENTS_FETCH_ERROR"; +export const REQUEST_REJECTED_COMMENTS = 'REQUEST_REJECTED_COMMENTS' +export const RECEIVE_REJECTED_COMMENTS = 'RECEIVE_REJECTED_COMMENTS' +export const REJECTED_COMMENTS_FETCH_ERROR = 'REJECTED_COMMENTS_FETCH_ERROR' -export const ACCEPT_COMMENT = "ACCEPT_COMMENT"; -export const ACCEPT_COMMENT_SUCCESS = "ACCEPT_COMMENT_SUCCESS"; -export const ACCEPT_COMMENT_ERROR = "ACCEPT_COMMENT_ERROR"; +export const ACCEPT_COMMENT = 'ACCEPT_COMMENT' +export const ACCEPT_COMMENT_SUCCESS = 'ACCEPT_COMMENT_SUCCESS' +export const ACCEPT_COMMENT_ERROR = 'ACCEPT_COMMENT_ERROR' -export const REJECT_COMMENT = "REJECT_COMMENT"; -export const REJECT_COMMENT_SUCCESS = "REJECT_COMMENT_SUCCESS"; -export const REJECT_COMMENT_ERROR = "REJECT_COMMENT_ERROR"; +export const REJECT_COMMENT = 'REJECT_COMMENT' +export const REJECT_COMMENT_SUCCESS = 'REJECT_COMMENT_SUCCESS' +export const REJECT_COMMENT_ERROR = 'REJECT_COMMENT_ERROR' -export const COMMENT_IS_META = "COMMENT_IS_META"; -export const COMMENT_IS_META_SUCCESS = "COMMENT_IS_META_SUCCESS"; -export const COMMENT_IS_META_ERROR = "COMMENT_IS_META_ERROR"; +export const COMMENT_IS_META = 'COMMENT_IS_META' +export const COMMENT_IS_META_SUCCESS = 'COMMENT_IS_META_SUCCESS' +export const COMMENT_IS_META_ERROR = 'COMMENT_IS_META_ERROR' -export const REQUEST_PARTICIPANTS = "REQUEST_PARTICIPANTS"; -export const RECEIVE_PARTICIPANTS = "RECEIVE_PARTICIPANTS"; -export const PARTICIPANTS_FETCH_ERROR = "PARTICIPANTS_FETCH_ERROR"; +export const REQUEST_PARTICIPANTS = 'REQUEST_PARTICIPANTS' +export const RECEIVE_PARTICIPANTS = 'RECEIVE_PARTICIPANTS' +export const PARTICIPANTS_FETCH_ERROR = 'PARTICIPANTS_FETCH_ERROR' -export const REQUEST_DEFAULT_PARTICIPANTS = "REQUEST_DEFAULT_PARTICIPANTS"; -export const RECEIVE_DEFAULT_PARTICIPANTS = "RECEIVE_DEFAULT_PARTICIPANTS"; -export const DEFAULT_PARTICIPANTS_FETCH_ERROR = "DEFAULT_PARTICIPANTS_FETCH_ERROR"; +export const REQUEST_DEFAULT_PARTICIPANTS = 'REQUEST_DEFAULT_PARTICIPANTS' +export const RECEIVE_DEFAULT_PARTICIPANTS = 'RECEIVE_DEFAULT_PARTICIPANTS' +export const DEFAULT_PARTICIPANTS_FETCH_ERROR = + 'DEFAULT_PARTICIPANTS_FETCH_ERROR' -export const REQUEST_FEATURED_PARTICIPANTS = "REQUEST_FEATURED_PARTICIPANTS"; -export const RECEIVE_FEATURED_PARTICIPANTS = "RECEIVE_FEATURED_PARTICIPANTS"; -export const FEATURED_PARTICIPANTS_FETCH_ERROR = "FEATURED_PARTICIPANTS_FETCH_ERROR"; +export const REQUEST_FEATURED_PARTICIPANTS = 'REQUEST_FEATURED_PARTICIPANTS' +export const RECEIVE_FEATURED_PARTICIPANTS = 'RECEIVE_FEATURED_PARTICIPANTS' +export const FEATURED_PARTICIPANTS_FETCH_ERROR = + 'FEATURED_PARTICIPANTS_FETCH_ERROR' -export const REQUEST_HIDDEN_PARTICIPANTS = "REQUEST_HIDDEN_PARTICIPANTS"; -export const RECEIVE_HIDDEN_PARTICIPANTS = "RECEIVE_HIDDEN_PARTICIPANTS"; -export const HIDDEN_PARTICIPANTS_FETCH_ERROR = "HIDDEN_PARTICIPANTS_FETCH_ERROR"; +export const REQUEST_HIDDEN_PARTICIPANTS = 'REQUEST_HIDDEN_PARTICIPANTS' +export const RECEIVE_HIDDEN_PARTICIPANTS = 'RECEIVE_HIDDEN_PARTICIPANTS' +export const HIDDEN_PARTICIPANTS_FETCH_ERROR = 'HIDDEN_PARTICIPANTS_FETCH_ERROR' /* participant actions */ -export const FEATURE_PARTICIPANT = "FEATURE_PARTICIPANT"; -export const FEATURE_PARTICIPANT_SUCCESS = "FEATURE_PARTICIPANT_SUCCESS"; -export const FEATURE_PARTICIPANT_ERROR = "FEATURE_PARTICIPANT_ERROR"; +export const FEATURE_PARTICIPANT = 'FEATURE_PARTICIPANT' +export const FEATURE_PARTICIPANT_SUCCESS = 'FEATURE_PARTICIPANT_SUCCESS' +export const FEATURE_PARTICIPANT_ERROR = 'FEATURE_PARTICIPANT_ERROR' -export const HIDE_PARTICIPANT = "HIDE_PARTICIPANT"; -export const HIDE_PARTICIPANT_SUCCESS = "HIDE_PARTICIPANT_SUCCESS"; -export const HIDE_PARTICIPANT_ERROR = "HIDE_PARTICIPANT_ERROR"; +export const HIDE_PARTICIPANT = 'HIDE_PARTICIPANT' +export const HIDE_PARTICIPANT_SUCCESS = 'HIDE_PARTICIPANT_SUCCESS' +export const HIDE_PARTICIPANT_ERROR = 'HIDE_PARTICIPANT_ERROR' /* submit seed comment */ -export const SEED_COMMENT_LOCAL_UPDATE = "SEED_COMMENT_LOCAL_UPDATE"; -export const SUBMIT_SEED_COMMENT = "SUBMIT_SEED_COMMENT"; -export const SUBMIT_SEED_COMMENT_SUCCESS = "SUBMIT_SEED_COMMENT_SUCCESS"; -export const SUBMIT_SEED_COMMENT_ERROR = "SUBMIT_SEED_COMMENT_ERROR"; +export const SEED_COMMENT_LOCAL_UPDATE = 'SEED_COMMENT_LOCAL_UPDATE' +export const SUBMIT_SEED_COMMENT = 'SUBMIT_SEED_COMMENT' +export const SUBMIT_SEED_COMMENT_SUCCESS = 'SUBMIT_SEED_COMMENT_SUCCESS' +export const SUBMIT_SEED_COMMENT_ERROR = 'SUBMIT_SEED_COMMENT_ERROR' /* submit tweet seed comment */ -export const SEED_COMMENT_TWEET_LOCAL_UPDATE = "SEED_COMMENT_TWEET_LOCAL_UPDATE"; -export const SUBMIT_SEED_COMMENT_TWEET = "SUBMIT_SEED_COMMENT_TWEET"; -export const SUBMIT_SEED_COMMENT_TWEET_SUCCESS = "SUBMIT_SEED_COMMENT_TWEET_SUCCESS"; -export const SUBMIT_SEED_COMMENT_TWEET_ERROR = "SUBMIT_SEED_COMMENT_TWEET_ERROR"; +export const SEED_COMMENT_TWEET_LOCAL_UPDATE = 'SEED_COMMENT_TWEET_LOCAL_UPDATE' +export const SUBMIT_SEED_COMMENT_TWEET = 'SUBMIT_SEED_COMMENT_TWEET' +export const SUBMIT_SEED_COMMENT_TWEET_SUCCESS = + 'SUBMIT_SEED_COMMENT_TWEET_SUCCESS' +export const SUBMIT_SEED_COMMENT_TWEET_ERROR = 'SUBMIT_SEED_COMMENT_TWEET_ERROR' -export const REQUEST_SEED_COMMENTS = "REQUEST_SEED_COMMENTS"; -export const RECEIVE_SEED_COMMENTS = "RECEIVE_SEED_COMMENTS"; -export const SEED_COMMENTS_FETCH_ERROR = "SEED_COMMENTS_FETCH_ERROR"; +export const REQUEST_SEED_COMMENTS = 'REQUEST_SEED_COMMENTS' +export const RECEIVE_SEED_COMMENTS = 'RECEIVE_SEED_COMMENTS' +export const SEED_COMMENTS_FETCH_ERROR = 'SEED_COMMENTS_FETCH_ERROR' /* conversation stats */ -export const REQUEST_CONVERSATION_STATS = "REQUEST_CONVERSATION_STATS"; -export const RECEIVE_CONVERSATION_STATS = "RECEIVE_CONVERSATION_STATS"; -export const CONVERSATION_STATS_FETCH_ERROR = "CONVERSATION_STATS_FETCH_ERROR"; +export const REQUEST_CONVERSATION_STATS = 'REQUEST_CONVERSATION_STATS' +export const RECEIVE_CONVERSATION_STATS = 'RECEIVE_CONVERSATION_STATS' +export const CONVERSATION_STATS_FETCH_ERROR = 'CONVERSATION_STATS_FETCH_ERROR' -export const DATA_EXPORT_STARTED = "DATA_EXPORT_STARTED"; -export const DATA_EXPORT_SUCCESS = "DATA_EXPORT_SUCCESS"; -export const DATA_EXPORT_ERROR = "DATA_EXPORT_ERROR"; +export const DATA_EXPORT_STARTED = 'DATA_EXPORT_STARTED' +export const DATA_EXPORT_SUCCESS = 'DATA_EXPORT_SUCCESS' +export const DATA_EXPORT_ERROR = 'DATA_EXPORT_ERROR' -export const CREATEUSER_INITIATED = "CREATEUSER_INITIATED"; +export const CREATEUSER_INITIATED = 'CREATEUSER_INITIATED' // export const CREATEUSER_SUCCESSFUL = "CREATEUSER_SUCCESSFUL"; -export const CREATEUSER_ERROR = "CREATEUSER_ERROR"; +export const CREATEUSER_ERROR = 'CREATEUSER_ERROR' -export const SIGNIN_INITIATED = "SIGNIN_INITIATED"; +export const SIGNIN_INITIATED = 'SIGNIN_INITIATED' // export const SIGNIN_SUCCESSFUL = "SIGNIN_SUCCESSFUL"; -export const SIGNIN_ERROR = "SIGNIN_ERROR"; +export const SIGNIN_ERROR = 'SIGNIN_ERROR' -export const SIGNOUT_INITIATED = "SIGNOUT_INITIATED"; -export const SIGNOUT_SUCCESSFUL = "SIGNOUT_SUCCESSFUL"; -export const SIGNOUT_ERROR = "SIGNOUT_ERROR"; +export const SIGNOUT_INITIATED = 'SIGNOUT_INITIATED' +export const SIGNOUT_SUCCESSFUL = 'SIGNOUT_SUCCESSFUL' +export const SIGNOUT_ERROR = 'SIGNOUT_ERROR' -export const PWRESET_INIT_INITIATED = "PWRESET_INIT_INITIATED"; -export const PWRESET_INIT_SUCCESS = "PWRESET_INIT_SUCCESS"; -export const PWRESET_INIT_ERROR = "PWRESET_INIT_ERROR"; +export const PWRESET_INIT_INITIATED = 'PWRESET_INIT_INITIATED' +export const PWRESET_INIT_SUCCESS = 'PWRESET_INIT_SUCCESS' +export const PWRESET_INIT_ERROR = 'PWRESET_INIT_ERROR' -export const PWRESET_INITIATED = "PWRESET_INITIATED"; -export const PWRESET_SUCCESS = "PWRESET_SUCCESS"; -export const PWRESET_ERROR = "PWRESET_ERROR"; +export const PWRESET_INITIATED = 'PWRESET_INITIATED' +export const PWRESET_SUCCESS = 'PWRESET_SUCCESS' +export const PWRESET_ERROR = 'PWRESET_ERROR' -export const FACEBOOK_SIGNIN_INITIATED = "FACEBOOK_SIGNIN_INITIATED"; -export const FACEBOOK_SIGNIN_SUCCESSFUL = "FACEBOOK_SIGNIN_SUCCESSFUL"; -export const FACEBOOK_SIGNIN_FAILED = "FACEBOOK_SIGNIN_FAILED"; +export const FACEBOOK_SIGNIN_INITIATED = 'FACEBOOK_SIGNIN_INITIATED' +export const FACEBOOK_SIGNIN_SUCCESSFUL = 'FACEBOOK_SIGNIN_SUCCESSFUL' +export const FACEBOOK_SIGNIN_FAILED = 'FACEBOOK_SIGNIN_FAILED' -export const SUBMIT_CONTRIB = "SUBMIT_CONTRIB"; -export const SUBMIT_CONTRIB_SUCCESS = "SUBMIT_CONTRIB_SUCCESS"; -export const SUBMIT_CONTRIB_ERROR = "SUBMIT_CONTRIB_ERROR"; +export const SUBMIT_CONTRIB = 'SUBMIT_CONTRIB' +export const SUBMIT_CONTRIB_SUCCESS = 'SUBMIT_CONTRIB_SUCCESS' +export const SUBMIT_CONTRIB_ERROR = 'SUBMIT_CONTRIB_ERROR' /* MATH */ -export const REQUEST_MATH = "REQUEST_MATH"; -export const RECEIVE_MATH = "RECEIVE_MATH"; -export const MATH_FETCH_ERROR = "MATH_FETCH_ERROR"; +export const REQUEST_MATH = 'REQUEST_MATH' +export const RECEIVE_MATH = 'RECEIVE_MATH' +export const MATH_FETCH_ERROR = 'MATH_FETCH_ERROR' /* ======= Actions ======= */ @@ -163,260 +167,263 @@ export const MATH_FETCH_ERROR = "MATH_FETCH_ERROR"; const requestUser = () => { return { - type: REQUEST_USER, - }; -}; + type: REQUEST_USER + } +} -const receiveUser = (data) => { +const receiveUser = data => { return { type: RECEIVE_USER, - data: data, - }; -}; + data: data + } +} -const userFetchError = (err) => { +const userFetchError = err => { return { type: USER_FETCH_ERROR, status: err.status, - data: err, - }; -}; + data: err + } +} const fetchUser = () => { - return PolisNet.polisGet("/api/v3/users", { errIfNoAuth: true }); -}; + return PolisNet.polisGet('/api/v3/users', { errIfNoAuth: true }) +} export const populateUserStore = () => { - return (dispatch) => { - dispatch(requestUser()); + return dispatch => { + dispatch(requestUser()) return fetchUser().then( - (res) => dispatch(receiveUser(res)), - (err) => dispatch(userFetchError(err)) - ); - }; -}; + res => dispatch(receiveUser(res)), + err => dispatch(userFetchError(err)) + ) + } +} /* signin */ const signinInitiated = () => { return { - type: SIGNIN_INITIATED, - }; -}; + type: SIGNIN_INITIATED + } +} // SIGNIN_SUCCESSFUL Not needed since redirecting to clear password from memory -const signinError = (err) => { +const signinError = err => { return { type: SIGNIN_ERROR, - data: err, - }; -}; + data: err + } +} -const signinPost = (attrs) => { - return PolisNet.polisPost("/api/v3/auth/login", attrs); -}; +const signinPost = attrs => { + return PolisNet.polisPost('/api/v3/auth/login', attrs) +} -export const doSignin = (attrs) => { - return (dispatch) => { - dispatch(signinInitiated()); +export const doSignin = attrs => { + return dispatch => { + dispatch(signinInitiated()) return signinPost(attrs).then( () => { setTimeout(() => { // Force page to load so we can be sure the password is cleared from memory // delay a bit so the cookie has time to set - dispatch({ type: "signin completed successfully" }); - window.location = "/"; - }, 3000); + dispatch({ type: 'signin completed successfully' }) + window.location = '/' + }, 3000) }, - (err) => dispatch(signinError(err)) - ); - }; -}; + err => dispatch(signinError(err)) + ) + } +} /* createUser */ const createUserInitiated = () => { return { - type: CREATEUSER_INITIATED, - }; -}; + type: CREATEUSER_INITIATED + } +} // SIGNIN_SUCCESSFUL Not needed since redirecting to clear password from memory -const createUserError = (err) => { +const createUserError = err => { return { type: CREATEUSER_ERROR, - data: err, - }; -}; + data: err + } +} -const createUserPost = (attrs) => { - return PolisNet.polisPost("/api/v3/auth/new", attrs); -}; +const createUserPost = attrs => { + return PolisNet.polisPost('/api/v3/auth/new', attrs) +} export const doCreateUser = (attrs, dest) => { - return (dispatch) => { - dispatch(createUserInitiated()); + return dispatch => { + dispatch(createUserInitiated()) return createUserPost(attrs).then( () => { setTimeout(() => { // Force page to load so we can be sure the password is cleared from memory // delay a bit so the cookie has time to set - window.location = dest || ""; - }, 3000); + window.location = dest || '' + }, 3000) }, - (err) => dispatch(createUserError(err)) - ); - }; -}; + err => dispatch(createUserError(err)) + ) + } +} /* passwordResetInit */ const passwordResetInitInitiated = () => { return { - type: PWRESET_INIT_INITIATED, - }; -}; + type: PWRESET_INIT_INITIATED + } +} const passwordResetInitSuccess = () => { return { - type: PWRESET_INIT_SUCCESS, - }; -}; + type: PWRESET_INIT_SUCCESS + } +} -const passwordResetInitError = (err) => { +const passwordResetInitError = err => { return { type: PWRESET_INIT_ERROR, - data: err, - }; -}; + data: err + } +} -const passwordResetInitPost = (attrs) => { - return PolisNet.polisPost("/api/v3/auth/pwresettoken", attrs); -}; +const passwordResetInitPost = attrs => { + return PolisNet.polisPost('/api/v3/auth/pwresettoken', attrs) +} -export const doPasswordResetInit = (attrs) => { - return (dispatch) => { - dispatch(passwordResetInitInitiated()); +export const doPasswordResetInit = attrs => { + return dispatch => { + dispatch(passwordResetInitInitiated()) return passwordResetInitPost(attrs).then( () => { setTimeout(() => { // Force page to load so we can be sure the password is cleared from memory // delay a bit so the cookie has time to set - window.location = "/pwresetinit/done"; - }, 3000); + window.location = '/pwresetinit/done' + }, 3000) - return dispatch(passwordResetInitSuccess()); + return dispatch(passwordResetInitSuccess()) }, - (err) => dispatch(passwordResetInitError(err)) - ); - }; -}; + err => dispatch(passwordResetInitError(err)) + ) + } +} /* passwordReset */ const passwordResetInitiated = () => { return { - type: PWRESET_INITIATED, - }; -}; + type: PWRESET_INITIATED + } +} const passwordResetSuccess = () => { return { - type: PWRESET_SUCCESS, - }; -}; + type: PWRESET_SUCCESS + } +} -const passwordResetError = (err) => { +const passwordResetError = err => { return { type: PWRESET_ERROR, - data: err, - }; -}; + data: err + } +} -const passwordResetPost = (attrs) => { - return PolisNet.polisPost("/api/v3/auth/password", attrs); -}; +const passwordResetPost = attrs => { + return PolisNet.polisPost('/api/v3/auth/password', attrs) +} -export const doPasswordReset = (attrs) => { - return (dispatch) => { - dispatch(passwordResetInitiated()); +export const doPasswordReset = attrs => { + return dispatch => { + dispatch(passwordResetInitiated()) return passwordResetPost(attrs).then( () => { setTimeout(() => { // Force page to load so we can be sure the password is cleared from memory // delay a bit so the cookie has time to set - window.location = "/"; - }, 3000); + window.location = '/' + }, 3000) - return dispatch(passwordResetSuccess()); + return dispatch(passwordResetSuccess()) }, - (err) => dispatch(passwordResetError(err)) - ); - }; -}; + err => dispatch(passwordResetError(err)) + ) + } +} /* facebook */ const facebookSigninInitiated = () => { return { - type: FACEBOOK_SIGNIN_INITIATED, - }; -}; + type: FACEBOOK_SIGNIN_INITIATED + } +} const facebookSigninSuccessful = () => { return { - type: FACEBOOK_SIGNIN_SUCCESSFUL, - }; -}; + type: FACEBOOK_SIGNIN_SUCCESSFUL + } +} -const facebookSigninFailed = (errorCode) => { +const facebookSigninFailed = errorCode => { return { type: FACEBOOK_SIGNIN_FAILED, - errorCode: errorCode, - }; -}; + errorCode: errorCode + } +} const getFriends = () => { - var dfd = $.Deferred(); + var dfd = $.Deferred() const getMoreFriends = (friendsSoFar, urlForNextCall) => { - return $.get(urlForNextCall).then((response) => { + return $.get(urlForNextCall).then(response => { if (response.data.length) { for (let i = 0; i < response.data.length; i++) { - friendsSoFar.push(response.data[i]); + friendsSoFar.push(response.data[i]) } if (response.paging.next) { - return getMoreFriends(friendsSoFar, response.paging.next); + return getMoreFriends(friendsSoFar, response.paging.next) } - return friendsSoFar; + return friendsSoFar } else { - return friendsSoFar; + return friendsSoFar } - }); - }; + }) + } - FB.api("/me/friends", (response) => { + FB.api('/me/friends', response => { if (response && !response.error) { - var friendsSoFar = response.data; + var friendsSoFar = response.data if (response.data.length && response.paging.next) { - getMoreFriends(friendsSoFar, response.paging.next).then(dfd.resolve, dfd.reject); + getMoreFriends(friendsSoFar, response.paging.next).then( + dfd.resolve, + dfd.reject + ) } else { - dfd.resolve(friendsSoFar || []); + dfd.resolve(friendsSoFar || []) } } else { // "failed to find friends" - dfd.reject(response); + dfd.reject(response) } - }); - return dfd.promise(); -}; + }) + return dfd.promise() +} const getInfo = () => { - var dfd = $.Deferred(); + var dfd = $.Deferred() - FB.api("/me", (response) => { + FB.api('/me', response => { // {"id":"10152802017421079" // "email":"michael@bjorkegren.com" // "first_name":"Mike" @@ -435,54 +442,57 @@ const getInfo = () => { if (response && !response.error) { if (response.location && response.location.id) { - FB.api("/" + response.location.id, (locationResponse) => { + FB.api('/' + response.location.id, locationResponse => { if (locationResponse) { - response.locationInfo = locationResponse; + response.locationInfo = locationResponse } - dfd.resolve(response); - }); + dfd.resolve(response) + }) } else { - dfd.resolve(response); + dfd.resolve(response) } } else { // alert("failed to find data"); - dfd.reject(response); + dfd.reject(response) } - }); - return dfd.promise(); -}; + }) + return dfd.promise() +} const saveFacebookFriendsData = (data, dest, dispatch) => { $.ajax({ - url: "/api/v3/auth/facebook", - contentType: "application/json; charset=utf-8", + url: '/api/v3/auth/facebook', + contentType: 'application/json; charset=utf-8', headers: { - "Cache-Control": "max-age=0", + 'Cache-Control': 'max-age=0' }, xhrFields: { - withCredentials: true, + withCredentials: true }, - dataType: "json", + dataType: 'json', data: JSON.stringify(data), - type: "POST", + type: 'POST' }).then( () => { setTimeout(() => { // Force page to load so we can be sure the old user"s state is cleared from memory // delay a bit so the cookies have time to clear too. - window.location = dest || "/"; - }, 1000); + window.location = dest || '/' + }, 1000) }, - (err) => { - console.dir(err); + err => { + console.dir(err) - if (err.responseText && /polis_err_user_with_this_email_exists/.test(err.responseText)) { + if ( + err.responseText && + /polis_err_user_with_this_email_exists/.test(err.responseText) + ) { // Todo handle // var password = prompt("A pol.is user "+data.fb_email+", the same email address as associted with your facebook account, already exists. Enter your pol.is password to enable facebook login for your pol.is account."); // that.linkMode = true; - dispatch(facebookSigninFailed("polis_err_user_with_this_email_exists")); //handle case user already exists enter your password + dispatch(facebookSigninFailed('polis_err_user_with_this_email_exists')) // handle case user already exists enter your password // that.model.set({ // create: false, // don"t show create account stuff, account exists. @@ -490,388 +500,403 @@ const saveFacebookFriendsData = (data, dest, dispatch) => { // email: data.fb_email, // }); } else { - alert("error logging in with Facebook"); + alert('error logging in with Facebook') } } - ); -}; - -const processFacebookFriendsData = (response, dest, dispatch, optionalPassword) => { + ) +} + +const processFacebookFriendsData = ( + response, + dest, + dispatch, + optionalPassword +) => { return (fb_public_profile, friendsData) => { // alert(JSON.stringify(friendsData)); - let data = { + const data = { fb_public_profile: JSON.stringify(fb_public_profile), fb_friends_response: JSON.stringify(friendsData), - response: JSON.stringify(response), - }; + response: JSON.stringify(response) + } // cleaner as fb_email: fb_public_profile.email ? fb_public_profile.email : null if (fb_public_profile.email) { - data.fb_email = fb_public_profile.email; + data.fb_email = fb_public_profile.email } else { - data.provided_email = prompt("Please enter your email address."); + data.provided_email = prompt('Please enter your email address.') } - let hname = [fb_public_profile.first_name, fb_public_profile.last_name].join(" "); + const hname = [ + fb_public_profile.first_name, + fb_public_profile.last_name + ].join(' ') if (hname.length) { - data.hname = hname; + data.hname = hname } - if (response && response.authResponse && response.authResponse.grantedScopes) { - data.fb_granted_scopes = response.authResponse.grantedScopes; + if ( + response && + response.authResponse && + response.authResponse.grantedScopes + ) { + data.fb_granted_scopes = response.authResponse.grantedScopes } if (optionalPassword) { - data.password = optionalPassword; + data.password = optionalPassword } - saveFacebookFriendsData(data, dest, dispatch); - }; -}; + saveFacebookFriendsData(data, dest, dispatch) + } +} const onFbLoginOk = (response, dest, dispatch, optionalPassword) => { $.when(getInfo(), getFriends()).then( processFacebookFriendsData(response, dest, dispatch, optionalPassword), - (err) => { - console.error(err); - console.dir(arguments); + err => { + console.error(err) + console.dir(arguments) } - ); -}; + ) +} const callFacebookLoginAPI = (dest, dispatch, optionalPassword) => { - console.log("ringing facebook..."); - const password = "THIS_STRING_SHOULD_NOT_BE_HERE"; + console.log('ringing facebook...') + const password = 'THIS_STRING_SHOULD_NOT_BE_HERE' FB.login( - (res) => { - return onFbLoginOk(res, dest, dispatch, optionalPassword); + res => { + return onFbLoginOk(res, dest, dispatch, optionalPassword) }, { return_scopes: true, // response should contain the scopes the user allowed scope: [ // "taggable_friends", // requires review. // invitable_friends NOTE: only for games with a fb Canvas presence, so don"t use this - "public_profile", - "user_friends", - "email", - ].join(","), + 'public_profile', + 'user_friends', + 'email' + ].join(',') } - ); -}; + ) +} export const doFacebookSignin = (dest, optionalPassword) => { - return (dispatch) => { - dispatch(facebookSigninInitiated()); - return callFacebookLoginAPI(dest, dispatch, optionalPassword); - }; -}; + return dispatch => { + dispatch(facebookSigninInitiated()) + return callFacebookLoginAPI(dest, dispatch, optionalPassword) + } +} /* signout */ const signoutInitiated = () => { return { - type: SIGNOUT_INITIATED, - }; -}; + type: SIGNOUT_INITIATED + } +} // SIGNOUT_SUCCESSFUL Not needed since redirecting to clear old user"s state from memory -const signoutError = (err) => { +const signoutError = err => { return { type: SIGNOUT_ERROR, - data: err, - }; -}; + data: err + } +} -const signoutPost = (dest) => { +const signoutPost = dest => { // relying on server to clear cookies return $.ajax({ - type: "POST", - url: "/api/v3/auth/deregister", + type: 'POST', + url: '/api/v3/auth/deregister', data: {}, - dataType: "text", // server returns an empty response, so can"t parse as JSON - }); -}; + dataType: 'text' // server returns an empty response, so can"t parse as JSON + }) +} -export const doSignout = (dest) => { - return (dispatch) => { - dispatch(signoutInitiated()); +export const doSignout = dest => { + return dispatch => { + dispatch(signoutInitiated()) return signoutPost().then( - (res) => { + res => { setTimeout(() => { // Force page to load so we can be sure the old user"s state is cleared from memory // delay a bit so the cookies have time to clear too. - window.location = dest || "/home"; - }, 1000); + window.location = dest || '/home' + }, 1000) }, - (err) => dispatch(signoutError(err)) - ); - }; -}; + err => dispatch(signoutError(err)) + ) + } +} /* Conversations */ const requestConversations = () => { return { - type: REQUEST_CONVERSATIONS, - }; -}; + type: REQUEST_CONVERSATIONS + } +} -const receiveConversations = (data) => { +const receiveConversations = data => { return { type: RECEIVE_CONVERSATIONS, - data: data, - }; -}; + data: data + } +} -const conversationsError = (err) => { +const conversationsError = err => { return { type: CONVERSATIONS_FETCH_ERROR, - data: err, - }; -}; + data: err + } +} const fetchConversations = () => { - return $.get("/api/v3/conversations?include_all_conversations_i_am_in=true"); -}; + return $.get('/api/v3/conversations?include_all_conversations_i_am_in=true') +} export const populateConversationsStore = () => { - return (dispatch) => { - dispatch(requestConversations()); + return dispatch => { + dispatch(requestConversations()) return fetchConversations().then( - (res) => dispatch(receiveConversations(res)), - (err) => dispatch(conversationsError(err)) - ); - }; -}; + res => dispatch(receiveConversations(res)), + err => dispatch(conversationsError(err)) + ) + } +} /* zid metadata */ -const requestZidMetadata = (conversation_id) => { +const requestZidMetadata = conversation_id => { return { type: REQUEST_ZID_METADATA, data: { - conversation_id: conversation_id, - }, - }; -}; + conversation_id: conversation_id + } + } +} -const receiveZidMetadata = (data) => { +const receiveZidMetadata = data => { return { type: RECEIVE_ZID_METADATA, - data: data, - }; -}; + data: data + } +} -const zidMetadataFetchError = (err) => { +const zidMetadataFetchError = err => { return { type: ZID_METADATA_FETCH_ERROR, - data: err, - }; -}; + data: err + } +} export const resetMetadataStore = () => { return { - type: ZID_METADATA_RESET, - }; -}; + type: ZID_METADATA_RESET + } +} -const fetchZidMetadata = (conversation_id) => { - return $.get("/api/v3/conversations?conversation_id=" + conversation_id); -}; +const fetchZidMetadata = conversation_id => { + return $.get('/api/v3/conversations?conversation_id=' + conversation_id) +} -export const populateZidMetadataStore = (conversation_id) => { +export const populateZidMetadataStore = conversation_id => { return (dispatch, getState) => { - var state = getState(); + var state = getState() var hasConversationId = state.zid_metadata && state.zid_metadata.zid_metadata && - state.zid_metadata.zid_metadata.conversation_id; + state.zid_metadata.zid_metadata.conversation_id - var isLoading = state.zid_metadata.loading; + var isLoading = state.zid_metadata.loading // NOTE: if there are multiple calls outstanding this may be wrong. var isLoadingThisConversation = - state.zid_metadata.conversation_id == conversation_id && isLoading; + state.zid_metadata.conversation_id == conversation_id && isLoading if (isLoadingThisConversation) { - return; + return } // don"t fetch again if we already have data loaded for that conversation. - if (hasConversationId && state.zid_metadata.zid_metadata.conversation_id == conversation_id) { - return; + if ( + hasConversationId && + state.zid_metadata.zid_metadata.conversation_id == conversation_id + ) { + return } - dispatch(requestZidMetadata(conversation_id)); + dispatch(requestZidMetadata(conversation_id)) return fetchZidMetadata(conversation_id).then( - (res) => dispatch(receiveZidMetadata(res)), - (err) => dispatch(zidMetadataFetchError(err)) - ); - }; -}; + res => dispatch(receiveZidMetadata(res)), + err => dispatch(zidMetadataFetchError(err)) + ) + } +} /* zid metadata update */ const updateZidMetadataStarted = () => { return { - type: UPDATE_ZID_METADATA_STARTED, - }; -}; + type: UPDATE_ZID_METADATA_STARTED + } +} -const updateZidMetadataSuccess = (data) => { +const updateZidMetadataSuccess = data => { return { type: UPDATE_ZID_METADATA_SUCCESS, - data: data, - }; -}; + data: data + } +} -const updateZidMetadataError = (err) => { +const updateZidMetadataError = err => { return { type: UPDATE_ZID_METADATA_ERROR, - data: err, - }; -}; + data: err + } +} const updateZidMetadata = (zm, field, value) => { - let data = {}; - data[field] = value; + const data = {} + data[field] = value return $.ajax({ - url: "/api/v3/conversations", - method: "PUT", - contentType: "application/json; charset=utf-8", - headers: { "Cache-Control": "max-age=0" }, + url: '/api/v3/conversations', + method: 'PUT', + contentType: 'application/json; charset=utf-8', + headers: { 'Cache-Control': 'max-age=0' }, xhrFields: { withCredentials: true }, - dataType: "json", - data: JSON.stringify(Object.assign({}, zm, data)), - }); -}; + dataType: 'json', + data: JSON.stringify(Object.assign({}, zm, data)) + }) +} export const handleZidMetadataUpdate = (zm, field, value) => { - return (dispatch) => { - dispatch(updateZidMetadataStarted()); + return dispatch => { + dispatch(updateZidMetadataStarted()) return updateZidMetadata(zm, field, value) - .then((res) => dispatch(updateZidMetadataSuccess(res))) - .fail((err) => dispatch(updateZidMetadataError(err))); - }; -}; + .then(res => dispatch(updateZidMetadataSuccess(res))) + .fail(err => dispatch(updateZidMetadataError(err))) + } +} export const optimisticZidMetadataUpdateOnTyping = (zm, field, value) => { - zm[field] = value; + zm[field] = value return { type: OPTIMISTIC_ZID_METADATA_UPDATE, - data: zm, - }; -}; + data: zm + } +} /* seed comments submit */ -export const seedCommentChanged = (text) => { +export const seedCommentChanged = text => { return { type: SEED_COMMENT_LOCAL_UPDATE, - text: text, - }; -}; + text: text + } +} const submitSeedCommentStart = () => { return { - type: SUBMIT_SEED_COMMENT, - }; -}; + type: SUBMIT_SEED_COMMENT + } +} const submitSeedCommentPostSuccess = () => { - console.log("seed comment post success"); + console.log('seed comment post success') return { - type: SUBMIT_SEED_COMMENT_SUCCESS, - }; -}; + type: SUBMIT_SEED_COMMENT_SUCCESS + } +} -const submitSeedCommentPostError = (err) => { +const submitSeedCommentPostError = err => { return { type: SUBMIT_SEED_COMMENT_ERROR, - data: err, - }; -}; + data: err + } +} -const postSeedComment = (comment) => { - return PolisNet.polisPost("/api/v3/comments", comment); -}; +const postSeedComment = comment => { + return PolisNet.polisPost('/api/v3/comments', comment) +} -export const handleSeedCommentSubmit = (comment) => { - return (dispatch) => { - dispatch(submitSeedCommentStart()); +export const handleSeedCommentSubmit = comment => { + return dispatch => { + dispatch(submitSeedCommentStart()) return postSeedComment(comment) .then( - (res) => dispatch(submitSeedCommentPostSuccess(res)), - (err) => dispatch(submitSeedCommentPostError(err)) + res => dispatch(submitSeedCommentPostSuccess(res)), + err => dispatch(submitSeedCommentPostError(err)) ) - .then(dispatch(populateAllCommentStores(comment.conversation_id))); - }; -}; + .then(dispatch(populateAllCommentStores(comment.conversation_id))) + } +} -const makeStandardStart = (type) => { +const makeStandardStart = type => { return { - type: type, - }; -}; + type: type + } +} const makeStandardError = (type, err) => { return { type: type, - data: err, - }; -}; + data: err + } +} const makeStandardSuccess = (type, data) => { return { type: type, - data: data, - }; -}; + data: data + } +} /* seed tweets submit */ -export const seedCommentTweetChanged = (text) => { +export const seedCommentTweetChanged = text => { return { type: SEED_COMMENT_TWEET_LOCAL_UPDATE, - text: text, - }; -}; + text: text + } +} const submitSeedCommentTweetStart = () => { return { - type: SUBMIT_SEED_COMMENT_TWEET, - }; -}; + type: SUBMIT_SEED_COMMENT_TWEET + } +} const submitSeedCommentPostTweetSuccess = () => { return { - type: SUBMIT_SEED_COMMENT_TWEET_SUCCESS, - }; -}; + type: SUBMIT_SEED_COMMENT_TWEET_SUCCESS + } +} -const submitSeedCommentPostTweetError = (err) => { +const submitSeedCommentPostTweetError = err => { return { type: SUBMIT_SEED_COMMENT_TWEET_ERROR, - data: err, - }; -}; + data: err + } +} -const postSeedCommentTweet = (o) => { - return PolisNet.polisPost("/api/v3/comments", o); -}; +const postSeedCommentTweet = o => { + return PolisNet.polisPost('/api/v3/comments', o) +} -export const handleSeedCommentTweetSubmit = (o) => { - return (dispatch) => { - dispatch(submitSeedCommentTweetStart()); +export const handleSeedCommentTweetSubmit = o => { + return dispatch => { + dispatch(submitSeedCommentTweetStart()) return postSeedCommentTweet(o) .then( - (res) => dispatch(submitSeedCommentPostTweetSuccess(res)), - (err) => dispatch(submitSeedCommentPostTweetError(err)) + res => dispatch(submitSeedCommentPostTweetSuccess(res)), + err => dispatch(submitSeedCommentPostTweetError(err)) ) - .then(dispatch(populateAllCommentStores(o.conversation_id))); - }; -}; + .then(dispatch(populateAllCommentStores(o.conversation_id))) + } +} /* seed comments fetch */ @@ -913,759 +938,779 @@ export const handleSeedCommentTweetSubmit = (o) => { const createConversationStart = () => { return { - type: CREATE_NEW_CONVERSATION, - }; -}; + type: CREATE_NEW_CONVERSATION + } +} -const createConversationPostSuccess = (res) => { +const createConversationPostSuccess = res => { return { type: CREATE_NEW_CONVERSATION_SUCCESS, - data: res, - }; -}; + data: res + } +} -const createConversationPostError = (err) => { +const createConversationPostError = err => { return { type: CREATE_NEW_CONVERSATION_ERROR, - data: err, - }; -}; + data: err + } +} const postCreateConversation = () => { - return PolisNet.polisPost("/api/v3/conversations", { + return PolisNet.polisPost('/api/v3/conversations', { is_draft: true, - is_active: true, - }); -}; + is_active: true + }) +} -export const handleCreateConversationSubmit = (routeTo) => { - return (dispatch) => { - dispatch(createConversationStart()); +export const handleCreateConversationSubmit = routeTo => { + return dispatch => { + dispatch(createConversationStart()) return postCreateConversation() .then( - (res) => { - dispatch(createConversationPostSuccess(res)); - return res; + res => { + dispatch(createConversationPostSuccess(res)) + return res }, - (err) => dispatch(createConversationPostError(err)) + err => dispatch(createConversationPostError(err)) ) - .then((res) => { - window.location = "/m/" + res.conversation_id; - }); - }; -}; + .then(res => { + window.location = '/m/' + res.conversation_id + }) + } +} /* request all comments */ const requestComments = () => { return { - type: REQUEST_COMMENTS, - }; -}; + type: REQUEST_COMMENTS + } +} -const receiveComments = (data) => { +const receiveComments = data => { return { type: RECEIVE_COMMENTS, - data: data, - }; -}; + data: data + } +} -const commentsFetchError = (err) => { +const commentsFetchError = err => { return { type: COMMENTS_FETCH_ERROR, - data: err, - }; -}; + data: err + } +} -const fetchAllComments = (conversation_id) => { +const fetchAllComments = conversation_id => { // let includeSocial = "include_social=true&"; - let includeSocial = ""; + const includeSocial = '' return $.get( - "/api/v3/comments?moderation=true&include_voting_patterns=false&" + + '/api/v3/comments?moderation=true&include_voting_patterns=false&' + includeSocial + - "conversation_id=" + + 'conversation_id=' + conversation_id - ); -}; + ) +} -export const populateCommentsStore = (conversation_id) => { - return (dispatch) => { - dispatch(requestComments()); +export const populateCommentsStore = conversation_id => { + return dispatch => { + dispatch(requestComments()) return fetchAllComments(conversation_id).then( - (res) => dispatch(receiveComments(res)), - (err) => dispatch(commentsFetchError(err)) - ); - }; -}; + res => dispatch(receiveComments(res)), + err => dispatch(commentsFetchError(err)) + ) + } +} /* request math */ const requestMath = () => { return { - type: REQUEST_MATH, - }; -}; + type: REQUEST_MATH + } +} -const receiveMath = (data) => { +const receiveMath = data => { return { type: RECEIVE_MATH, - data: data, - }; -}; + data: data + } +} -const mathFetchError = (err) => { +const mathFetchError = err => { return { type: MATH_FETCH_ERROR, - data: err, - }; -}; + data: err + } +} const fetchMath = (conversation_id, math_tick) => { - return $.get("/api/v3/math/pca2?&math_tick=" + math_tick + "&conversation_id=" + conversation_id); -}; + return $.get( + '/api/v3/math/pca2?&math_tick=' + + math_tick + + '&conversation_id=' + + conversation_id + ) +} -export const populateMathStore = (conversation_id) => { +export const populateMathStore = conversation_id => { return (dispatch, getState) => { - dispatch(requestMath()); - const math_tick = getState().math.math_tick; + dispatch(requestMath()) + const math_tick = getState().math.math_tick return fetchMath(conversation_id, math_tick).then( - (res) => dispatch(receiveMath(res)), - (err) => dispatch(mathFetchError(err)) - ); - }; -}; + res => dispatch(receiveMath(res)), + err => dispatch(mathFetchError(err)) + ) + } +} /* unmoderated comments */ const requestUnmoderatedComments = () => { return { - type: REQUEST_UNMODERATED_COMMENTS, - }; -}; + type: REQUEST_UNMODERATED_COMMENTS + } +} -const receiveUnmoderatedComments = (data) => { +const receiveUnmoderatedComments = data => { return { type: RECEIVE_UNMODERATED_COMMENTS, - data: data, - }; -}; + data: data + } +} -const unmoderatedCommentsFetchError = (err) => { +const unmoderatedCommentsFetchError = err => { return { type: UNMODERATED_COMMENTS_FETCH_ERROR, - data: err, - }; -}; + data: err + } +} -const fetchUnmoderatedComments = (conversation_id) => { +const fetchUnmoderatedComments = conversation_id => { // let includeSocial = "include_social=true&"; - let includeSocial = ""; + const includeSocial = '' return $.get( - "/api/v3/comments?moderation=true&include_voting_patterns=false&" + + '/api/v3/comments?moderation=true&include_voting_patterns=false&' + includeSocial + - "mod=0&conversation_id=" + + 'mod=0&conversation_id=' + conversation_id - ); -}; + ) +} -export const populateUnmoderatedCommentsStore = (conversation_id) => { - return (dispatch) => { - dispatch(requestUnmoderatedComments()); +export const populateUnmoderatedCommentsStore = conversation_id => { + return dispatch => { + dispatch(requestUnmoderatedComments()) return fetchUnmoderatedComments(conversation_id).then( - (res) => dispatch(receiveUnmoderatedComments(res)), - (err) => dispatch(unmoderatedCommentsFetchError(err)) - ); - }; -}; + res => dispatch(receiveUnmoderatedComments(res)), + err => dispatch(unmoderatedCommentsFetchError(err)) + ) + } +} /* accepted comments */ const requestAcceptedComments = () => { return { - type: REQUEST_ACCEPTED_COMMENTS, - }; -}; + type: REQUEST_ACCEPTED_COMMENTS + } +} -const receiveAcceptedComments = (data) => { +const receiveAcceptedComments = data => { return { type: RECEIVE_ACCEPTED_COMMENTS, - data: data, - }; -}; + data: data + } +} -const acceptedCommentsFetchError = (err) => { +const acceptedCommentsFetchError = err => { return { type: ACCEPTED_COMMENTS_FETCH_ERROR, - data: err, - }; -}; + data: err + } +} -const fetchAcceptedComments = (conversation_id) => { +const fetchAcceptedComments = conversation_id => { // let includeSocial = "include_social=true&"; - let includeSocial = ""; + const includeSocial = '' return $.get( - "/api/v3/comments?moderation=true&include_voting_patterns=false&mod=1&" + + '/api/v3/comments?moderation=true&include_voting_patterns=false&mod=1&' + includeSocial + - "conversation_id=" + + 'conversation_id=' + conversation_id - ); -}; + ) +} -export const populateAcceptedCommentsStore = (conversation_id) => { - return (dispatch) => { - dispatch(requestAcceptedComments()); +export const populateAcceptedCommentsStore = conversation_id => { + return dispatch => { + dispatch(requestAcceptedComments()) return fetchAcceptedComments(conversation_id).then( - (res) => dispatch(receiveAcceptedComments(res)), - (err) => dispatch(acceptedCommentsFetchError(err)) - ); - }; -}; + res => dispatch(receiveAcceptedComments(res)), + err => dispatch(acceptedCommentsFetchError(err)) + ) + } +} /* rejected comments */ const requestRejectedComments = () => { return { - type: REQUEST_REJECTED_COMMENTS, - }; -}; + type: REQUEST_REJECTED_COMMENTS + } +} -const receiveRejectedComments = (data) => { +const receiveRejectedComments = data => { return { type: RECEIVE_REJECTED_COMMENTS, - data: data, - }; -}; + data: data + } +} -const rejectedCommentsFetchError = (err) => { +const rejectedCommentsFetchError = err => { return { type: REJECTED_COMMENTS_FETCH_ERROR, - data: err, - }; -}; + data: err + } +} -const fetchRejectedComments = (conversation_id) => { +const fetchRejectedComments = conversation_id => { // let includeSocial = "include_social=true&"; - let includeSocial = ""; + const includeSocial = '' return $.get( - "/api/v3/comments?moderation=true&include_voting_patterns=false&" + + '/api/v3/comments?moderation=true&include_voting_patterns=false&' + includeSocial + - "mod=-1&conversation_id=" + + 'mod=-1&conversation_id=' + conversation_id - ); -}; + ) +} -export const populateRejectedCommentsStore = (conversation_id) => { - return (dispatch) => { - dispatch(requestRejectedComments()); +export const populateRejectedCommentsStore = conversation_id => { + return dispatch => { + dispatch(requestRejectedComments()) return fetchRejectedComments(conversation_id).then( - (res) => dispatch(receiveRejectedComments(res)), - (err) => dispatch(rejectedCommentsFetchError(err)) - ); - }; -}; + res => dispatch(receiveRejectedComments(res)), + err => dispatch(rejectedCommentsFetchError(err)) + ) + } +} /* populate ALL stores todo/accept/reject/seed */ -export const populateAllCommentStores = (conversation_id) => { - return (dispatch) => { +export const populateAllCommentStores = conversation_id => { + return dispatch => { return $.when( dispatch(populateUnmoderatedCommentsStore(conversation_id)), dispatch(populateAcceptedCommentsStore(conversation_id)), dispatch(populateRejectedCommentsStore(conversation_id)) - ); - }; -}; + ) + } +} // export const populateAllCommentStores = (conversation) => { // } /* moderator clicked accept comment */ -const optimisticCommentAccepted = (comment) => { +const optimisticCommentAccepted = comment => { return { type: ACCEPT_COMMENT, - comment: comment, - }; -}; + comment: comment + } +} -const acceptCommentSuccess = (data) => { +const acceptCommentSuccess = data => { return { type: ACCEPT_COMMENT_SUCCESS, - data: data, - }; -}; + data: data + } +} -const acceptCommentError = (err) => { +const acceptCommentError = err => { return { type: ACCEPT_COMMENT_ERROR, - data: err, - }; -}; + data: err + } +} -const putCommentAccepted = (comment) => { +const putCommentAccepted = comment => { return $.ajax({ - method: "PUT", - url: "/api/v3/comments", - data: Object.assign(comment, { mod: 1 }), - }); -}; - -export const changeCommentStatusToAccepted = (comment) => { - comment.active = true; - return (dispatch) => { - dispatch(optimisticCommentAccepted(comment)); + method: 'PUT', + url: '/api/v3/comments', + data: Object.assign(comment, { mod: 1 }) + }) +} + +export const changeCommentStatusToAccepted = comment => { + comment.active = true + return dispatch => { + dispatch(optimisticCommentAccepted(comment)) return putCommentAccepted(comment).then( - (res) => { - dispatch(acceptCommentSuccess(res)); - dispatch(populateAllCommentStores(comment.conversation_id)); + res => { + dispatch(acceptCommentSuccess(res)) + dispatch(populateAllCommentStores(comment.conversation_id)) }, - (err) => dispatch(acceptCommentError(err)) - ); - }; -}; + err => dispatch(acceptCommentError(err)) + ) + } +} /* moderator clicked reject comment */ -const optimisticCommentRejected = (comment) => { +const optimisticCommentRejected = comment => { return { type: REJECT_COMMENT, - comment: comment, - }; -}; + comment: comment + } +} -const rejectCommentSuccess = (data) => { +const rejectCommentSuccess = data => { return { type: REJECT_COMMENT_SUCCESS, - data: data, - }; -}; + data: data + } +} -const rejectCommentError = (err) => { +const rejectCommentError = err => { return { type: REJECT_COMMENT_ERROR, - data: err, - }; -}; + data: err + } +} -const putCommentRejected = (comment) => { +const putCommentRejected = comment => { return $.ajax({ - method: "PUT", - url: "/api/v3/comments", - data: Object.assign(comment, { mod: -1 }), - }); -}; - -export const changeCommentStatusToRejected = (comment) => { - return (dispatch) => { - dispatch(optimisticCommentRejected()); + method: 'PUT', + url: '/api/v3/comments', + data: Object.assign(comment, { mod: -1 }) + }) +} + +export const changeCommentStatusToRejected = comment => { + return dispatch => { + dispatch(optimisticCommentRejected()) return putCommentRejected(comment).then( - (res) => { - dispatch(rejectCommentSuccess(res)); - dispatch(populateAllCommentStores(comment.conversation_id)); + res => { + dispatch(rejectCommentSuccess(res)) + dispatch(populateAllCommentStores(comment.conversation_id)) }, - (err) => dispatch(rejectCommentError(err)) - ); - }; -}; + err => dispatch(rejectCommentError(err)) + ) + } +} /* moderator changed comment's is_meta flag */ -const optimisticCommentIsMetaChanged = (comment) => { +const optimisticCommentIsMetaChanged = comment => { return { type: COMMENT_IS_META, - comment: comment, - }; -}; + comment: comment + } +} -const commentIsMetaChangeSuccess = (data) => { +const commentIsMetaChangeSuccess = data => { return { type: COMMENT_IS_META_SUCCESS, - data: data, - }; -}; + data: data + } +} -const commentIsMetaChangeError = (err) => { +const commentIsMetaChangeError = err => { return { type: COMMENT_IS_META_ERROR, - data: err, - }; -}; + data: err + } +} const putCommentCommentIsMetaChange = (comment, is_meta) => { return $.ajax({ - method: "PUT", - url: "/api/v3/comments", - data: Object.assign(comment, { is_meta: is_meta }), - }); -}; + method: 'PUT', + url: '/api/v3/comments', + data: Object.assign(comment, { is_meta: is_meta }) + }) +} export const changeCommentCommentIsMeta = (comment, is_meta) => { - return (dispatch) => { - dispatch(optimisticCommentIsMetaChanged()); + return dispatch => { + dispatch(optimisticCommentIsMetaChanged()) return putCommentCommentIsMetaChange(comment, is_meta).then( - (res) => { - dispatch(commentIsMetaChangeSuccess(res)); - dispatch(populateAllCommentStores(comment.conversation_id)); + res => { + dispatch(commentIsMetaChangeSuccess(res)) + dispatch(populateAllCommentStores(comment.conversation_id)) }, - (err) => dispatch(commentIsMetaChangeError(err)) - ); - }; -}; + err => dispatch(commentIsMetaChangeError(err)) + ) + } +} /* request participants */ const requestParticipants = () => { return { - type: REQUEST_PARTICIPANTS, - }; -}; + type: REQUEST_PARTICIPANTS + } +} -const receiveParticipants = (data) => { +const receiveParticipants = data => { return { type: RECEIVE_PARTICIPANTS, - data: data, - }; -}; + data: data + } +} -const participantsFetchError = (err) => { +const participantsFetchError = err => { return { type: PARTICIPANTS_FETCH_ERROR, - data: err, - }; -}; + data: err + } +} -const fetchParticipants = (conversation_id) => { - return $.get("/api/v3/ptptois?conversation_id=" + conversation_id); -}; +const fetchParticipants = conversation_id => { + return $.get('/api/v3/ptptois?conversation_id=' + conversation_id) +} -export const populateParticipantsStore = (conversation_id) => { - return (dispatch) => { - dispatch(requestParticipants()); +export const populateParticipantsStore = conversation_id => { + return dispatch => { + dispatch(requestParticipants()) return fetchParticipants(conversation_id).then( - (res) => dispatch(receiveParticipants(res)), - (err) => dispatch(participantsFetchError(err)) - ); - }; -}; + res => dispatch(receiveParticipants(res)), + err => dispatch(participantsFetchError(err)) + ) + } +} /* request default participants for ptpt moderation view */ const requestDefaultParticipants = () => { return { - type: REQUEST_DEFAULT_PARTICIPANTS, - }; -}; + type: REQUEST_DEFAULT_PARTICIPANTS + } +} -const receiveDefaultParticipants = (data) => { +const receiveDefaultParticipants = data => { return { type: RECEIVE_DEFAULT_PARTICIPANTS, - data: data, - }; -}; + data: data + } +} -const defaultParticipantFetchError = (err) => { +const defaultParticipantFetchError = err => { return { type: DEFAULT_PARTICIPANTS_FETCH_ERROR, - data: err, - }; -}; + data: err + } +} -const fetchDefaultParticipants = (conversation_id) => { - return $.get("/api/v3/ptptois?mod=0&conversation_id=" + conversation_id); -}; +const fetchDefaultParticipants = conversation_id => { + return $.get('/api/v3/ptptois?mod=0&conversation_id=' + conversation_id) +} -export const populateDefaultParticipantStore = (conversation_id) => { - return (dispatch) => { - dispatch(requestDefaultParticipants()); +export const populateDefaultParticipantStore = conversation_id => { + return dispatch => { + dispatch(requestDefaultParticipants()) return fetchDefaultParticipants(conversation_id).then( - (res) => dispatch(receiveDefaultParticipants(res)), - (err) => dispatch(defaultParticipantFetchError(err)) - ); - }; -}; + res => dispatch(receiveDefaultParticipants(res)), + err => dispatch(defaultParticipantFetchError(err)) + ) + } +} /* request featured participants for ptpt moderation view */ const requestFeaturedParticipants = () => { return { - type: REQUEST_FEATURED_PARTICIPANTS, - }; -}; + type: REQUEST_FEATURED_PARTICIPANTS + } +} -const receiveFeaturedParticipants = (data) => { +const receiveFeaturedParticipants = data => { return { type: RECEIVE_FEATURED_PARTICIPANTS, - data: data, - }; -}; + data: data + } +} -const featuredParticipantFetchError = (err) => { +const featuredParticipantFetchError = err => { return { type: FEATURED_PARTICIPANTS_FETCH_ERROR, - data: err, - }; -}; + data: err + } +} -const fetchFeaturedParticipants = (conversation_id) => { - return $.get("/api/v3/ptptois?mod=1&conversation_id=" + conversation_id); -}; +const fetchFeaturedParticipants = conversation_id => { + return $.get('/api/v3/ptptois?mod=1&conversation_id=' + conversation_id) +} -export const populateFeaturedParticipantStore = (conversation_id) => { - return (dispatch) => { - dispatch(requestFeaturedParticipants()); +export const populateFeaturedParticipantStore = conversation_id => { + return dispatch => { + dispatch(requestFeaturedParticipants()) return fetchFeaturedParticipants(conversation_id).then( - (res) => dispatch(receiveFeaturedParticipants(res)), - (err) => dispatch(featuredParticipantFetchError(err)) - ); - }; -}; + res => dispatch(receiveFeaturedParticipants(res)), + err => dispatch(featuredParticipantFetchError(err)) + ) + } +} /* request hidden participants for ptpt moderation view */ const requestHiddenParticipants = () => { return { - type: REQUEST_HIDDEN_PARTICIPANTS, - }; -}; + type: REQUEST_HIDDEN_PARTICIPANTS + } +} -const receiveHiddenParticipants = (data) => { +const receiveHiddenParticipants = data => { return { type: RECEIVE_HIDDEN_PARTICIPANTS, - data: data, - }; -}; + data: data + } +} -const hiddenParticipantFetchError = (err) => { +const hiddenParticipantFetchError = err => { return { type: HIDDEN_PARTICIPANTS_FETCH_ERROR, - data: err, - }; -}; + data: err + } +} -const fetchHiddenParticipants = (conversation_id) => { - return $.get("/api/v3/ptptois?mod=-1&conversation_id=" + conversation_id); -}; +const fetchHiddenParticipants = conversation_id => { + return $.get('/api/v3/ptptois?mod=-1&conversation_id=' + conversation_id) +} -export const populateHiddenParticipantStore = (conversation_id) => { - return (dispatch) => { - dispatch(requestHiddenParticipants()); +export const populateHiddenParticipantStore = conversation_id => { + return dispatch => { + dispatch(requestHiddenParticipants()) return fetchHiddenParticipants(conversation_id).then( - (res) => dispatch(receiveHiddenParticipants(res)), - (err) => dispatch(hiddenParticipantFetchError(err)) - ); - }; -}; + res => dispatch(receiveHiddenParticipants(res)), + err => dispatch(hiddenParticipantFetchError(err)) + ) + } +} /* populate ALL stores todo/accept/reject/seed */ -export const populateAllParticipantStores = (conversation_id) => { - return (dispatch) => { +export const populateAllParticipantStores = conversation_id => { + return dispatch => { return $.when( dispatch(populateDefaultParticipantStore(conversation_id)), dispatch(populateFeaturedParticipantStore(conversation_id)), dispatch(populateHiddenParticipantStore(conversation_id)) - ); - }; -}; + ) + } +} /* moderator clicked feature ptpt */ -const optimisticFeatureParticipant = (participant) => { +const optimisticFeatureParticipant = participant => { return { type: FEATURE_PARTICIPANT, - participant: participant, - }; -}; + participant: participant + } +} -const featureParticipantSuccess = (data) => { +const featureParticipantSuccess = data => { return { type: FEATURE_PARTICIPANT_SUCCESS, - data: data, - }; -}; + data: data + } +} -const featureParticipantError = (err) => { +const featureParticipantError = err => { return { type: FEATURE_PARTICIPANT_ERROR, - data: err, - }; -}; + data: err + } +} -const putFeatureParticipant = (participant) => { +const putFeatureParticipant = participant => { return $.ajax({ - method: "PUT", - url: "/api/v3/ptptois", - data: Object.assign(participant, { mod: 1 }), - }); -}; - -export const changeParticipantStatusToFeatured = (participant) => { - return (dispatch) => { - dispatch(optimisticFeatureParticipant(participant)); + method: 'PUT', + url: '/api/v3/ptptois', + data: Object.assign(participant, { mod: 1 }) + }) +} + +export const changeParticipantStatusToFeatured = participant => { + return dispatch => { + dispatch(optimisticFeatureParticipant(participant)) return putFeatureParticipant(participant).then( - (res) => dispatch(featureParticipantSuccess(res)), - (err) => dispatch(featureParticipantError(err)) - ); - }; -}; + res => dispatch(featureParticipantSuccess(res)), + err => dispatch(featureParticipantError(err)) + ) + } +} /* moderator clicked hide ptpt */ -const optimisticHideParticipant = (participant) => { +const optimisticHideParticipant = participant => { return { type: FEATURE_PARTICIPANT, - participant: participant, - }; -}; + participant: participant + } +} -const hideParticipantSuccess = (data) => { +const hideParticipantSuccess = data => { return { type: FEATURE_PARTICIPANT_SUCCESS, - data: data, - }; -}; + data: data + } +} -const hideParticipantError = (err) => { +const hideParticipantError = err => { return { type: FEATURE_PARTICIPANT_ERROR, - data: err, - }; -}; + data: err + } +} -const putHideParticipant = (participant) => { +const putHideParticipant = participant => { return $.ajax({ - method: "PUT", - url: "/api/v3/ptptois", - data: Object.assign(participant, { mod: -1 }), - }); -}; - -export const changeParticipantStatusToHidden = (participant) => { - return (dispatch) => { - dispatch(optimisticHideParticipant(participant)); + method: 'PUT', + url: '/api/v3/ptptois', + data: Object.assign(participant, { mod: -1 }) + }) +} + +export const changeParticipantStatusToHidden = participant => { + return dispatch => { + dispatch(optimisticHideParticipant(participant)) return putHideParticipant(participant).then( - (res) => dispatch(hideParticipantSuccess(res)), - (err) => dispatch(hideParticipantError(err)) - ); - }; -}; + res => dispatch(hideParticipantSuccess(res)), + err => dispatch(hideParticipantError(err)) + ) + } +} /* moderator clicked unmoderate ptpt */ -const optimisticUnmoderateParticipant = (participant) => { +const optimisticUnmoderateParticipant = participant => { return { type: FEATURE_PARTICIPANT, - participant: participant, - }; -}; + participant: participant + } +} -const unmoderateParticipantSuccess = (data) => { +const unmoderateParticipantSuccess = data => { return { type: FEATURE_PARTICIPANT_SUCCESS, - data: data, - }; -}; + data: data + } +} -const unmoderateParticipantError = (err) => { +const unmoderateParticipantError = err => { return { type: FEATURE_PARTICIPANT_ERROR, - data: err, - }; -}; + data: err + } +} -const putUnmoderateParticipant = (participant) => { +const putUnmoderateParticipant = participant => { return $.ajax({ - method: "PUT", - url: "/api/v3/ptptois", - data: Object.assign(participant, { mod: 0 }), - }); -}; - -export const changeParticipantStatusToUnmoderated = (participant) => { - return (dispatch) => { - dispatch(optimisticUnmoderateParticipant(participant)); + method: 'PUT', + url: '/api/v3/ptptois', + data: Object.assign(participant, { mod: 0 }) + }) +} + +export const changeParticipantStatusToUnmoderated = participant => { + return dispatch => { + dispatch(optimisticUnmoderateParticipant(participant)) return putUnmoderateParticipant(participant).then( - (res) => dispatch(hideParticipantSuccess(res)), - (err) => dispatch(hideParticipantError(err)) - ); - }; -}; + res => dispatch(hideParticipantSuccess(res)), + err => dispatch(hideParticipantError(err)) + ) + } +} /* request conversation stats */ const requestConversationStats = () => { return { - type: REQUEST_CONVERSATION_STATS, - }; -}; + type: REQUEST_CONVERSATION_STATS + } +} -const receiveConversationStats = (data) => { +const receiveConversationStats = data => { return { type: RECEIVE_CONVERSATION_STATS, - data: data, - }; -}; + data: data + } +} -const conversationStatsFetchError = (err) => { +const conversationStatsFetchError = err => { return { type: CONVERSATION_STATS_FETCH_ERROR, - data: err, - }; -}; + data: err + } +} const fetchConversationStats = (conversation_id, until) => { return $.get( - "/api/v3/conversationStats?conversation_id=" + + '/api/v3/conversationStats?conversation_id=' + conversation_id + - (until ? "&until=" + until : "") - ); -}; + (until ? '&until=' + until : '') + ) +} export const populateConversationStatsStore = (conversation_id, until) => { - return (dispatch) => { - dispatch(requestConversationStats()); + return dispatch => { + dispatch(requestConversationStats()) return fetchConversationStats(conversation_id, until).then( - (res) => dispatch(receiveConversationStats(res)), - (err) => dispatch(conversationStatsFetchError(err)) - ); - }; -}; + res => dispatch(receiveConversationStats(res)), + err => dispatch(conversationStatsFetchError(err)) + ) + } +} /* data export */ const dataExportStarted = () => { return { - type: DATA_EXPORT_STARTED, - }; -}; + type: DATA_EXPORT_STARTED + } +} const dataExportSuccess = () => { return { - type: DATA_EXPORT_SUCCESS, - }; -}; + type: DATA_EXPORT_SUCCESS + } +} const dataExportError = () => { return { - type: DATA_EXPORT_ERROR, - }; -}; - -const dataExportGet = (conversation_id, format, unixTimestamp, untilEnabled) => { + type: DATA_EXPORT_ERROR + } +} + +const dataExportGet = ( + conversation_id, + format, + unixTimestamp, + untilEnabled +) => { // url += ("&unixTimestamp=" + ((ctx.date/1000) << 0)); /* https://pol.is/api/v3/dataExport?conversation_id=2arcefpshi&format=csv&unixTimestamp=1447362000 */ - var url = `/api/v3/dataExport?conversation_id=${conversation_id}&format=${format}`; + var url = `/api/v3/dataExport?conversation_id=${conversation_id}&format=${format}` if (untilEnabled) { - url += `&unixTimestamp=${unixTimestamp}`; - } - return $.get(url); -}; - -export const startDataExport = (conversation_id, format, unixTimestamp, untilEnabled) => { - return (dispatch) => { - dispatch(dataExportStarted()); - return dataExportGet(conversation_id, format, unixTimestamp, untilEnabled).then( - (res) => dispatch(dataExportSuccess(res)), - (err) => dispatch(dataExportError(err)) - ); - }; -}; + url += `&unixTimestamp=${unixTimestamp}` + } + return $.get(url) +} + +export const startDataExport = ( + conversation_id, + format, + unixTimestamp, + untilEnabled +) => { + return dispatch => { + dispatch(dataExportStarted()) + return dataExportGet( + conversation_id, + format, + unixTimestamp, + untilEnabled + ).then( + res => dispatch(dataExportSuccess(res)), + err => dispatch(dataExportError(err)) + ) + } +} diff --git a/client-admin/src/components/conversation-admin/no-permission.js b/client-admin/src/components/conversation-admin/no-permission.js index 412e9e618..465624498 100644 --- a/client-admin/src/components/conversation-admin/no-permission.js +++ b/client-admin/src/components/conversation-admin/no-permission.js @@ -1,16 +1,16 @@ // Copyright (C) 2012-present, The Authors. This program is free software: you can redistribute it and/or modify it under the terms of the GNU Affero General Public License, version 3, as published by the Free Software Foundation. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Affero General Public License for more details. You should have received a copy of the GNU Affero General Public License along with this program. If not, see . -import React from "react"; -import strings from "../../strings/strings"; +import React from 'react' +import strings from '../../strings/strings' class NoPermission extends React.Component { render() { return (
-
{strings("no_permission")}
+
{strings('no_permission')}
- ); + ) } } -export default NoPermission; +export default NoPermission diff --git a/client-admin/src/components/conversation-admin/report/reports.js b/client-admin/src/components/conversation-admin/report/reports.js index 6a3ea2d3f..50b2e2156 100644 --- a/client-admin/src/components/conversation-admin/report/reports.js +++ b/client-admin/src/components/conversation-admin/report/reports.js @@ -1,9 +1,9 @@ // Copyright (C) 2012-present, The Authors. This program is free software: you can redistribute it and/or modify it under the terms of the GNU Affero General Public License, version 3, as published by the Free Software Foundation. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Affero General Public License for more details. You should have received a copy of the GNU Affero General Public License along with this program. If not, see . -import React from "react"; +import React from 'react' -import ReportsList from "./reports-list"; -import { Switch, Route, Link, Redirect } from "react-router-dom"; +import ReportsList from './reports-list' +import { Switch, Route, Link, Redirect } from 'react-router-dom' class Reports extends React.Component { render() { @@ -13,11 +13,11 @@ class Reports extends React.Component { - ); + ) } } -export default Reports; +export default Reports // // diff --git a/client-admin/src/components/conversation-admin/stats/commenters.js b/client-admin/src/components/conversation-admin/stats/commenters.js index 703e0b210..33c2af71a 100644 --- a/client-admin/src/components/conversation-admin/stats/commenters.js +++ b/client-admin/src/components/conversation-admin/stats/commenters.js @@ -2,25 +2,24 @@ /** @jsx jsx */ -import React from "react"; -import { jsx, Box, Heading } from "theme-ui"; -import { VictoryChart, VictoryArea } from "victory"; -import victoryTheme from "./victoryTheme"; +import React from 'react' +import { jsx, Box, Heading } from 'theme-ui' +import { VictoryChart, VictoryArea } from 'victory' +import victoryTheme from './victoryTheme' class Commenters extends React.Component { render() { - const { size, firstCommentTimes } = this.props; - if (firstCommentTimes.length <= 1) return null; /* handle seed commenter */ + const { size, firstCommentTimes } = this.props + if (firstCommentTimes.length <= 1) return null /* handle seed commenter */ return ( + lineHeight: 'body', + my: [2] + }}> Commenters over time, by time of first comment + scale={{ x: 'time' }}> { - return { x: new Date(d), y: i }; + return { x: new Date(d), y: i } })} /> - ); + ) } } -export default Commenters; +export default Commenters diff --git a/client-admin/src/components/conversation-admin/stats/conversation-stats-commenters-voters.js b/client-admin/src/components/conversation-admin/stats/conversation-stats-commenters-voters.js index 20546ab65..78bec0cc4 100644 --- a/client-admin/src/components/conversation-admin/stats/conversation-stats-commenters-voters.js +++ b/client-admin/src/components/conversation-admin/stats/conversation-stats-commenters-voters.js @@ -1,10 +1,10 @@ // Copyright (C) 2012-present, The Authors. This program is free software: you can redistribute it and/or modify it under the terms of the GNU Affero General Public License, version 3, as published by the Free Software Foundation. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Affero General Public License for more details. You should have received a copy of the GNU Affero General Public License along with this program. If not, see . -import React from "react"; -import { VictoryChart } from "victory-chart"; -import { VictoryLine } from "victory-line"; -import { VictoryAxis } from "victory-axis"; -import * as d3 from "d3"; +import React from 'react' +import { VictoryChart } from 'victory-chart' +import { VictoryLine } from 'victory-line' +import { VictoryAxis } from 'victory-axis' +import * as d3 from 'd3' class CommentersVoters extends React.Component { render() { @@ -14,45 +14,44 @@ class CommentersVoters extends React.Component { height={this.props.chartHeight} scale={{ x: d3.scaleTime(this.props.data.firstVoteTimes), - y: d3.scaleLinear(), - }} - > + y: d3.scaleLinear() + }}> { - return { x: timestamp, y: i }; + return { x: timestamp, y: i } })} /> { - return { x: timestamp, y: i }; + return { x: timestamp, y: i } })} /> - ); + ) } } -export default CommentersVoters; +export default CommentersVoters diff --git a/client-admin/src/components/conversation-admin/stats/conversation-stats-comments-timescale.js b/client-admin/src/components/conversation-admin/stats/conversation-stats-comments-timescale.js index 8dd5a0ce0..6ed63f6e3 100644 --- a/client-admin/src/components/conversation-admin/stats/conversation-stats-comments-timescale.js +++ b/client-admin/src/components/conversation-admin/stats/conversation-stats-comments-timescale.js @@ -1,11 +1,11 @@ // Copyright (C) 2012-present, The Authors. This program is free software: you can redistribute it and/or modify it under the terms of the GNU Affero General Public License, version 3, as published by the Free Software Foundation. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Affero General Public License for more details. You should have received a copy of the GNU Affero General Public License along with this program. If not, see . -import React from "react"; +import React from 'react' -import { VictoryChart } from "victory-chart"; -import { VictoryLine } from "victory-line"; -import { VictoryAxis } from "victory-axis"; -import * as d3 from "d3"; +import { VictoryChart } from 'victory-chart' +import { VictoryLine } from 'victory-line' +import { VictoryAxis } from 'victory-axis' +import * as d3 from 'd3' class CommentsTimescale extends React.Component { render() { @@ -15,25 +15,24 @@ class CommentsTimescale extends React.Component { height={this.props.chartHeight} scale={{ x: d3.scaleTime(this.props.data.commentTimes), - y: d3.scaleLinear(), - }} - > + y: d3.scaleLinear() + }}> { - return { x: timestamp, y: i }; + return { x: timestamp, y: i } })} /> - + - ); + ) } } -export default CommentsTimescale; +export default CommentsTimescale diff --git a/client-admin/src/components/conversation-admin/stats/conversation-stats-number-card.js b/client-admin/src/components/conversation-admin/stats/conversation-stats-number-card.js index 6e927a1a1..bb79f8356 100644 --- a/client-admin/src/components/conversation-admin/stats/conversation-stats-number-card.js +++ b/client-admin/src/components/conversation-admin/stats/conversation-stats-number-card.js @@ -1,7 +1,7 @@ // Copyright (C) 2012-present, The Authors. This program is free software: you can redistribute it and/or modify it under the terms of the GNU Affero General Public License, version 3, as published by the Free Software Foundation. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Affero General Public License for more details. You should have received a copy of the GNU Affero General Public License along with this program. If not, see . -import React from "react"; -import { Text, Flex } from "theme-ui"; +import React from 'react' +import { Text, Flex } from 'theme-ui' class NumberCard extends React.Component { render() { @@ -10,8 +10,8 @@ class NumberCard extends React.Component { {this.props.datum} {this.props.subheading} - ); + ) } } -export default NumberCard; +export default NumberCard diff --git a/client-admin/src/components/conversation-admin/stats/conversation-stats-number-cards.js b/client-admin/src/components/conversation-admin/stats/conversation-stats-number-cards.js index 4aa668c5c..ba316e914 100644 --- a/client-admin/src/components/conversation-admin/stats/conversation-stats-number-cards.js +++ b/client-admin/src/components/conversation-admin/stats/conversation-stats-number-cards.js @@ -1,12 +1,14 @@ // Copyright (C) 2012-present, The Authors. This program is free software: you can redistribute it and/or modify it under the terms of the GNU Affero General Public License, version 3, as published by the Free Software Foundation. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Affero General Public License for more details. You should have received a copy of the GNU Affero General Public License along with this program. If not, see . -import React from "react"; -import NumberCard from "./conversation-stats-number-card"; +import React from 'react' +import NumberCard from './conversation-stats-number-card' class NumberCards extends React.Component { render() { - const data = this.props.data; - const averageVotes = (data.voteTimes.length / data.firstVoteTimes.length).toFixed(2); + const data = this.props.data + const averageVotes = ( + data.voteTimes.length / data.firstVoteTimes.length + ).toFixed(2) return (
- + - +
- ); + ) } } -export default NumberCards; +export default NumberCards diff --git a/client-admin/src/components/conversation-admin/stats/conversation-stats-vote-distribution.js b/client-admin/src/components/conversation-admin/stats/conversation-stats-vote-distribution.js index e0c03356d..e35110f15 100644 --- a/client-admin/src/components/conversation-admin/stats/conversation-stats-vote-distribution.js +++ b/client-admin/src/components/conversation-admin/stats/conversation-stats-vote-distribution.js @@ -1,68 +1,70 @@ // Copyright (C) 2012-present, The Authors. This program is free software: you can redistribute it and/or modify it under the terms of the GNU Affero General Public License, version 3, as published by the Free Software Foundation. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Affero General Public License for more details. You should have received a copy of the GNU Affero General Public License along with this program. If not, see . -import React from "react"; -import { VictoryChart } from "victory-chart"; -import { VictoryBar } from "victory-bar"; -import { VictoryAxis } from "victory-axis"; +import React from 'react' +import { VictoryChart } from 'victory-chart' +import { VictoryBar } from 'victory-bar' +import { VictoryAxis } from 'victory-axis' class VotesDistribution extends React.Component { render() { return ( - + { + data={this.props.data.votesHistogram.map(d => { return { x: d.n_votes, - y: d.n_ptpts, - }; + y: d.n_ptpts + } })} /> - ); + ) } } -export default VotesDistribution; +export default VotesDistribution diff --git a/client-admin/src/components/conversation-admin/stats/conversation-stats-votes-timescale.js b/client-admin/src/components/conversation-admin/stats/conversation-stats-votes-timescale.js index 118a9aa41..7014abbdd 100644 --- a/client-admin/src/components/conversation-admin/stats/conversation-stats-votes-timescale.js +++ b/client-admin/src/components/conversation-admin/stats/conversation-stats-votes-timescale.js @@ -1,11 +1,11 @@ // Copyright (C) 2012-present, The Authors. This program is free software: you can redistribute it and/or modify it under the terms of the GNU Affero General Public License, version 3, as published by the Free Software Foundation. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Affero General Public License for more details. You should have received a copy of the GNU Affero General Public License along with this program. If not, see . -import React from "react"; +import React from 'react' -import { VictoryChart } from "victory-chart"; -import { VictoryLine } from "victory-line"; -import { VictoryAxis } from "victory-axis"; -import * as d3 from "d3"; +import { VictoryChart } from 'victory-chart' +import { VictoryLine } from 'victory-line' +import { VictoryAxis } from 'victory-axis' +import * as d3 from 'd3' class VotesTimescale extends React.Component { render() { @@ -15,25 +15,24 @@ class VotesTimescale extends React.Component { height={this.props.chartHeight} scale={{ x: d3.scaleTime(this.props.data.voteTimes), - y: d3.scaleLinear(), - }} - > + y: d3.scaleLinear() + }}> { - return { x: timestamp, y: i }; + return { x: timestamp, y: i } })} /> - + - ); + ) } } -export default VotesTimescale; +export default VotesTimescale diff --git a/client-admin/src/components/conversation-admin/stats/victoryTheme.js b/client-admin/src/components/conversation-admin/stats/victoryTheme.js index dbc9b310c..212ea6c58 100644 --- a/client-admin/src/components/conversation-admin/stats/victoryTheme.js +++ b/client-admin/src/components/conversation-admin/stats/victoryTheme.js @@ -1,28 +1,35 @@ // Colors -const yellow200 = "#FFF59D"; -const deepOrange600 = "#F4511E"; -const lime300 = "#DCE775"; -const lightGreen500 = "#8BC34A"; -const teal700 = "#00796B"; -const cyan900 = "#006064"; -const colors = [deepOrange600, yellow200, lime300, lightGreen500, teal700, cyan900]; -const blueGrey50 = "#ECEFF1"; -const blueGrey300 = "#90A4AE"; -const blueGrey700 = "#455A64"; -const grey900 = "#212121"; +const yellow200 = '#FFF59D' +const deepOrange600 = '#F4511E' +const lime300 = '#DCE775' +const lightGreen500 = '#8BC34A' +const teal700 = '#00796B' +const cyan900 = '#006064' +const colors = [ + deepOrange600, + yellow200, + lime300, + lightGreen500, + teal700, + cyan900 +] +const blueGrey50 = '#ECEFF1' +const blueGrey300 = '#90A4AE' +const blueGrey700 = '#455A64' +const grey900 = '#212121' // Typography -const sansSerif = "'Space Mono', monospace"; -const letterSpacing = "normal"; -const fontSize = 12; +const sansSerif = "'Space Mono', monospace" +const letterSpacing = 'normal' +const fontSize = 12 // Layout -const padding = 8; +const padding = 8 const baseProps = { width: 350, height: 350, - padding: 50, -}; + padding: 50 +} // * Labels const baseLabelStyles = { @@ -31,16 +38,19 @@ const baseLabelStyles = { letterSpacing, padding, fill: blueGrey700, - stroke: "transparent", - strokeWidth: 0, -}; + stroke: 'transparent', + strokeWidth: 0 +} -const centeredLabelStyles = Object.assign({ textAnchor: "middle" }, baseLabelStyles); +const centeredLabelStyles = Object.assign( + { textAnchor: 'middle' }, + baseLabelStyles +) // Strokes -const strokeDasharray = "10, 5"; -const strokeLinecap = "round"; -const strokeLinejoin = "round"; +const strokeDasharray = '10, 5' +const strokeLinecap = 'round' +const strokeLinejoin = 'round' // Put it all together... const theme = { @@ -48,10 +58,10 @@ const theme = { { style: { data: { - fill: grey900, + fill: grey900 }, - labels: centeredLabelStyles, - }, + labels: centeredLabelStyles + } }, baseProps ), @@ -59,36 +69,36 @@ const theme = { { style: { axis: { - fill: "transparent", + fill: 'transparent', stroke: blueGrey300, strokeWidth: 2, strokeLinecap, - strokeLinejoin, + strokeLinejoin }, axisLabel: Object.assign({}, centeredLabelStyles, { padding, - stroke: "transparent", + stroke: 'transparent' }), grid: { - fill: "none", + fill: 'none', stroke: blueGrey50, strokeDasharray, strokeLinecap, strokeLinejoin, - pointerEvents: "painted", + pointerEvents: 'painted' }, ticks: { - fill: "transparent", + fill: 'transparent', size: 5, stroke: blueGrey300, strokeWidth: 1, strokeLinecap, - strokeLinejoin, + strokeLinejoin }, tickLabels: Object.assign({}, baseLabelStyles, { - fill: blueGrey700, - }), - }, + fill: blueGrey700 + }) + } }, baseProps ), @@ -98,10 +108,10 @@ const theme = { data: { fill: blueGrey700, padding, - strokeWidth: 0, + strokeWidth: 0 }, - labels: baseLabelStyles, - }, + labels: baseLabelStyles + } }, baseProps ), @@ -111,33 +121,33 @@ const theme = { max: { padding, stroke: blueGrey700, - strokeWidth: 1, + strokeWidth: 1 }, maxLabels: baseLabelStyles, median: { padding, stroke: blueGrey700, - strokeWidth: 1, + strokeWidth: 1 }, medianLabels: baseLabelStyles, min: { padding, stroke: blueGrey700, - strokeWidth: 1, + strokeWidth: 1 }, minLabels: baseLabelStyles, q1: { padding, - fill: blueGrey700, + fill: blueGrey700 }, q1Labels: baseLabelStyles, q3: { padding, - fill: blueGrey700, + fill: blueGrey700 }, - q3Labels: baseLabelStyles, + q3Labels: baseLabelStyles }, - boxWidth: 20, + boxWidth: 20 }, baseProps ), @@ -145,14 +155,14 @@ const theme = { { style: { data: { - stroke: blueGrey700, + stroke: blueGrey700 }, - labels: centeredLabelStyles, + labels: centeredLabelStyles }, candleColors: { - positive: "#ffffff", - negative: blueGrey700, - }, + positive: '#ffffff', + negative: blueGrey700 + } }, baseProps ), @@ -162,46 +172,46 @@ const theme = { borderWidth: 8, style: { data: { - fill: "transparent", + fill: 'transparent', opacity: 1, stroke: blueGrey700, - strokeWidth: 2, + strokeWidth: 2 }, - labels: centeredLabelStyles, - }, + labels: centeredLabelStyles + } }, baseProps ), group: Object.assign( { - colorScale: colors, + colorScale: colors }, baseProps ), legend: { colorScale: colors, gutter: 10, - orientation: "vertical", - titleOrientation: "top", + orientation: 'vertical', + titleOrientation: 'top', style: { data: { - type: "circle", + type: 'circle' }, labels: baseLabelStyles, - title: Object.assign({}, baseLabelStyles, { padding: 5 }), - }, + title: Object.assign({}, baseLabelStyles, { padding: 5 }) + } }, line: Object.assign( { style: { data: { - fill: "transparent", + fill: 'transparent', opacity: 1, stroke: blueGrey700, - strokeWidth: 2, + strokeWidth: 2 }, - labels: centeredLabelStyles, - }, + labels: centeredLabelStyles + } }, baseProps ), @@ -212,10 +222,10 @@ const theme = { data: { padding, stroke: blueGrey50, - strokeWidth: 1, + strokeWidth: 1 }, - labels: Object.assign({}, baseLabelStyles, { padding: 20 }), - }, + labels: Object.assign({}, baseLabelStyles, { padding: 20 }) + } }, baseProps ), @@ -225,56 +235,56 @@ const theme = { data: { fill: blueGrey700, opacity: 1, - stroke: "transparent", - strokeWidth: 0, + stroke: 'transparent', + strokeWidth: 0 }, - labels: centeredLabelStyles, - }, + labels: centeredLabelStyles + } }, baseProps ), stack: Object.assign( { - colorScale: colors, + colorScale: colors }, baseProps ), tooltip: { style: Object.assign({}, centeredLabelStyles, { padding: 5, - pointerEvents: "none", + pointerEvents: 'none' }), flyoutStyle: { stroke: grey900, strokeWidth: 1, - fill: "#f0f0f0", - pointerEvents: "none", + fill: '#f0f0f0', + pointerEvents: 'none' }, cornerRadius: 5, - pointerLength: 10, + pointerLength: 10 }, voronoi: Object.assign( { style: { data: { - fill: "transparent", - stroke: "transparent", - strokeWidth: 0, + fill: 'transparent', + stroke: 'transparent', + strokeWidth: 0 }, labels: Object.assign({}, centeredLabelStyles, { padding: 5, - pointerEvents: "none", + pointerEvents: 'none' }), flyout: { stroke: grey900, strokeWidth: 1, - fill: "#f0f0f0", - pointerEvents: "none", - }, - }, + fill: '#f0f0f0', + pointerEvents: 'none' + } + } }, baseProps - ), -}; + ) +} -export default theme; +export default theme diff --git a/client-admin/src/components/conversation-admin/stats/voters.js b/client-admin/src/components/conversation-admin/stats/voters.js index 766548c93..f6f57a4b2 100644 --- a/client-admin/src/components/conversation-admin/stats/voters.js +++ b/client-admin/src/components/conversation-admin/stats/voters.js @@ -2,25 +2,25 @@ /** @jsx jsx */ -import React from "react"; -import { jsx, Box, Heading } from "theme-ui"; -import { VictoryChart, VictoryArea } from "victory"; -import victoryTheme from "./victoryTheme"; +import React from 'react' +import { jsx, Box, Heading } from 'theme-ui' +import { VictoryChart, VictoryArea } from 'victory' +import victoryTheme from './victoryTheme' class Voters extends React.Component { render() { - const { size, firstVoteTimes } = this.props; - if (firstVoteTimes.length <= 1) return null; /* no area chart with 1 data point */ + const { size, firstVoteTimes } = this.props + if (firstVoteTimes.length <= 1) + return null /* no area chart with 1 data point */ return ( + lineHeight: 'body', + my: [2] + }}> Voters over time, by time of first vote + scale={{ x: 'time' }}> { - return { x: new Date(d), y: i }; + return { x: new Date(d), y: i } })} /> - ); + ) } } -export default Voters; +export default Voters diff --git a/client-admin/src/components/conversations-and-account/conversation.js b/client-admin/src/components/conversations-and-account/conversation.js index e657809c0..0a30c9c55 100644 --- a/client-admin/src/components/conversations-and-account/conversation.js +++ b/client-admin/src/components/conversations-and-account/conversation.js @@ -1,13 +1,16 @@ /** @jsx jsx */ -import { jsx, Text, Card } from "theme-ui"; +import { jsx, Text, Card } from 'theme-ui' export default ({ c, i, goToConversation }) => { return ( - + {c.topic} {c.description} {c.parent_url ? `Embedded on ${c.parent_url}` : null} {c.participant_count} participants - ); -}; + ) +} diff --git a/client-admin/src/components/framework/colors.js b/client-admin/src/components/framework/colors.js index 844a3007c..7f4431887 100644 --- a/client-admin/src/components/framework/colors.js +++ b/client-admin/src/components/framework/colors.js @@ -1,5 +1,5 @@ // Copyright (C) 2012-present, The Authors. This program is free software: you can redistribute it and/or modify it under the terms of the GNU Affero General Public License, version 3, as published by the Free Software Foundation. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Affero General Public License for more details. You should have received a copy of the GNU Affero General Public License along with this program. If not, see . export const colors = { - agree: "#2ecc71" -}; + agree: '#2ecc71' +} diff --git a/client-admin/src/components/framework/flex.js b/client-admin/src/components/framework/flex.js index fcd47d39f..9b6355afd 100644 --- a/client-admin/src/components/framework/flex.js +++ b/client-admin/src/components/framework/flex.js @@ -1,7 +1,7 @@ // Copyright (C) 2012-present, The Authors. This program is free software: you can redistribute it and/or modify it under the terms of the GNU Affero General Public License, version 3, as published by the Free Software Foundation. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Affero General Public License for more details. You should have received a copy of the GNU Affero General Public License along with this program. If not, see . -import React from "react"; -import Radium from "radium"; +import React from 'react' +import Radium from 'radium' /** @@ -18,7 +18,7 @@ class Flex extends React.Component { getStyles() { return { base: { - display: "flex", + display: 'flex', flexDirection: this.props.direction, flexWrap: this.props.wrap, justifyContent: this.props.justifyContent, @@ -28,21 +28,23 @@ class Flex extends React.Component { flexGrow: this.props.grow, flexShrink: this.props.shrink, flexBasis: this.props.basis, - alignSelf: this.props.alignSelf, + alignSelf: this.props.alignSelf }, - styleOverrides: this.props.styleOverrides, - }; + styleOverrides: this.props.styleOverrides + } } render() { - const styles = this.getStyles(); + const styles = this.getStyles() return ( -
+
{this.props.children}
- ); + ) } } -export default Radium(Flex); +export default Radium(Flex) diff --git a/client-admin/src/components/framework/global-styles.js b/client-admin/src/components/framework/global-styles.js index 101428009..9ab17b1c0 100644 --- a/client-admin/src/components/framework/global-styles.js +++ b/client-admin/src/components/framework/global-styles.js @@ -1,9 +1,9 @@ // Copyright (C) 2012-present, The Authors. This program is free software: you can redistribute it and/or modify it under the terms of the GNU Affero General Public License, version 3, as published by the Free Software Foundation. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Affero General Public License for more details. You should have received a copy of the GNU Affero General Public License along with this program. If not, see . -export const headerHeight = 30; -const regular = 300; -const bold = 500; -const brand = "#03a9f4"; +export const headerHeight = 30 +const regular = 300 +const bold = 500 +const brand = '#03a9f4' export const s = {} @@ -11,61 +11,61 @@ export const s = {} General *************************/ -s.brandColor = brand; +s.brandColor = brand s.container = { - minHeight: "100%", - margin: 0, + minHeight: '100%', + margin: 0 } s.dangerButton = { borderRadius: 3, - padding: "10px 20px", - color: "white", - backgroundColor: "#F1360A", - border: "none", - cursor: "pointer", + padding: '10px 20px', + color: 'white', + backgroundColor: '#F1360A', + border: 'none', + cursor: 'pointer' } s.primaryButton = { borderRadius: 3, - padding: "10px 20px", - color: "white", + padding: '10px 20px', + color: 'white', backgroundColor: brand, - border: "none", - cursor: "pointer", - textDecoration: "none", + border: 'none', + cursor: 'pointer', + textDecoration: 'none' } s.secondaryButton = { borderRadius: 3, - padding: "10px 20px", - color: "white", - backgroundColor: "#444444", - border: "none", - cursor: "pointer", - textDecoration: "none", + padding: '10px 20px', + color: 'white', + backgroundColor: '#444444', + border: 'none', + cursor: 'pointer', + textDecoration: 'none' } /************************* Sidebar *************************/ s.sidebar = { - width: 256, + width: 256 } s.sidebarLinks = { - backgroundColor: "white", - height: "100%", + backgroundColor: 'white', + height: '100%', padding: 20 } s.sidebarLink = { - display: "block", - color: "black", - textDecoration: "none", - cursor: "pointer", - marginBottom: 20, + display: 'block', + color: 'black', + textDecoration: 'none', + cursor: 'pointer', + marginBottom: 20 } /************************* @@ -73,32 +73,32 @@ s.sidebarLink = { *************************/ s.conversation = { - ":hover": { - backgroundColor: "rgb(245,245,245)" + ':hover': { + backgroundColor: 'rgb(245,245,245)' }, - padding: "10px 20px", - cursor: "pointer", + padding: '10px 20px', + cursor: 'pointer' } s.statNumber = { fontSize: 12, - margin: 0, + margin: 0 } s.topic = { fontWeight: bold, - margin: "5px 0px 5px 0px", + margin: '5px 0px 5px 0px' } s.description = { fontWeight: regular, - fontStyle: "italic", - margin: 0, + fontStyle: 'italic', + margin: 0 } s.parentUrl = { fontSize: 12, - marginTop: 10, + marginTop: 10 } /************************* @@ -106,7 +106,7 @@ s.parentUrl = { *************************/ s.accountContainer = { - padding: 20, + padding: 20 } s.accountSection = { @@ -114,5 +114,5 @@ s.accountSection = { } s.accountSectionHeader = { - fontWeight: bold, + fontWeight: bold } diff --git a/client-admin/src/components/framework/logomark.js b/client-admin/src/components/framework/logomark.js index 952f9c466..11a2b12ea 100644 --- a/client-admin/src/components/framework/logomark.js +++ b/client-admin/src/components/framework/logomark.js @@ -1,6 +1,6 @@ /** @jsx jsx */ -import React from "react"; -import { jsx } from "theme-ui"; +import React from 'react' +import { jsx } from 'theme-ui' class Logomark extends React.Component { render() { @@ -10,12 +10,14 @@ class Logomark extends React.Component { viewBox="0 0 88 100" style={this.props.style} fill="none" - xmlns="http://www.w3.org/2000/svg" - > - + xmlns="http://www.w3.org/2000/svg"> + - ); + ) } } -export default Logomark; +export default Logomark diff --git a/client-admin/src/components/framework/spinner.js b/client-admin/src/components/framework/spinner.js index 9a16b7ba2..9c0af23f7 100644 --- a/client-admin/src/components/framework/spinner.js +++ b/client-admin/src/components/framework/spinner.js @@ -1,6 +1,6 @@ // Copyright (C) 2012-present, The Authors. This program is free software: you can redistribute it and/or modify it under the terms of the GNU Affero General Public License, version 3, as published by the Free Software Foundation. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Affero General Public License for more details. You should have received a copy of the GNU Affero General Public License along with this program. If not, see . -import React from "react"; +import React from 'react' class Spinner extends React.Component { getSpinner() { @@ -220,12 +220,13 @@ class Spinner extends React.Component { from="1" to="0" dur="1s" begin="0.9166666666666666s" repeatCount="indefinite"/> - `, - }; + ` + } } + render() { - return
; + return
} } -export default Spinner; +export default Spinner diff --git a/client-admin/src/components/framework/verified-twitter-icon.js b/client-admin/src/components/framework/verified-twitter-icon.js index 572522127..f193dd580 100644 --- a/client-admin/src/components/framework/verified-twitter-icon.js +++ b/client-admin/src/components/framework/verified-twitter-icon.js @@ -1,13 +1,13 @@ // Copyright (C) 2012-present, The Authors. This program is free software: you can redistribute it and/or modify it under the terms of the GNU Affero General Public License, version 3, as published by the Free Software Foundation. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Affero General Public License for more details. You should have received a copy of the GNU Affero General Public License along with this program. If not, see . -import React from "react"; +import React from 'react' class TwitterIcon extends React.Component { render() { return ( - ); + ) } } -export default TwitterIcon; +export default TwitterIcon diff --git a/client-admin/src/components/interior-header.js b/client-admin/src/components/interior-header.js index 6513023ca..8433c4c00 100644 --- a/client-admin/src/components/interior-header.js +++ b/client-admin/src/components/interior-header.js @@ -1,39 +1,41 @@ /** @jsx jsx */ -import React from "react"; -import { Box, jsx } from "theme-ui"; -import { Link } from "react-router-dom"; -import Logomark from "./framework/logomark"; +import React from 'react' +import { Box, jsx } from 'theme-ui' +import { Link } from 'react-router-dom' +import Logomark from './framework/logomark' class InteriorHeader extends React.Component { render() { - const globalWidth = "45em"; + const globalWidth = '45em' return ( - - + display: 'flex', + alignItems: 'center', + justifyContent: 'space-between' + }}> + + Polis - + sign out {this.props.children} - ); + ) } } -export default InteriorHeader; +export default InteriorHeader diff --git a/client-admin/src/components/landers/exploreKnowledgeBase.js b/client-admin/src/components/landers/exploreKnowledgeBase.js index e320cadca..fc989cdbc 100644 --- a/client-admin/src/components/landers/exploreKnowledgeBase.js +++ b/client-admin/src/components/landers/exploreKnowledgeBase.js @@ -1,19 +1,23 @@ -import React from "react"; -import { Box, Link, Heading } from "theme-ui"; -import KnowledgeBase from "./knowledgeBase"; +import React from 'react' +import { Box, Link, Heading } from 'theme-ui' +import KnowledgeBase from './knowledgeBase' const ExploreKnowledgeBase = () => { return ( - + Explore - + - Onboard with a{" "} - + Onboard with a{' '} + comprehensive knowledge base - {" "} + {' '} including { /> - ); -}; + ) +} -export default ExploreKnowledgeBase; +export default ExploreKnowledgeBase diff --git a/client-admin/src/components/landers/home.js b/client-admin/src/components/landers/home.js index 608ec4455..5bb1b2449 100644 --- a/client-admin/src/components/landers/home.js +++ b/client-admin/src/components/landers/home.js @@ -1,8 +1,8 @@ -import React from "react"; -import Layout from "./lander-layout"; -import { Heading, Box, Text, Link } from "theme-ui"; -import ExploreKnowledgeBase from "./exploreKnowledgeBase"; -import Press from "./press"; +import React from 'react' +import Layout from './lander-layout' +import { Heading, Box, Text, Link } from 'theme-ui' +import ExploreKnowledgeBase from './exploreKnowledgeBase' +import Press from './press' const Index = () => { return ( @@ -14,40 +14,44 @@ const Index = () => { as="h3" sx={{ fontSize: [3, null, 4], - lineHeight: "body", - mb: [4, null, 5], - }} - > - Polis is a real-time system for gathering, analyzing and understanding what large groups of - people think in their own words, enabled by advanced statistics and machine learning. + lineHeight: 'body', + mb: [4, null, 5] + }}> + Polis is a real-time system for gathering, analyzing and understanding + what large groups of people think in their own words, enabled by + advanced statistics and machine learning. - Polis has been used all over the world by governments, academics, independent media and - citizens, and is completely open source. + Polis has been used all over the world by governments, academics, + independent media and citizens, and is completely open source. - + Get Started Sign up - {" or "} + {' or '} Sign in - + Contribute - Explore the code and join the community{" "} + Explore the code and join the community{' '} on Github - ); -}; + ) +} -export default Index; +export default Index diff --git a/client-admin/src/components/landers/knowledgeBase.js b/client-admin/src/components/landers/knowledgeBase.js index fcd1a96fa..ca9630d5c 100644 --- a/client-admin/src/components/landers/knowledgeBase.js +++ b/client-admin/src/components/landers/knowledgeBase.js @@ -1,6 +1,6 @@ -import React from "react"; -import { Box, Link, Styled } from "theme-ui"; -import emoji from "react-easy-emoji"; +import React from 'react' +import { Box, Link, Styled } from 'theme-ui' +import emoji from 'react-easy-emoji' const KnowledgeBase = ({ e, url, txt }) => { return ( @@ -10,7 +10,7 @@ const KnowledgeBase = ({ e, url, txt }) => { {txt} - ); -}; + ) +} -export default KnowledgeBase; +export default KnowledgeBase diff --git a/client-admin/src/components/landers/lander-footer.js b/client-admin/src/components/landers/lander-footer.js index f1bedb04c..47fbac72e 100644 --- a/client-admin/src/components/landers/lander-footer.js +++ b/client-admin/src/components/landers/lander-footer.js @@ -1,31 +1,33 @@ /** @jsx jsx */ -import { Component } from "react"; -import { Box, Link, Heading } from "theme-ui"; -import { jsx } from "theme-ui"; -import emoji from "react-easy-emoji"; +import { Component } from 'react' +import { Box, Link, Heading, jsx } from 'theme-ui' + +import emoji from 'react-easy-emoji' class Header extends Component { constructor(props) { - super(props); + super(props) } render() { return ( - + Legal - - Polis is built for the public with {emoji("❀️")} in Seattle {emoji("πŸ‡ΊπŸ‡Έ")}, with - contributions from around the {emoji("🌍🌏🌎")} + + Polis is built for the public with {emoji('❀️')} in Seattle{' '} + {emoji('πŸ‡ΊπŸ‡Έ')}, with contributions from around the {emoji('🌍🌏🌎')} - Β© {new Date().getFullYear()} The Authors TOS{" "} + Β© {new Date().getFullYear()} The Authors TOS{' '} Privacy - ); + ) } } -export default Header; +export default Header diff --git a/client-admin/src/components/landers/lander-header.js b/client-admin/src/components/landers/lander-header.js index 7c1efa919..1d1d67a58 100644 --- a/client-admin/src/components/landers/lander-header.js +++ b/client-admin/src/components/landers/lander-header.js @@ -1,9 +1,9 @@ /** @jsx jsx */ -import { Component } from "react"; -import { Flex, Box } from "theme-ui"; -import { jsx } from "theme-ui"; -import { Link } from "react-router-dom"; -import Logomark from "../framework/logomark"; +import { Component } from 'react' +import { Flex, Box, jsx } from 'theme-ui' + +import { Link } from 'react-router-dom' +import Logomark from '../framework/logomark' class Header extends Component { render() { @@ -12,30 +12,29 @@ class Header extends Component { + width: '100%', + paddingTop: '2rem', + paddingBottom: '1.45rem', + justifyContent: 'space-between' + }}> - + Polis - + Sign in - ); + ) } } -export default Header; +export default Header diff --git a/client-admin/src/components/landers/lander-layout.js b/client-admin/src/components/landers/lander-layout.js index 15a5682d8..2ab6b2bb4 100644 --- a/client-admin/src/components/landers/lander-layout.js +++ b/client-admin/src/components/landers/lander-layout.js @@ -1,23 +1,22 @@ -import React from "react"; -import Header from "./lander-header"; -import Footer from "./lander-footer"; -import { Box } from "theme-ui"; +import React from 'react' +import Header from './lander-header' +import Footer from './lander-footer' +import { Box } from 'theme-ui' const Layout = ({ children }) => { - const globalWidth = "45em"; + const globalWidth = '45em' return ( + padding: `0 1.0875rem 1.45rem` + }}>
{children}
- ); -}; + ) +} -export default Layout; +export default Layout diff --git a/client-admin/src/components/landers/press.js b/client-admin/src/components/landers/press.js index 260801403..b9cf0da25 100644 --- a/client-admin/src/components/landers/press.js +++ b/client-admin/src/components/landers/press.js @@ -1,56 +1,60 @@ -import React from "react"; -import { Box, Link, Heading } from "theme-ui"; +import React from 'react' +import { Box, Link, Heading } from 'theme-ui' const Press = () => { return ( - + Read - - Press coverage from{" "} + + Press coverage from{' '} + href="https://www.nytimes.com/2019/10/15/opinion/taiwan-digital-democracy.html"> The New York Times - ,{" "} + ,{' '} + href="https://www.technologyreview.com/2018/08/21/240284/the-simple-but-ingenious-system-taiwan-uses-to-crowdsource-its-laws/"> MIT Tech Review - ,{" "} - + ,{' '} + Wired - ,{" "} + ,{' '} + href="https://www.economist.com/open-future/2019/03/22/technology-and-political-will-can-create-better-governance"> The Economist - ,{" "} + ,{' '} + href="https://www.centreforpublicimpact.org/case-study/building-consensus-compromise-uber-taiwan/#evidence"> Center for Public Impact - ,{" "} - + ,{' '} + Civicist - ,{" and a mini documentary from "} - + ,{' and a mini documentary from '} + BBC - ); -}; + ) +} -export default Press; +export default Press diff --git a/client-admin/src/components/landers/privacy.js b/client-admin/src/components/landers/privacy.js index d85617676..731191f4f 100644 --- a/client-admin/src/components/landers/privacy.js +++ b/client-admin/src/components/landers/privacy.js @@ -1,17 +1,17 @@ // Copyright (C) 2012-present, The Authors. This program is free software: you can redistribute it and/or modify it under the terms of the GNU Affero General Public License, version 3, as published by the Free Software Foundation. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Affero General Public License for more details. You should have received a copy of the GNU Affero General Public License along with this program. If not, see . -import React from "react"; -import StaticLayout from "./lander-layout"; -import PrivacyContent from "../../content/privacy.md" +import React from 'react' +import StaticLayout from './lander-layout' +import PrivacyContent from '../../content/privacy.md' class Privacy extends React.Component { render() { return ( - + - ); + ) } } -export default Privacy; +export default Privacy diff --git a/client-admin/src/components/landers/tos.js b/client-admin/src/components/landers/tos.js index f19e849b2..d6db6af52 100644 --- a/client-admin/src/components/landers/tos.js +++ b/client-admin/src/components/landers/tos.js @@ -1,17 +1,17 @@ // Copyright (C) 2012-present, The Authors. This program is free software: you can redistribute it and/or modify it under the terms of the GNU Affero General Public License, version 3, as published by the Free Software Foundation. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Affero General Public License for more details. You should have received a copy of the GNU Affero General Public License along with this program. If not, see . -import React from "react"; -import StaticLayout from "./lander-layout"; -import TOSContent from "../../content/tos.md"; +import React from 'react' +import StaticLayout from './lander-layout' +import TOSContent from '../../content/tos.md' class TOS extends React.Component { render() { return ( - + - ); + ) } } -export default TOS; +export default TOS diff --git a/client-admin/src/index.js b/client-admin/src/index.js index 39fc0f665..1bab7cfc1 100644 --- a/client-admin/src/index.js +++ b/client-admin/src/index.js @@ -1,19 +1,19 @@ // Copyright (C) 2012-present, The Authors. This program is free software: you can redistribute it and/or modify it under the terms of the GNU Affero General Public License, version 3, as published by the Free Software Foundation. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Affero General Public License for more details. You should have received a copy of the GNU Affero General Public License along with this program. If not, see . -import $ from "jquery"; +import $ from 'jquery' -import React from "react"; -import ReactDOM from "react-dom"; -import { Provider } from "react-redux"; +import React from 'react' +import ReactDOM from 'react-dom' +import { Provider } from 'react-redux' -import configureStore from "./store"; -import { ThemeProvider } from "theme-ui"; -import theme from "./theme"; -import App from "./app"; +import configureStore from './store' +import { ThemeProvider } from 'theme-ui' +import theme from './theme' +import App from './app' -import { BrowserRouter as Router, Route } from "react-router-dom"; +import { BrowserRouter as Router, Route } from 'react-router-dom' -const store = configureStore(); +const store = configureStore() class Root extends React.Component { render() { @@ -21,14 +21,14 @@ class Root extends React.Component { - }> + }> - ); + ) } } -window.$ = $; +window.$ = $ -ReactDOM.render(, document.getElementById("root")); +ReactDOM.render(, document.getElementById('root')) diff --git a/client-admin/src/reducers/REDUCER_TEMPLATE.js b/client-admin/src/reducers/REDUCER_TEMPLATE.js index eef2445c8..0eb48203b 100644 --- a/client-admin/src/reducers/REDUCER_TEMPLATE.js +++ b/client-admin/src/reducers/REDUCER_TEMPLATE.js @@ -1,32 +1,35 @@ // Copyright (C) 2012-present, The Authors. This program is free software: you can redistribute it and/or modify it under the terms of the GNU Affero General Public License, version 3, as published by the Free Software Foundation. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Affero General Public License for more details. You should have received a copy of the GNU Affero General Public License along with this program. If not, see . -import * as types from "../actions"; +import * as types from '../actions' -const ReducerTitle = (state = { - loading: false, - qux: null, - error: null -}, action) => { +const ReducerTitle = ( + state = { + loading: false, + qux: null, + error: null + }, + action +) => { switch (action.type) { - case types.REQUEST_FOO: - return Object.assign({}, state, { - loading: true, - error: null - }); - case types.RECEIVE_FOO: - return Object.assign({}, state, { - loading: false, - error: null, - qux: action.data - }); - case types.FOO_FETCH_ERROR: - return Object.assign({}, state, { - loading: false, - error: action.data - }); - default: - return state; + case types.REQUEST_FOO: + return Object.assign({}, state, { + loading: true, + error: null + }) + case types.RECEIVE_FOO: + return Object.assign({}, state, { + loading: false, + error: null, + qux: action.data + }) + case types.FOO_FETCH_ERROR: + return Object.assign({}, state, { + loading: false, + error: action.data + }) + default: + return state } -}; +} -export default ReducerTitle; +export default ReducerTitle diff --git a/client-admin/src/reducers/comments.js b/client-admin/src/reducers/comments.js index 11b74c3fe..2d7664610 100644 --- a/client-admin/src/reducers/comments.js +++ b/client-admin/src/reducers/comments.js @@ -1,33 +1,36 @@ // Copyright (C) 2012-present, The Authors. This program is free software: you can redistribute it and/or modify it under the terms of the GNU Affero General Public License, version 3, as published by the Free Software Foundation. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Affero General Public License for more details. You should have received a copy of the GNU Affero General Public License along with this program. If not, see . -import * as types from "../actions"; -import _ from "lodash"; +import * as types from '../actions' +import _ from 'lodash' -const accepted_comments = (state = { - loading: false, - comments: null, - error: null -}, action) => { +const accepted_comments = ( + state = { + loading: false, + comments: null, + error: null + }, + action +) => { switch (action.type) { - case types.REQUEST_COMMENTS: - return Object.assign({}, state, { - loading: true, - error: null - }); - case types.RECEIVE_COMMENTS: - return Object.assign({}, state, { - loading: false, - error: null, - comments: _.sortBy(action.data, "tid") - }); - case types.COMMENTS_FETCH_ERROR: - return Object.assign({}, state, { - loading: false, - error: action.data - }); - default: - return state; + case types.REQUEST_COMMENTS: + return Object.assign({}, state, { + loading: true, + error: null + }) + case types.RECEIVE_COMMENTS: + return Object.assign({}, state, { + loading: false, + error: null, + comments: _.sortBy(action.data, 'tid') + }) + case types.COMMENTS_FETCH_ERROR: + return Object.assign({}, state, { + loading: false, + error: action.data + }) + default: + return state } -}; +} -export default accepted_comments; +export default accepted_comments diff --git a/client-admin/src/reducers/conversation_config.js b/client-admin/src/reducers/conversation_config.js index 840a2eea3..d22e83acc 100644 --- a/client-admin/src/reducers/conversation_config.js +++ b/client-admin/src/reducers/conversation_config.js @@ -1,17 +1,19 @@ // Copyright (C) 2012-present, The Authors. This program is free software: you can redistribute it and/or modify it under the terms of the GNU Affero General Public License, version 3, as published by the Free Software Foundation. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Affero General Public License for more details. You should have received a copy of the GNU Affero General Public License along with this program. If not, see . -import * as types from "../actions"; +import * as types from '../actions' -const conversation_config = (state = { - loading: false, - conversation_config: null, - update_error: null -}, action) => { +const conversation_config = ( + state = { + loading: false, + conversation_config: null, + update_error: null + }, + action +) => { switch (action.type) { - - default: - return state; + default: + return state } -}; +} -export default conversation_config; +export default conversation_config diff --git a/client-admin/src/reducers/conversations.js b/client-admin/src/reducers/conversations.js index da2ec1ee9..3f890d4db 100644 --- a/client-admin/src/reducers/conversations.js +++ b/client-admin/src/reducers/conversations.js @@ -1,33 +1,36 @@ // Copyright (C) 2012-present, The Authors. This program is free software: you can redistribute it and/or modify it under the terms of the GNU Affero General Public License, version 3, as published by the Free Software Foundation. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Affero General Public License for more details. You should have received a copy of the GNU Affero General Public License along with this program. If not, see . -import * as types from "../actions"; +import * as types from '../actions' -const conversations = (state = { - loading: false, - error: false, - conversations: null -}, action) => { +const conversations = ( + state = { + loading: false, + error: false, + conversations: null + }, + action +) => { switch (action.type) { - case types.REQUEST_CONVERSATIONS: - return Object.assign({}, state, { - loading: true, - error: false, - }); - case types.RECEIVE_CONVERSATIONS: - return Object.assign({}, state, { - loading: false, - error: false, - conversations: action.data - }); - case types.CONVERSATIONS_FETCH_ERROR: - return Object.assign({}, state, { - loading: false, - error: action.data, - conversations: null - }) - default: - return state; + case types.REQUEST_CONVERSATIONS: + return Object.assign({}, state, { + loading: true, + error: false + }) + case types.RECEIVE_CONVERSATIONS: + return Object.assign({}, state, { + loading: false, + error: false, + conversations: action.data + }) + case types.CONVERSATIONS_FETCH_ERROR: + return Object.assign({}, state, { + loading: false, + error: action.data, + conversations: null + }) + default: + return state } -}; +} -export default conversations; +export default conversations diff --git a/client-admin/src/reducers/index.js b/client-admin/src/reducers/index.js index a96ffb28f..55f123b13 100644 --- a/client-admin/src/reducers/index.js +++ b/client-admin/src/reducers/index.js @@ -1,24 +1,23 @@ // Copyright (C) 2012-present, The Authors. This program is free software: you can redistribute it and/or modify it under the terms of the GNU Affero General Public License, version 3, as published by the Free Software Foundation. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Affero General Public License for more details. You should have received a copy of the GNU Affero General Public License along with this program. If not, see . -import { combineReducers } from "redux"; -import conversations from "./conversations"; -import user from "./user"; -import zid_metadata from "./zid_metadata"; -import mod_comments_accepted from "./mod_comments_accepted"; -import mod_comments_rejected from "./mod_comments_rejected"; -import mod_comments_unmoderated from "./mod_comments_unmoderated"; -import mod_ptpt_default from "./mod_ptpt_default"; -import mod_ptpt_featured from "./mod_ptpt_featured"; -import mod_ptpt_hidden from "./mod_ptpt_hidden"; -import stats from "./stats"; -import seed_comments from "./seed_comments"; -import seed_comments_tweet from "./seed_comments_tweet"; -import signout from "./signout"; -import signin from "./signin"; -import comments from "./comments"; -import math from "./math"; -import participants from "./participants"; - +import { combineReducers } from 'redux' +import conversations from './conversations' +import user from './user' +import zid_metadata from './zid_metadata' +import mod_comments_accepted from './mod_comments_accepted' +import mod_comments_rejected from './mod_comments_rejected' +import mod_comments_unmoderated from './mod_comments_unmoderated' +import mod_ptpt_default from './mod_ptpt_default' +import mod_ptpt_featured from './mod_ptpt_featured' +import mod_ptpt_hidden from './mod_ptpt_hidden' +import stats from './stats' +import seed_comments from './seed_comments' +import seed_comments_tweet from './seed_comments_tweet' +import signout from './signout' +import signin from './signin' +import comments from './comments' +import math from './math' +import participants from './participants' const rootReducer = combineReducers({ conversations, @@ -38,6 +37,6 @@ const rootReducer = combineReducers({ stats, signout, signin -}); +}) -export default rootReducer; +export default rootReducer diff --git a/client-admin/src/reducers/math.js b/client-admin/src/reducers/math.js index 34b827624..c1621b9b1 100644 --- a/client-admin/src/reducers/math.js +++ b/client-admin/src/reducers/math.js @@ -1,34 +1,37 @@ // Copyright (C) 2012-present, The Authors. This program is free software: you can redistribute it and/or modify it under the terms of the GNU Affero General Public License, version 3, as published by the Free Software Foundation. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Affero General Public License for more details. You should have received a copy of the GNU Affero General Public License along with this program. If not, see . -import * as types from "../actions"; +import * as types from '../actions' -const Math = (state = { - loading: false, - math: null, - math_tick: -1, - error: null -}, action) => { +const Math = ( + state = { + loading: false, + math: null, + math_tick: -1, + error: null + }, + action +) => { switch (action.type) { - case types.REQUEST_MATH: - return Object.assign({}, state, { - loading: true, - error: null - }); - case types.RECEIVE_MATH: - return Object.assign({}, state, { - loading: false, - error: null, - math: action.data, - math_tick: action.data.math_tick, - }); - case types.MATH_FETCH_ERROR: - return Object.assign({}, state, { - loading: false, - error: action.data - }); - default: - return state; + case types.REQUEST_MATH: + return Object.assign({}, state, { + loading: true, + error: null + }) + case types.RECEIVE_MATH: + return Object.assign({}, state, { + loading: false, + error: null, + math: action.data, + math_tick: action.data.math_tick + }) + case types.MATH_FETCH_ERROR: + return Object.assign({}, state, { + loading: false, + error: action.data + }) + default: + return state } -}; +} -export default Math; +export default Math diff --git a/client-admin/src/reducers/mod_comments_accepted.js b/client-admin/src/reducers/mod_comments_accepted.js index 1fc3db42b..ebe297fb1 100644 --- a/client-admin/src/reducers/mod_comments_accepted.js +++ b/client-admin/src/reducers/mod_comments_accepted.js @@ -1,24 +1,27 @@ // Copyright (C) 2012-present, The Authors. This program is free software: you can redistribute it and/or modify it under the terms of the GNU Affero General Public License, version 3, as published by the Free Software Foundation. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Affero General Public License for more details. You should have received a copy of the GNU Affero General Public License along with this program. If not, see . -import * as types from "../actions"; +import * as types from '../actions' -const accepted_comments = (state = { - loading: false, - accepted_comments: null -}, action) => { +const accepted_comments = ( + state = { + loading: false, + accepted_comments: null + }, + action +) => { switch (action.type) { - case types.REQUEST_ACCEPTED_COMMENTS: - return Object.assign({}, state, { - loading: true - }); - case types.RECEIVE_ACCEPTED_COMMENTS: - return Object.assign({}, state, { - loading: false, - accepted_comments: action.data - }); - default: - return state; + case types.REQUEST_ACCEPTED_COMMENTS: + return Object.assign({}, state, { + loading: true + }) + case types.RECEIVE_ACCEPTED_COMMENTS: + return Object.assign({}, state, { + loading: false, + accepted_comments: action.data + }) + default: + return state } -}; +} -export default accepted_comments; +export default accepted_comments diff --git a/client-admin/src/reducers/mod_comments_rejected.js b/client-admin/src/reducers/mod_comments_rejected.js index 37e89c7f2..f579379ed 100644 --- a/client-admin/src/reducers/mod_comments_rejected.js +++ b/client-admin/src/reducers/mod_comments_rejected.js @@ -1,24 +1,27 @@ // Copyright (C) 2012-present, The Authors. This program is free software: you can redistribute it and/or modify it under the terms of the GNU Affero General Public License, version 3, as published by the Free Software Foundation. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Affero General Public License for more details. You should have received a copy of the GNU Affero General Public License along with this program. If not, see . -import * as types from "../actions"; +import * as types from '../actions' -const rejected_comments = (state = { - loading: false, - rejected_comments: null -}, action) => { +const rejected_comments = ( + state = { + loading: false, + rejected_comments: null + }, + action +) => { switch (action.type) { - case types.REQUEST_REJECTED_COMMENTS: - return Object.assign({}, state, { - loading: true - }); - case types.RECEIVE_REJECTED_COMMENTS: - return Object.assign({}, state, { - loading: false, - rejected_comments: action.data - }); - default: - return state; + case types.REQUEST_REJECTED_COMMENTS: + return Object.assign({}, state, { + loading: true + }) + case types.RECEIVE_REJECTED_COMMENTS: + return Object.assign({}, state, { + loading: false, + rejected_comments: action.data + }) + default: + return state } -}; +} -export default rejected_comments; +export default rejected_comments diff --git a/client-admin/src/reducers/mod_comments_unmoderated.js b/client-admin/src/reducers/mod_comments_unmoderated.js index e70c40284..3e4726ec2 100644 --- a/client-admin/src/reducers/mod_comments_unmoderated.js +++ b/client-admin/src/reducers/mod_comments_unmoderated.js @@ -1,24 +1,27 @@ // Copyright (C) 2012-present, The Authors. This program is free software: you can redistribute it and/or modify it under the terms of the GNU Affero General Public License, version 3, as published by the Free Software Foundation. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Affero General Public License for more details. You should have received a copy of the GNU Affero General Public License along with this program. If not, see . -import * as types from "../actions"; +import * as types from '../actions' -const unmoderated_comments = (state = { - loading: false, - unmoderated_comments: null -}, action) => { +const unmoderated_comments = ( + state = { + loading: false, + unmoderated_comments: null + }, + action +) => { switch (action.type) { - case types.REQUEST_UNMODERATED_COMMENTS: - return Object.assign({}, state, { - loading: true - }); - case types.RECEIVE_UNMODERATED_COMMENTS: - return Object.assign({}, state, { - loading: false, - unmoderated_comments: action.data - }); - default: - return state; + case types.REQUEST_UNMODERATED_COMMENTS: + return Object.assign({}, state, { + loading: true + }) + case types.RECEIVE_UNMODERATED_COMMENTS: + return Object.assign({}, state, { + loading: false, + unmoderated_comments: action.data + }) + default: + return state } -}; +} -export default unmoderated_comments; +export default unmoderated_comments diff --git a/client-admin/src/reducers/mod_ptpt_default.js b/client-admin/src/reducers/mod_ptpt_default.js index 4e5aa507c..9866c637b 100644 --- a/client-admin/src/reducers/mod_ptpt_default.js +++ b/client-admin/src/reducers/mod_ptpt_default.js @@ -1,24 +1,27 @@ // Copyright (C) 2012-present, The Authors. This program is free software: you can redistribute it and/or modify it under the terms of the GNU Affero General Public License, version 3, as published by the Free Software Foundation. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Affero General Public License for more details. You should have received a copy of the GNU Affero General Public License along with this program. If not, see . -import * as types from "../actions"; +import * as types from '../actions' -const default_participants = (state = { - loading: false, - default_participants: null -}, action) => { +const default_participants = ( + state = { + loading: false, + default_participants: null + }, + action +) => { switch (action.type) { - case types.REQUEST_DEFAULT_PARTICIPANTS: - return Object.assign({}, state, { - loading: true - }); - case types.RECEIVE_DEFAULT_PARTICIPANTS: - return Object.assign({}, state, { - loading: false, - default_participants: action.data - }); - default: - return state; + case types.REQUEST_DEFAULT_PARTICIPANTS: + return Object.assign({}, state, { + loading: true + }) + case types.RECEIVE_DEFAULT_PARTICIPANTS: + return Object.assign({}, state, { + loading: false, + default_participants: action.data + }) + default: + return state } -}; +} -export default default_participants; +export default default_participants diff --git a/client-admin/src/reducers/mod_ptpt_featured.js b/client-admin/src/reducers/mod_ptpt_featured.js index 8409d5432..0b53a6ba8 100644 --- a/client-admin/src/reducers/mod_ptpt_featured.js +++ b/client-admin/src/reducers/mod_ptpt_featured.js @@ -1,24 +1,27 @@ // Copyright (C) 2012-present, The Authors. This program is free software: you can redistribute it and/or modify it under the terms of the GNU Affero General Public License, version 3, as published by the Free Software Foundation. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Affero General Public License for more details. You should have received a copy of the GNU Affero General Public License along with this program. If not, see . -import * as types from "../actions"; +import * as types from '../actions' -const featured_participants = (state = { - loading: false, - featured_participants: null -}, action) => { +const featured_participants = ( + state = { + loading: false, + featured_participants: null + }, + action +) => { switch (action.type) { - case types.REQUEST_FEATURED_PARTICIPANTS: - return Object.assign({}, state, { - loading: true - }); - case types.RECEIVE_FEATURED_PARTICIPANTS: - return Object.assign({}, state, { - loading: false, - featured_participants: action.data - }); - default: - return state; + case types.REQUEST_FEATURED_PARTICIPANTS: + return Object.assign({}, state, { + loading: true + }) + case types.RECEIVE_FEATURED_PARTICIPANTS: + return Object.assign({}, state, { + loading: false, + featured_participants: action.data + }) + default: + return state } -}; +} -export default featured_participants; +export default featured_participants diff --git a/client-admin/src/reducers/mod_ptpt_hidden.js b/client-admin/src/reducers/mod_ptpt_hidden.js index 204da81a4..2c218a4e0 100644 --- a/client-admin/src/reducers/mod_ptpt_hidden.js +++ b/client-admin/src/reducers/mod_ptpt_hidden.js @@ -1,24 +1,27 @@ // Copyright (C) 2012-present, The Authors. This program is free software: you can redistribute it and/or modify it under the terms of the GNU Affero General Public License, version 3, as published by the Free Software Foundation. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Affero General Public License for more details. You should have received a copy of the GNU Affero General Public License along with this program. If not, see . -import * as types from "../actions"; +import * as types from '../actions' -const hidden_participants = (state = { - loading: false, - hidden_participants: null -}, action) => { +const hidden_participants = ( + state = { + loading: false, + hidden_participants: null + }, + action +) => { switch (action.type) { - case types.REQUEST_HIDDEN_PARTICIPANTS: - return Object.assign({}, state, { - loading: true - }); - case types.RECEIVE_HIDDEN_PARTICIPANTS: - return Object.assign({}, state, { - loading: false, - hidden_participants: action.data - }); - default: - return state; + case types.REQUEST_HIDDEN_PARTICIPANTS: + return Object.assign({}, state, { + loading: true + }) + case types.RECEIVE_HIDDEN_PARTICIPANTS: + return Object.assign({}, state, { + loading: false, + hidden_participants: action.data + }) + default: + return state } -}; +} -export default hidden_participants; +export default hidden_participants diff --git a/client-admin/src/reducers/participants.js b/client-admin/src/reducers/participants.js index f51930efb..0bee815bf 100644 --- a/client-admin/src/reducers/participants.js +++ b/client-admin/src/reducers/participants.js @@ -1,32 +1,35 @@ // Copyright (C) 2012-present, The Authors. This program is free software: you can redistribute it and/or modify it under the terms of the GNU Affero General Public License, version 3, as published by the Free Software Foundation. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Affero General Public License for more details. You should have received a copy of the GNU Affero General Public License along with this program. If not, see . -import * as types from "../actions"; +import * as types from '../actions' -const Participants = (state = { - loading: false, - participants: null, - error: null -}, action) => { +const Participants = ( + state = { + loading: false, + participants: null, + error: null + }, + action +) => { switch (action.type) { - case types.REQUEST_PARTICIPANTS: - return Object.assign({}, state, { - loading: true, - error: null - }); - case types.RECEIVE_PARTICIPANTS: - return Object.assign({}, state, { - loading: false, - error: null, - participants: action.data - }); - case types.PARTICIPANTS_FETCH_ERROR: - return Object.assign({}, state, { - loading: false, - error: action.data - }); - default: - return state; + case types.REQUEST_PARTICIPANTS: + return Object.assign({}, state, { + loading: true, + error: null + }) + case types.RECEIVE_PARTICIPANTS: + return Object.assign({}, state, { + loading: false, + error: null, + participants: action.data + }) + case types.PARTICIPANTS_FETCH_ERROR: + return Object.assign({}, state, { + loading: false, + error: action.data + }) + default: + return state } -}; +} -export default Participants; +export default Participants diff --git a/client-admin/src/reducers/seed_comments.js b/client-admin/src/reducers/seed_comments.js index 413ee4d16..86e7d4ed0 100644 --- a/client-admin/src/reducers/seed_comments.js +++ b/client-admin/src/reducers/seed_comments.js @@ -1,43 +1,46 @@ // Copyright (C) 2012-present, The Authors. This program is free software: you can redistribute it and/or modify it under the terms of the GNU Affero General Public License, version 3, as published by the Free Software Foundation. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Affero General Public License for more details. You should have received a copy of the GNU Affero General Public License along with this program. If not, see . -import * as types from "../actions"; +import * as types from '../actions' -const seed_comments = (state = { - seedText: "", - loading: false, - error: false, - success: false, -}, action) => { +const seed_comments = ( + state = { + seedText: '', + loading: false, + error: false, + success: false + }, + action +) => { switch (action.type) { - case types.SEED_COMMENT_LOCAL_UPDATE: - return Object.assign({}, state, { - loading: false, - error: false, - seedText: action.text, - success: false - }); - case types.SUBMIT_SEED_COMMENT: - return Object.assign({}, state, { - loading: true, - error: false, - success: false - }); - case types.SUBMIT_SEED_COMMENT_SUCCESS: - return Object.assign({}, state, { - loading: false, - seedText: "", - error: false, - success: true - }); - case types.SUBMIT_SEED_COMMENT_ERROR: - return Object.assign({}, state, { - loading: false, - error: action.data.responseText, - success: false - }); - default: - return state; + case types.SEED_COMMENT_LOCAL_UPDATE: + return Object.assign({}, state, { + loading: false, + error: false, + seedText: action.text, + success: false + }) + case types.SUBMIT_SEED_COMMENT: + return Object.assign({}, state, { + loading: true, + error: false, + success: false + }) + case types.SUBMIT_SEED_COMMENT_SUCCESS: + return Object.assign({}, state, { + loading: false, + seedText: '', + error: false, + success: true + }) + case types.SUBMIT_SEED_COMMENT_ERROR: + return Object.assign({}, state, { + loading: false, + error: action.data.responseText, + success: false + }) + default: + return state } -}; +} -export default seed_comments; +export default seed_comments diff --git a/client-admin/src/reducers/seed_comments_tweet.js b/client-admin/src/reducers/seed_comments_tweet.js index 5b1df8d32..b434e4559 100644 --- a/client-admin/src/reducers/seed_comments_tweet.js +++ b/client-admin/src/reducers/seed_comments_tweet.js @@ -1,42 +1,45 @@ // Copyright (C) 2012-present, The Authors. This program is free software: you can redistribute it and/or modify it under the terms of the GNU Affero General Public License, version 3, as published by the Free Software Foundation. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Affero General Public License for more details. You should have received a copy of the GNU Affero General Public License along with this program. If not, see . -import * as types from "../actions"; +import * as types from '../actions' -const seed_comments_tweet = (state = { - seedText: "", - loading: false, - error: false, - success: false, -}, action) => { +const seed_comments_tweet = ( + state = { + seedText: '', + loading: false, + error: false, + success: false + }, + action +) => { switch (action.type) { - case types.SEED_COMMENT_TWEET_LOCAL_UPDATE: - return Object.assign({}, state, { - loading: false, - error: false, - seedTweetText: action.text, - success: false - }); - case types.SUBMIT_SEED_COMMENT_TWEET: - return Object.assign({}, state, { - loading: true, - error: false, - }); - case types.SUBMIT_SEED_COMMENT_TWEET_SUCCESS: - return Object.assign({}, state, { - seedTweetText: "", - loading: false, - error: false, - success: true, - }); - case types.SUBMIT_SEED_COMMENT_TWEET_ERROR: { - return Object.assign({}, state, { - loading: false, - error: action.data.responseText, - }); + case types.SEED_COMMENT_TWEET_LOCAL_UPDATE: + return Object.assign({}, state, { + loading: false, + error: false, + seedTweetText: action.text, + success: false + }) + case types.SUBMIT_SEED_COMMENT_TWEET: + return Object.assign({}, state, { + loading: true, + error: false + }) + case types.SUBMIT_SEED_COMMENT_TWEET_SUCCESS: + return Object.assign({}, state, { + seedTweetText: '', + loading: false, + error: false, + success: true + }) + case types.SUBMIT_SEED_COMMENT_TWEET_ERROR: { + return Object.assign({}, state, { + loading: false, + error: action.data.responseText + }) + } + default: + return state } - default: - return state; - } -}; +} -export default seed_comments_tweet; +export default seed_comments_tweet diff --git a/client-admin/src/reducers/signin.js b/client-admin/src/reducers/signin.js index 1359513c9..367f331ed 100644 --- a/client-admin/src/reducers/signin.js +++ b/client-admin/src/reducers/signin.js @@ -1,6 +1,6 @@ // Copyright (C) 2012-present, The Authors. This program is free software: you can redistribute it and/or modify it under the terms of the GNU Affero General Public License, version 3, as published by the Free Software Foundation. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Affero General Public License for more details. You should have received a copy of the GNU Affero General Public License along with this program. If not, see . -import * as types from "../actions"; +import * as types from '../actions' const signin = ( state = { @@ -8,7 +8,7 @@ const signin = ( facebookLoading: false, signInSuccessful: false, error: false, - facebookError: false, + facebookError: false }, action ) => { @@ -18,71 +18,71 @@ const signin = ( loading: false, facebookLoading: true, error: false, - facebookError: false, - }); + facebookError: false + }) case types.FACEBOOK_SIGNIN_SUCCESSFUL: return Object.assign({}, state, { loading: false, facebookLoading: false, error: false, - facebookError: false, - }); + facebookError: false + }) case types.FACEBOOK_SIGNIN_FAILED: return Object.assign({}, state, { loading: false, facebookLoading: false, error: false, - facebookError: action.errorCode, - }); + facebookError: action.errorCode + }) case types.SIGNIN_INITIATED: return Object.assign({}, state, { loading: false, pending: true, facebookLoading: false, - error: false, - }); + error: false + }) - case "signin reset state": + case 'signin reset state': return Object.assign({}, state, { loading: false, pending: false, signInSuccessful: false, facebookLoading: false, - error: false, - }); - case "signin completed successfully": + error: false + }) + case 'signin completed successfully': return Object.assign({}, state, { loading: false, pending: false, signInSuccessful: true, facebookLoading: false, - error: false, - }); + error: false + }) case types.SIGNIN_ERROR: return Object.assign({}, state, { loading: false, pending: false, facebookLoading: false, - error: action.data, - }); + error: action.data + }) case types.CREATEUSER_INITIATED: return Object.assign({}, state, { loading: false, pending: true, facebookLoading: false, - error: false, - }); + error: false + }) case types.CREATEUSER_ERROR: return Object.assign({}, state, { loading: false, pending: false, facebookLoading: false, - error: action.data, - }); + error: action.data + }) default: - return state; + return state } -}; +} -export default signin; +export default signin diff --git a/client-admin/src/reducers/signout.js b/client-admin/src/reducers/signout.js index 7728ac759..308f185bd 100644 --- a/client-admin/src/reducers/signout.js +++ b/client-admin/src/reducers/signout.js @@ -1,33 +1,36 @@ // Copyright (C) 2012-present, The Authors. This program is free software: you can redistribute it and/or modify it under the terms of the GNU Affero General Public License, version 3, as published by the Free Software Foundation. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Affero General Public License for more details. You should have received a copy of the GNU Affero General Public License along with this program. If not, see . -import * as types from "../actions"; +import * as types from '../actions' -const signout = (state = { - loading: false, - signout: false, - error: false -}, action) => { +const signout = ( + state = { + loading: false, + signout: false, + error: false + }, + action +) => { switch (action.type) { - case types.SIGNOUT_INITIATED: - return Object.assign({}, state, { - loading: true, - error: false - }); - case types.SIGNOUT_SUCCESSFUL: - return Object.assign({}, state, { - loading: false, - signout: true, - error: false - }); - case types.SIGNOUT_SUCCESSFUL: - return Object.assign({}, state, { - loading: false, - signout: false, - error: true - }); - default: - return state; + case types.SIGNOUT_INITIATED: + return Object.assign({}, state, { + loading: true, + error: false + }) + case types.SIGNOUT_SUCCESSFUL: + return Object.assign({}, state, { + loading: false, + signout: true, + error: false + }) + case types.SIGNOUT_SUCCESSFUL: + return Object.assign({}, state, { + loading: false, + signout: false, + error: true + }) + default: + return state } -}; +} -export default signout; +export default signout diff --git a/client-admin/src/reducers/stats.js b/client-admin/src/reducers/stats.js index c59ba7306..296b9b9e9 100644 --- a/client-admin/src/reducers/stats.js +++ b/client-admin/src/reducers/stats.js @@ -1,24 +1,27 @@ // Copyright (C) 2012-present, The Authors. This program is free software: you can redistribute it and/or modify it under the terms of the GNU Affero General Public License, version 3, as published by the Free Software Foundation. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Affero General Public License for more details. You should have received a copy of the GNU Affero General Public License along with this program. If not, see . -import * as types from "../actions"; +import * as types from '../actions' -const conversation_stats = (state = { - loading: false, - conversation_stats: {}, -}, action) => { +const conversation_stats = ( + state = { + loading: false, + conversation_stats: {} + }, + action +) => { switch (action.type) { - case types.REQUEST_CONVERSATION_STATS: - return Object.assign({}, state, { - loading: true - }); - case types.RECEIVE_CONVERSATION_STATS: - return Object.assign({}, state, { - loading: false, - conversation_stats: action.data - }); - default: - return state; + case types.REQUEST_CONVERSATION_STATS: + return Object.assign({}, state, { + loading: true + }) + case types.RECEIVE_CONVERSATION_STATS: + return Object.assign({}, state, { + loading: false, + conversation_stats: action.data + }) + default: + return state } -}; +} -export default conversation_stats; +export default conversation_stats diff --git a/client-admin/src/reducers/user.js b/client-admin/src/reducers/user.js index 23a2c9d88..635afd544 100644 --- a/client-admin/src/reducers/user.js +++ b/client-admin/src/reducers/user.js @@ -1,36 +1,39 @@ // Copyright (C) 2012-present, The Authors. This program is free software: you can redistribute it and/or modify it under the terms of the GNU Affero General Public License, version 3, as published by the Free Software Foundation. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Affero General Public License for more details. You should have received a copy of the GNU Affero General Public License along with this program. If not, see . -import * as types from "../actions"; +import * as types from '../actions' -const user = (state = { - loading: false, - user: null, - error: false, - isLoggedIn: undefined -}, action) => { +const user = ( + state = { + loading: false, + user: null, + error: false, + isLoggedIn: undefined + }, + action +) => { switch (action.type) { - case types.REQUEST_USER: - return Object.assign({}, state, { - loading: true - }); - case types.RECEIVE_USER: - return Object.assign({}, state, { - loading: false, - user: action.data, - isLoggedIn: !!action.data.email || !!action.data.xInfo, - error: false - }); - case types.USER_FETCH_ERROR: - return Object.assign({}, state, { - loading: false, - user: null, - error: true, - status: action.status, - isLoggedIn: false - }); - default: - return state; + case types.REQUEST_USER: + return Object.assign({}, state, { + loading: true + }) + case types.RECEIVE_USER: + return Object.assign({}, state, { + loading: false, + user: action.data, + isLoggedIn: !!action.data.email || !!action.data.xInfo, + error: false + }) + case types.USER_FETCH_ERROR: + return Object.assign({}, state, { + loading: false, + user: null, + error: true, + status: action.status, + isLoggedIn: false + }) + default: + return state } -}; +} -export default user; +export default user diff --git a/client-admin/src/reducers/zid_metadata.js b/client-admin/src/reducers/zid_metadata.js index 280c4bf7c..1de7a3d77 100644 --- a/client-admin/src/reducers/zid_metadata.js +++ b/client-admin/src/reducers/zid_metadata.js @@ -1,58 +1,61 @@ // Copyright (C) 2012-present, The Authors. This program is free software: you can redistribute it and/or modify it under the terms of the GNU Affero General Public License, version 3, as published by the Free Software Foundation. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Affero General Public License for more details. You should have received a copy of the GNU Affero General Public License along with this program. If not, see . -import * as types from "../actions"; +import * as types from '../actions' -const zid = (state = { - loading: false, - zid_metadata: {}, - error: null, - optimistic: 0 /* `h4x0rz` trigger render because shallow comparison https://github.com/reactjs/redux/issues/585 */ -}, action) => { +const zid = ( + state = { + loading: false, + zid_metadata: {}, + error: null, + optimistic: 0 /* `h4x0rz` trigger render because shallow comparison https://github.com/reactjs/redux/issues/585 */ + }, + action +) => { switch (action.type) { - case types.REQUEST_ZID_METADATA: - return Object.assign({}, state, { - conversation_id: action.data.conversation_id, - loading: true, - error: null - }); - case types.RECEIVE_ZID_METADATA: - return Object.assign({}, state, { - loading: false, - zid_metadata: action.data, - error: null - }); - case types.ZID_METADATA_RESET: - return Object.assign({}, state, { - loading: false, - zid_metadata: {}, - error: null - }); - case types.OPTIMISTIC_ZID_METADATA_UPDATE: - return Object.assign({}, state, { - loading: false, - zid_metadata: action.data, - error: null, - optimistic: Math.random() - }) - case types.UPDATE_ZID_METADATA_STARTED: - return Object.assign({}, state, { - loading: true, - error: null - }); - case types.UPDATE_ZID_METADATA_SUCCESS: - return Object.assign({}, state, { - loading: false, - zid_metadata: action.data, - error: null - }); - case types.UPDATE_ZID_METADATA_ERROR: - return Object.assign({}, state, { - loading: false, - error: action.data - }); - default: - return state; + case types.REQUEST_ZID_METADATA: + return Object.assign({}, state, { + conversation_id: action.data.conversation_id, + loading: true, + error: null + }) + case types.RECEIVE_ZID_METADATA: + return Object.assign({}, state, { + loading: false, + zid_metadata: action.data, + error: null + }) + case types.ZID_METADATA_RESET: + return Object.assign({}, state, { + loading: false, + zid_metadata: {}, + error: null + }) + case types.OPTIMISTIC_ZID_METADATA_UPDATE: + return Object.assign({}, state, { + loading: false, + zid_metadata: action.data, + error: null, + optimistic: Math.random() + }) + case types.UPDATE_ZID_METADATA_STARTED: + return Object.assign({}, state, { + loading: true, + error: null + }) + case types.UPDATE_ZID_METADATA_SUCCESS: + return Object.assign({}, state, { + loading: false, + zid_metadata: action.data, + error: null + }) + case types.UPDATE_ZID_METADATA_ERROR: + return Object.assign({}, state, { + loading: false, + error: action.data + }) + default: + return state } -}; +} -export default zid; +export default zid diff --git a/client-admin/src/settings.js b/client-admin/src/settings.js index 3474c9583..c5a440333 100644 --- a/client-admin/src/settings.js +++ b/client-admin/src/settings.js @@ -1,37 +1,37 @@ // Copyright (C) 2012-present, The Authors. This program is free software: you can redistribute it and/or modify it under the terms of the GNU Affero General Public License, version 3, as published by the Free Software Foundation. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Affero General Public License for more details. You should have received a copy of the GNU Affero General Public License along with this program. If not, see . const settings = { - polisBlue: "rgb(81, 171, 244)", - textColor: "#3e3e3e", - linkColor: "#777777", - darkColorBase: "#202020", - lightColorBase: "#F1F1F1", - clickCursor: "pointer", - linkHoverColor: "#3e3e3e", - highlightColor: "#006FC7", - transitionAll: "all ease .3s", - bgColorOffset: "#f8f8f8", - bgColorBase: "#ffffff", - borderColorBase: "#BEBEBE", + polisBlue: 'rgb(81, 171, 244)', + textColor: '#3e3e3e', + linkColor: '#777777', + darkColorBase: '#202020', + lightColorBase: '#F1F1F1', + clickCursor: 'pointer', + linkHoverColor: '#3e3e3e', + highlightColor: '#006FC7', + transitionAll: 'all ease .3s', + bgColorOffset: '#f8f8f8', + bgColorBase: '#ffffff', + borderColorBase: '#BEBEBE', borderRadiusBase: 4, - borderStyleBase: "solid", + borderStyleBase: 'solid', borderWidthBase: 1, - fontFamilyMonospace: "\"Courier New\", monospace", - fontFamilySansSerif: "\"Helvetica Neue\", Helvetica, Arial, sans-serif", + fontFamilyMonospace: '"Courier New", monospace', + fontFamilySansSerif: '"Helvetica Neue", Helvetica, Arial, sans-serif', fontSizeBase: 14, lineHeightBase: 1.428571429, lineHeightSmall: 1.3, - lightestGray: "#FFFFFF", - lighterGray: "#F6F6F6", - lightGray: "#F1F1F1", - mediumGray: "#E0E0E0", - gray: "#979B9F", - darkBlueGray: "#ACB1B8", - blueGray: "#BFC5CC", - darkGray: "#6C7277", - darkerGray: "#34383C", - darkestGray: "#1E2226", -}; + lightestGray: '#FFFFFF', + lighterGray: '#F6F6F6', + lightGray: '#F1F1F1', + mediumGray: '#E0E0E0', + gray: '#979B9F', + darkBlueGray: '#ACB1B8', + blueGray: '#BFC5CC', + darkGray: '#6C7277', + darkerGray: '#34383C', + darkestGray: '#1E2226' +} -export default settings; +export default settings diff --git a/client-admin/src/store/index.js b/client-admin/src/store/index.js index d54bf03d2..170caf8b6 100644 --- a/client-admin/src/store/index.js +++ b/client-admin/src/store/index.js @@ -1,16 +1,16 @@ // Copyright (C) 2012-present, The Authors. This program is free software: you can redistribute it and/or modify it under the terms of the GNU Affero General Public License, version 3, as published by the Free Software Foundation. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Affero General Public License for more details. You should have received a copy of the GNU Affero General Public License along with this program. If not, see . -import { createStore, applyMiddleware, compose } from "redux"; -import thunk from "redux-thunk"; +import { createStore, applyMiddleware, compose } from 'redux' +import thunk from 'redux-thunk' -import rootReducer from "../reducers"; +import rootReducer from '../reducers' -const middleware = [thunk]; +const middleware = [thunk] -const finalCreateStore = compose(applyMiddleware(...middleware))(createStore); +const finalCreateStore = compose(applyMiddleware(...middleware))(createStore) const configureStore = function (initialState) { - return finalCreateStore(rootReducer, initialState); -}; + return finalCreateStore(rootReducer, initialState) +} -export default configureStore; +export default configureStore diff --git a/client-admin/src/strings/en_us.js b/client-admin/src/strings/en_us.js index 90caed5e8..046617866 100644 --- a/client-admin/src/strings/en_us.js +++ b/client-admin/src/strings/en_us.js @@ -1,28 +1,33 @@ // Copyright (C) 2012-present, The Authors. This program is free software: you can redistribute it and/or modify it under the terms of the GNU Affero General Public License, version 3, as published by the Free Software Foundation. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Affero General Public License for more details. You should have received a copy of the GNU Affero General Public License along with this program. If not, see . -var s = {}; +var s = {} // login/createuser strings -s.polis_err_param_parse_failed_email = "Please enter a valid email address."; -s.polis_err_reg_bad_email = "Please enter a valid email address."; -s.polis_err_param_parse_failed_password = "Please enter a valid password."; +s.polis_err_param_parse_failed_email = 'Please enter a valid email address.' +s.polis_err_reg_bad_email = 'Please enter a valid email address.' +s.polis_err_param_parse_failed_password = 'Please enter a valid password.' s.polis_err_login_unknown_user_or_password_noresults = - "Login failed: invalid username/password combination."; -s.polis_err_login_unknown_user_or_password = "Login failed: invalid username/password combination."; + 'Login failed: invalid username/password combination.' +s.polis_err_login_unknown_user_or_password = + 'Login failed: invalid username/password combination.' s.polis_err_reg_user_with_that_email_exists = - "Email address already in use, Try logging in instead."; -s.polis_err_reg_need_name = "Please include your name."; + 'Email address already in use, Try logging in instead.' +s.polis_err_reg_need_name = 'Please include your name.' -s.polis_err_post_comment_duplicate = "Error posting: This comment already exists!"; -s.waitinglist_add_success = "You've been added to the waiting list! We'll be in touch."; +s.polis_err_post_comment_duplicate = + 'Error posting: This comment already exists!' +s.waitinglist_add_success = + "You've been added to the waiting list! We'll be in touch." -s.polis_err_fetching_tweet = "Error fetching tweet. Expected a URL to a twitter tweet."; +s.polis_err_fetching_tweet = + 'Error fetching tweet. Expected a URL to a twitter tweet.' s.share_but_no_comments_warning = - "This conversation has no comments. We recommend you add a few comments before inviting participants. This will help participants get started. Go to 'Configure' and then 'Seed Comments'."; + "This conversation has no comments. We recommend you add a few comments before inviting participants. This will help participants get started. Go to 'Configure' and then 'Seed Comments'." s.share_but_no_visible_comments_warning = - "This conversation has no visible comments. We recommend you add a few comments (or moderate the comments that exist) before inviting participants, since this will help them understand what kind of comments they should submit."; + 'This conversation has no visible comments. We recommend you add a few comments (or moderate the comments that exist) before inviting participants, since this will help them understand what kind of comments they should submit.' -s.no_permission = "Your account does not have the permissions to view this page."; +s.no_permission = + 'Your account does not have the permissions to view this page.' -export default s; +export default s diff --git a/client-admin/src/strings/footer.js b/client-admin/src/strings/footer.js index 7cbf74640..5a92fa8bb 100644 --- a/client-admin/src/strings/footer.js +++ b/client-admin/src/strings/footer.js @@ -1,43 +1,44 @@ export default { footer: { - copyright: "The Authors. All Rights Reserved.", - social: ["https://github.com/pol-is/", "https://twitter.com/usepolis"], + copyright: 'The Authors. All Rights Reserved.', + social: ['https://github.com/pol-is/', 'https://twitter.com/usepolis'], groups: [ { - heading: "Company", + heading: 'Company', links: [ { - title: "About", - url: "https://pol.is/company" + title: 'About', + url: 'https://pol.is/company' }, { - title: "Blog", - url: "https://blog.pol.is/" + title: 'Blog', + url: 'https://blog.pol.is/' } ] }, { - heading: "Support", + heading: 'Support', links: [ { - title: "FAQ", - url: "https://intercom.help/polis/frequently-asked-questions/polis-faq" + title: 'FAQ', + url: + 'https://intercom.help/polis/frequently-asked-questions/polis-faq' } ] }, { - heading: "Legal", + heading: 'Legal', links: [ { - title: "Terms", - url: "https://pol.is/tos" + title: 'Terms', + url: 'https://pol.is/tos' }, { - title: "Privacy", - url: "https://pol.is/privacy" + title: 'Privacy', + url: 'https://pol.is/privacy' } ] } ] } -}; +} diff --git a/client-admin/src/strings/pt_br.js b/client-admin/src/strings/pt_br.js index 4e61bdbac..97489c7f5 100644 --- a/client-admin/src/strings/pt_br.js +++ b/client-admin/src/strings/pt_br.js @@ -1,23 +1,31 @@ // Copyright (C) 2012-present, The Authors. This program is free software: you can redistribute it and/or modify it under the terms of the GNU Affero General Public License, version 3, as published by the Free Software Foundation. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Affero General Public License for more details. You should have received a copy of the GNU Affero General Public License along with this program. If not, see . -var s = {}; +var s = {} // login/createuser strings -s.polis_err_param_parse_failed_email = "Por favor insira um endereΓ§o de email vΓ‘lido."; -s.polis_err_reg_bad_email = "Por favor insira um endereΓ§o de email vΓ‘lido."; -s.polis_err_param_parse_failed_password = "Por favor insira uma senha vΓ‘lida." -s.polis_err_login_unknown_user_or_password_noresults = "Login falhou: usuΓ‘rio/senha invΓ‘lida."; -s.polis_err_login_unknown_user_or_password = "Login falhou: usuΓ‘rio/senha invΓ‘lida."; -s.polis_err_reg_user_with_that_email_exists = "Email jΓ‘ cadastrado, tente fazer login."; -s.polis_err_reg_need_name = "Por favor inclua seu nome."; +s.polis_err_param_parse_failed_email = + 'Por favor insira um endereΓ§o de email vΓ‘lido.' +s.polis_err_reg_bad_email = 'Por favor insira um endereΓ§o de email vΓ‘lido.' +s.polis_err_param_parse_failed_password = 'Por favor insira uma senha vΓ‘lida.' +s.polis_err_login_unknown_user_or_password_noresults = + 'Login falhou: usuΓ‘rio/senha invΓ‘lida.' +s.polis_err_login_unknown_user_or_password = + 'Login falhou: usuΓ‘rio/senha invΓ‘lida.' +s.polis_err_reg_user_with_that_email_exists = + 'Email jΓ‘ cadastrado, tente fazer login.' +s.polis_err_reg_need_name = 'Por favor inclua seu nome.' -s.polis_err_post_comment_duplicate = "Erro ao publicar. Este comentΓ‘rio jΓ‘ existe!"; -s.waitinglist_add_success = "VocΓͺ jΓ‘ foi incluΓ­do na lista de email! Manteremos contato."; +s.polis_err_post_comment_duplicate = + 'Erro ao publicar. Este comentΓ‘rio jΓ‘ existe!' +s.waitinglist_add_success = + 'VocΓͺ jΓ‘ foi incluΓ­do na lista de email! Manteremos contato.' -s.polis_err_fetching_tweet = "Erro buscando tuΓ­te. Verifique se esse link Γ© mesmo de um tuΓ­te."; +s.polis_err_fetching_tweet = + 'Erro buscando tuΓ­te. Verifique se esse link Γ© mesmo de um tuΓ­te.' -s.share_but_no_comments_warning = "Essa discussΓ£o nΓ£o tem comentΓ‘rios. NΓ³s recomendamos adicionar alguns comentΓ‘rios antes de convidar participantes. Isso irΓ‘ ajudar os participantes a comeΓ§ar. No menu da direita, vΓ‘ para a opção 'comments' e depois 'seed'."; -s.share_but_no_visible_comments_warning = "Essa discussΓ£o nΓ£o tem comentΓ‘rios visΓ­veis. NΓ³s recomendamos acrescentar alguns comentΓ‘rios ou moderar comentΓ‘rios que estejam na fila antes de convidar os participantes, jΓ‘ que isso os ajudarΓ‘ a entender que tipo de comentΓ‘rios eles devem enviar."; +s.share_but_no_comments_warning = + "Essa discussΓ£o nΓ£o tem comentΓ‘rios. NΓ³s recomendamos adicionar alguns comentΓ‘rios antes de convidar participantes. Isso irΓ‘ ajudar os participantes a comeΓ§ar. No menu da direita, vΓ‘ para a opção 'comments' e depois 'seed'." +s.share_but_no_visible_comments_warning = + 'Essa discussΓ£o nΓ£o tem comentΓ‘rios visΓ­veis. NΓ³s recomendamos acrescentar alguns comentΓ‘rios ou moderar comentΓ‘rios que estejam na fila antes de convidar os participantes, jΓ‘ que isso os ajudarΓ‘ a entender que tipo de comentΓ‘rios eles devem enviar.' - -export default s; +export default s diff --git a/client-admin/src/strings/strings.js b/client-admin/src/strings/strings.js index 7a09c1c5a..1bb8bc1bc 100644 --- a/client-admin/src/strings/strings.js +++ b/client-admin/src/strings/strings.js @@ -1,21 +1,20 @@ // Copyright (C) 2012-present, The Authors. This program is free software: you can redistribute it and/or modify it under the terms of the GNU Affero General Public License, version 3, as published by the Free Software Foundation. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Affero General Public License for more details. You should have received a copy of the GNU Affero General Public License along with this program. If not, see . -import en_us from "./en_us"; -import pt_br from "./pt_br"; // Temporarily until language choosing code is ported +import en_us from './en_us' +import pt_br from './pt_br' // Temporarily until language choosing code is ported -var s = {}; +var s = {} // TODO port language choosing code -s = en_us; - +s = en_us function f(key) { // strip whitespace from key - key = key.replace(/\s+$/,"").replace(/^\s+/,""); - if (typeof s[key] === "undefined") { - return key; + key = key.replace(/\s+$/, '').replace(/^\s+/, '') + if (typeof s[key] === 'undefined') { + return key } - return s[key]; + return s[key] } -export default f; +export default f diff --git a/client-admin/src/theme/index.js b/client-admin/src/theme/index.js index 8ef6a6a1b..62969b5c5 100644 --- a/client-admin/src/theme/index.js +++ b/client-admin/src/theme/index.js @@ -4,122 +4,122 @@ export default { body: // 'system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", sans-serif', "'Space Mono', monospace", - heading: "inherit", - monospace: "'Space Mono', monospace", + heading: 'inherit', + monospace: "'Space Mono', monospace" }, fontSizes: [12, 14, 16, 20, 24, 32, 48, 64, 96], fontWeights: { body: 400, heading: 700, - bold: 700, + bold: 700 }, sizes: { maxWidth: { - paragraph: "35em", // right syntax? https://theme-ui.com/theme-spec - }, + paragraph: '35em' // right syntax? https://theme-ui.com/theme-spec + } }, lineHeights: { body: 1.5, - heading: 1.125, + heading: 1.125 }, colors: { // text: "#FFF", - text: "#60656F", + text: '#60656F', // background: "#03a9f4", // primary: "#FFF", - background: "#FFF", - primary: "#03a9f4", - secondary: "#F6F7F8", - mediumGray: "#60656F", + background: '#FFF', + primary: '#03a9f4', + secondary: '#F6F7F8', + mediumGray: '#60656F' }, links: { nav: { - color: "inherit", - "&.active": { - color: "primary", + color: 'inherit', + '&.active': { + color: 'primary' }, - "&:hover": { - color: "primary", - borderBottom: "2px solid", - borderBottomColor: "primary", + '&:hover': { + color: 'primary', + borderBottom: '2px solid', + borderBottomColor: 'primary' }, - textDecoration: "none", + textDecoration: 'none', fontSize: [2], - fontWeight: "bold", - cursor: "pointer", - borderBottom: "2px solid", - borderBottomColor: "background", + fontWeight: 'bold', + cursor: 'pointer', + borderBottom: '2px solid', + borderBottomColor: 'background' }, activeNav: { - color: "inherit", - "&.active": { - color: "primary", + color: 'inherit', + '&.active': { + color: 'primary' }, - "&:hover": { - color: "primary", - borderBottomColor: "primary", + '&:hover': { + color: 'primary', + borderBottomColor: 'primary' }, - textDecoration: "none", + textDecoration: 'none', fontSize: [2], - fontWeight: "bold", - cursor: "pointer", - borderBottom: "2px solid", - borderBottomColor: "mediumGray", + fontWeight: 'bold', + cursor: 'pointer', + borderBottom: '2px solid', + borderBottomColor: 'mediumGray' }, header: { - color: "inherit", - "&.active": { - color: "background", + color: 'inherit', + '&.active': { + color: 'background' }, - "&:hover": { - color: "background", + '&:hover': { + color: 'background' }, - textDecoration: "none", + textDecoration: 'none', fontSize: [2], - fontWeight: "bold", - cursor: "pointer", - }, + fontWeight: 'bold', + cursor: 'pointer' + } }, buttons: { primary: { - color: "background", - bg: "primary", - fontFamily: "body", - cursor: "pointer", - }, + color: 'background', + bg: 'primary', + fontFamily: 'body', + cursor: 'pointer' + } }, cards: { primary: { - backgroundColor: "background", - color: "mediumGray", + backgroundColor: 'background', + color: 'mediumGray', padding: 3, borderRadius: 4, - boxShadow: "0 0 8px rgba(0, 0, 0, 0.125)", - }, + boxShadow: '0 0 8px rgba(0, 0, 0, 0.125)' + } }, styles: { root: { - fontFamily: "body", - lineHeight: "body", - fontWeight: "body", + fontFamily: 'body', + lineHeight: 'body', + fontWeight: 'body' }, a: { - color: "primary", - "&:active": { - color: "primary", + color: 'primary', + '&:active': { + color: 'primary' }, - "&:hover": { - color: "primary", - borderBottom: "solid", + '&:hover': { + color: 'primary', + borderBottom: 'solid', borderWidth: 2, - borderColor: "primary", + borderColor: 'primary' }, - textDecoration: "none", - fontWeight: "bold", - cursor: "pointer", - borderBottom: "solid", + textDecoration: 'none', + fontWeight: 'bold', + cursor: 'pointer', + borderBottom: 'solid', borderWidth: 2, - borderColor: "background", - }, - }, -}; + borderColor: 'background' + } + } +} diff --git a/client-admin/src/util/component-helpers.js b/client-admin/src/util/component-helpers.js index 7a1ae8671..7c37acfd7 100644 --- a/client-admin/src/util/component-helpers.js +++ b/client-admin/src/util/component-helpers.js @@ -1,11 +1,10 @@ // Copyright (C) 2012-present, The Authors. This program is free software: you can redistribute it and/or modify it under the terms of the GNU Affero General Public License, version 3, as published by the Free Software Foundation. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Affero General Public License for more details. You should have received a copy of the GNU Affero General Public License along with this program. If not, see . -const helpers = {}; +const helpers = {} -helpers.shouldShowPermissionsError = (props) => { - return false; - //return props.zid_metadata && !props.zid_metadata.is_owner && !props.zid_metadata.is_mod; -}; +helpers.shouldShowPermissionsError = props => { + return false + // return props.zid_metadata && !props.zid_metadata.is_owner && !props.zid_metadata.is_mod; +} - -export default helpers; +export default helpers diff --git a/client-admin/src/util/data-export-date-setup.js b/client-admin/src/util/data-export-date-setup.js index 2d623205f..412e36e96 100644 --- a/client-admin/src/util/data-export-date-setup.js +++ b/client-admin/src/util/data-export-date-setup.js @@ -1,105 +1,104 @@ // Copyright (C) 2012-present, The Authors. This program is free software: you can redistribute it and/or modify it under the terms of the GNU Affero General Public License, version 3, as published by the Free Software Foundation. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Affero General Public License for more details. You should have received a copy of the GNU Affero General Public License along with this program. If not, see . const setupBasedOnCurrentDate = () => { - var d = new Date(); - var month = (d.getMonth() + 1) || 12; - var year = d.getUTCFullYear() || 2030; - var dayOfMonth = d.getDate() || 31; - var tzKey = d.getTimezoneOffset() || 480; - tzKey = tzKey / 60; - var tzWasNegative = tzKey < 0; - tzKey = Math.abs(tzKey); - if (tzKey < 10) { - tzKey = "0" + tzKey; - } - if (tzWasNegative) { - tzKey = "UTC+" + tzKey + "00"; - } else { - tzKey = "UTC-" + tzKey + "00"; - } - - var months = [ - {num: 1, name: "january"}, - {num: 2, name: "february"}, - {num: 3, name: "march"}, - {num: 4, name: "april"}, - {num: 5, name: "may"}, - {num: 6, name: "june"}, - {num: 7, name: "july"}, - {num: 8, name: "august"}, - {num: 9, name: "september"}, - {num: 10, name: "october"}, - {num: 11, name: "november"}, - {num: 12, name: "december"}, - ].map(function(m) { - if (m.num === month) { - m.selected = true; - } - return m; - }); + var d = new Date() + var month = d.getMonth() + 1 || 12 + var year = d.getUTCFullYear() || 2030 + var dayOfMonth = d.getDate() || 31 + var tzKey = d.getTimezoneOffset() || 480 + tzKey = tzKey / 60 + var tzWasNegative = tzKey < 0 + tzKey = Math.abs(tzKey) + if (tzKey < 10) { + tzKey = '0' + tzKey + } + if (tzWasNegative) { + tzKey = 'UTC+' + tzKey + '00' + } else { + tzKey = 'UTC-' + tzKey + '00' + } - var years = []; - for (var i = 2012; i <= year; i++) { - years.push({name: i, selected: i === year}); + var months = [ + { num: 1, name: 'january' }, + { num: 2, name: 'february' }, + { num: 3, name: 'march' }, + { num: 4, name: 'april' }, + { num: 5, name: 'may' }, + { num: 6, name: 'june' }, + { num: 7, name: 'july' }, + { num: 8, name: 'august' }, + { num: 9, name: 'september' }, + { num: 10, name: 'october' }, + { num: 11, name: 'november' }, + { num: 12, name: 'december' } + ].map(function (m) { + if (m.num === month) { + m.selected = true } + return m + }) - var days = []; - for (var day = 1; day <= 31; day++) { - days.push({name: day, selected: day === dayOfMonth}); - } - var tzs = [ - "UTC-1200", - "UTC-1100", - "UTC-1000", - "UTC-0900", - "UTC-0800", - "UTC-0700", - "UTC-0600", - "UTC-0500", - "UTC-0430", - "UTC-0400", - "UTC-0330", - "UTC-0300", - "UTC-0200", - "UTC-0100", - "UTC+0000", - "UTC+0100", - "UTC+0200", - "UTC+0300", - "UTC+0330", - "UTC+0400", - "UTC+0430", - "UTC+0500", - "UTC+0530", - "UTC+0600", - "UTC+0630", - "UTC+0700", - "UTC+0800", - "UTC+0830", - "UTC+0900", - "UTC+0930", - "UTC+1000", - "UTC+1030", - "UTC+1100", - "UTC+1200", - "UTC+1245", - "UTC+1300", - "UTC+1400", - ].map(function(s) { - return { - name: s, - selected: s === tzKey, - }; - }); + var years = [] + for (var i = 2012; i <= year; i++) { + years.push({ name: i, selected: i === year }) + } + var days = [] + for (var day = 1; day <= 31; day++) { + days.push({ name: day, selected: day === dayOfMonth }) + } + var tzs = [ + 'UTC-1200', + 'UTC-1100', + 'UTC-1000', + 'UTC-0900', + 'UTC-0800', + 'UTC-0700', + 'UTC-0600', + 'UTC-0500', + 'UTC-0430', + 'UTC-0400', + 'UTC-0330', + 'UTC-0300', + 'UTC-0200', + 'UTC-0100', + 'UTC+0000', + 'UTC+0100', + 'UTC+0200', + 'UTC+0300', + 'UTC+0330', + 'UTC+0400', + 'UTC+0430', + 'UTC+0500', + 'UTC+0530', + 'UTC+0600', + 'UTC+0630', + 'UTC+0700', + 'UTC+0800', + 'UTC+0830', + 'UTC+0900', + 'UTC+0930', + 'UTC+1000', + 'UTC+1030', + 'UTC+1100', + 'UTC+1200', + 'UTC+1245', + 'UTC+1300', + 'UTC+1400' + ].map(function (s) { return { - format: "csv", - months: months, - years: years, - days: days, - tzs: tzs + name: s, + selected: s === tzKey } + }) + return { + format: 'csv', + months: months, + years: years, + days: days, + tzs: tzs } +} -export default setupBasedOnCurrentDate; +export default setupBasedOnCurrentDate diff --git a/client-admin/src/util/isUnlocked.js b/client-admin/src/util/isUnlocked.js index ba7f6b982..72bc3e51b 100644 --- a/client-admin/src/util/isUnlocked.js +++ b/client-admin/src/util/isUnlocked.js @@ -1,7 +1,7 @@ function canDoAnything() { - return !window.usePlans; + return !window.usePlans } -export default (user) => { - return (user && user.planCode >= 1) || canDoAnything(); -}; +export default user => { + return (user && user.planCode >= 1) || canDoAnything() +} diff --git a/client-admin/src/util/net.js b/client-admin/src/util/net.js index 79bfebad6..9d72e3052 100644 --- a/client-admin/src/util/net.js +++ b/client-admin/src/util/net.js @@ -1,23 +1,23 @@ // Copyright (C) 2012-present, The Authors. This program is free software: you can redistribute it and/or modify it under the terms of the GNU Affero General Public License, version 3, as published by the Free Software Foundation. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Affero General Public License for more details. You should have received a copy of the GNU Affero General Public License along with this program. If not, see . -import URLs from "./url"; -import _ from "lodash"; +import URLs from './url' +import _ from 'lodash' -var urlPrefix = URLs.urlPrefix; -var basePath = ""; +var urlPrefix = URLs.urlPrefix +var basePath = '' // var pid = "unknownpid"; function polisAjax(api, data, type) { if (!_.isString(api)) { - throw "api param should be a string"; + throw 'api param should be a string' } - if (api && api.length && api[0] === "/") { - api = api.slice(1); + if (api && api.length && api[0] === '/') { + api = api.slice(1) } - var url = urlPrefix + basePath + api; + var url = urlPrefix + basePath + api // Add the auth token if needed. // if (_.contains(authenticatedCalls, api)) { @@ -30,62 +30,62 @@ function polisAjax(api, data, type) { // //data = $.extend({ token: token}, data); // moving to cookies // } - var promise; + var promise var config = { url: url, - contentType: "application/json; charset=utf-8", + contentType: 'application/json; charset=utf-8', headers: { - //"Cache-Control": "no-cache" // no-cache - "Cache-Control": "max-age=0", + // "Cache-Control": "no-cache" // no-cache + 'Cache-Control': 'max-age=0' }, xhrFields: { - withCredentials: true, + withCredentials: true }, // crossDomain: true, - dataType: "json", - }; - if ("GET" === type) { + dataType: 'json' + } + if (type === 'GET') { promise = $.ajax( $.extend(config, { - type: "GET", - data: data, + type: 'GET', + data: data }) - ); - } else if ("POST" === type) { + ) + } else if (type === 'POST') { promise = $.ajax( $.extend(config, { - type: "POST", - data: JSON.stringify(data), + type: 'POST', + data: JSON.stringify(data) }) - ); + ) } promise.fail(function (jqXHR, message, errorType) { // sendEvent("Error", api, jqXHR.status); // logger.error("SEND ERROR"); - console.dir("polisAjax promise failed: ", arguments); - if (403 === jqXHR.status) { + console.dir('polisAjax promise failed: ', arguments) + if (jqXHR.status === 403) { // eb.trigger(eb.authNeeded); } - //logger.dir(data); - //logger.dir(message); - //logger.dir(errorType); - }); - return promise; + // logger.dir(data); + // logger.dir(message); + // logger.dir(errorType); + }) + return promise } function polisPost(api, data) { - return polisAjax(api, data, "POST"); + return polisAjax(api, data, 'POST') } function polisGet(api, data) { - return polisAjax(api, data, "GET"); + return polisAjax(api, data, 'GET') } const PolisNet = { polisAjax: polisAjax, polisPost: polisPost, - polisGet: polisGet, -}; -export default PolisNet; + polisGet: polisGet +} +export default PolisNet diff --git a/client-admin/src/util/url.js b/client-admin/src/util/url.js index 1a0ce5c8f..66cc7fd29 100644 --- a/client-admin/src/util/url.js +++ b/client-admin/src/util/url.js @@ -2,23 +2,23 @@ // build may prepend 'devWithPreprod' -var urlPrefix = "_domainWhitelistError_"; +var urlPrefix = '_domainWhitelistError_' -var wl = window.domainWhitelist.map(function(x) { - return new RegExp(x); -}); +var wl = window.domainWhitelist.map(function (x) { + return new RegExp(x) +}) for (var i = 0; i < wl.length; i++) { if (document.domain.match(wl[i])) { - urlPrefix = document.location.protocol + "//" + document.location.hostname; + urlPrefix = document.location.protocol + '//' + document.location.hostname if (document.location.port) { - urlPrefix = urlPrefix + ":" + document.location.port; + urlPrefix = urlPrefix + ':' + document.location.port } - urlPrefix = urlPrefix + "/"; - break; + urlPrefix = urlPrefix + '/' + break } } export default { - urlPrefix: urlPrefix, -}; + urlPrefix: urlPrefix +} From 38a886f9a4965d3d84155a1f31fae5025e709012 Mon Sep 17 00:00:00 2001 From: Patrick Connolly Date: Wed, 1 Jul 2020 00:20:34 -0300 Subject: [PATCH 005/106] Bugfix: SIGNIN_ERROR switch case was missing. --- client-admin/src/reducers/signout.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/client-admin/src/reducers/signout.js b/client-admin/src/reducers/signout.js index 308f185bd..dd9cbac9f 100644 --- a/client-admin/src/reducers/signout.js +++ b/client-admin/src/reducers/signout.js @@ -22,7 +22,7 @@ const signout = ( signout: true, error: false }) - case types.SIGNOUT_SUCCESSFUL: + case types.SIGNOUT_ERROR: return Object.assign({}, state, { loading: false, signout: false, From a97f0f0a9b4521525cd59dcc7dc9c413c8022990 Mon Sep 17 00:00:00 2001 From: Patrick Connolly Date: Wed, 1 Jul 2020 00:26:32 -0300 Subject: [PATCH 006/106] Added auto-fixed from using babel-eslint parser. --- client-admin/.eslintrc.yml | 1 + client-admin/src/app.js | 169 ++++++------ .../comment-moderation/comment.js | 47 ++-- .../comment-moderation/index.js | 107 ++++---- .../moderate-comments-accepted.js | 28 +- .../moderate-comments-rejected.js | 33 +-- .../moderate-comments-todo.js | 30 +-- .../conversation-admin/conversation-config.js | 248 ++++++++++-------- .../conversation-has-comments-check.js | 54 ++-- .../conversation-admin/data-export.js | 101 +++---- .../components/conversation-admin/index.js | 79 +++--- .../conversation-admin/report/reports-list.js | 67 ++--- .../conversation-admin/seed-comment.js | 70 ++--- .../conversation-admin/seed-tweet.js | 98 +++---- .../conversation-admin/share-and-embed.js | 57 ++-- .../conversation-admin/stats/index.js | 86 +++--- .../conversations-and-account/account.js | 34 +-- .../conversations.js | 98 ++++--- .../conversations-and-account/integrate.js | 51 ++-- .../components/framework/moderate-button.js | 52 ++-- .../src/components/framework/nav-tab.js | 52 ++-- .../src/components/landers/createuser.js | 139 +++++----- .../landers/password-reset-init-done.js | 10 +- .../components/landers/password-reset-init.js | 24 +- .../src/components/landers/password-reset.js | 34 ++- client-admin/src/components/landers/signin.js | 122 +++++---- .../src/components/landers/signout.js | 18 +- 27 files changed, 1054 insertions(+), 855 deletions(-) diff --git a/client-admin/.eslintrc.yml b/client-admin/.eslintrc.yml index a7cd1032b..7a2a961f0 100644 --- a/client-admin/.eslintrc.yml +++ b/client-admin/.eslintrc.yml @@ -11,6 +11,7 @@ extends: - plugin:react/recommended - prettier/react rules: {} +parser: babel-eslint parserOptions: ecmaFeatures: jsx: true diff --git a/client-admin/src/app.js b/client-admin/src/app.js index 93333c364..63a6294a1 100644 --- a/client-admin/src/app.js +++ b/client-admin/src/app.js @@ -1,106 +1,113 @@ // Copyright (C) 2012-present, The Authors. This program is free software: you can redistribute it and/or modify it under the terms of the GNU Affero General Public License, version 3, as published by the Free Software Foundation. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Affero General Public License for more details. You should have received a copy of the GNU Affero General Public License along with this program. If not, see . /** @jsx jsx */ -import React from "react"; -import { connect } from "react-redux"; -import { populateUserStore } from "./actions"; +import React from 'react' +import { connect } from 'react-redux' +import { populateUserStore } from './actions' -import _ from "lodash"; +import _ from 'lodash' -import { Switch, Route, Link, Redirect } from "react-router-dom"; -import { Flex, Box, jsx } from "theme-ui"; +import { Switch, Route, Link, Redirect } from 'react-router-dom' +import { Flex, Box, jsx } from 'theme-ui' /* landers */ -import Home from "./components/landers/home"; -import TOS from "./components/landers/tos"; -import Privacy from "./components/landers/privacy"; -import PasswordReset from "./components/landers/password-reset"; -import PasswordResetInit from "./components/landers/password-reset-init"; -import PasswordResetInitDone from "./components/landers/password-reset-init-done"; -import SignIn from "./components/landers/signin"; -import SignOut from "./components/landers/signout"; -import CreateUser from "./components/landers/createuser"; +import Home from './components/landers/home' +import TOS from './components/landers/tos' +import Privacy from './components/landers/privacy' +import PasswordReset from './components/landers/password-reset' +import PasswordResetInit from './components/landers/password-reset-init' +import PasswordResetInitDone from './components/landers/password-reset-init-done' +import SignIn from './components/landers/signin' +import SignOut from './components/landers/signout' +import CreateUser from './components/landers/createuser' // /conversation-admin -import ConversationAdminContainer from "./components/conversation-admin/index"; +import ConversationAdminContainer from './components/conversation-admin/index' -import Conversations from "./components/conversations-and-account/conversations"; -import Account from "./components/conversations-and-account/account"; -import Integrate from "./components/conversations-and-account/integrate"; +import Conversations from './components/conversations-and-account/conversations' +import Account from './components/conversations-and-account/account' +import Integrate from './components/conversations-and-account/integrate' -import InteriorHeader from "./components/interior-header"; +import InteriorHeader from './components/interior-header' const PrivateRoute = ({ component: Component, isLoading, authed, ...rest }) => { if (isLoading) { - return null; + return null } return ( + render={props => authed === true ? ( ) : ( - + ) } /> - ); -}; + ) +} -@connect((state) => { - return state.user; +@connect(state => { + return state.user }) class App extends React.Component { constructor(props) { - super(props); + super(props) this.state = { - sidebarOpen: false, + sidebarOpen: false // sidebarDocked: true, - }; + } } loadUserData() { - this.props.dispatch(populateUserStore()); + this.props.dispatch(populateUserStore()) } componentWillMount() { - this.loadUserData(); - let mql = window.matchMedia(`(min-width: 800px)`); - mql.addListener(this.mediaQueryChanged.bind(this)); - this.setState({ mql: mql, docked: mql.matches }); + this.loadUserData() + const mql = window.matchMedia(`(min-width: 800px)`) + mql.addListener(this.mediaQueryChanged.bind(this)) + this.setState({ mql: mql, docked: mql.matches }) } isAuthed() { - let authed = false; + let authed = false if (!_.isUndefined(this.props.isLoggedIn) && this.props.isLoggedIn) { - authed = true; + authed = true } - if ((this.props.error && this.props.status === 401) || this.props.status === 403) { - authed = false; + if ( + (this.props.error && this.props.status === 401) || + this.props.status === 403 + ) { + authed = false } - return authed; + return authed } isLoading() { - const { isLoggedIn } = this.props; + const { isLoggedIn } = this.props - return _.isUndefined(isLoggedIn); /* if isLoggedIn is undefined, the app is loading */ + return _.isUndefined( + isLoggedIn + ) /* if isLoggedIn is undefined, the app is loading */ } componentDidMount() { - this.mediaQueryChanged(); + this.mediaQueryChanged() } initIntercom() { if (window.useIntercom && !this.intercomInitialized) { - const user = this.props.user; + const user = this.props.user if (user) { if (!window.Intercom && user && user.uid) { - window.initIntercom(); + window.initIntercom() } if (user.email) { /*eslint-disable */ @@ -111,61 +118,61 @@ class App extends React.Component { user_id: user.uid, }); /* jshint ignore:end */ - /*eslint-enable */ + /* eslint-enable */ } - this.intercomInitialized = true; + this.intercomInitialized = true } } } updateIntercomSettings() { - this.initIntercom(); + this.initIntercom() if (this.intercomInitialized) { - const user = this.props.user; + const user = this.props.user window.intercomOptions = { - app_id: "nb5hla8s", + app_id: 'nb5hla8s', widget: { - activator: "#IntercomDefaultWidget", - }, - }; + activator: '#IntercomDefaultWidget' + } + } if (user && user.uid) { - intercomOptions.user_id = user.uid + ""; + intercomOptions.user_id = user.uid + '' } if (user && user.email) { - intercomOptions.email = user.email; + intercomOptions.email = user.email } if (user && user.created) { - intercomOptions.created_at = (user.created / 1000) >> 0; + intercomOptions.created_at = (user.created / 1000) >> 0 } if (user && user.hname) { - intercomOptions.name = user.hname; + intercomOptions.name = user.hname } - Intercom("update", intercomOptions); + Intercom('update', intercomOptions) } } componentDidUpdate() { - this.updateIntercomSettings(); + this.updateIntercomSettings() } componentWillUnmount() { - this.state.mql.removeListener(this.mediaQueryChanged.bind(this)); + this.state.mql.removeListener(this.mediaQueryChanged.bind(this)) } mediaQueryChanged() { - this.setState({ sidebarDocked: this.state.mql.matches }); + this.setState({ sidebarDocked: this.state.mql.matches }) } onSetSidebarOpen(open) { - this.setState({ sidebarOpen: open }); + this.setState({ sidebarOpen: open }) } handleMenuButtonClick() { - this.setState({ sidebarOpen: !this.state.sidebarOpen }); + this.setState({ sidebarOpen: !this.state.sidebarOpen }) } render() { - const { location } = this.props; + const { location } = this.props return ( <> @@ -196,36 +203,46 @@ class App extends React.Component { - + { - if (routeProps.location.pathname.split("/")[1] === "m") { - return null; + render={routeProps => { + if (routeProps.location.pathname.split('/')[1] === 'm') { + return null } return ( - + - + Conversations - + Integrate - + Account - + - ); + ) }} /> @@ -269,8 +286,8 @@ class App extends React.Component { - ); + ) } } -export default App; +export default App diff --git a/client-admin/src/components/conversation-admin/comment-moderation/comment.js b/client-admin/src/components/conversation-admin/comment-moderation/comment.js index 8318a4dee..3b96afac7 100644 --- a/client-admin/src/components/conversation-admin/comment-moderation/comment.js +++ b/client-admin/src/components/conversation-admin/comment-moderation/comment.js @@ -1,34 +1,46 @@ // Copyright (C) 2012-present, The Authors. This program is free software: you can redistribute it and/or modify it under the terms of the GNU Affero General Public License, version 3, as published by the Free Software Foundation. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Affero General Public License for more details. You should have received a copy of the GNU Affero General Public License along with this program. If not, see . -import React from "react"; -import { connect } from "react-redux"; -import { Flex, Box, Text, Button, Card, Link } from "theme-ui"; +import React from 'react' +import { connect } from 'react-redux' +import { Flex, Box, Text, Button, Card, Link } from 'theme-ui' -@connect((state) => { +@connect(state => { return { - conversation: state.zid_metadata.zid_metadata, - }; + conversation: state.zid_metadata.zid_metadata + } }) class Comment extends React.Component { onAcceptClicked() { - this.props.acceptClickHandler(this.props.comment); + this.props.acceptClickHandler(this.props.comment) } + onRejectClicked() { - this.props.rejectClickHandler(this.props.comment); + this.props.rejectClickHandler(this.props.comment) } + onIsMetaClicked() { - this.props.toggleIsMetaHandler(this.props.comment, this.refs.is_meta.checked); + this.props.toggleIsMetaHandler( + this.props.comment, + this.refs.is_meta.checked + ) } render() { return ( - + {this.props.comment.txt} - + {this.props.acceptButton ? ( - ) : null} @@ -38,13 +50,12 @@ class Comment extends React.Component { ) : null} - + - {this.props.isMetaCheckbox ? "metadata" : null} + href="https://roamresearch.com/#/app/polis-methods/page/Q5VQKsuU5"> + {this.props.isMetaCheckbox ? 'metadata' : null} {this.props.isMetaCheckbox ? ( - ); + ) } } -export default Comment; +export default Comment diff --git a/client-admin/src/components/conversation-admin/comment-moderation/index.js b/client-admin/src/components/conversation-admin/comment-moderation/index.js index ec66ad385..fc3b1ef5c 100644 --- a/client-admin/src/components/conversation-admin/comment-moderation/index.js +++ b/client-admin/src/components/conversation-admin/comment-moderation/index.js @@ -1,57 +1,60 @@ // Copyright (C) 2012-present, The Authors. This program is free software: you can redistribute it and/or modify it under the terms of the GNU Affero General Public License, version 3, as published by the Free Software Foundation. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Affero General Public License for more details. You should have received a copy of the GNU Affero General Public License along with this program. If not, see . /** @jsx jsx */ -import ComponentHelpers from "../../../util/component-helpers"; +import ComponentHelpers from '../../../util/component-helpers' -import NoPermission from "../no-permission"; -import React from "react"; -import { connect } from "react-redux"; -import { populateAllCommentStores } from "../../../actions"; -import { Heading, Flex, Box, jsx } from "theme-ui"; +import NoPermission from '../no-permission' +import React from 'react' +import { connect } from 'react-redux' +import { populateAllCommentStores } from '../../../actions' +import { Heading, Flex, Box, jsx } from 'theme-ui' -import ModerateCommentsTodo from "./moderate-comments-todo"; -import ModerateCommentsAccepted from "./moderate-comments-accepted"; -import ModerateCommentsRejected from "./moderate-comments-rejected"; +import ModerateCommentsTodo from './moderate-comments-todo' +import ModerateCommentsAccepted from './moderate-comments-accepted' +import ModerateCommentsRejected from './moderate-comments-rejected' -import { Switch, Route, Link, Redirect } from "react-router-dom"; +import { Switch, Route, Link, Redirect } from 'react-router-dom' const mapStateToProps = (state, ownProps) => { return { unmoderated: state.mod_comments_unmoderated, accepted: state.mod_comments_accepted, rejected: state.mod_comments_rejected, - seed: state.seed_comments, - }; -}; + seed: state.seed_comments + } +} -const pollFrequency = 60000; +const pollFrequency = 60000 -@connect((state) => state.zid_metadata) +@connect(state => state.zid_metadata) @connect(mapStateToProps) class CommentModeration extends React.Component { loadComments() { - const { match } = this.props; - this.props.dispatch(populateAllCommentStores(match.params.conversation_id)); + const { match } = this.props + this.props.dispatch(populateAllCommentStores(match.params.conversation_id)) } + componentWillMount() { this.getCommentsRepeatedly = setInterval(() => { - this.loadComments(); - }, pollFrequency); + this.loadComments() + }, pollFrequency) } + componentDidMount() { - this.loadComments(); + this.loadComments() } + componentWillUnmount() { - clearInterval(this.getCommentsRepeatedly); + clearInterval(this.getCommentsRepeatedly) } render() { if (ComponentHelpers.shouldShowPermissionsError(this.props)) { - return ; + return } - const { match, location } = this.props; + const { match, location } = this.props - const url = location.pathname.split("/")[4]; + const url = location.pathname.split('/')[4] return ( @@ -59,39 +62,41 @@ class CommentModeration extends React.Component { as="h3" sx={{ fontSize: [3, null, 4], - lineHeight: "body", - mb: [3, null, 4], - }} - > + lineHeight: 'body', + mb: [3, null, 4] + }}> Moderate - Unmoderated{" "} + to={`${match.url}`}> + Unmoderated{' '} {this.props.unmoderated.unmoderated_comments ? this.props.unmoderated.unmoderated_comments.length : null} - Accepted{" "} + sx={{ + mr: [4], + variant: url === 'accepted' ? 'links.activeNav' : 'links.nav' + }} + to={`${match.url}/accepted`}> + Accepted{' '} {this.props.accepted.accepted_comments ? this.props.accepted.accepted_comments.length : null} - Rejected{" "} + sx={{ + mr: [4], + variant: url === 'rejected' ? 'links.activeNav' : 'links.nav' + }} + to={`${match.url}/rejected`}> + Rejected{' '} {this.props.rejected.rejected_comments ? this.props.rejected.rejected_comments.length : null} @@ -99,14 +104,26 @@ class CommentModeration extends React.Component { - - - + + + - ); + ) } } -export default CommentModeration; +export default CommentModeration diff --git a/client-admin/src/components/conversation-admin/comment-moderation/moderate-comments-accepted.js b/client-admin/src/components/conversation-admin/comment-moderation/moderate-comments-accepted.js index 8bf132d77..b69b83c33 100644 --- a/client-admin/src/components/conversation-admin/comment-moderation/moderate-comments-accepted.js +++ b/client-admin/src/components/conversation-admin/comment-moderation/moderate-comments-accepted.js @@ -1,22 +1,22 @@ // Copyright (C) 2012-present, The Authors. This program is free software: you can redistribute it and/or modify it under the terms of the GNU Affero General Public License, version 3, as published by the Free Software Foundation. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Affero General Public License for more details. You should have received a copy of the GNU Affero General Public License along with this program. If not, see . -import React from "react"; -import { connect } from "react-redux"; +import React from 'react' +import { connect } from 'react-redux' import { populateAcceptedCommentsStore, changeCommentStatusToRejected, - changeCommentCommentIsMeta, -} from "../../../actions"; -import Comment from "./comment"; + changeCommentCommentIsMeta +} from '../../../actions' +import Comment from './comment' -@connect((state) => state.mod_comments_accepted) +@connect(state => state.mod_comments_accepted) class ModerateCommentsAccepted extends React.Component { onCommentRejected(comment) { - this.props.dispatch(changeCommentStatusToRejected(comment)); + this.props.dispatch(changeCommentStatusToRejected(comment)) } toggleIsMetaHandler(comment, is_meta) { - this.props.dispatch(changeCommentCommentIsMeta(comment, is_meta)); + this.props.dispatch(changeCommentCommentIsMeta(comment, is_meta)) } createCommentMarkup() { @@ -31,9 +31,9 @@ class ModerateCommentsAccepted extends React.Component { toggleIsMetaHandler={this.toggleIsMetaHandler.bind(this)} comment={comment} /> - ); - }); - return comments; + ) + }) + return comments } render() { @@ -41,10 +41,10 @@ class ModerateCommentsAccepted extends React.Component {
{this.props.accepted_comments !== null ? this.createCommentMarkup() - : "Loading accepted comments..."} + : 'Loading accepted comments...'}
- ); + ) } } -export default ModerateCommentsAccepted; +export default ModerateCommentsAccepted diff --git a/client-admin/src/components/conversation-admin/comment-moderation/moderate-comments-rejected.js b/client-admin/src/components/conversation-admin/comment-moderation/moderate-comments-rejected.js index 06fcb9063..ba8c8a975 100644 --- a/client-admin/src/components/conversation-admin/comment-moderation/moderate-comments-rejected.js +++ b/client-admin/src/components/conversation-admin/comment-moderation/moderate-comments-rejected.js @@ -1,20 +1,23 @@ // Copyright (C) 2012-present, The Authors. This program is free software: you can redistribute it and/or modify it under the terms of the GNU Affero General Public License, version 3, as published by the Free Software Foundation. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Affero General Public License for more details. You should have received a copy of the GNU Affero General Public License along with this program. If not, see . -import React from "react"; -import { changeCommentStatusToAccepted, changeCommentCommentIsMeta } from "../../../actions"; -import { connect } from "react-redux"; -import Comment from "./comment"; -import Spinner from "../../framework/spinner"; -import Flex from "../../framework/flex"; +import React from 'react' +import { + changeCommentStatusToAccepted, + changeCommentCommentIsMeta +} from '../../../actions' +import { connect } from 'react-redux' +import Comment from './comment' +import Spinner from '../../framework/spinner' +import Flex from '../../framework/flex' -@connect((state) => state.mod_comments_rejected) +@connect(state => state.mod_comments_rejected) class ModerateCommentsRejected extends React.Component { onCommentAccepted(comment) { - this.props.dispatch(changeCommentStatusToAccepted(comment)); + this.props.dispatch(changeCommentStatusToAccepted(comment)) } toggleIsMetaHandler(comment, is_meta) { - this.props.dispatch(changeCommentCommentIsMeta(comment, is_meta)); + this.props.dispatch(changeCommentCommentIsMeta(comment, is_meta)) } createCommentMarkup() { @@ -29,9 +32,9 @@ class ModerateCommentsRejected extends React.Component { toggleIsMetaHandler={this.toggleIsMetaHandler.bind(this)} comment={comment} /> - ); - }); - return comments; + ) + }) + return comments } render() { @@ -39,10 +42,10 @@ class ModerateCommentsRejected extends React.Component {
{this.props.rejected_comments !== null ? this.createCommentMarkup() - : "Loading rejected comments..."} + : 'Loading rejected comments...'}
- ); + ) } } -export default ModerateCommentsRejected; +export default ModerateCommentsRejected diff --git a/client-admin/src/components/conversation-admin/comment-moderation/moderate-comments-todo.js b/client-admin/src/components/conversation-admin/comment-moderation/moderate-comments-todo.js index 92642dc42..95d660e07 100644 --- a/client-admin/src/components/conversation-admin/comment-moderation/moderate-comments-todo.js +++ b/client-admin/src/components/conversation-admin/comment-moderation/moderate-comments-todo.js @@ -1,26 +1,26 @@ // Copyright (C) 2012-present, The Authors. This program is free software: you can redistribute it and/or modify it under the terms of the GNU Affero General Public License, version 3, as published by the Free Software Foundation. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Affero General Public License for more details. You should have received a copy of the GNU Affero General Public License along with this program. If not, see . -import React from "react"; -import { connect } from "react-redux"; +import React from 'react' +import { connect } from 'react-redux' import { changeCommentStatusToAccepted, changeCommentStatusToRejected, - changeCommentCommentIsMeta, -} from "../../../actions"; -import Comment from "./comment"; + changeCommentCommentIsMeta +} from '../../../actions' +import Comment from './comment' -@connect((state) => state.mod_comments_unmoderated) +@connect(state => state.mod_comments_unmoderated) class ModerateCommentsTodo extends React.Component { onCommentAccepted(comment) { - this.props.dispatch(changeCommentStatusToAccepted(comment)); + this.props.dispatch(changeCommentStatusToAccepted(comment)) } onCommentRejected(comment) { - this.props.dispatch(changeCommentStatusToRejected(comment)); + this.props.dispatch(changeCommentStatusToRejected(comment)) } toggleIsMetaHandler(comment, is_meta) { - this.props.dispatch(changeCommentCommentIsMeta(comment, is_meta)); + this.props.dispatch(changeCommentCommentIsMeta(comment, is_meta)) } createCommentMarkup() { @@ -38,9 +38,9 @@ class ModerateCommentsTodo extends React.Component { toggleIsMetaHandler={this.toggleIsMetaHandler.bind(this)} comment={comment} /> - ); - }); - return comments; + ) + }) + return comments } render() { @@ -49,11 +49,11 @@ class ModerateCommentsTodo extends React.Component {
{this.props.unmoderated_comments !== null ? this.createCommentMarkup() - : "Loading unmoderated comments..."} + : 'Loading unmoderated comments...'}
- ); + ) } } -export default ModerateCommentsTodo; +export default ModerateCommentsTodo diff --git a/client-admin/src/components/conversation-admin/conversation-config.js b/client-admin/src/components/conversation-admin/conversation-config.js index 612399666..59d808a7e 100644 --- a/client-admin/src/components/conversation-admin/conversation-config.js +++ b/client-admin/src/components/conversation-admin/conversation-config.js @@ -2,38 +2,43 @@ /** @jsx jsx */ -import React from "react"; -import { connect } from "react-redux"; -import { handleZidMetadataUpdate, optimisticZidMetadataUpdateOnTyping } from "../../actions"; -import ComponentHelpers from "../../util/component-helpers"; -import NoPermission from "./no-permission"; -import settings from "../../settings"; -import { Heading, Box, Flex, Text, Input, jsx } from "theme-ui"; -import emoji from "react-easy-emoji"; - -import ModerateCommentsSeed from "./seed-comment"; +import React from 'react' +import { connect } from 'react-redux' +import { + handleZidMetadataUpdate, + optimisticZidMetadataUpdateOnTyping +} from '../../actions' +import ComponentHelpers from '../../util/component-helpers' +import NoPermission from './no-permission' +import settings from '../../settings' +import { Heading, Box, Flex, Text, Input, jsx } from 'theme-ui' +import emoji from 'react-easy-emoji' + +import ModerateCommentsSeed from './seed-comment' // import ModerateCommentsSeedTweet from "./seed-tweet"; -@connect((state) => state.user) -@connect((state) => state.zid_metadata) +@connect(state => state.user) +@connect(state => state.zid_metadata) class ConversationConfig extends React.Component { constructor(props) { - super(props); + super(props) } handleBoolValueChange(field) { return () => { - var val = this.refs[field].checked; - if (field === "bgcolor") { + var val = this.refs[field].checked + if (field === 'bgcolor') { // gray checked=default, unchecked white - val = val ? "default" : "#fff"; + val = val ? 'default' : '#fff' } - this.props.dispatch(handleZidMetadataUpdate(this.props.zid_metadata, field, val)); - }; + this.props.dispatch( + handleZidMetadataUpdate(this.props.zid_metadata, field, val) + ) + } } transformBoolToInt(value) { - return value ? 1 : 0; + return value ? 1 : 0 } handleIntegerBoolValueChange(field) { @@ -44,33 +49,39 @@ class ConversationConfig extends React.Component { field, this.transformBoolToInt(this.refs[field].checked) ) - ); - }; + ) + } } handleStringValueChange(field) { return () => { - const val = this.refs[field].value; - if (field === "help_bgcolor" || field === "help_color") { + const val = this.refs[field].value + if (field === 'help_bgcolor' || field === 'help_color') { if (!val.length) { - val = "default"; + val = 'default' } } - this.props.dispatch(handleZidMetadataUpdate(this.props.zid_metadata, field, val)); - }; + this.props.dispatch( + handleZidMetadataUpdate(this.props.zid_metadata, field, val) + ) + } } handleConfigInputTyping(field) { - return (e) => { + return e => { this.props.dispatch( - optimisticZidMetadataUpdateOnTyping(this.props.zid_metadata, field, e.target.value) - ); - }; + optimisticZidMetadataUpdateOnTyping( + this.props.zid_metadata, + field, + e.target.value + ) + ) + } } render() { if (ComponentHelpers.shouldShowPermissionsError(this.props)) { - return ; + return } return ( @@ -79,17 +90,16 @@ class ConversationConfig extends React.Component { as="h3" sx={{ fontSize: [3, null, 4], - lineHeight: "body", - mb: [3, null, 4], - }} - > + lineHeight: 'body', + mb: [3, null, 4] + }}> Configure {this.props.loading ? ( - {emoji("πŸ’Ύ")} Saving + {emoji('πŸ’Ύ')} Saving ) : ( - {emoji("⚑")} Up to date + {emoji('⚑')} Up to date )} {this.props.error ? Error Saving : null} @@ -98,16 +108,16 @@ class ConversationConfig extends React.Component { @@ -117,18 +127,18 @@ class ConversationConfig extends React.Component {