diff --git a/superset-frontend/package-lock.json b/superset-frontend/package-lock.json index 208c406001b..9d2d5f58d12 100644 --- a/superset-frontend/package-lock.json +++ b/superset-frontend/package-lock.json @@ -18927,6 +18927,16 @@ "integrity": "sha512-GRTZLeLJ8ia00ZH8mxMO8t0aC9M1N9bN461Z2eaRurJo6Fpa+utgCwLzI4jQHcrdzuzp5WPN9jRwpsCQ1VhJ5w==", "dev": true }, + "@types/hoist-non-react-statics": { + "version": "3.3.1", + "resolved": "https://registry.npmjs.org/@types/hoist-non-react-statics/-/hoist-non-react-statics-3.3.1.tgz", + "integrity": "sha512-iMIqiko6ooLrTh1joXodJK5X9xeEALT1kM5G3ZLhD3hszxBdIEd5C75U834D9mLcINgD4OyZf5uQXjkuYydWvA==", + "dev": true, + "requires": { + "@types/react": "*", + "hoist-non-react-statics": "^3.3.0" + } + }, "@types/html-minifier-terser": { "version": "5.1.0", "resolved": "https://registry.npmjs.org/@types/html-minifier-terser/-/html-minifier-terser-5.1.0.tgz", @@ -19216,13 +19226,27 @@ } }, "@types/react-redux": { - "version": "5.0.21", - "resolved": "https://registry.npmjs.org/@types/react-redux/-/react-redux-5.0.21.tgz", - "integrity": "sha512-ewkOW4GjnyXq5L++T31utI8yRmwj8iCIahZohYi1Ef7Xkrw0V/q92ao7x20rm38FKgImDaCCsaRGWfCJmF/Ukg==", + "version": "7.1.10", + "resolved": "https://registry.npmjs.org/@types/react-redux/-/react-redux-7.1.10.tgz", + "integrity": "sha512-lmt2BPf0fFuYrXg1JM4udUd4sCmqnTlNUIxC7B6RIBTzmMuv/MxOfumGNUx1UyzVZieEZ2ttCQvFfh/3eUHvrQ==", "dev": true, "requires": { + "@types/hoist-non-react-statics": "^3.3.0", "@types/react": "*", - "redux": "^3.6.0" + "hoist-non-react-statics": "^3.3.0", + "redux": "^4.0.0" + }, + "dependencies": { + "redux": { + "version": "4.0.5", + "resolved": "https://registry.npmjs.org/redux/-/redux-4.0.5.tgz", + "integrity": "sha512-VSz1uMAH24DM6MF72vcojpYPtrTUu3ByVWfPL1nPfVRb5mZVTve5GnNCUV53QM/BZ66xfWrm0CTWoM+Xlz8V1w==", + "dev": true, + "requires": { + "loose-envify": "^1.4.0", + "symbol-observable": "^1.2.0" + } + } } }, "@types/react-router": { @@ -19336,6 +19360,20 @@ "dev": true, "requires": { "redux": "^3.6.0" + }, + "dependencies": { + "redux": { + "version": "3.7.2", + "resolved": "https://registry.npmjs.org/redux/-/redux-3.7.2.tgz", + "integrity": "sha512-pNqnf9q1hI5HHZRBkj3bAngGZW/JMCmexDlOxw4XagXY2o1327nHH54LoTjiPJ0gizoqPDRqWyX/00g0hD6w+A==", + "dev": true, + "requires": { + "lodash": "^4.2.1", + "lodash-es": "^4.2.1", + "loose-envify": "^1.1.0", + "symbol-observable": "^1.0.3" + } + } } }, "@types/redux-mock-store": { @@ -22850,28 +22888,28 @@ "dependencies": { "abbrev": { "version": "1.1.1", - "resolved": false, + "resolved": "", "integrity": "sha512-nne9/IiQ/hzIhY6pdDnbBtz7DjPTKrY00P/zvPSm5pOFkl6xuGrGnXn/VtTNNfNtAfZ9/1RtehkszU9qcTii0Q==", "dev": true, "optional": true }, "ansi-regex": { "version": "2.1.1", - "resolved": false, + "resolved": "", "integrity": "sha1-w7M6te42DYbg5ijwRorn7yfWVN8=", "dev": true, "optional": true }, "aproba": { "version": "1.2.0", - "resolved": false, + "resolved": "", "integrity": "sha512-Y9J6ZjXtoYh8RnXVCMOU/ttDmk1aBjunq9vO0ta5x85WDQiQfUF9sIPBITdbiiIVcBo03Hi3jMxigBtsddlXRw==", "dev": true, "optional": true }, "are-we-there-yet": { "version": "1.1.5", - "resolved": false, + "resolved": "", "integrity": "sha512-5hYdAkZlcG8tOLujVDTgCT+uPX0VnpAH28gWsLfzpXYm7wP6mp5Q/gYyR7YQ0cKVJcXJnl3j2kpBan13PtQf6w==", "dev": true, "optional": true, @@ -22882,14 +22920,14 @@ }, "balanced-match": { "version": "1.0.0", - "resolved": false, + "resolved": "", "integrity": "sha1-ibTRmasr7kneFk6gK4nORi1xt2c=", "dev": true, "optional": true }, "brace-expansion": { "version": "1.1.11", - "resolved": false, + "resolved": "", "integrity": "sha512-iCuPHDFgrHX7H2vEI/5xpz07zSHB00TpugqhmYtVmMO6518mCuRMoOYFldEBl0g187ufozdaHgWKcYFb61qGiA==", "dev": true, "optional": true, @@ -22900,35 +22938,35 @@ }, "code-point-at": { "version": "1.1.0", - "resolved": false, + "resolved": "", "integrity": "sha1-DQcLTQQ6W+ozovGkDi7bPZpMz3c=", "dev": true, "optional": true }, "concat-map": { "version": "0.0.1", - "resolved": false, + "resolved": "", "integrity": "sha1-2Klr13/Wjfd5OnMDajug1UBdR3s=", "dev": true, "optional": true }, "console-control-strings": { "version": "1.1.0", - "resolved": false, + "resolved": "", "integrity": "sha1-PXz0Rk22RG6mRL9LOVB/mFEAjo4=", "dev": true, "optional": true }, "core-util-is": { "version": "1.0.2", - "resolved": false, + "resolved": "", "integrity": "sha1-tf1UIgqivFq1eqtxQMlAdUUDwac=", "dev": true, "optional": true }, "debug": { "version": "4.1.1", - "resolved": false, + "resolved": "", "integrity": "sha512-pYAIzeRo8J6KPEaJ0VWOh5Pzkbw/RetuzehGM7QRRX5he4fPHx2rdKMB256ehJCkX+XRQm16eZLqLNS8RSZXZw==", "dev": true, "optional": true, @@ -22938,35 +22976,35 @@ }, "deep-extend": { "version": "0.6.0", - "resolved": false, + "resolved": "", "integrity": "sha512-LOHxIOaPYdHlJRtCQfDIVZtfw/ufM8+rVj649RIHzcm/vGwQRXFt6OPqIFWsm2XEMrNIEtWR64sY1LEKD2vAOA==", "dev": true, "optional": true }, "delegates": { "version": "1.0.0", - "resolved": false, + "resolved": "", "integrity": "sha1-hMbhWbgZBP3KWaDvRM2HDTElD5o=", "dev": true, "optional": true }, "detect-libc": { "version": "1.0.3", - "resolved": false, + "resolved": "", "integrity": "sha1-+hN8S9aY7fVc1c0CrFWfkaTEups=", "dev": true, "optional": true }, "fs.realpath": { "version": "1.0.0", - "resolved": false, + "resolved": "", "integrity": "sha1-FQStJSMVjKpA20onh8sBQRmU6k8=", "dev": true, "optional": true }, "gauge": { "version": "2.7.4", - "resolved": false, + "resolved": "", "integrity": "sha1-LANAXHU4w51+s3sxcCLjJfsBi/c=", "dev": true, "optional": true, @@ -22983,7 +23021,7 @@ }, "glob": { "version": "7.1.3", - "resolved": false, + "resolved": "", "integrity": "sha512-vcfuiIxogLV4DlGBHIUOwI0IbrJ8HWPc4MU7HzviGeNho/UJDfi6B5p3sHeWIQ0KGIU0Jpxi5ZHxemQfLkkAwQ==", "dev": true, "optional": true, @@ -22998,14 +23036,14 @@ }, "has-unicode": { "version": "2.0.1", - "resolved": false, + "resolved": "", "integrity": "sha1-4Ob+aijPUROIVeCG0Wkedx3iqLk=", "dev": true, "optional": true }, "iconv-lite": { "version": "0.4.24", - "resolved": false, + "resolved": "", "integrity": "sha512-v3MXnZAcvnywkTUEZomIActle7RXXeedOR31wwl7VlyoXO4Qi9arvSenNQWne1TcRwhCL1HwLI21bEqdpj8/rA==", "dev": true, "optional": true, @@ -23015,7 +23053,7 @@ }, "ignore-walk": { "version": "3.0.1", - "resolved": false, + "resolved": "", "integrity": "sha512-DTVlMx3IYPe0/JJcYP7Gxg7ttZZu3IInhuEhbchuqneY9wWe5Ojy2mXLBaQFUQmo0AW2r3qG7m1mg86js+gnlQ==", "dev": true, "optional": true, @@ -23025,7 +23063,7 @@ }, "inflight": { "version": "1.0.6", - "resolved": false, + "resolved": "", "integrity": "sha1-Sb1jMdfQLQwJvJEKEHW6gWW1bfk=", "dev": true, "optional": true, @@ -23036,21 +23074,21 @@ }, "inherits": { "version": "2.0.3", - "resolved": false, + "resolved": "", "integrity": "sha1-Yzwsg+PaQqUC9SRmAiSA9CCCYd4=", "dev": true, "optional": true }, "ini": { "version": "1.3.5", - "resolved": false, + "resolved": "", "integrity": "sha512-RZY5huIKCMRWDUqZlEi72f/lmXKMvuszcMBduliQ3nnWbx9X/ZBQO7DijMEYS9EhHBb2qacRUMtC7svLwe0lcw==", "dev": true, "optional": true }, "is-fullwidth-code-point": { "version": "1.0.0", - "resolved": false, + "resolved": "", "integrity": "sha1-754xOG8DGn8NZDr4L95QxFfvAMs=", "dev": true, "optional": true, @@ -23060,14 +23098,14 @@ }, "isarray": { "version": "1.0.0", - "resolved": false, + "resolved": "", "integrity": "sha1-u5NdSFgsuhaMBoNJV6VKPgcSTxE=", "dev": true, "optional": true }, "minimatch": { "version": "3.0.4", - "resolved": false, + "resolved": "", "integrity": "sha512-yJHVQEhyqPLUTgt9B83PXu6W3rx4MvvHvSUvToogpwoGDOUQ+yDrR0HRot+yOCdCO7u4hX3pWft6kWBBcqh0UA==", "dev": true, "optional": true, @@ -23084,14 +23122,14 @@ }, "ms": { "version": "2.1.1", - "resolved": false, + "resolved": "", "integrity": "sha512-tgp+dl5cGk28utYktBsrFqA7HKgrhgPsg6Z/EfhWI4gl1Hwq8B/GmY/0oXZ6nF8hDVesS/FpnYaD/kOWhYQvyg==", "dev": true, "optional": true }, "needle": { "version": "2.3.0", - "resolved": false, + "resolved": "", "integrity": "sha512-QBZu7aAFR0522EyaXZM0FZ9GLpq6lvQ3uq8gteiDUp7wKdy0lSd2hPlgFwVuW1CBkfEs9PfDQsQzZghLs/psdg==", "dev": true, "optional": true, @@ -23103,7 +23141,7 @@ }, "node-pre-gyp": { "version": "0.12.0", - "resolved": false, + "resolved": "", "integrity": "sha512-4KghwV8vH5k+g2ylT+sLTjy5wmUOb9vPhnM8NHvRf9dHmnW/CndrFXy2aRPaPST6dugXSdHXfeaHQm77PIz/1A==", "dev": true, "optional": true, @@ -23122,7 +23160,7 @@ }, "nopt": { "version": "4.0.1", - "resolved": false, + "resolved": "", "integrity": "sha1-0NRoWv1UFRk8jHUFYC0NF81kR00=", "dev": true, "optional": true, @@ -23133,14 +23171,14 @@ }, "npm-bundled": { "version": "1.0.6", - "resolved": false, + "resolved": "", "integrity": "sha512-8/JCaftHwbd//k6y2rEWp6k1wxVfpFzB6t1p825+cUb7Ym2XQfhwIC5KwhrvzZRJu+LtDE585zVaS32+CGtf0g==", "dev": true, "optional": true }, "npm-packlist": { "version": "1.4.1", - "resolved": false, + "resolved": "", "integrity": "sha512-+TcdO7HJJ8peiiYhvPxsEDhF3PJFGUGRcFsGve3vxvxdcpO2Z4Z7rkosRM0kWj6LfbK/P0gu3dzk5RU1ffvFcw==", "dev": true, "optional": true, @@ -23151,7 +23189,7 @@ }, "npmlog": { "version": "4.1.2", - "resolved": false, + "resolved": "", "integrity": "sha512-2uUqazuKlTaSI/dC8AzicUck7+IrEaOnN/e0jd3Xtt1KcGpwx30v50mL7oPyr/h9bL3E4aZccVwpwP+5W9Vjkg==", "dev": true, "optional": true, @@ -23164,21 +23202,21 @@ }, "number-is-nan": { "version": "1.0.1", - "resolved": false, + "resolved": "", "integrity": "sha1-CXtgK1NCKlIsGvuHkDGDNpQaAR0=", "dev": true, "optional": true }, "object-assign": { "version": "4.1.1", - "resolved": false, + "resolved": "", "integrity": "sha1-IQmtx5ZYh8/AXLvUQsrIv7s2CGM=", "dev": true, "optional": true }, "once": { "version": "1.4.0", - "resolved": false, + "resolved": "", "integrity": "sha1-WDsap3WWHUsROsF9nFC6753Xa9E=", "dev": true, "optional": true, @@ -23188,21 +23226,21 @@ }, "os-homedir": { "version": "1.0.2", - "resolved": false, + "resolved": "", "integrity": "sha1-/7xJiDNuDoM94MFox+8VISGqf7M=", "dev": true, "optional": true }, "os-tmpdir": { "version": "1.0.2", - "resolved": false, + "resolved": "", "integrity": "sha1-u+Z0BseaqFxc/sdm/lc0VV36EnQ=", "dev": true, "optional": true }, "osenv": { "version": "0.1.5", - "resolved": false, + "resolved": "", "integrity": "sha512-0CWcCECdMVc2Rw3U5w9ZjqX6ga6ubk1xDVKxtBQPK7wis/0F2r9T6k4ydGYhecl7YUBxBVxhL5oisPsNxAPe2g==", "dev": true, "optional": true, @@ -23213,21 +23251,21 @@ }, "path-is-absolute": { "version": "1.0.1", - "resolved": false, + "resolved": "", "integrity": "sha1-F0uSaHNVNP+8es5r9TpanhtcX18=", "dev": true, "optional": true }, "process-nextick-args": { "version": "2.0.0", - "resolved": false, + "resolved": "", "integrity": "sha512-MtEC1TqN0EU5nephaJ4rAtThHtC86dNN9qCuEhtshvpVBkAW5ZO7BASN9REnF9eoXGcRub+pFuKEpOHE+HbEMw==", "dev": true, "optional": true }, "rc": { "version": "1.2.8", - "resolved": false, + "resolved": "", "integrity": "sha512-y3bGgqKj3QBdxLbLkomlohkvsA8gdAiUQlSBJnBhfn+BPxg4bc62d8TcBW15wavDfgexCgccckhcZvywyQYPOw==", "dev": true, "optional": true, @@ -23240,7 +23278,7 @@ }, "readable-stream": { "version": "2.3.6", - "resolved": false, + "resolved": "", "integrity": "sha512-tQtKA9WIAhBF3+VLAseyMqZeBjW0AHJoxOtYqSUZNJxauErmLbVm2FW1y+J/YA9dUrAC39ITejlZWhVIwawkKw==", "dev": true, "optional": true, @@ -23256,7 +23294,7 @@ }, "rimraf": { "version": "2.6.3", - "resolved": false, + "resolved": "", "integrity": "sha512-mwqeW5XsA2qAejG46gYdENaxXjx9onRNCfn7L0duuP4hCuTIi/QO7PDK07KJfp1d+izWPrzEJDcSqBa0OZQriA==", "dev": true, "optional": true, @@ -23266,49 +23304,49 @@ }, "safe-buffer": { "version": "5.1.2", - "resolved": false, + "resolved": "", "integrity": "sha512-Gd2UZBJDkXlY7GbJxfsE8/nvKkUEU1G38c1siN6QP6a9PT9MmHB8GnpscSmMJSoF8LOIrt8ud/wPtojys4G6+g==", "dev": true, "optional": true }, "safer-buffer": { "version": "2.1.2", - "resolved": false, + "resolved": "", "integrity": "sha512-YZo3K82SD7Riyi0E1EQPojLz7kpepnSQI9IyPbHHg1XXXevb5dJI7tpyN2ADxGcQbHG7vcyRHk0cbwqcQriUtg==", "dev": true, "optional": true }, "sax": { "version": "1.2.4", - "resolved": false, + "resolved": "", "integrity": "sha512-NqVDv9TpANUjFm0N8uM5GxL36UgKi9/atZw+x7YFnQ8ckwFGKrl4xX4yWtrey3UJm5nP1kUbnYgLopqWNSRhWw==", "dev": true, "optional": true }, "semver": { "version": "5.7.0", - "resolved": false, + "resolved": "", "integrity": "sha512-Ya52jSX2u7QKghxeoFGpLwCtGlt7j0oY9DYb5apt9nPlJ42ID+ulTXESnt/qAQcoSERyZ5sl3LDIOw0nAn/5DA==", "dev": true, "optional": true }, "set-blocking": { "version": "2.0.0", - "resolved": false, + "resolved": "", "integrity": "sha1-BF+XgtARrppoA93TgrJDkrPYkPc=", "dev": true, "optional": true }, "signal-exit": { "version": "3.0.2", - "resolved": false, + "resolved": "", "integrity": "sha1-tf3AjxKH6hF4Yo5BXiUTK3NkbG0=", "dev": true, "optional": true }, "string-width": { "version": "1.0.2", - "resolved": false, + "resolved": "", "integrity": "sha1-EYvfW4zcUaKn5w0hHgfisLmxB9M=", "dev": true, "optional": true, @@ -23320,7 +23358,7 @@ }, "string_decoder": { "version": "1.1.1", - "resolved": false, + "resolved": "", "integrity": "sha512-n/ShnvDi6FHbbVfviro+WojiFzv+s8MPMHBczVePfUpDJLwoLT0ht1l4YwBCbi8pJAveEEdnkHyPyTP/mzRfwg==", "dev": true, "optional": true, @@ -23330,7 +23368,7 @@ }, "strip-ansi": { "version": "3.0.1", - "resolved": false, + "resolved": "", "integrity": "sha1-ajhfuIU9lS1f8F0Oiq+UJ43GPc8=", "dev": true, "optional": true, @@ -23340,21 +23378,21 @@ }, "strip-json-comments": { "version": "2.0.1", - "resolved": false, + "resolved": "", "integrity": "sha1-PFMZQukIwml8DsNEhYwobHygpgo=", "dev": true, "optional": true }, "util-deprecate": { "version": "1.0.2", - "resolved": false, + "resolved": "", "integrity": "sha1-RQ1Nyfpw3nMnYvvS1KKJgUGaDM8=", "dev": true, "optional": true }, "wide-align": { "version": "1.1.3", - "resolved": false, + "resolved": "", "integrity": "sha512-QGkOQc8XL6Bt5PwnsExKBPuMKBxnGxWWW3fU55Xt4feHozMUhdUMaBCk290qpm/wG5u/RSKzwdAC4i51YigihA==", "dev": true, "optional": true, @@ -23364,7 +23402,7 @@ }, "wrappy": { "version": "1.0.2", - "resolved": false, + "resolved": "", "integrity": "sha1-tSQ9jz7BqjXxNkYFvA0QNuMKtp8=", "dev": true, "optional": true @@ -25814,6 +25852,19 @@ "invariant": "^2.0.0", "lodash": "^4.2.0", "redux": "^3.7.1" + }, + "dependencies": { + "redux": { + "version": "3.7.2", + "resolved": "https://registry.npmjs.org/redux/-/redux-3.7.2.tgz", + "integrity": "sha512-pNqnf9q1hI5HHZRBkj3bAngGZW/JMCmexDlOxw4XagXY2o1327nHH54LoTjiPJ0gizoqPDRqWyX/00g0hD6w+A==", + "requires": { + "lodash": "^4.2.1", + "lodash-es": "^4.2.1", + "loose-envify": "^1.1.0", + "symbol-observable": "^1.0.3" + } + } } }, "dns-equal": { @@ -28476,7 +28527,7 @@ "dependencies": { "core-js": { "version": "1.2.7", - "resolved": "http://registry.npmjs.org/core-js/-/core-js-1.2.7.tgz", + "resolved": "https://registry.npmjs.org/core-js/-/core-js-1.2.7.tgz", "integrity": "sha1-ZSKUwUZR2yj6k70tX/KYOk8IxjY=" } } @@ -43693,17 +43744,30 @@ } }, "react-redux": { - "version": "5.1.2", - "resolved": "https://registry.npmjs.org/react-redux/-/react-redux-5.1.2.tgz", - "integrity": "sha512-Ns1G0XXc8hDyH/OcBHOxNgQx9ayH3SPxBnFCOidGKSle8pKihysQw2rG/PmciUQRoclhVBO8HMhiRmGXnDja9Q==", + "version": "7.2.0", + "resolved": "https://registry.npmjs.org/react-redux/-/react-redux-7.2.0.tgz", + "integrity": "sha512-EvCAZYGfOLqwV7gh849xy9/pt55rJXPwmYvI4lilPM5rUT/1NxuuN59ipdBksRVSvz0KInbPnp4IfoXJXCqiDA==", "requires": { - "@babel/runtime": "^7.1.2", + "@babel/runtime": "^7.5.5", "hoist-non-react-statics": "^3.3.0", - "invariant": "^2.2.4", - "loose-envify": "^1.1.0", - "prop-types": "^15.6.1", - "react-is": "^16.6.0", - "react-lifecycles-compat": "^3.0.0" + "loose-envify": "^1.4.0", + "prop-types": "^15.7.2", + "react-is": "^16.9.0" + }, + "dependencies": { + "@babel/runtime": { + "version": "7.12.5", + "resolved": "https://registry.npmjs.org/@babel/runtime/-/runtime-7.12.5.tgz", + "integrity": "sha512-plcc+hbExy3McchJCEQG3knOsuh3HH+Prx1P6cLIkET/0dLuQDEnrT+s27Axgc9bqfsmNUNHfscgMUdBpC9xfg==", + "requires": { + "regenerator-runtime": "^0.13.4" + } + }, + "react-is": { + "version": "16.13.1", + "resolved": "https://registry.npmjs.org/react-is/-/react-is-16.13.1.tgz", + "integrity": "sha512-24e6ynE2H+OKt4kqsOvNd8kBpV65zoxbA4BVsEOB3ARVWQki/DHzaUoC5KuON/BiccDaCCTZBuOcfZs70kR8bQ==" + } } }, "react-router": { @@ -44337,14 +44401,12 @@ } }, "redux": { - "version": "3.7.2", - "resolved": "https://registry.npmjs.org/redux/-/redux-3.7.2.tgz", - "integrity": "sha512-pNqnf9q1hI5HHZRBkj3bAngGZW/JMCmexDlOxw4XagXY2o1327nHH54LoTjiPJ0gizoqPDRqWyX/00g0hD6w+A==", + "version": "4.0.5", + "resolved": "https://registry.npmjs.org/redux/-/redux-4.0.5.tgz", + "integrity": "sha512-VSz1uMAH24DM6MF72vcojpYPtrTUu3ByVWfPL1nPfVRb5mZVTve5GnNCUV53QM/BZ66xfWrm0CTWoM+Xlz8V1w==", "requires": { - "lodash": "^4.2.1", - "lodash-es": "^4.2.1", - "loose-envify": "^1.1.0", - "symbol-observable": "^1.0.3" + "loose-envify": "^1.4.0", + "symbol-observable": "^1.2.0" } }, "redux-localstorage": { diff --git a/superset-frontend/package.json b/superset-frontend/package.json index c498ea83347..b4585c77213 100644 --- a/superset-frontend/package.json +++ b/superset-frontend/package.json @@ -145,7 +145,7 @@ "react-jsonschema-form": "^1.2.0", "react-loadable": "^5.5.0", "react-markdown": "^4.3.1", - "react-redux": "^5.1.2", + "react-redux": "^7.2.0", "react-router-dom": "^5.1.2", "react-search-input": "^0.11.3", "react-select": "^3.1.0", @@ -161,7 +161,7 @@ "react-virtualized-auto-sizer": "^1.0.2", "react-virtualized-select": "^3.1.3", "react-window": "^1.8.5", - "redux": "^3.5.2", + "redux": "^4.0.5", "redux-localstorage": "^0.4.1", "redux-thunk": "^2.1.0", "redux-undo": "^1.0.0-beta9-9-7", @@ -210,7 +210,7 @@ "@types/react-dom": "^16.9.8", "@types/react-gravatar": "^2.6.8", "@types/react-json-tree": "^0.6.11", - "@types/react-redux": "^5.0.2", + "@types/react-redux": "^7.1.10", "@types/react-router-dom": "^5.1.5", "@types/react-select": "^3.0.19", "@types/react-table": "^7.0.19", diff --git a/superset-frontend/spec/javascripts/components/URLShortLinkButton_spec.jsx b/superset-frontend/spec/javascripts/components/URLShortLinkButton_spec.jsx index f58f2aa3fa0..fc6194248c3 100644 --- a/superset-frontend/spec/javascripts/components/URLShortLinkButton_spec.jsx +++ b/superset-frontend/spec/javascripts/components/URLShortLinkButton_spec.jsx @@ -33,9 +33,9 @@ describe('URLShortLinkButton', () => { function setup() { const mockStore = configureStore([]); const store = mockStore({}); - return shallow(, { - context: { store }, - }).dive(); + return shallow( + , + ).dive(); } it('renders OverlayTrigger', () => { diff --git a/superset-frontend/spec/javascripts/components/URLShortLinkModal_spec.jsx b/superset-frontend/spec/javascripts/components/URLShortLinkModal_spec.jsx index 2b687844dfe..41ff9565d67 100644 --- a/superset-frontend/spec/javascripts/components/URLShortLinkModal_spec.jsx +++ b/superset-frontend/spec/javascripts/components/URLShortLinkModal_spec.jsx @@ -34,9 +34,9 @@ describe('URLShortLinkModal', () => { function setup() { const mockStore = configureStore([]); const store = mockStore({}); - return shallow(, { - context: { store }, - }).dive(); + return shallow( + , + ).dive(); } it('renders ModalTrigger', () => { diff --git a/superset-frontend/spec/javascripts/dashboard/components/FiltersBadge_spec.tsx b/superset-frontend/spec/javascripts/dashboard/components/FiltersBadge_spec.tsx index ea89927944d..07dfdd523d8 100644 --- a/superset-frontend/spec/javascripts/dashboard/components/FiltersBadge_spec.tsx +++ b/superset-frontend/spec/javascripts/dashboard/components/FiltersBadge_spec.tsx @@ -19,6 +19,7 @@ import React from 'react'; import { shallow } from 'enzyme'; import { supersetTheme } from '@superset-ui/core'; +import { Provider } from 'react-redux'; import * as SupersetUI from '@superset-ui/core'; import { CHART_UPDATE_SUCCEEDED } from 'src/chart/chartAction'; import { buildActiveFilters } from 'src/dashboard/util/activeDashboardFilters'; @@ -57,7 +58,11 @@ describe('FiltersBadge', () => { }, dashboardFilters, }); - const wrapper = shallow(); + const wrapper = shallow( + + , + , + ); expect( wrapper.dive().find('[data-test="applied-filter-count"]'), ).not.toExist(); @@ -76,7 +81,9 @@ describe('FiltersBadge', () => { }, dashboardFilters, }); - const wrapper = shallow(); + const wrapper = shallow( + , + ).dive(); expect(wrapper.dive().find('DetailsPanelPopover')).toExist(); expect( wrapper.dive().find('[data-test="applied-filter-count"]'), @@ -97,7 +104,9 @@ describe('FiltersBadge', () => { }, dashboardFilters, }); - const wrapper = shallow(); + const wrapper = shallow( + , + ).dive(); expect(wrapper.dive().find('DetailsPanelPopover')).toExist(); expect( wrapper.dive().find('[data-test="applied-filter-count"]'), diff --git a/superset-frontend/spec/javascripts/datasource/ChangeDatasourceModal_spec.jsx b/superset-frontend/spec/javascripts/datasource/ChangeDatasourceModal_spec.jsx index fed3b4bdbdc..c058851a056 100644 --- a/superset-frontend/spec/javascripts/datasource/ChangeDatasourceModal_spec.jsx +++ b/superset-frontend/spec/javascripts/datasource/ChangeDatasourceModal_spec.jsx @@ -55,8 +55,7 @@ fetchMock.get(DATASOURCES_ENDPOINT, [mockDatasource['7__table']]); fetchMock.get(DATASOURCE_ENDPOINT, DATASOURCE_PAYLOAD); async function mountAndWait(props = mockedProps) { - const mounted = mount(, { - context: { store }, + const mounted = mount(, { wrappingComponent: ThemeProvider, wrappingComponentProps: { theme: supersetTheme }, }); diff --git a/superset-frontend/spec/javascripts/datasource/DatasourceEditor_spec.jsx b/superset-frontend/spec/javascripts/datasource/DatasourceEditor_spec.jsx index 3caa82b160e..a09cb54a71b 100644 --- a/superset-frontend/spec/javascripts/datasource/DatasourceEditor_spec.jsx +++ b/superset-frontend/spec/javascripts/datasource/DatasourceEditor_spec.jsx @@ -51,8 +51,8 @@ describe('DatasourceEditor', () => { let isFeatureEnabledMock; beforeEach(() => { - el = ; - wrapper = shallow(el, { context: { store } }).dive(); + el = ; + wrapper = shallow(el).dive(); inst = wrapper.instance(); }); diff --git a/superset-frontend/spec/javascripts/datasource/DatasourceModal_spec.jsx b/superset-frontend/spec/javascripts/datasource/DatasourceModal_spec.jsx index dc5e4879ab3..18890c57847 100644 --- a/superset-frontend/spec/javascripts/datasource/DatasourceModal_spec.jsx +++ b/superset-frontend/spec/javascripts/datasource/DatasourceModal_spec.jsx @@ -20,6 +20,7 @@ import React from 'react'; import { act } from 'react-dom/test-utils'; import configureStore from 'redux-mock-store'; import { mount } from 'enzyme'; +import { Provider } from 'react-redux'; import fetchMock from 'fetch-mock'; import thunk from 'redux-thunk'; import sinon from 'sinon'; @@ -50,11 +51,15 @@ const mockedProps = { }; async function mountAndWait(props = mockedProps) { - const mounted = mount(, { - context: { store }, - wrappingComponent: ThemeProvider, - wrappingComponentProps: { theme: supersetTheme }, - }); + const mounted = mount( + + + , + { + wrappingComponent: ThemeProvider, + wrappingComponentProps: { theme: supersetTheme }, + }, + ); await waitForComponentToPaint(mounted); return mounted; diff --git a/superset-frontend/spec/javascripts/explore/components/ExploreViewContainer_spec.jsx b/superset-frontend/spec/javascripts/explore/components/ExploreViewContainer_spec.jsx index ffcd43b4800..29ff2dd9d89 100644 --- a/superset-frontend/spec/javascripts/explore/components/ExploreViewContainer_spec.jsx +++ b/superset-frontend/spec/javascripts/explore/components/ExploreViewContainer_spec.jsx @@ -17,9 +17,11 @@ * under the License. */ import React from 'react'; +import * as ReactAll from 'react'; import configureStore from 'redux-mock-store'; import thunk from 'redux-thunk'; import sinon from 'sinon'; +import { Subscription } from 'react-redux'; import { shallow } from 'enzyme'; import getInitialState from 'src/explore/reducers/getInitialState'; @@ -36,6 +38,13 @@ describe('ExploreViewContainer', () => { let wrapper; let isFeatureEnabledMock; + jest.spyOn(ReactAll, 'useContext').mockImplementation(() => { + return { + store, + subscription: new Subscription(store), + }; + }); + beforeAll(() => { isFeatureEnabledMock = jest .spyOn(featureFlags, 'isFeatureEnabled') @@ -57,10 +66,11 @@ describe('ExploreViewContainer', () => { }); beforeEach(() => { - wrapper = shallow(, { - context: { store }, + wrapper = shallow(, { disableLifecycleMethods: true, - }).dive(); + }) + .dive() + .dive(); }); it('renders', () => { diff --git a/superset-frontend/spec/javascripts/explore/components/MetricDefinitionOption_spec.jsx b/superset-frontend/spec/javascripts/explore/components/MetricDefinitionOption_spec.jsx index 76154984a03..b626674c45e 100644 --- a/superset-frontend/spec/javascripts/explore/components/MetricDefinitionOption_spec.jsx +++ b/superset-frontend/spec/javascripts/explore/components/MetricDefinitionOption_spec.jsx @@ -29,9 +29,7 @@ describe('MetricDefinitionOption', () => { const store = mockStore({}); function setup(props) { - return shallow(, { - context: { store }, - }).dive(); + return shallow().dive(); } it('renders a MetricOption given a saved metric', () => { diff --git a/superset-frontend/spec/javascripts/explore/components/SaveModal_spec.jsx b/superset-frontend/spec/javascripts/explore/components/SaveModal_spec.jsx index a35223213c2..55ea431bfcb 100644 --- a/superset-frontend/spec/javascripts/explore/components/SaveModal_spec.jsx +++ b/superset-frontend/spec/javascripts/explore/components/SaveModal_spec.jsx @@ -20,6 +20,7 @@ import React from 'react'; import configureStore from 'redux-mock-store'; import thunk from 'redux-thunk'; import { bindActionCreators } from 'redux'; +import { Provider } from 'react-redux'; import { shallow } from 'enzyme'; import { styledMount as mount } from 'spec/helpers/theming'; @@ -72,9 +73,9 @@ describe('SaveModal', () => { }; const getWrapper = () => - shallow(, { - context: { store }, - }).dive(); + shallow() + .dive() + .dive(); it('renders a Modal with the right set of components', () => { const wrapper = getWrapper(); @@ -117,15 +118,14 @@ describe('SaveModal', () => { }); it('componentDidMount', () => { - sinon.spy(SaveModal.prototype, 'componentDidMount'); sinon.spy(defaultProps.actions, 'fetchDashboards'); - mount(, { - context: { store }, - }); - expect(SaveModal.prototype.componentDidMount.calledOnce).toBe(true); + mount( + + + , + ); expect(defaultProps.actions.fetchDashboards.calledOnce).toBe(true); - SaveModal.prototype.componentDidMount.restore(); defaultProps.actions.fetchDashboards.restore(); }); diff --git a/superset-frontend/spec/javascripts/sqllab/App_spec.jsx b/superset-frontend/spec/javascripts/sqllab/App_spec.jsx index daedb8d4011..0629de27d5d 100644 --- a/superset-frontend/spec/javascripts/sqllab/App_spec.jsx +++ b/superset-frontend/spec/javascripts/sqllab/App_spec.jsx @@ -33,7 +33,7 @@ describe('SqlLab App', () => { let wrapper; beforeEach(() => { - wrapper = shallow(, { context: { store } }); + wrapper = shallow().dive(); }); it('is valid', () => { diff --git a/superset-frontend/spec/javascripts/sqllab/ExploreResultsButton_spec.jsx b/superset-frontend/spec/javascripts/sqllab/ExploreResultsButton_spec.jsx index 108835ea0c8..e1d672ec026 100644 --- a/superset-frontend/spec/javascripts/sqllab/ExploreResultsButton_spec.jsx +++ b/superset-frontend/spec/javascripts/sqllab/ExploreResultsButton_spec.jsx @@ -71,9 +71,9 @@ describe('ExploreResultsButton', () => { value: 'bar', }; const getExploreResultsButtonWrapper = (props = mockedProps) => - shallow(, { - context: { store }, - }).dive(); + shallow() + .dive() + .dive(); it('renders', () => { expect(React.isValidElement()).toBe(true); @@ -148,9 +148,11 @@ describe('ExploreResultsButton', () => { query: longQuery, database, }; - const longQueryWrapper = shallow(, { - context: { store }, - }).dive(); + const longQueryWrapper = shallow( + , + ) + .dive() + .dive(); const inst = longQueryWrapper.instance(); expect(inst.getQueryDuration()).toBe(100.7050400390625); }); diff --git a/superset-frontend/spec/javascripts/sqllab/QueryAutoRefresh_spec.jsx b/superset-frontend/spec/javascripts/sqllab/QueryAutoRefresh_spec.jsx index 4295a2a458b..1065b8063ca 100644 --- a/superset-frontend/spec/javascripts/sqllab/QueryAutoRefresh_spec.jsx +++ b/superset-frontend/spec/javascripts/sqllab/QueryAutoRefresh_spec.jsx @@ -39,12 +39,10 @@ describe('QueryAutoRefresh', () => { sqlLab, }; const store = mockStore(state); - const getWrapper = () => - shallow(, { - context: { store }, - }).dive(); - + shallow() + .dive() + .dive(); let wrapper; it('shouldCheckForQueries', () => { diff --git a/superset-frontend/spec/javascripts/sqllab/ShareSqlLabQuery_spec.jsx b/superset-frontend/spec/javascripts/sqllab/ShareSqlLabQuery_spec.jsx index 05bc7446247..693c45fad79 100644 --- a/superset-frontend/spec/javascripts/sqllab/ShareSqlLabQuery_spec.jsx +++ b/superset-frontend/spec/javascripts/sqllab/ShareSqlLabQuery_spec.jsx @@ -66,10 +66,7 @@ describe('ShareSqlLabQuery via /kv/store', () => { function setup(overrideProps) { const wrapper = shallow( - , - { - context: { store }, - }, + , ).dive(); // wrapped in withToasts HOC return wrapper; diff --git a/superset-frontend/spec/javascripts/sqllab/SouthPane_spec.jsx b/superset-frontend/spec/javascripts/sqllab/SouthPane_spec.jsx index 75a85192f6a..6209b9617f7 100644 --- a/superset-frontend/spec/javascripts/sqllab/SouthPane_spec.jsx +++ b/superset-frontend/spec/javascripts/sqllab/SouthPane_spec.jsx @@ -76,9 +76,7 @@ describe('SouthPane', () => { }; const getWrapper = () => - shallow(, { - context: { store }, - }); + shallow().dive(); let wrapper; diff --git a/superset-frontend/spec/javascripts/sqllab/TabbedSqlEditors_spec.jsx b/superset-frontend/spec/javascripts/sqllab/TabbedSqlEditors_spec.jsx index 2832b32a10a..c679bf85546 100644 --- a/superset-frontend/spec/javascripts/sqllab/TabbedSqlEditors_spec.jsx +++ b/superset-frontend/spec/javascripts/sqllab/TabbedSqlEditors_spec.jsx @@ -20,6 +20,7 @@ import React from 'react'; import configureStore from 'redux-mock-store'; import thunk from 'redux-thunk'; import URI from 'urijs'; +import { Provider } from 'react-redux'; import { shallow, mount } from 'enzyme'; import sinon from 'sinon'; import { supersetTheme, ThemeProvider } from '@superset-ui/core'; @@ -73,9 +74,9 @@ describe('TabbedSqlEditors', () => { maxRow: 100000, }; const getWrapper = () => - shallow(, { - context: { store }, - }).dive(); + shallow() + .dive() + .dive(); let wrapper; it('is valid', () => { @@ -87,70 +88,74 @@ describe('TabbedSqlEditors', () => { let uriStub; beforeEach(() => { sinon.stub(window.history, 'replaceState'); - sinon.spy(TabbedSqlEditors.prototype, 'componentDidMount'); + // sinon.spy(TabbedSqlEditors.prototype, 'componentDidMount'); uriStub = sinon.stub(URI.prototype, 'search'); }); afterEach(() => { window.history.replaceState.restore(); - TabbedSqlEditors.prototype.componentDidMount.restore(); + // TabbedSqlEditors.prototype.componentDidMount.restore(); uriStub.restore(); }); it('should handle id', () => { uriStub.returns({ id: 1 }); - wrapper = mount(, { - context: { store }, - wrappingComponent: ThemeProvider, - wrappingComponentProps: { theme: supersetTheme }, - }); - expect(TabbedSqlEditors.prototype.componentDidMount.calledOnce).toBe( - true, + wrapper = mount( + + + , + { + wrappingComponent: ThemeProvider, + wrappingComponentProps: { theme: supersetTheme }, + }, ); + /* expect(TabbedSqlEditors.prototype.componentDidMount.calledOnce).toBe( + true, + ); */ expect(window.history.replaceState.getCall(0).args[2]).toBe( '/superset/sqllab', ); }); it('should handle savedQueryId', () => { uriStub.returns({ savedQueryId: 1 }); - wrapper = mount(, { - context: { store }, - wrappingComponent: ThemeProvider, - wrappingComponentProps: { theme: supersetTheme }, - }); - expect(TabbedSqlEditors.prototype.componentDidMount.calledOnce).toBe( - true, + wrapper = mount( + + + , + { + wrappingComponent: ThemeProvider, + wrappingComponentProps: { theme: supersetTheme }, + }, ); + /* expect(TabbedSqlEditors.prototype.componentDidMount.calledOnce).toBe( + true, + ); */ expect(window.history.replaceState.getCall(0).args[2]).toBe( '/superset/sqllab', ); }); it('should handle sql', () => { uriStub.returns({ sql: 1, dbid: 1 }); - wrapper = mount(, { - context: { store }, - wrappingComponent: ThemeProvider, - wrappingComponentProps: { theme: supersetTheme }, - }); - expect(TabbedSqlEditors.prototype.componentDidMount.calledOnce).toBe( - true, + wrapper = mount( + + + , + { + wrappingComponent: ThemeProvider, + wrappingComponentProps: { theme: supersetTheme }, + }, ); + /* expect(TabbedSqlEditors.prototype.componentDidMount.calledOnce).toBe( + true, + ); */ expect(window.history.replaceState.getCall(0).args[2]).toBe( '/superset/sqllab', ); }); }); describe('UNSAFE_componentWillReceiveProps', () => { - let spy; beforeEach(() => { wrapper = getWrapper(); - spy = sinon.spy( - TabbedSqlEditors.prototype, - 'UNSAFE_componentWillReceiveProps', - ); wrapper.setProps({ queryEditors, queries, tabHistory, tables }); }); - afterEach(() => { - spy.restore(); - }); it('should update queriesArray and dataPreviewQueries', () => { expect(wrapper.state().queriesArray.slice(-1)[0]).toBe( queries['B1-VQU1zW'], diff --git a/superset-frontend/spec/javascripts/views/CRUD/alert/AlertList_spec.jsx b/superset-frontend/spec/javascripts/views/CRUD/alert/AlertList_spec.jsx index 22bc86e44c7..9b9327ded5b 100644 --- a/superset-frontend/spec/javascripts/views/CRUD/alert/AlertList_spec.jsx +++ b/superset-frontend/spec/javascripts/views/CRUD/alert/AlertList_spec.jsx @@ -78,9 +78,7 @@ fetchMock.put(alertEndpoint, { ...mockalerts[0], active: false }); fetchMock.put(alertsEndpoint, { ...mockalerts[0], active: false }); async function mountAndWait(props) { - const mounted = mount(, { - context: { store }, - }); + const mounted = mount(); await waitForComponentToPaint(mounted); return mounted; diff --git a/superset-frontend/spec/javascripts/views/CRUD/annotation/AnnotationList_spec.jsx b/superset-frontend/spec/javascripts/views/CRUD/annotation/AnnotationList_spec.jsx index e096c7c6f36..84b9516b048 100644 --- a/superset-frontend/spec/javascripts/views/CRUD/annotation/AnnotationList_spec.jsx +++ b/superset-frontend/spec/javascripts/views/CRUD/annotation/AnnotationList_spec.jsx @@ -20,6 +20,7 @@ import React from 'react'; import thunk from 'redux-thunk'; import configureStore from 'redux-mock-store'; import fetchMock from 'fetch-mock'; +import { Provider } from 'react-redux'; import { styledMount as mount } from 'spec/helpers/theming'; import AnnotationList from 'src/views/CRUD/annotation/AnnotationList'; @@ -74,9 +75,11 @@ jest.mock('react-router-dom', () => ({ })); async function mountAndWait(props) { - const mounted = mount(, { - context: { store }, - }); + const mounted = mount( + + + , + ); await waitForComponentToPaint(mounted); return mounted; diff --git a/superset-frontend/spec/javascripts/views/CRUD/annotation/AnnotationModal_spec.jsx b/superset-frontend/spec/javascripts/views/CRUD/annotation/AnnotationModal_spec.jsx index 1babcfe4275..54d14223ca0 100644 --- a/superset-frontend/spec/javascripts/views/CRUD/annotation/AnnotationModal_spec.jsx +++ b/superset-frontend/spec/javascripts/views/CRUD/annotation/AnnotationModal_spec.jsx @@ -19,6 +19,7 @@ import React from 'react'; import thunk from 'redux-thunk'; import configureStore from 'redux-mock-store'; +import { Provider } from 'react-redux'; import fetchMock from 'fetch-mock'; import AnnotationModal from 'src/views/CRUD/annotation/AnnotationModal'; import Modal from 'src/common/components/Modal'; @@ -51,11 +52,12 @@ const mockedProps = { }; async function mountAndWait(props = mockedProps) { - const mounted = mount(, { - context: { store }, - }); + const mounted = mount( + + + , + ); await waitForComponentToPaint(mounted); - return mounted; } diff --git a/superset-frontend/spec/javascripts/views/CRUD/annotationlayers/AnnotationLayerModal_spec.jsx b/superset-frontend/spec/javascripts/views/CRUD/annotationlayers/AnnotationLayerModal_spec.jsx index ed927bf5df9..64fd55b9f54 100644 --- a/superset-frontend/spec/javascripts/views/CRUD/annotationlayers/AnnotationLayerModal_spec.jsx +++ b/superset-frontend/spec/javascripts/views/CRUD/annotationlayers/AnnotationLayerModal_spec.jsx @@ -19,6 +19,7 @@ import React from 'react'; import thunk from 'redux-thunk'; import configureStore from 'redux-mock-store'; +import { Provider } from 'react-redux'; import fetchMock from 'fetch-mock'; import AnnotationLayerModal from 'src/views/CRUD/annotationlayers/AnnotationLayerModal'; import Modal from 'src/common/components/Modal'; @@ -43,9 +44,11 @@ const mockedProps = { }; async function mountAndWait(props = mockedProps) { - const mounted = mount(, { - context: { store }, - }); + const mounted = mount( + + + , + ); await waitForComponentToPaint(mounted); return mounted; diff --git a/superset-frontend/spec/javascripts/views/CRUD/annotationlayers/AnnotationLayersList_spec.jsx b/superset-frontend/spec/javascripts/views/CRUD/annotationlayers/AnnotationLayersList_spec.jsx index 987fc768bca..7a4847007e0 100644 --- a/superset-frontend/spec/javascripts/views/CRUD/annotationlayers/AnnotationLayersList_spec.jsx +++ b/superset-frontend/spec/javascripts/views/CRUD/annotationlayers/AnnotationLayersList_spec.jsx @@ -20,6 +20,7 @@ import React from 'react'; import thunk from 'redux-thunk'; import configureStore from 'redux-mock-store'; import fetchMock from 'fetch-mock'; +import { Provider } from 'react-redux'; import { styledMount as mount } from 'spec/helpers/theming'; import AnnotationLayersList from 'src/views/CRUD/annotationlayers/AnnotationLayersList'; @@ -78,10 +79,11 @@ fetchMock.get(layersRelatedEndpoint, { }); describe('AnnotationLayersList', () => { - const wrapper = mount(, { - context: { store }, - }); - + const wrapper = mount( + + + , + ); beforeAll(async () => { await waitForComponentToPaint(wrapper); }); diff --git a/superset-frontend/spec/javascripts/views/CRUD/chart/ChartList_spec.jsx b/superset-frontend/spec/javascripts/views/CRUD/chart/ChartList_spec.jsx index b871421cd34..1ba73407468 100644 --- a/superset-frontend/spec/javascripts/views/CRUD/chart/ChartList_spec.jsx +++ b/superset-frontend/spec/javascripts/views/CRUD/chart/ChartList_spec.jsx @@ -19,6 +19,7 @@ import React from 'react'; import thunk from 'redux-thunk'; import configureStore from 'redux-mock-store'; +import { Provider } from 'react-redux'; import fetchMock from 'fetch-mock'; import * as featureFlags from 'src/featureFlags'; @@ -97,9 +98,11 @@ describe('ChartList', () => { isFeatureEnabledMock.restore(); }); const mockedProps = {}; - const wrapper = mount(, { - context: { store }, - }); + const wrapper = mount( + + + , + ); beforeAll(async () => { await waitForComponentToPaint(wrapper); diff --git a/superset-frontend/spec/javascripts/views/CRUD/csstemplates/CssTemplateModal_spec.jsx b/superset-frontend/spec/javascripts/views/CRUD/csstemplates/CssTemplateModal_spec.jsx index d00186671d0..1e3d3bffbd7 100644 --- a/superset-frontend/spec/javascripts/views/CRUD/csstemplates/CssTemplateModal_spec.jsx +++ b/superset-frontend/spec/javascripts/views/CRUD/csstemplates/CssTemplateModal_spec.jsx @@ -18,6 +18,7 @@ */ import React from 'react'; import thunk from 'redux-thunk'; +import { Provider } from 'react-redux'; import configureStore from 'redux-mock-store'; import fetchMock from 'fetch-mock'; import CssTemplateModal from 'src/views/CRUD/csstemplates/CssTemplateModal'; @@ -44,9 +45,11 @@ const mockedProps = { }; async function mountAndWait(props = mockedProps) { - const mounted = mount(, { - context: { store }, - }); + const mounted = mount( + + + , + ); await waitForComponentToPaint(mounted); return mounted; diff --git a/superset-frontend/spec/javascripts/views/CRUD/csstemplates/CssTemplatesList_spec.jsx b/superset-frontend/spec/javascripts/views/CRUD/csstemplates/CssTemplatesList_spec.jsx index f293bf1eca1..b0d29d3ccc8 100644 --- a/superset-frontend/spec/javascripts/views/CRUD/csstemplates/CssTemplatesList_spec.jsx +++ b/superset-frontend/spec/javascripts/views/CRUD/csstemplates/CssTemplatesList_spec.jsx @@ -19,6 +19,7 @@ import React from 'react'; import thunk from 'redux-thunk'; import configureStore from 'redux-mock-store'; +import { Provider } from 'react-redux'; import fetchMock from 'fetch-mock'; import { styledMount as mount } from 'spec/helpers/theming'; @@ -76,9 +77,11 @@ fetchMock.get(templatesRelatedEndpoint, { }); describe('CssTemplatesList', () => { - const wrapper = mount(, { - context: { store }, - }); + const wrapper = mount( + + + , + ); beforeAll(async () => { await waitForComponentToPaint(wrapper); diff --git a/superset-frontend/spec/javascripts/views/CRUD/dashboard/DashboardList_spec.jsx b/superset-frontend/spec/javascripts/views/CRUD/dashboard/DashboardList_spec.jsx index 42077dd5d7b..f20010f7e2e 100644 --- a/superset-frontend/spec/javascripts/views/CRUD/dashboard/DashboardList_spec.jsx +++ b/superset-frontend/spec/javascripts/views/CRUD/dashboard/DashboardList_spec.jsx @@ -20,6 +20,7 @@ import React from 'react'; import thunk from 'redux-thunk'; import configureStore from 'redux-mock-store'; import fetchMock from 'fetch-mock'; +import { Provider } from 'react-redux'; import * as featureFlags from 'src/featureFlags'; import waitForComponentToPaint from 'spec/helpers/waitForComponentToPaint'; @@ -92,9 +93,11 @@ describe('DashboardList', () => { }); const mockedProps = {}; - const wrapper = mount(, { - context: { store }, - }); + const wrapper = mount( + + + , + ); beforeAll(async () => { await waitForComponentToPaint(wrapper); diff --git a/superset-frontend/spec/javascripts/views/CRUD/data/database/DatabaseList_spec.jsx b/superset-frontend/spec/javascripts/views/CRUD/data/database/DatabaseList_spec.jsx index 471072803be..52d129c310e 100644 --- a/superset-frontend/spec/javascripts/views/CRUD/data/database/DatabaseList_spec.jsx +++ b/superset-frontend/spec/javascripts/views/CRUD/data/database/DatabaseList_spec.jsx @@ -20,6 +20,7 @@ import React from 'react'; import thunk from 'redux-thunk'; import configureStore from 'redux-mock-store'; import fetchMock from 'fetch-mock'; +import { Provider } from 'react-redux'; import { styledMount as mount } from 'spec/helpers/theming'; import DatabaseList from 'src/views/CRUD/data/database/DatabaseList'; @@ -81,10 +82,11 @@ fetchMock.get(databaseRelatedEndpoint, { }); describe('DatabaseList', () => { - const wrapper = mount(, { - context: { store }, - }); - + const wrapper = mount( + + + , + ); beforeAll(async () => { await waitForComponentToPaint(wrapper); }); diff --git a/superset-frontend/spec/javascripts/views/CRUD/data/database/DatabaseModal_spec.jsx b/superset-frontend/spec/javascripts/views/CRUD/data/database/DatabaseModal_spec.jsx index e4c16fd6457..9a9126c8ed0 100644 --- a/superset-frontend/spec/javascripts/views/CRUD/data/database/DatabaseModal_spec.jsx +++ b/superset-frontend/spec/javascripts/views/CRUD/data/database/DatabaseModal_spec.jsx @@ -43,12 +43,8 @@ const dbProps = { }; describe('DatabaseModal', () => { - const wrapper = mount(, { - context: { store }, - }); - const editWrapper = mount(, { - context: { store }, - }); + const wrapper = mount(); + const editWrapper = mount(); it('renders', () => { expect(wrapper.find(DatabaseModal)).toExist(); diff --git a/superset-frontend/spec/javascripts/views/CRUD/data/dataset/DatasetList_spec.jsx b/superset-frontend/spec/javascripts/views/CRUD/data/dataset/DatasetList_spec.jsx index b93ea5178f3..d919bc033b4 100644 --- a/superset-frontend/spec/javascripts/views/CRUD/data/dataset/DatasetList_spec.jsx +++ b/superset-frontend/spec/javascripts/views/CRUD/data/dataset/DatasetList_spec.jsx @@ -20,6 +20,7 @@ import React from 'react'; import thunk from 'redux-thunk'; import configureStore from 'redux-mock-store'; import fetchMock from 'fetch-mock'; +import { Provider } from 'react-redux'; import { styledMount as mount } from 'spec/helpers/theming'; import DatasetList from 'src/views/CRUD/data/dataset/DatasetList'; @@ -74,9 +75,11 @@ fetchMock.get(databaseEndpoint, { }); async function mountAndWait(props) { - const mounted = mount(, { - context: { store }, - }); + const mounted = mount( + + + , + ); await waitForComponentToPaint(mounted); return mounted; diff --git a/superset-frontend/spec/javascripts/views/CRUD/data/savedquery/SavedQueryList_spec.jsx b/superset-frontend/spec/javascripts/views/CRUD/data/savedquery/SavedQueryList_spec.jsx index 0b32bb04708..a57cf9b54af 100644 --- a/superset-frontend/spec/javascripts/views/CRUD/data/savedquery/SavedQueryList_spec.jsx +++ b/superset-frontend/spec/javascripts/views/CRUD/data/savedquery/SavedQueryList_spec.jsx @@ -19,6 +19,7 @@ import React from 'react'; import thunk from 'redux-thunk'; import configureStore from 'redux-mock-store'; +import { Provider } from 'react-redux'; import fetchMock from 'fetch-mock'; import { styledMount as mount } from 'spec/helpers/theming'; import SavedQueryList from 'src/views/CRUD/data/savedquery/SavedQueryList'; @@ -91,9 +92,11 @@ fetchMock.get(queriesDistinctEndpoint, { }); describe('SavedQueryList', () => { - const wrapper = mount(, { - context: { store }, - }); + const wrapper = mount( + + + , + ); beforeAll(async () => { await waitForComponentToPaint(wrapper); diff --git a/superset-frontend/spec/javascripts/views/CRUD/data/savedquery/SavedQueryPreviewModal_spec.jsx b/superset-frontend/spec/javascripts/views/CRUD/data/savedquery/SavedQueryPreviewModal_spec.jsx index 4a82609dff1..19d1235bdc8 100644 --- a/superset-frontend/spec/javascripts/views/CRUD/data/savedquery/SavedQueryPreviewModal_spec.jsx +++ b/superset-frontend/spec/javascripts/views/CRUD/data/savedquery/SavedQueryPreviewModal_spec.jsx @@ -73,9 +73,7 @@ const SAVED_QUERY_PAYLOAD = { result: mockqueries[1] }; fetchMock.get(FETCH_SAVED_QUERY_ENDPOINT, SAVED_QUERY_PAYLOAD); async function mountAndWait(props = mockedProps) { - const mounted = mount(, { - context: { store }, - }); + const mounted = mount(); await waitForComponentToPaint(mounted); return mounted; diff --git a/superset-frontend/spec/javascripts/views/CRUD/welcome/ChartTable_spec.tsx b/superset-frontend/spec/javascripts/views/CRUD/welcome/ChartTable_spec.tsx index a2979296de2..7b60e31adfa 100644 --- a/superset-frontend/spec/javascripts/views/CRUD/welcome/ChartTable_spec.tsx +++ b/superset-frontend/spec/javascripts/views/CRUD/welcome/ChartTable_spec.tsx @@ -57,9 +57,7 @@ describe('ChartTable', () => { userId: '2', }, }; - const wrapper = mount(, { - context: { store }, - }); + const wrapper = mount(); it('it renders', () => { expect(wrapper.find(ChartTable)).toExist(); }); @@ -78,9 +76,7 @@ describe('ChartTable', () => { it('display EmptyState if there is no data', () => { fetchMock.resetHistory(); - const wrapper = mount(, { - context: { store }, - }); + const wrapper = mount(); expect(wrapper.find('EmptyState')).toExist(); }); }); diff --git a/superset-frontend/spec/javascripts/views/CRUD/welcome/DashboardTable_spec.tsx b/superset-frontend/spec/javascripts/views/CRUD/welcome/DashboardTable_spec.tsx index 491c582ffd0..8fbc75d4fb8 100644 --- a/superset-frontend/spec/javascripts/views/CRUD/welcome/DashboardTable_spec.tsx +++ b/superset-frontend/spec/javascripts/views/CRUD/welcome/DashboardTable_spec.tsx @@ -59,9 +59,7 @@ describe('DashboardTable', () => { }, mine: mockDashboards, }; - const wrapper = mount(, { - context: { store }, - }); + const wrapper = mount(); beforeAll(async () => { await waitForComponentToPaint(wrapper); @@ -95,10 +93,8 @@ describe('DashboardTable', () => { dashboardFilter="Mine" user={{ userId: '2' }} mine={[]} + store={store} />, - { - context: { store }, - }, ); expect(wrapper.find('EmptyState')).toExist(); }); diff --git a/superset-frontend/spec/javascripts/views/CRUD/welcome/SavedQueries_spec.tsx b/superset-frontend/spec/javascripts/views/CRUD/welcome/SavedQueries_spec.tsx index 081cafdaa34..1ef5748c432 100644 --- a/superset-frontend/spec/javascripts/views/CRUD/welcome/SavedQueries_spec.tsx +++ b/superset-frontend/spec/javascripts/views/CRUD/welcome/SavedQueries_spec.tsx @@ -77,9 +77,7 @@ describe('SavedQueries', () => { mine: mockqueries, }; - const wrapper = mount(, { - context: { store }, - }); + const wrapper = mount(); const clickTab = (idx: number) => { act(() => { diff --git a/superset-frontend/spec/javascripts/views/CRUD/welcome/Welcome_spec.tsx b/superset-frontend/spec/javascripts/views/CRUD/welcome/Welcome_spec.tsx index 7bb22a067cb..8788e52e68f 100644 --- a/superset-frontend/spec/javascripts/views/CRUD/welcome/Welcome_spec.tsx +++ b/superset-frontend/spec/javascripts/views/CRUD/welcome/Welcome_spec.tsx @@ -18,6 +18,7 @@ */ import React from 'react'; import { styledMount as mount } from 'spec/helpers/theming'; +import { Provider } from 'react-redux'; import thunk from 'redux-thunk'; import fetchMock from 'fetch-mock'; import configureStore from 'redux-mock-store'; @@ -69,9 +70,11 @@ describe('Welcome', () => { isActive: true, }, }; - const wrapper = mount(, { - context: { store }, - }); + const wrapper = mount( + + + , + ); it('renders', () => { expect(wrapper).toExist(); diff --git a/superset-frontend/src/dashboard/components/Dashboard.jsx b/superset-frontend/src/dashboard/components/Dashboard.jsx index e4f373c1697..935a5fdf449 100644 --- a/superset-frontend/src/dashboard/components/Dashboard.jsx +++ b/superset-frontend/src/dashboard/components/Dashboard.jsx @@ -86,7 +86,6 @@ class Dashboard extends React.PureComponent { constructor(props) { super(props); this.appliedFilters = props.activeFilters || {}; - this.onVisibilityChange = this.onVisibilityChange.bind(this); } diff --git a/superset-frontend/src/dashboard/containers/FiltersBadge.tsx b/superset-frontend/src/dashboard/containers/FiltersBadge.tsx index 6dccc7d51d8..51a0a0bb208 100644 --- a/superset-frontend/src/dashboard/containers/FiltersBadge.tsx +++ b/superset-frontend/src/dashboard/containers/FiltersBadge.tsx @@ -16,8 +16,8 @@ * specific language governing permissions and limitations * under the License. */ -import { connect, Dispatch } from 'react-redux'; -import { bindActionCreators } from 'redux'; +import { connect } from 'react-redux'; +import { bindActionCreators, Dispatch } from 'redux'; import { setDirectPathToChild } from 'src/dashboard/actions/dashboardState'; import { selectIndicatorsForChart, @@ -29,7 +29,7 @@ export interface FiltersBadgeProps { chartId: number; } -const mapDispatchToProps = (dispatch: Dispatch) => { +const mapDispatchToProps = (dispatch: Dispatch) => { return bindActionCreators( { onHighlightFilterSource: setDirectPathToChild, diff --git a/superset-frontend/src/explore/actions/exploreActions.ts b/superset-frontend/src/explore/actions/exploreActions.ts index f312f68e1c3..9d53f7506d5 100644 --- a/superset-frontend/src/explore/actions/exploreActions.ts +++ b/superset-frontend/src/explore/actions/exploreActions.ts @@ -73,7 +73,7 @@ export function toggleFaveStar(isStarred: boolean) { export const FETCH_FAVE_STAR = 'FETCH_FAVE_STAR'; export function fetchFaveStar(sliceId: string) { - return function (dispatch: Dispatch>) { + return function (dispatch: Dispatch) { SupersetClient.get({ endpoint: `${FAVESTAR_BASE_URL}/${sliceId}/count`, }).then(({ json }) => { @@ -86,7 +86,7 @@ export function fetchFaveStar(sliceId: string) { export const SAVE_FAVE_STAR = 'SAVE_FAVE_STAR'; export function saveFaveStar(sliceId: string, isStarred: boolean) { - return function (dispatch: Dispatch>) { + return function (dispatch: Dispatch) { const urlSuffix = isStarred ? 'unselect' : 'select'; SupersetClient.get({ endpoint: `${FAVESTAR_BASE_URL}/${sliceId}/${urlSuffix}/`, diff --git a/superset-frontend/src/logger/actions/index.ts b/superset-frontend/src/logger/actions/index.ts index c89ff0ca86b..9e605b7775d 100644 --- a/superset-frontend/src/logger/actions/index.ts +++ b/superset-frontend/src/logger/actions/index.ts @@ -16,12 +16,12 @@ * specific language governing permissions and limitations * under the License. */ -import { Dispatch } from 'react-redux'; +import { Dispatch } from 'redux'; export const LOG_EVENT = 'LOG_EVENT'; export function logEvent(eventName: string, eventData: Record) { - return (dispatch: Dispatch) => + return (dispatch: Dispatch) => dispatch({ type: LOG_EVENT, payload: { diff --git a/superset-frontend/src/views/CRUD/data/query/QueryList.test.tsx b/superset-frontend/src/views/CRUD/data/query/QueryList.test.tsx index eb18e925831..83ecc588b2d 100644 --- a/superset-frontend/src/views/CRUD/data/query/QueryList.test.tsx +++ b/superset-frontend/src/views/CRUD/data/query/QueryList.test.tsx @@ -19,6 +19,7 @@ import React from 'react'; import thunk from 'redux-thunk'; import configureStore from 'redux-mock-store'; +import { Provider } from 'react-redux'; import fetchMock from 'fetch-mock'; import { act } from 'react-dom/test-utils'; @@ -87,9 +88,14 @@ fetchMock.get('glob:*/api/v1/query/disting/status*', { describe('QueryList', () => { const mockedProps = {}; - const wrapper = mount(, { - context: { store }, - }); + const wrapper = mount( + + + , + { + context: { store }, + }, + ); beforeAll(async () => { await waitForComponentToPaint(wrapper); diff --git a/superset-frontend/src/views/CRUD/data/query/QueryPreviewModal.test.tsx b/superset-frontend/src/views/CRUD/data/query/QueryPreviewModal.test.tsx index 0407c7635ea..7a85e4c2921 100644 --- a/superset-frontend/src/views/CRUD/data/query/QueryPreviewModal.test.tsx +++ b/superset-frontend/src/views/CRUD/data/query/QueryPreviewModal.test.tsx @@ -75,9 +75,7 @@ describe('QueryPreviewModal', () => { }), show: true, }; - const wrapper = mount(, { - context: { store }, - }); + const wrapper = mount(); beforeAll(async () => { await waitForComponentToPaint(wrapper); @@ -122,9 +120,9 @@ describe('QueryPreviewModal', () => { ...mockedProps, query: mockQueries[1], }; - const wrapper2 = mount(, { - context: { store }, - }); + const wrapper2 = mount( + , + ); act(() => { const props = wrapper2 .find('[data-test="previous-query"]') @@ -156,9 +154,9 @@ describe('QueryPreviewModal', () => { ...mockedProps, query: mockQueries[2], }; - const wrapper2 = mount(, { - context: { store }, - }); + const wrapper2 = mount( + , + ); expect( wrapper2.find('[data-test="next-query"]').first().props().disabled,