From 4c2f22c2b19106390f7bf2edd4717b14f517531d Mon Sep 17 00:00:00 2001 From: Jordi Bunster Date: Mon, 29 Mar 2021 10:38:41 -0700 Subject: [PATCH 01/12] When switching between tabs, editors remain open (#586) I misunderstood the purpose of a ko.foreach() loop in my changes back in #534. This re-introduces the loop. --- src/Explorer/Tabs/TabsManager.html | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/Explorer/Tabs/TabsManager.html b/src/Explorer/Tabs/TabsManager.html index deb01358d..d66a2ba33 100644 --- a/src/Explorer/Tabs/TabsManager.html +++ b/src/Explorer/Tabs/TabsManager.html @@ -76,10 +76,10 @@
- -
+ +
From 9108c01e629f7dea01db684b68b4bfe02c2ee265 Mon Sep 17 00:00:00 2001 From: Steve Faulkner Date: Mon, 29 Mar 2021 13:31:52 -0500 Subject: [PATCH 02/12] Drop IE11 Support (#476) --- package-lock.json | 258 ++---------------- package.json | 20 +- .../GremlinSimpleClient.ts | 3 - src/Libs/is-integer-polyfill.js | 5 - src/Main.tsx | 11 - src/Terminal/index.ts | 2 - src/setupTests.ts | 5 +- src/workers/upload/index.ts | 3 +- tsconfig.json | 2 +- webpack.config.js | 19 -- 10 files changed, 35 insertions(+), 293 deletions(-) delete mode 100644 src/Libs/is-integer-polyfill.js diff --git a/package-lock.json b/package-lock.json index e63f2b398..1b5386d33 100644 --- a/package-lock.json +++ b/package-lock.json @@ -3673,30 +3673,6 @@ "resolved": "https://registry.npmjs.org/@opentelemetry/context-base/-/context-base-0.10.2.tgz", "integrity": "sha512-hZNKjKOYsckoOEgBziGMnBcX0M7EtstnCmwz5jZUOUYwlZ+/xxX6z3jPu1XVO2Jivk0eLfuP9GP+vFD49CMetw==" }, - "@peculiar/asn1-schema": { - "version": "1.1.2", - "resolved": "https://registry.npmjs.org/@peculiar/asn1-schema/-/asn1-schema-1.1.2.tgz", - "integrity": "sha512-ntQ4UnUFgdjs0tfWR6YmEQm/x0glV4OFus/RjxLkaJUKfu/R7VilefBntyUO3MoKWdlCgib30KN+JpCY1HqU2A==", - "requires": { - "asn1js": "^2.0.26", - "tslib": "^1.11.1" - } - }, - "@peculiar/json-schema": { - "version": "1.1.12", - "resolved": "https://registry.npmjs.org/@peculiar/json-schema/-/json-schema-1.1.12.tgz", - "integrity": "sha512-coUfuoMeIB7B8/NMekxaDzLhaYmp0HZNPEjYRm9goRou8UZIC3z21s0sL9AWoCw4EG876QyO3kYrc61WNF9B/w==", - "requires": { - "tslib": "^2.0.0" - }, - "dependencies": { - "tslib": { - "version": "2.1.0", - "resolved": "https://registry.npmjs.org/tslib/-/tslib-2.1.0.tgz", - "integrity": "sha512-hcVC3wYEziELGGmEEXue7D75zbwIIVUMWAVbHItGPx0ziyXxrOMQx4rQEVEV45Ut/1IotuEvwqPopzIOkDMf0A==" - } - } - }, "@phosphor/algorithm": { "version": "1.2.0", "resolved": "https://registry.npmjs.org/@phosphor/algorithm/-/algorithm-1.2.0.tgz", @@ -4061,11 +4037,6 @@ "resolved": "https://registry.npmjs.org/@types/asap/-/asap-2.0.0.tgz", "integrity": "sha512-upIS0Gt9Mc8eEpCbYMZ1K8rhNosfKUtimNcINce+zLwJF5UpM3Vv7yz3S5l/1IX+DxTa8lTkUjqynvjRXyJzsg==" }, - "@types/asn1js": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/@types/asn1js/-/asn1js-2.0.0.tgz", - "integrity": "sha512-Jjzp5EqU0hNpADctc/UqhiFbY1y2MqIxBVa2S4dBlbnZHTLPMuggoL5q43X63LpsOIINRDirBjP56DUUKIUWIA==" - }, "@types/babel__core": { "version": "7.1.12", "resolved": "https://registry.npmjs.org/@types/babel__core/-/babel__core-7.1.12.tgz", @@ -4671,8 +4642,7 @@ "@types/node": { "version": "12.11.1", "resolved": "https://registry.npmjs.org/@types/node/-/node-12.11.1.tgz", - "integrity": "sha512-TJtwsqZ39pqcljJpajeoofYRfeZ7/I/OMUQ5pR4q5wOKf2ocrUvBAZUMhWsOvKx3dVc/aaV5GluBivt0sWqA5A==", - "dev": true + "integrity": "sha512-TJtwsqZ39pqcljJpajeoofYRfeZ7/I/OMUQ5pR4q5wOKf2ocrUvBAZUMhWsOvKx3dVc/aaV5GluBivt0sWqA5A==" }, "@types/node-fetch": { "version": "2.5.7", @@ -4866,12 +4836,6 @@ "@types/jest": "*" } }, - "@types/text-encoding": { - "version": "0.0.33", - "resolved": "https://registry.npmjs.org/@types/text-encoding/-/text-encoding-0.0.33.tgz", - "integrity": "sha512-kAMOjud0Nw3HPY0Cu8cTFk0LVya8skY+ajb2rgrSahPQ6AreN0cpGBNrs8Kjlu9EhFIeh5cp7phovL7v9HrPdQ==", - "dev": true - }, "@types/tunnel": { "version": "0.0.1", "resolved": "https://registry.npmjs.org/@types/tunnel/-/tunnel-0.0.1.tgz", @@ -4920,12 +4884,6 @@ "resolved": "https://registry.npmjs.org/@types/uuid/-/uuid-8.3.0.tgz", "integrity": "sha512-eQ9qFW/fhfGJF8WKHGEHZEyVWfZxrT+6CLIJGBcZPfxUh/+BnEj+UCGYMlr9qZuX/2AltsvwrGqp0LhEW8D0zQ==" }, - "@types/webfontloader": { - "version": "1.6.29", - "resolved": "https://registry.npmjs.org/@types/webfontloader/-/webfontloader-1.6.29.tgz", - "integrity": "sha512-wobuM+LvpkzU296NsFVRGDAFWw3X2XEhrLHuvV+VGSbok6aOxQcymmopUFwNB69qy5oudHt9lYC0JF+z+DxFLw==", - "dev": true - }, "@types/webpack": { "version": "4.41.26", "resolved": "https://registry.npmjs.org/@types/webpack/-/webpack-4.41.26.tgz", @@ -6016,11 +5974,6 @@ "resolved": "https://registry.npmjs.org/asap/-/asap-2.0.6.tgz", "integrity": "sha1-5QNHYR1+aQlDIIu9r+vLwvuGbUY=" }, - "asmcrypto.js": { - "version": "2.3.2", - "resolved": "https://registry.npmjs.org/asmcrypto.js/-/asmcrypto.js-2.3.2.tgz", - "integrity": "sha512-3FgFARf7RupsZETQ1nHnhLUUvpcttcCq1iZCaVAbJZbCZ5VNRrNyvpDyHTOb0KC3llFcsyOT/a99NZcCbeiEsA==" - }, "asn1": { "version": "0.2.4", "resolved": "https://registry.npmjs.org/asn1/-/asn1-0.2.4.tgz", @@ -6041,14 +5994,6 @@ "safer-buffer": "^2.1.0" } }, - "asn1js": { - "version": "2.0.26", - "resolved": "https://registry.npmjs.org/asn1js/-/asn1js-2.0.26.tgz", - "integrity": "sha512-yG89F0j9B4B0MKIcFyWWxnpZPLaNTjCj4tkE3fjbAoo0qmpGw0PYYqSbX/4ebnd9Icn8ZgK4K1fvDyEtW1JYtQ==", - "requires": { - "pvutils": "^1.0.17" - } - }, "assert": { "version": "1.5.0", "resolved": "https://registry.npmjs.org/assert/-/assert-1.5.0.tgz", @@ -6326,23 +6271,6 @@ "resolved": "https://registry.npmjs.org/babel-plugin-syntax-jsx/-/babel-plugin-syntax-jsx-6.18.0.tgz", "integrity": "sha1-CvMqmm4Tyno/1QaeYtew9Y0NiUY=" }, - "babel-polyfill": { - "version": "6.26.0", - "resolved": "https://registry.npmjs.org/babel-polyfill/-/babel-polyfill-6.26.0.tgz", - "integrity": "sha1-N5k3q8Z9eJWXCtxiHyhM2WbPIVM=", - "requires": { - "babel-runtime": "^6.26.0", - "core-js": "^2.5.0", - "regenerator-runtime": "^0.10.5" - }, - "dependencies": { - "regenerator-runtime": { - "version": "0.10.5", - "resolved": "https://registry.npmjs.org/regenerator-runtime/-/regenerator-runtime-0.10.5.tgz", - "integrity": "sha1-M2w+/BIgrc7dosn6tntaeVWjNlg=" - } - } - }, "babel-preset-current-node-syntax": { "version": "0.1.4", "resolved": "https://registry.npmjs.org/babel-preset-current-node-syntax/-/babel-preset-current-node-syntax-0.1.4.tgz", @@ -6567,7 +6495,8 @@ "bn.js": { "version": "4.11.9", "resolved": "https://registry.npmjs.org/bn.js/-/bn.js-4.11.9.tgz", - "integrity": "sha512-E6QoYqCKZfgatHTdHzs1RRKP7ip4vvm+EyRUeE2RF0NblwVvb0p6jSVeNTOFxPn26QXN2o6SMfNxKp6kU8zQaw==" + "integrity": "sha512-E6QoYqCKZfgatHTdHzs1RRKP7ip4vvm+EyRUeE2RF0NblwVvb0p6jSVeNTOFxPn26QXN2o6SMfNxKp6kU8zQaw==", + "dev": true }, "body-parser": { "version": "1.19.0", @@ -6713,7 +6642,8 @@ "brorand": { "version": "1.1.0", "resolved": "https://registry.npmjs.org/brorand/-/brorand-1.1.0.tgz", - "integrity": "sha1-EsJe/kCkXjwyPrhnWgoM5XsiNx8=" + "integrity": "sha1-EsJe/kCkXjwyPrhnWgoM5XsiNx8=", + "dev": true }, "browser-process-hrtime": { "version": "1.0.0", @@ -8858,6 +8788,7 @@ "version": "1.0.1", "resolved": "https://registry.npmjs.org/des.js/-/des.js-1.0.1.tgz", "integrity": "sha512-Q0I4pfFrv2VPd34/vfLrFOoRmlYj3OV50i7fskps1jZWK1kApMWWT9G6RRUeYedLcBDIhnSDaUvJMb3AhUlaEA==", + "dev": true, "requires": { "inherits": "^2.0.1", "minimalistic-assert": "^1.0.0" @@ -9174,6 +9105,7 @@ "version": "6.5.3", "resolved": "https://registry.npmjs.org/elliptic/-/elliptic-6.5.3.tgz", "integrity": "sha512-IMqzv5wNQf+E6aHeIqATs0tOLeOTwj1QKbRcS3jBbYkl5oLAserA8yJTT7/VyHUYG91PRmPyeQDObKLPpeS4dw==", + "dev": true, "requires": { "bn.js": "^4.4.0", "brorand": "^1.0.1", @@ -9414,11 +9346,6 @@ "es6-symbol": "^3.1.1" } }, - "es6-object-assign": { - "version": "1.1.0", - "resolved": "https://registry.npmjs.org/es6-object-assign/-/es6-object-assign-1.1.0.tgz", - "integrity": "sha1-wsNYJlYkfDnqEHyx5mUrb58kUjw=" - }, "es6-symbol": { "version": "3.1.3", "resolved": "https://registry.npmjs.org/es6-symbol/-/es6-symbol-3.1.3.tgz", @@ -11557,6 +11484,7 @@ "version": "1.1.7", "resolved": "https://registry.npmjs.org/hash.js/-/hash.js-1.1.7.tgz", "integrity": "sha512-taOaskGt4z4SOANNseOviYDvjEJinIkRgmp7LbKP2YTTmVxWBl87s/uzK9r+44BclBSp2X7K1hqeNfz9JbBeXA==", + "dev": true, "requires": { "inherits": "^2.0.3", "minimalistic-assert": "^1.0.1" @@ -11601,6 +11529,7 @@ "version": "1.0.1", "resolved": "https://registry.npmjs.org/hmac-drbg/-/hmac-drbg-1.0.1.tgz", "integrity": "sha1-0nRXAQJabHdabFRXk+1QL8DGSaE=", + "dev": true, "requires": { "hash.js": "^1.0.3", "minimalistic-assert": "^1.0.0", @@ -15897,12 +15826,14 @@ "minimalistic-assert": { "version": "1.0.1", "resolved": "https://registry.npmjs.org/minimalistic-assert/-/minimalistic-assert-1.0.1.tgz", - "integrity": "sha512-UtJcAD4yEaGtjPezWuO9wC4nwUnVH/8/Im3yEHQP4b67cXlD/Qr9hdITCU1xDbSEXg2XKNaP8jsReV7vQd00/A==" + "integrity": "sha512-UtJcAD4yEaGtjPezWuO9wC4nwUnVH/8/Im3yEHQP4b67cXlD/Qr9hdITCU1xDbSEXg2XKNaP8jsReV7vQd00/A==", + "dev": true }, "minimalistic-crypto-utils": { "version": "1.0.1", "resolved": "https://registry.npmjs.org/minimalistic-crypto-utils/-/minimalistic-crypto-utils-1.0.1.tgz", - "integrity": "sha1-9sAMHAsIIkblxNmd+4x8CDsrWCo=" + "integrity": "sha1-9sAMHAsIIkblxNmd+4x8CDsrWCo=", + "dev": true }, "minimatch": { "version": "3.0.4", @@ -16515,6 +16446,7 @@ "version": "1.1.0", "resolved": "https://registry.npmjs.org/object.entries/-/object.entries-1.1.0.tgz", "integrity": "sha512-l+H6EQ8qzGRxbkHOd5I/aHRhHDKoQXQ8g0BYt4uSweQU1/J6dZUOyWh9a2Vky35YCKjzmgxOzta2hH6kf9HuXA==", + "dev": true, "requires": { "define-properties": "^1.1.3", "es-abstract": "^1.12.0", @@ -16526,6 +16458,7 @@ "version": "1.17.7", "resolved": "https://registry.npmjs.org/es-abstract/-/es-abstract-1.17.7.tgz", "integrity": "sha512-VBl/gnfcJ7OercKA9MVaegWsBHFjV492syMudcnQZvt/Dw8ezpcOHYZXa/J96O8vx+g4x65YKhxOwDUh63aS5g==", + "dev": true, "requires": { "es-to-primitive": "^1.2.1", "function-bind": "^1.1.1", @@ -17595,41 +17528,6 @@ "resolved": "https://registry.npmjs.org/promise-inflight/-/promise-inflight-1.0.1.tgz", "integrity": "sha1-mEcocL8igTL8vdhoEputEsPAKeM=" }, - "promise-polyfill": { - "version": "8.1.0", - "resolved": "https://registry.npmjs.org/promise-polyfill/-/promise-polyfill-8.1.0.tgz", - "integrity": "sha512-OzSf6gcCUQ01byV4BgwyUCswlaQQ6gzXc23aLQWhicvfX9kfsUiUhgt3CCQej8jDnl8/PhGF31JdHX2/MzF3WA==" - }, - "promise.prototype.finally": { - "version": "3.1.0", - "resolved": "https://registry.npmjs.org/promise.prototype.finally/-/promise.prototype.finally-3.1.0.tgz", - "integrity": "sha512-7p/K2f6dI+dM8yjRQEGrTQs5hTQixUAdOGpMEA3+pVxpX5oHKRSKAXyLw9Q9HUWDTdwtoo39dSHGQtN90HcEwQ==", - "requires": { - "define-properties": "^1.1.2", - "es-abstract": "^1.9.0", - "function-bind": "^1.1.1" - }, - "dependencies": { - "es-abstract": { - "version": "1.17.7", - "resolved": "https://registry.npmjs.org/es-abstract/-/es-abstract-1.17.7.tgz", - "integrity": "sha512-VBl/gnfcJ7OercKA9MVaegWsBHFjV492syMudcnQZvt/Dw8ezpcOHYZXa/J96O8vx+g4x65YKhxOwDUh63aS5g==", - "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.2", - "is-regex": "^1.1.1", - "object-inspect": "^1.8.0", - "object-keys": "^1.1.1", - "object.assign": "^4.1.1", - "string.prototype.trimend": "^1.0.1", - "string.prototype.trimstart": "^1.0.1" - } - } - } - }, "prompts": { "version": "2.4.0", "resolved": "https://registry.npmjs.org/prompts/-/prompts-2.4.0.tgz", @@ -17858,26 +17756,6 @@ "resolved": "https://registry.npmjs.org/pure-color/-/pure-color-1.3.0.tgz", "integrity": "sha1-H+Bk+wrIUfDeYTIKi/eWg2Qi8z4=" }, - "pvtsutils": { - "version": "1.1.1", - "resolved": "https://registry.npmjs.org/pvtsutils/-/pvtsutils-1.1.1.tgz", - "integrity": "sha512-Evbhe6L4Sxwu4SPLQ4LQZhgfWDQO3qa1lju9jM5cxsQp8vE10VipcSmo7hiJW48TmiHgVLgDtC2TL6/+ND+IVg==", - "requires": { - "tslib": "^2.0.3" - }, - "dependencies": { - "tslib": { - "version": "2.1.0", - "resolved": "https://registry.npmjs.org/tslib/-/tslib-2.1.0.tgz", - "integrity": "sha512-hcVC3wYEziELGGmEEXue7D75zbwIIVUMWAVbHItGPx0ziyXxrOMQx4rQEVEV45Ut/1IotuEvwqPopzIOkDMf0A==" - } - } - }, - "pvutils": { - "version": "1.0.17", - "resolved": "https://registry.npmjs.org/pvutils/-/pvutils-1.0.17.tgz", - "integrity": "sha512-wLHYUQxWaXVQvKnwIDWFVKDJku9XDCvyhhxoq8dc5MFdIlRenyPI9eSfEtcvgHgD7FlvCyGAlWgOzRnZD99GZQ==" - }, "q": { "version": "1.5.1", "resolved": "https://registry.npmjs.org/q/-/q-1.5.1.tgz", @@ -20578,7 +20456,6 @@ "version": "4.8.0", "resolved": "https://registry.npmjs.org/terser/-/terser-4.8.0.tgz", "integrity": "sha512-EAPipTNeWsb/3wLPeup1tVPaXfIaU68xMnVdPafIL1TV05OhASArYyIfFvnvJCNrR2NIOvDVNNTFRa+Re2MWyw==", - "dev": true, "requires": { "commander": "^2.20.0", "source-map": "~0.6.1", @@ -20588,39 +20465,35 @@ "source-map": { "version": "0.6.1", "resolved": "https://registry.npmjs.org/source-map/-/source-map-0.6.1.tgz", - "integrity": "sha512-UjgapumWlbMhkBgzT7Ykc5YXUT46F0iKu8SGXq0bcwP5dz/h0Plj6enJqjz1Zbq2l5WaqYnrVbwWOWMyF3F47g==", - "dev": true + "integrity": "sha512-UjgapumWlbMhkBgzT7Ykc5YXUT46F0iKu8SGXq0bcwP5dz/h0Plj6enJqjz1Zbq2l5WaqYnrVbwWOWMyF3F47g==" } } }, "terser-webpack-plugin": { - "version": "3.0.5", - "resolved": "https://registry.npmjs.org/terser-webpack-plugin/-/terser-webpack-plugin-3.0.5.tgz", - "integrity": "sha512-pyHUyfQUZB3ciYL81GgXzDh8Qb3fGED77xDjZVSFYSN1cQnWgC51OMPKj7vBWVZx0GGuYhpa9+Vz2KxkzXWhBA==", - "dev": true, + "version": "3.1.0", + "resolved": "https://registry.npmjs.org/terser-webpack-plugin/-/terser-webpack-plugin-3.1.0.tgz", + "integrity": "sha512-cjdZte66fYkZ65rQ2oJfrdCAkkhJA7YLYk5eGOcGCSGlq0ieZupRdjedSQXYknMPo2IveQL+tPdrxUkERENCFA==", "requires": { - "cacache": "^15.0.4", + "cacache": "^15.0.5", "find-cache-dir": "^3.3.1", - "jest-worker": "^26.0.0", - "p-limit": "^3.0.1", + "jest-worker": "^26.2.1", + "p-limit": "^3.0.2", "schema-utils": "^2.6.6", "serialize-javascript": "^4.0.0", "source-map": "^0.6.1", - "terser": "^4.6.13", + "terser": "^4.8.0", "webpack-sources": "^1.4.3" }, "dependencies": { "has-flag": { "version": "4.0.0", "resolved": "https://registry.npmjs.org/has-flag/-/has-flag-4.0.0.tgz", - "integrity": "sha512-EykJT/Q1KjTWctppgIAgfSO0tKVuZUjhgMr17kqTumMl6Afv3EISleU7qZUzoXDFTAHTDC4NOoG/ZxU3EvlMPQ==", - "dev": true + "integrity": "sha512-EykJT/Q1KjTWctppgIAgfSO0tKVuZUjhgMr17kqTumMl6Afv3EISleU7qZUzoXDFTAHTDC4NOoG/ZxU3EvlMPQ==" }, "jest-worker": { "version": "26.6.2", "resolved": "https://registry.npmjs.org/jest-worker/-/jest-worker-26.6.2.tgz", "integrity": "sha512-KWYVV1c4i+jbMpaBC+U++4Va0cp8OisU185o73T1vo99hqi7w8tSJfUXYswwqqrjzwxa6KpRK54WhPvwf5w6PQ==", - "dev": true, "requires": { "@types/node": "*", "merge-stream": "^2.0.0", @@ -20631,7 +20504,6 @@ "version": "3.1.0", "resolved": "https://registry.npmjs.org/p-limit/-/p-limit-3.1.0.tgz", "integrity": "sha512-TYOanM3wGwNGsZN2cVTYPArw454xnXj5qmWF1bEoAc4+cU/ol7GVh7odevjp1FNHduHc3KZMcFduxU5Xc6uJRQ==", - "dev": true, "requires": { "yocto-queue": "^0.1.0" } @@ -20640,7 +20512,6 @@ "version": "4.0.0", "resolved": "https://registry.npmjs.org/serialize-javascript/-/serialize-javascript-4.0.0.tgz", "integrity": "sha512-GaNA54380uFefWghODBWEGisLZFj00nS5ACs6yHa9nLqlLpVLO8ChDGeKRjZnV4Nh4n0Qi7nhYZD/9fCPzEqkw==", - "dev": true, "requires": { "randombytes": "^2.1.0" } @@ -20648,14 +20519,12 @@ "source-map": { "version": "0.6.1", "resolved": "https://registry.npmjs.org/source-map/-/source-map-0.6.1.tgz", - "integrity": "sha512-UjgapumWlbMhkBgzT7Ykc5YXUT46F0iKu8SGXq0bcwP5dz/h0Plj6enJqjz1Zbq2l5WaqYnrVbwWOWMyF3F47g==", - "dev": true + "integrity": "sha512-UjgapumWlbMhkBgzT7Ykc5YXUT46F0iKu8SGXq0bcwP5dz/h0Plj6enJqjz1Zbq2l5WaqYnrVbwWOWMyF3F47g==" }, "supports-color": { "version": "7.2.0", "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-7.2.0.tgz", "integrity": "sha512-qpCAvRl9stuOHveKsn7HncJRvv501qIacKzQlO/+Lwxc9+0q2wLyv4Dfvt80/DPn2pqOBsJdDiogXGR9+OvwRw==", - "dev": true, "requires": { "has-flag": "^4.0.0" } @@ -20673,11 +20542,6 @@ "require-main-filename": "^2.0.0" } }, - "text-encoding": { - "version": "0.7.0", - "resolved": "https://registry.npmjs.org/text-encoding/-/text-encoding-0.7.0.tgz", - "integrity": "sha512-oJQ3f1hrOnbRLOcwKz0Liq2IcrvDeZRHXhd9RgLrsT+DjWY/nty1Hi7v3dtkaEYbPYe0mUoOfzRrMwfXXwgPUA==" - }, "text-table": { "version": "0.2.0", "resolved": "https://registry.npmjs.org/text-table/-/text-table-0.2.0.tgz", @@ -21431,11 +21295,6 @@ "requires-port": "^1.0.0" } }, - "url-polyfill": { - "version": "1.1.7", - "resolved": "https://registry.npmjs.org/url-polyfill/-/url-polyfill-1.1.7.tgz", - "integrity": "sha512-ZrAxYWCREjmMtL8gSbSiKKLZZticgihCvVBtrFbUVpyoETt8GQJeG2okMWA8XryDAaHMjJfhnc+rnhXRbI4DXA==" - }, "use": { "version": "3.1.1", "resolved": "https://registry.npmjs.org/use/-/use-3.1.1.tgz", @@ -21828,65 +21687,6 @@ "minimalistic-assert": "^1.0.0" } }, - "webcrypto-core": { - "version": "1.1.9", - "resolved": "https://registry.npmjs.org/webcrypto-core/-/webcrypto-core-1.1.9.tgz", - "integrity": "sha512-Ac7yZQpz9+oDpKgltmHUb7Czlw6fahe9AhbBOkXkaU3y7vmvrRASNmU1T0VdH4iJsNEFgYh7R49qJjru4huzmw==", - "requires": { - "@peculiar/asn1-schema": "^2.0.12", - "@peculiar/json-schema": "^1.1.12", - "asn1js": "^2.0.26", - "pvtsutils": "^1.0.11", - "tslib": "^2.0.1" - }, - "dependencies": { - "@peculiar/asn1-schema": { - "version": "2.0.27", - "resolved": "https://registry.npmjs.org/@peculiar/asn1-schema/-/asn1-schema-2.0.27.tgz", - "integrity": "sha512-1tIx7iL3Ma3HtnNS93nB7nhyI0soUJypElj9owd4tpMrRDmeJ8eZubsdq1sb0KSaCs5RqZNoABCP6m5WtnlVhQ==", - "requires": { - "@types/asn1js": "^2.0.0", - "asn1js": "^2.0.26", - "pvtsutils": "^1.1.1", - "tslib": "^2.0.3" - } - }, - "tslib": { - "version": "2.1.0", - "resolved": "https://registry.npmjs.org/tslib/-/tslib-2.1.0.tgz", - "integrity": "sha512-hcVC3wYEziELGGmEEXue7D75zbwIIVUMWAVbHItGPx0ziyXxrOMQx4rQEVEV45Ut/1IotuEvwqPopzIOkDMf0A==" - } - } - }, - "webcrypto-liner": { - "version": "1.1.4", - "resolved": "https://registry.npmjs.org/webcrypto-liner/-/webcrypto-liner-1.1.4.tgz", - "integrity": "sha512-p4ovRsS8hIyG8KnW2FyrWZG4rZY5eHow5IlNiyOXeisE4gbX3FMZzJPej1dhdxL67111yf0zW2H24qt0ny+JHQ==", - "requires": { - "@peculiar/asn1-schema": "^1.0.3", - "@peculiar/json-schema": "^1.1.9", - "asmcrypto.js": "^2.3.2", - "asn1js": "^2.0.26", - "core-js": "^3.5.0", - "des.js": "^1.0.1", - "elliptic": "^6.5.2", - "pvtsutils": "^1.0.9", - "tslib": "^1.10.0", - "webcrypto-core": "^1.0.17" - }, - "dependencies": { - "core-js": { - "version": "3.8.3", - "resolved": "https://registry.npmjs.org/core-js/-/core-js-3.8.3.tgz", - "integrity": "sha512-KPYXeVZYemC2TkNEkX/01I+7yd+nX3KddKwZ1Ww7SKWdI2wQprSgLmrTddT8nw92AjEklTsPBoSdQBhbI1bQ6Q==" - } - } - }, - "webfontloader": { - "version": "1.6.28", - "resolved": "https://registry.npmjs.org/webfontloader/-/webfontloader-1.6.28.tgz", - "integrity": "sha1-23hhKSU8tujq5UwvsF+HCvZnW64=" - }, "webidl-conversions": { "version": "4.0.2", "resolved": "https://registry.npmjs.org/webidl-conversions/-/webidl-conversions-4.0.2.tgz", @@ -22566,11 +22366,6 @@ "iconv-lite": "0.4.24" } }, - "whatwg-fetch": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/whatwg-fetch/-/whatwg-fetch-3.0.0.tgz", - "integrity": "sha512-9GSJUgz1D4MfyKU7KRqwOjXCXTqWdFNvEr7eUBYchQiVc744mqK/MzXPNR2WsPkmkOa4ywfg8C2n8h+13Bey1Q==" - }, "whatwg-mimetype": { "version": "2.3.0", "resolved": "https://registry.npmjs.org/whatwg-mimetype/-/whatwg-mimetype-2.3.0.tgz", @@ -22880,8 +22675,7 @@ "yocto-queue": { "version": "0.1.0", "resolved": "https://registry.npmjs.org/yocto-queue/-/yocto-queue-0.1.0.tgz", - "integrity": "sha512-rVksvsnNCdJ/ohGc6xgPwyN8eheCxsiLM8mxuE/t/mOVqJewPuO1miLpTHQiRgTKCLexL4MeAFVagts7HmNZ2Q==", - "dev": true + "integrity": "sha512-rVksvsnNCdJ/ohGc6xgPwyN8eheCxsiLM8mxuE/t/mOVqJewPuO1miLpTHQiRgTKCLexL4MeAFVagts7HmNZ2Q==" } } } diff --git a/package.json b/package.json index eadbebf31..d7498a3c9 100644 --- a/package.json +++ b/package.json @@ -44,9 +44,7 @@ "@types/node-fetch": "2.5.7", "@uifabric/react-cards": "0.109.110", "@uifabric/styling": "7.13.7", - "abort-controller": "3.0.0", "applicationinsights": "1.8.0", - "babel-polyfill": "6.26.0", "bootstrap": "3.4.1", "canvas": "file:./canvas", "clean-webpack-plugin": "0.1.19", @@ -60,8 +58,6 @@ "date-fns": "1.29.0", "dayjs": "1.8.19", "dotenv": "8.2.0", - "es6-object-assign": "1.1.0", - "es6-symbol": "3.1.3", "eslint-plugin-jest": "23.13.2", "eslint-plugin-react": "7.20.0", "hasher": "1.2.0", @@ -79,12 +75,9 @@ "monaco-editor": "0.18.1", "ms": "2.1.3", "msal": "1.4.4", - "object.entries": "1.1.0", "office-ui-fabric-react": "7.164.2", "p-retry": "4.2.0", "plotly.js-cartesian-dist-min": "1.52.3", - "promise-polyfill": "8.1.0", - "promise.prototype.finally": "3.1.0", "q": "1.5.1", "react": "16.13.1", "react-animate-height": "2.0.8", @@ -101,13 +94,9 @@ "rxjs": "6.6.3", "styled-components": "4.3.2", "swr": "0.4.0", - "text-encoding": "0.7.0", + "terser-webpack-plugin": "3.1.0", "underscore": "1.9.1", - "url-polyfill": "1.1.7", - "utility-types": "3.10.0", - "webcrypto-liner": "1.1.4", - "webfontloader": "1.6.28", - "whatwg-fetch": "3.0.0" + "utility-types": "3.10.0" }, "devDependencies": { "@babel/core": "7.9.0", @@ -137,9 +126,7 @@ "@types/react-redux": "7.1.7", "@types/sinon": "2.3.3", "@types/styled-components": "5.1.1", - "@types/text-encoding": "0.0.33", "@types/underscore": "1.7.36", - "@types/webfontloader": "1.6.29", "@typescript-eslint/eslint-plugin": "4.0.1", "@typescript-eslint/parser": "4.0.1", "axe-puppeteer": "1.1.0", @@ -181,7 +168,6 @@ "rimraf": "3.0.0", "sinon": "3.2.1", "style-loader": "0.23.0", - "terser-webpack-plugin": "3.0.5", "ts-loader": "6.2.2", "tslint": "5.11.0", "tslint-microsoft-contrib": "6.0.0", @@ -238,4 +224,4 @@ "prettier": { "printWidth": 120 } -} \ No newline at end of file +} diff --git a/src/Explorer/Graph/GraphExplorerComponent/GremlinSimpleClient.ts b/src/Explorer/Graph/GraphExplorerComponent/GremlinSimpleClient.ts index 1ca0365c3..e61f81964 100644 --- a/src/Explorer/Graph/GraphExplorerComponent/GremlinSimpleClient.ts +++ b/src/Explorer/Graph/GraphExplorerComponent/GremlinSimpleClient.ts @@ -4,11 +4,8 @@ * - inspired from gremlin-javascript for nodejs: https://github.com/jbmusso/gremlin-javascript * - tested on cosmosdb gremlin server * - only supports sessionless gremlin requests - * - Relies on text-encoding polyfill (github.com/inexorabletash/text-encoding) for TextEncoder/TextDecoder on IE, Edge. */ -import { TextEncoder, TextDecoder } from "text-encoding"; - export interface GremlinSimpleClientParameters { endpoint: string; // The websocket endpoint user: string; diff --git a/src/Libs/is-integer-polyfill.js b/src/Libs/is-integer-polyfill.js deleted file mode 100644 index 6370244e4..000000000 --- a/src/Libs/is-integer-polyfill.js +++ /dev/null @@ -1,5 +0,0 @@ -Number.isInteger = - Number.isInteger || - function(value) { - return typeof value === "number" && isFinite(value) && Math.floor(value) === value; - }; diff --git a/src/Main.tsx b/src/Main.tsx index 863efc532..ad24a844c 100644 --- a/src/Main.tsx +++ b/src/Main.tsx @@ -1,18 +1,8 @@ // CSS Dependencies -import "abort-controller/polyfill"; -import "babel-polyfill"; import "bootstrap/dist/css/bootstrap.css"; -import "es6-object-assign/auto"; -import "es6-symbol/implement"; -import "object.entries/auto"; import { initializeIcons } from "office-ui-fabric-react/lib/Icons"; -import "promise-polyfill/src/polyfill"; -import "promise.prototype.finally/auto"; import React, { useState } from "react"; import ReactDOM from "react-dom"; -import "url-polyfill/url-polyfill.min"; -import "webcrypto-liner/build/webcrypto-liner.shim.min"; -import "whatwg-fetch"; import "../externals/jquery-ui.min.css"; import "../externals/jquery-ui.min.js"; import "../externals/jquery-ui.structure.min.css"; @@ -64,7 +54,6 @@ import { useConfig } from "./hooks/useConfig"; import { useKnockoutExplorer } from "./hooks/useKnockoutExplorer"; import { useSidePanel } from "./hooks/useSidePanel"; import { KOCommentEnd, KOCommentIfStart } from "./koComment"; -import "./Libs/is-integer-polyfill"; import "./Libs/jquery"; import "./Shared/appInsights"; import { userContext } from "./UserContext"; diff --git a/src/Terminal/index.ts b/src/Terminal/index.ts index 5994d7057..d9cd73898 100644 --- a/src/Terminal/index.ts +++ b/src/Terminal/index.ts @@ -1,5 +1,3 @@ -import "babel-polyfill"; -import "promise-polyfill/src/polyfill"; // polyfill Promise on IE import "@jupyterlab/terminal/style/index.css"; import "./index.css"; import { ServerConnection } from "@jupyterlab/services"; diff --git a/src/setupTests.ts b/src/setupTests.ts index 1d06b89ca..86f378bc0 100644 --- a/src/setupTests.ts +++ b/src/setupTests.ts @@ -1,7 +1,8 @@ -import Adapter from "enzyme-adapter-react-16"; import { configure } from "enzyme"; +import Adapter from "enzyme-adapter-react-16"; import "jest-canvas-mock"; import { initializeIcons } from "office-ui-fabric-react"; +import { TextDecoder, TextEncoder } from "util"; configure({ adapter: new Adapter() }); initializeIcons(); @@ -13,3 +14,5 @@ if (typeof window.URL.createObjectURL === "undefined") { (window).$ = (window).jQuery = require("jquery"); (global).$ = (global).$.jQuery = require("jquery"); require("jquery-ui-dist/jquery-ui"); +(global).TextEncoder = TextEncoder; +(global).TextDecoder = TextDecoder; diff --git a/src/workers/upload/index.ts b/src/workers/upload/index.ts index 10b02a18c..7cf0ecd20 100644 --- a/src/workers/upload/index.ts +++ b/src/workers/upload/index.ts @@ -1,7 +1,6 @@ -import "babel-polyfill"; import { DocumentClientParams, UploadDetailsRecord, UploadDetails } from "./definitions"; import { client } from "../../Common/CosmosClient"; -import { configContext, updateConfigContext } from "../../ConfigContext"; +import { updateConfigContext } from "../../ConfigContext"; import { updateUserContext } from "../../UserContext"; import { getErrorMessage } from "../../Common/ErrorHandlingUtils"; diff --git a/tsconfig.json b/tsconfig.json index 59e7064d3..0d31cf8f3 100644 --- a/tsconfig.json +++ b/tsconfig.json @@ -11,7 +11,7 @@ "allowSyntheticDefaultImports": true, "downlevelIteration": true, "module": "esnext", - "target": "es5", + "target": "es2017", "experimentalDecorators": true, "emitDecoratorMetadata": true, "lib": ["es5", "es6", "dom", "webworker.importscripts"], diff --git a/webpack.config.js b/webpack.config.js index e6cd411e8..1c5f8193c 100644 --- a/webpack.config.js +++ b/webpack.config.js @@ -81,23 +81,6 @@ const typescriptRule = { exclude: /node_modules/, }; -// Third party modules are compiled with babel since using ts-loader that much causes webpack to run out of memory -const ModulesRule = { - test: /\.js$/, - use: [ - { - loader: "babel-loader", - options: { - cacheDirectory: ".cache/babel", - presets: [["@babel/preset-env", { targets: { ie: "11" }, useBuiltIns: false }]], - }, - }, - ], - include: /node_modules/, - // Exclude large modules we know don't need transpiling - exclude: /vega|monaco|plotly/, -}; - module.exports = function (env = {}, argv = {}) { const mode = argv.mode || "development"; const rules = [fontRule, lessRule, imagesRule, cssRule, htmlRule, typescriptRule]; @@ -107,7 +90,6 @@ module.exports = function (env = {}, argv = {}) { }; if (mode === "production") { - rules.push(ModulesRule); envVars.NODE_ENV = "production"; } @@ -235,7 +217,6 @@ module.exports = function (env = {}, argv = {}) { minimize: mode === "production" ? true : false, minimizer: [ new TerserPlugin({ - cache: ".cache/terser", terserOptions: { // These options increase our initial bundle size by ~5% but the builds are significantly faster and won't run out of memory compress: false, From 6b73560122d3b78bebfb44974471918842bb1966 Mon Sep 17 00:00:00 2001 From: Jordi Bunster Date: Mon, 29 Mar 2021 15:09:18 -0700 Subject: [PATCH 03/12] Create dependabot.yml --- .github/dependabot.yml | 9 +++++++++ 1 file changed, 9 insertions(+) create mode 100644 .github/dependabot.yml diff --git a/.github/dependabot.yml b/.github/dependabot.yml new file mode 100644 index 000000000..60fa0ee1a --- /dev/null +++ b/.github/dependabot.yml @@ -0,0 +1,9 @@ +# Please see the documentation for all configuration options: +# https://help.github.com/github/administering-a-repository/configuration-options-for-dependency-updates + +version: 2 +updates: + - package-ecosystem: "npm" + directory: "/" + schedule: + interval: "daily" From 72c2d8592b8bb2974e3e58191383a195458fbbdd Mon Sep 17 00:00:00 2001 From: vaidankarswapnil <81285216+vaidankarswapnil@users.noreply.github.com> Date: Mon, 29 Mar 2021 15:13:35 -0700 Subject: [PATCH 04/12] Fix lint for Database Account Utils (#583) --- .eslintignore | 2 -- 1 file changed, 2 deletions(-) diff --git a/.eslintignore b/.eslintignore index 052e75fa4..889d8e8d8 100644 --- a/.eslintignore +++ b/.eslintignore @@ -255,8 +255,6 @@ src/Terminal/NotebookAppContracts.d.ts src/Terminal/index.ts src/TokenProviders/PortalTokenProvider.ts src/TokenProviders/TokenProviderFactory.ts -src/Utils/DatabaseAccountUtils.test.ts -src/Utils/DatabaseAccountUtils.ts src/Utils/PricingUtils.test.ts src/Utils/QueryUtils.test.ts src/Utils/QueryUtils.ts From fad3a08fdf51bcfcf271058512aa247fbc7cbca7 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon, 29 Mar 2021 21:22:31 -0500 Subject: [PATCH 05/12] Bump node-fetch from 2.6.0 to 2.6.1 in /utils/deployment-status (#587) Bumps [node-fetch](https://github.com/bitinn/node-fetch) from 2.6.0 to 2.6.1. - [Release notes](https://github.com/bitinn/node-fetch/releases) - [Changelog](https://github.com/node-fetch/node-fetch/blob/master/docs/CHANGELOG.md) - [Commits](https://github.com/bitinn/node-fetch/compare/v2.6.0...v2.6.1) Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> --- utils/deployment-status/package-lock.json | 6 +++--- utils/deployment-status/package.json | 2 +- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/utils/deployment-status/package-lock.json b/utils/deployment-status/package-lock.json index 60a3d059c..cd7f0a461 100644 --- a/utils/deployment-status/package-lock.json +++ b/utils/deployment-status/package-lock.json @@ -51,9 +51,9 @@ "integrity": "sha512-al0MUK7cpIcglMv3YF13qSgdAIqxHTO7brRtaz3DlSULbqfazqkc5kEjNrLDOM7fsjshoFIihnU8snrP7zUvhQ==" }, "node-fetch": { - "version": "2.6.0", - "resolved": "https://registry.npmjs.org/node-fetch/-/node-fetch-2.6.0.tgz", - "integrity": "sha512-8dG4H5ujfvFiqDmVu9fQ5bOHUC15JMjMY/Zumv26oOvvVJjM67KF8koCWIabKQ1GJIa9r2mMZscBq/TbdOcmNA==" + "version": "2.6.1", + "resolved": "https://registry.npmjs.org/node-fetch/-/node-fetch-2.6.1.tgz", + "integrity": "sha512-V4aYg89jEoVRxRb2fJdAg8FHvI7cEyYdVAh94HH0UIK8oJxUfkjlDQN9RbMx+bEjP7+ggMiFRprSti032Oipxw==" }, "supports-color": { "version": "7.1.0", diff --git a/utils/deployment-status/package.json b/utils/deployment-status/package.json index 5eefa5108..40b922b18 100644 --- a/utils/deployment-status/package.json +++ b/utils/deployment-status/package.json @@ -12,6 +12,6 @@ "dependencies": { "chalk": "^4.1.0", "moment": "^2.27.0", - "node-fetch": "^2.6.0" + "node-fetch": "^2.6.1" } } From 343e82c102231c21da1102ae57a5ff4b64ae073a Mon Sep 17 00:00:00 2001 From: Hardikkumar Nai <80053762+hardiknai-techm@users.noreply.github.com> Date: Tue, 30 Mar 2021 07:56:41 +0530 Subject: [PATCH 06/12] Fix lint query utils (#487) * Fix Lint errors in QueryUtils * Format * Simplify diff Co-authored-by: Your Name Co-authored-by: Steve Faulkner Co-authored-by: Steve Faulkner <471400+southpolesteve@users.noreply.github.com> Co-authored-by: Jordi Bunster --- .eslintignore | 1 - src/Common/QueriesClient.ts | 2 +- src/Explorer/Tabs/DocumentsTab.ts | 2 +- src/Explorer/Tabs/QueryTab.ts | 2 +- src/Utils/QueryUtils.test.ts | 2 +- src/Utils/QueryUtils.ts | 218 +++++++++++++++--------------- 6 files changed, 111 insertions(+), 116 deletions(-) diff --git a/.eslintignore b/.eslintignore index 889d8e8d8..e32b753fd 100644 --- a/.eslintignore +++ b/.eslintignore @@ -257,7 +257,6 @@ src/TokenProviders/PortalTokenProvider.ts src/TokenProviders/TokenProviderFactory.ts src/Utils/PricingUtils.test.ts src/Utils/QueryUtils.test.ts -src/Utils/QueryUtils.ts src/applyExplorerBindings.ts src/global.d.ts src/setupTests.ts diff --git a/src/Common/QueriesClient.ts b/src/Common/QueriesClient.ts index 3ecac7051..b7146fdbf 100644 --- a/src/Common/QueriesClient.ts +++ b/src/Common/QueriesClient.ts @@ -6,7 +6,7 @@ import Explorer from "../Explorer/Explorer"; import DocumentsTab from "../Explorer/Tabs/DocumentsTab"; import DocumentId from "../Explorer/Tree/DocumentId"; import * as NotificationConsoleUtils from "../Utils/NotificationConsoleUtils"; -import { QueryUtils } from "../Utils/QueryUtils"; +import * as QueryUtils from "../Utils/QueryUtils"; import { BackendDefaults, HttpStatusCodes, SavedQueries } from "./Constants"; import { userContext } from "../UserContext"; import { queryDocumentsPage } from "./dataAccess/queryDocumentsPage"; diff --git a/src/Explorer/Tabs/DocumentsTab.ts b/src/Explorer/Tabs/DocumentsTab.ts index f678db1b6..b27028d3b 100644 --- a/src/Explorer/Tabs/DocumentsTab.ts +++ b/src/Explorer/Tabs/DocumentsTab.ts @@ -11,7 +11,7 @@ import editable from "../../Common/EditableUtility"; import * as HeadersUtility from "../../Common/HeadersUtility"; import TabsBase from "./TabsBase"; import { DocumentsGridMetrics } from "../../Common/Constants"; -import { QueryUtils } from "../../Utils/QueryUtils"; +import * as QueryUtils from "../../Utils/QueryUtils"; import { Splitter, SplitterBounds, SplitterDirection } from "../../Common/Splitter"; import * as TelemetryProcessor from "../../Shared/Telemetry/TelemetryProcessor"; import NewDocumentIcon from "../../../images/NewDocument.svg"; diff --git a/src/Explorer/Tabs/QueryTab.ts b/src/Explorer/Tabs/QueryTab.ts index 089eaf959..b91043440 100644 --- a/src/Explorer/Tabs/QueryTab.ts +++ b/src/Explorer/Tabs/QueryTab.ts @@ -9,7 +9,7 @@ import * as HeadersUtility from "../../Common/HeadersUtility"; import { Splitter, SplitterBounds, SplitterDirection } from "../../Common/Splitter"; import * as TelemetryProcessor from "../../Shared/Telemetry/TelemetryProcessor"; import ExecuteQueryIcon from "../../../images/ExecuteQuery.svg"; -import { QueryUtils } from "../../Utils/QueryUtils"; +import * as QueryUtils from "../../Utils/QueryUtils"; import SaveQueryIcon from "../../../images/save-cosmos.svg"; import { MinimalQueryIterator } from "../../Common/IteratorUtilities"; diff --git a/src/Utils/QueryUtils.test.ts b/src/Utils/QueryUtils.test.ts index d05f57d2e..76e525a06 100644 --- a/src/Utils/QueryUtils.test.ts +++ b/src/Utils/QueryUtils.test.ts @@ -2,7 +2,7 @@ import * as DataModels from "../Contracts/DataModels"; import * as Q from "q"; import * as sinon from "sinon"; import * as ViewModels from "../Contracts/ViewModels"; -import { QueryUtils } from "./QueryUtils"; +import * as QueryUtils from "./QueryUtils"; describe("Query Utils", () => { function generatePartitionKeyForPath(path: string): DataModels.PartitionKey { diff --git a/src/Utils/QueryUtils.ts b/src/Utils/QueryUtils.ts index 2b3aafc90..b652df70f 100644 --- a/src/Utils/QueryUtils.ts +++ b/src/Utils/QueryUtils.ts @@ -1,118 +1,114 @@ -import Q from "q"; import * as DataModels from "../Contracts/DataModels"; import * as ViewModels from "../Contracts/ViewModels"; -export class QueryUtils { - public static buildDocumentsQuery( - filter: string, - partitionKeyProperty: string, - partitionKey: DataModels.PartitionKey - ): string { - let query: string = partitionKeyProperty - ? `select c.id, c._self, c._rid, c._ts, ${QueryUtils.buildDocumentsQueryPartitionProjections( - "c", - partitionKey - )} as _partitionKeyValue from c` - : `select c.id, c._self, c._rid, c._ts from c`; +export function buildDocumentsQuery( + filter: string, + partitionKeyProperty: string, + partitionKey: DataModels.PartitionKey +): string { + let query = partitionKeyProperty + ? `select c.id, c._self, c._rid, c._ts, ${buildDocumentsQueryPartitionProjections( + "c", + partitionKey + )} as _partitionKeyValue from c` + : `select c.id, c._self, c._rid, c._ts from c`; - if (filter) { - query += " " + filter; - } - - return query; + if (filter) { + query += " " + filter; } - public static buildDocumentsQueryPartitionProjections( - collectionAlias: string, - partitionKey: DataModels.PartitionKey - ): string { - if (!partitionKey) { - return ""; - } - - // e.g., path /order/id will be projected as c["order"]["id"], - // to escape any property names that match a keyword - let projections = []; - for (let index in partitionKey.paths) { - // TODO: Handle "/" in partition key definitions - const projectedProperties: string[] = partitionKey.paths[index].split("/").slice(1); - let projectedProperty: string = ""; - - projectedProperties.forEach((property: string) => { - const projection = property.trim(); - if (projection.length > 0 && projection.charAt(0) != "'" && projection.charAt(0) != '"') { - projectedProperty = projectedProperty + `["${projection}"]`; - } else if (projection.length > 0 && projection.charAt(0) == "'") { - // trim single quotes and escape double quotes - const projectionSlice = projection.slice(1, projection.length - 1); - projectedProperty = - projectedProperty + `["${projectionSlice.replace(/\\"/g, '"').replace(/"/g, '\\\\\\"')}"]`; - } else { - projectedProperty = projectedProperty + `[${projection}]`; - } - }); - - projections.push(`${collectionAlias}${projectedProperty}`); - } - - return projections.join(","); - } - - public static async queryPagesUntilContentPresent( - firstItemIndex: number, - queryItems: (itemIndex: number) => Promise - ): Promise { - let roundTrips: number = 0; - let netRequestCharge: number = 0; - const doRequest = async (itemIndex: number): Promise => { - const results: ViewModels.QueryResults = await queryItems(itemIndex); - roundTrips = roundTrips + 1; - results.roundTrips = roundTrips; - results.requestCharge = Number(results.requestCharge) + netRequestCharge; - netRequestCharge = Number(results.requestCharge); - const resultsMetadata: ViewModels.QueryResultsMetadata = { - hasMoreResults: results.hasMoreResults, - itemCount: results.itemCount, - firstItemIndex: results.firstItemIndex, - lastItemIndex: results.lastItemIndex, - }; - if (resultsMetadata.itemCount === 0 && resultsMetadata.hasMoreResults) { - return await doRequest(resultsMetadata.lastItemIndex); - } - return results; - }; - - return await doRequest(firstItemIndex); - } - - public static async queryAllPages( - queryItems: (itemIndex: number) => Promise - ): Promise { - const queryResults: ViewModels.QueryResults = { - documents: [], - activityId: undefined, - hasMoreResults: false, - itemCount: 0, - firstItemIndex: 0, - lastItemIndex: 0, - requestCharge: 0, - roundTrips: 0, - }; - const doRequest = async (itemIndex: number): Promise => { - const results: ViewModels.QueryResults = await queryItems(itemIndex); - const { requestCharge, hasMoreResults, itemCount, lastItemIndex, documents } = results; - queryResults.roundTrips = queryResults.roundTrips + 1; - queryResults.requestCharge = Number(queryResults.requestCharge) + Number(requestCharge); - queryResults.hasMoreResults = hasMoreResults; - queryResults.itemCount = queryResults.itemCount + itemCount; - queryResults.lastItemIndex = lastItemIndex; - queryResults.documents = queryResults.documents.concat(documents); - if (queryResults.hasMoreResults) { - return doRequest(queryResults.lastItemIndex + 1); - } - return queryResults; - }; - - return doRequest(0); - } + return query; } + +export function buildDocumentsQueryPartitionProjections( + collectionAlias: string, + partitionKey?: DataModels.PartitionKey +): string { + if (!partitionKey) { + return ""; + } + + // e.g., path /order/id will be projected as c["order"]["id"], + // to escape any property names that match a keyword + const projections = []; + for (const index in partitionKey.paths) { + // TODO: Handle "/" in partition key definitions + const projectedProperties: string[] = partitionKey.paths[index].split("/").slice(1); + let projectedProperty = ""; + + projectedProperties.forEach((property: string) => { + const projection = property.trim(); + if (projection.length > 0 && projection.charAt(0) !== "'" && projection.charAt(0) !== '"') { + projectedProperty += `["${projection}"]`; + } else if (projection.length > 0 && projection.charAt(0) === "'") { + // trim single quotes and escape double quotes + const projectionSlice = projection.slice(1, projection.length - 1); + projectedProperty += `["${projectionSlice.replace(/\\"/g, '"').replace(/"/g, '\\\\\\"')}"]`; + } else { + projectedProperty += `[${projection}]`; + } + }); + + projections.push(`${collectionAlias}${projectedProperty}`); + } + + return projections.join(","); +} + +export const queryPagesUntilContentPresent = async ( + firstItemIndex: number, + queryItems: (itemIndex: number) => Promise +): Promise => { + let roundTrips = 0; + let netRequestCharge = 0; + const doRequest = async (itemIndex: number): Promise => { + const results = await queryItems(itemIndex); + roundTrips = roundTrips + 1; + results.roundTrips = roundTrips; + results.requestCharge = Number(results.requestCharge) + netRequestCharge; + netRequestCharge = Number(results.requestCharge); + const resultsMetadata = { + hasMoreResults: results.hasMoreResults, + itemCount: results.itemCount, + firstItemIndex: results.firstItemIndex, + lastItemIndex: results.lastItemIndex, + }; + if (resultsMetadata.itemCount === 0 && resultsMetadata.hasMoreResults) { + return await doRequest(resultsMetadata.lastItemIndex); + } + return results; + }; + + return await doRequest(firstItemIndex); +}; + +export const queryAllPages = async ( + queryItems: (itemIndex: number) => Promise +): Promise => { + const queryResults: ViewModels.QueryResults = { + documents: [], + activityId: undefined, + hasMoreResults: false, + itemCount: 0, + firstItemIndex: 0, + lastItemIndex: 0, + requestCharge: 0, + roundTrips: 0, + }; + const doRequest = async (itemIndex: number): Promise => { + const results = await queryItems(itemIndex); + const { requestCharge, hasMoreResults, itemCount, lastItemIndex, documents } = results; + queryResults.roundTrips = queryResults.roundTrips + 1; + queryResults.requestCharge = Number(queryResults.requestCharge) + Number(requestCharge); + queryResults.hasMoreResults = hasMoreResults; + queryResults.itemCount = queryResults.itemCount + itemCount; + queryResults.lastItemIndex = lastItemIndex; + queryResults.documents = queryResults.documents.concat(documents); + if (queryResults.hasMoreResults) { + return doRequest(queryResults.lastItemIndex + 1); + } + return queryResults; + }; + + return doRequest(0); +}; From c9eb61351a6e07c4ced06876c51eda43915bc0b7 Mon Sep 17 00:00:00 2001 From: Steve Faulkner Date: Mon, 29 Mar 2021 21:56:25 -0500 Subject: [PATCH 07/12] Remove unused inline-css package (#593) --- package-lock.json | 889 ---------------------------------------------- package.json | 1 - 2 files changed, 890 deletions(-) diff --git a/package-lock.json b/package-lock.json index 1b5386d33..3093a0951 100644 --- a/package-lock.json +++ b/package-lock.json @@ -2203,12 +2203,6 @@ "@types/yargs": "^13.0.0" } }, - "@jonkemp/package-utils": { - "version": "1.0.7", - "resolved": "https://registry.npmjs.org/@jonkemp/package-utils/-/package-utils-1.0.7.tgz", - "integrity": "sha512-OoK+K1RmhtS8SlORrlH7sW0CNdrnm0BxKNcv4pQIk6y6VORsHiX91gV3dh6XD2eS7J+iCXROcu5sGuH0tjmNEQ==", - "dev": true - }, "@jupyterlab/apputils": { "version": "3.0.2", "resolved": "https://registry.npmjs.org/@jupyterlab/apputils/-/apputils-3.0.2.tgz", @@ -4008,12 +4002,6 @@ "@testing-library/dom": "^7.28.1" } }, - "@tootallnate/once": { - "version": "1.1.2", - "resolved": "https://registry.npmjs.org/@tootallnate/once/-/once-1.1.2.tgz", - "integrity": "sha512-RbzJvlNzmRq5c3O09UipeuXno4tA1FE6ikOjxZK0tuxVv3412l64l5t1W5pj4+rJq9vpkm/kwiR07aZXnsKPxw==", - "dev": true - }, "@types/anymatch": { "version": "1.3.1", "resolved": "https://registry.npmjs.org/@types/anymatch/-/anymatch-1.3.1.tgz", @@ -7592,12 +7580,6 @@ "integrity": "sha1-4wOogrNCzD7oylE6eZmXNNqzriw=", "dev": true }, - "cookiejar": { - "version": "2.1.2", - "resolved": "https://registry.npmjs.org/cookiejar/-/cookiejar-2.1.2.tgz", - "integrity": "sha512-Mw+adcfzPxcPeI+0WlvRrr/3lGVO0bD75SxX6811cxSh1Wbxx7xZBGK1eVtDf6si8rg2lhnUjsVLMFMfbRIuwA==", - "dev": true - }, "copy-concurrently": { "version": "1.0.5", "resolved": "https://registry.npmjs.org/copy-concurrently/-/copy-concurrently-1.0.5.tgz", @@ -7901,23 +7883,6 @@ } } }, - "css-rules": { - "version": "1.0.9", - "resolved": "https://registry.npmjs.org/css-rules/-/css-rules-1.0.9.tgz", - "integrity": "sha512-HU0mZu0RFIjRRWn4QIAO8MaE1W7q+JSCIiiKE9g2s3b0xgDEAYXG/F9n35xAkaU9NpvUbxBTMJWx1quRRPXbjg==", - "dev": true, - "requires": { - "cssom": "^0.4.4" - }, - "dependencies": { - "cssom": { - "version": "0.4.4", - "resolved": "https://registry.npmjs.org/cssom/-/cssom-0.4.4.tgz", - "integrity": "sha512-p3pvU7r1MyyqbTk+WbNJIgJjG2VmTIaB10rI93LzVPrmDJKkzKYMtxxyAvQXR/NS6otuzveI7+7BBq3SjBS2mw==", - "dev": true - } - } - }, "css-select": { "version": "3.1.2", "resolved": "https://registry.npmjs.org/css-select/-/css-select-3.1.2.tgz", @@ -8417,12 +8382,6 @@ "assert-plus": "^1.0.0" } }, - "data-uri-to-buffer": { - "version": "3.0.1", - "resolved": "https://registry.npmjs.org/data-uri-to-buffer/-/data-uri-to-buffer-3.0.1.tgz", - "integrity": "sha512-WboRycPNsVw3B3TL559F7kuBUM4d8CgMEvk6xEJlOp7OBPjt6G7z8WMWlD2rOFZLk6OYfFIUGsCOWzcQH9K2og==", - "dev": true - }, "data-urls": { "version": "1.1.0", "resolved": "https://registry.npmjs.org/data-urls/-/data-urls-1.1.0.tgz", @@ -8650,34 +8609,6 @@ } } }, - "degenerator": { - "version": "2.2.0", - "resolved": "https://registry.npmjs.org/degenerator/-/degenerator-2.2.0.tgz", - "integrity": "sha512-aiQcQowF01RxFI4ZLFMpzyotbQonhNpBao6dkI8JPk5a+hmSjR5ErHp2CQySmQe8os3VBqLCIh87nDBgZXvsmg==", - "dev": true, - "requires": { - "ast-types": "^0.13.2", - "escodegen": "^1.8.1", - "esprima": "^4.0.0" - }, - "dependencies": { - "ast-types": { - "version": "0.13.4", - "resolved": "https://registry.npmjs.org/ast-types/-/ast-types-0.13.4.tgz", - "integrity": "sha512-x1FCFnFifvYDDzTaLII71vG5uvDwgtmDTEVWAxrgeiR8VjMONcCXJx7E+USjDtHlwFmt9MysbqgF9b9Vjr6w+w==", - "dev": true, - "requires": { - "tslib": "^2.0.1" - } - }, - "tslib": { - "version": "2.1.0", - "resolved": "https://registry.npmjs.org/tslib/-/tslib-2.1.0.tgz", - "integrity": "sha512-hcVC3wYEziELGGmEEXue7D75zbwIIVUMWAVbHItGPx0ziyXxrOMQx4rQEVEV45Ut/1IotuEvwqPopzIOkDMf0A==", - "dev": true - } - } - }, "del": { "version": "4.1.1", "resolved": "https://registry.npmjs.org/del/-/del-4.1.1.tgz", @@ -10130,18 +10061,6 @@ } } }, - "extract-css": { - "version": "1.5.5", - "resolved": "https://registry.npmjs.org/extract-css/-/extract-css-1.5.5.tgz", - "integrity": "sha512-fvNKsWJxK8WaSyl9CsSw2lSn8qEKe0rBOaZXZ/fkCeux4tInHoFjTA1YBDi55iNwWTfe9VfLFsoBPCIIn5eArw==", - "dev": true, - "requires": { - "batch": "^0.6.1", - "href-content": "^1.2.3", - "list-stylesheets": "^1.2.8", - "style-data": "^1.4.6" - } - }, "extract-zip": { "version": "2.0.1", "resolved": "https://registry.npmjs.org/extract-zip/-/extract-zip-2.0.1.tgz", @@ -10254,12 +10173,6 @@ "resolved": "https://registry.npmjs.org/fast-memoize/-/fast-memoize-2.5.2.tgz", "integrity": "sha512-Ue0LwpDYErFbmNnZSF0UH6eImUwDmogUO1jyE+JbN2gsQz/jICm1Ve7t9QT0rNSsfJt+Hs4/S3GnsDVjL4HVrw==" }, - "fast-safe-stringify": { - "version": "2.0.7", - "resolved": "https://registry.npmjs.org/fast-safe-stringify/-/fast-safe-stringify-2.0.7.tgz", - "integrity": "sha512-Utm6CdzT+6xsDk2m8S6uL8VHxNwI6Jub+e9NYTcAms28T84pTa25GJQV9j0CY0N1rM8hK4x6grpF2BQf+2qwVA==", - "dev": true - }, "fastparse": { "version": "1.1.2", "resolved": "https://registry.npmjs.org/fastparse/-/fastparse-1.1.2.tgz", @@ -10351,12 +10264,6 @@ "resolved": "https://registry.npmjs.org/file-saver/-/file-saver-2.0.5.tgz", "integrity": "sha512-P9bmyZ3h/PRG+Nzga+rbdI4OEpNDzAVyy74uVO9ATgzLK6VtAsYybF/+TOCvrc0MO793d6+42lLyZTw7/ArVzA==" }, - "file-uri-to-path": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/file-uri-to-path/-/file-uri-to-path-2.0.0.tgz", - "integrity": "sha512-hjPFI8oE/2iQPVe4gbrJ73Pp+Xfub2+WI2LlXDbsaJBwT5wuMh35WNWVYYTpnz895shtwfyutMFLFywpQAFdLg==", - "dev": true - }, "filesize": { "version": "3.6.1", "resolved": "https://registry.npmjs.org/filesize/-/filesize-3.6.1.tgz", @@ -10687,12 +10594,6 @@ "integrity": "sha512-r5wGx7YeOwNWNlCA0wQ86zKyDLMQr+/RB8xy74M4hTphfmjlijTSSXGuH8rnvKZnfT9i+75zmd8jcKdMR4O6jA==", "dev": true }, - "flatten": { - "version": "1.0.3", - "resolved": "https://registry.npmjs.org/flatten/-/flatten-1.0.3.tgz", - "integrity": "sha512-dVsPA/UwQ8+2uoFe5GHtiBMu48dWLTdsuEd7CKGlZlD78r1TTWBvDuFaFGKCo/ZfEr95Uk56vZoX86OsHkUeIg==", - "dev": true - }, "flush-write-stream": { "version": "1.1.1", "resolved": "https://registry.npmjs.org/flush-write-stream/-/flush-write-stream-1.1.1.tgz", @@ -10776,12 +10677,6 @@ "samsam": "1.x" } }, - "formidable": { - "version": "1.2.2", - "resolved": "https://registry.npmjs.org/formidable/-/formidable-1.2.2.tgz", - "integrity": "sha512-V8gLm+41I/8kguQ4/o1D3RIHRmhYFG4pnNyonvua+40rqcEmT4+V71yaZ3B457xbbgCsCfjSPi65u/W6vK1U5Q==", - "dev": true - }, "forwarded": { "version": "0.1.2", "resolved": "https://registry.npmjs.org/forwarded/-/forwarded-0.1.2.tgz", @@ -10893,48 +10788,6 @@ "nan": "^2.12.1" } }, - "ftp": { - "version": "0.3.10", - "resolved": "https://registry.npmjs.org/ftp/-/ftp-0.3.10.tgz", - "integrity": "sha1-kZfYYa2BQvPmPVqDv+TFn3MwiF0=", - "dev": true, - "requires": { - "readable-stream": "1.1.x", - "xregexp": "2.0.0" - }, - "dependencies": { - "isarray": { - "version": "0.0.1", - "resolved": "https://registry.npmjs.org/isarray/-/isarray-0.0.1.tgz", - "integrity": "sha1-ihis/Kmo9Bd+Cav8YDiTmwXR7t8=", - "dev": true - }, - "readable-stream": { - "version": "1.1.14", - "resolved": "https://registry.npmjs.org/readable-stream/-/readable-stream-1.1.14.tgz", - "integrity": "sha1-fPTFTvZI44EwhMY23SB54WbAgdk=", - "dev": true, - "requires": { - "core-util-is": "~1.0.0", - "inherits": "~2.0.1", - "isarray": "0.0.1", - "string_decoder": "~0.10.x" - } - }, - "string_decoder": { - "version": "0.10.31", - "resolved": "https://registry.npmjs.org/string_decoder/-/string_decoder-0.10.31.tgz", - "integrity": "sha1-YuIDvEF2bGwoyfyEMB2rHFMQ+pQ=", - "dev": true - }, - "xregexp": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/xregexp/-/xregexp-2.0.0.tgz", - "integrity": "sha1-UqY+VsoLhKfzpfPWGHLxJq16WUM=", - "dev": true - } - } - }, "function-bind": { "version": "1.1.1", "resolved": "https://registry.npmjs.org/function-bind/-/function-bind-1.1.1.tgz", @@ -11014,33 +10867,6 @@ "pump": "^3.0.0" } }, - "get-uri": { - "version": "3.0.2", - "resolved": "https://registry.npmjs.org/get-uri/-/get-uri-3.0.2.tgz", - "integrity": "sha512-+5s0SJbGoyiJTZZ2JTpFPLMPSch72KEqGOTvQsBqg0RBWvwhWUSYZFAtz3TPW0GXJuLBJPts1E241iHg+VRfhg==", - "dev": true, - "requires": { - "@tootallnate/once": "1", - "data-uri-to-buffer": "3", - "debug": "4", - "file-uri-to-path": "2", - "fs-extra": "^8.1.0", - "ftp": "^0.3.10" - }, - "dependencies": { - "fs-extra": { - "version": "8.1.0", - "resolved": "https://registry.npmjs.org/fs-extra/-/fs-extra-8.1.0.tgz", - "integrity": "sha512-yhlQgA6mnOJUKOsRUFsgJdQCvkKhcz8tlZG5HBQfReYZy46OwLcY+Zia0mtdHsOo9y/hP+CxMN0TU9QxoOtG4g==", - "dev": true, - "requires": { - "graceful-fs": "^4.2.0", - "jsonfile": "^4.0.0", - "universalify": "^0.1.0" - } - } - } - }, "get-value": { "version": "2.0.6", "resolved": "https://registry.npmjs.org/get-value/-/get-value-2.0.6.tgz", @@ -11575,15 +11401,6 @@ "wbuf": "^1.1.0" } }, - "href-content": { - "version": "1.2.3", - "resolved": "https://registry.npmjs.org/href-content/-/href-content-1.2.3.tgz", - "integrity": "sha512-Ap8D5Bw0e0IpRMxw6vX6+w6TRie5Jpto92529WxfZLDSpwB0u0cuX7xuRXSSvy/M1vvPRluvME2ktK5n0znoAA==", - "dev": true, - "requires": { - "remote-content": "^1.2.3" - } - }, "html-element-map": { "version": "1.3.0", "resolved": "https://registry.npmjs.org/html-element-map/-/html-element-map-1.3.0.tgz", @@ -11796,17 +11613,6 @@ "requires-port": "^1.0.0" } }, - "http-proxy-agent": { - "version": "4.0.1", - "resolved": "https://registry.npmjs.org/http-proxy-agent/-/http-proxy-agent-4.0.1.tgz", - "integrity": "sha512-k0zdNgqWTGA6aeIRVpvfVob4fL52dTfaehylg0Y4UvSySvOq/Y+BOyPrgpUrA7HylqvU8vIZGsRuXmspskV0Tg==", - "dev": true, - "requires": { - "@tootallnate/once": "1", - "agent-base": "6", - "debug": "4" - } - }, "http-proxy-middleware": { "version": "0.19.1", "resolved": "https://registry.npmjs.org/http-proxy-middleware/-/http-proxy-middleware-0.19.1.tgz", @@ -12006,142 +11812,6 @@ "resolved": "https://registry.npmjs.org/ini/-/ini-1.3.8.tgz", "integrity": "sha512-JV/yugV2uzW5iMRSiZAyDtQd+nxtUnjeLt0acNdw98kKLrvuRVyB80tsREOE7yvGVgalhZ6RNXCmEHkUKBKxew==" }, - "inline-css": { - "version": "2.2.5", - "resolved": "https://registry.npmjs.org/inline-css/-/inline-css-2.2.5.tgz", - "integrity": "sha1-kbOAq+E1LlXP6uW9ZgtP81oGuDQ=", - "dev": true, - "requires": { - "bluebird": "^3.5.1", - "cheerio": "0.22.0", - "css-rules": "^1.0.0", - "extend": "^3.0.0", - "extract-css": "^1.0.0", - "flatten": "^1.0.2", - "object.pick": "^1.1.1", - "slick": "^1.12.1", - "specificity": "^0.3.2" - }, - "dependencies": { - "cheerio": { - "version": "0.22.0", - "resolved": "https://registry.npmjs.org/cheerio/-/cheerio-0.22.0.tgz", - "integrity": "sha1-qbqoYKP5tZWmuBsahocxIe06Jp4=", - "dev": true, - "requires": { - "css-select": "~1.2.0", - "dom-serializer": "~0.1.0", - "entities": "~1.1.1", - "htmlparser2": "^3.9.1", - "lodash.assignin": "^4.0.9", - "lodash.bind": "^4.1.4", - "lodash.defaults": "^4.0.1", - "lodash.filter": "^4.4.0", - "lodash.flatten": "^4.2.0", - "lodash.foreach": "^4.3.0", - "lodash.map": "^4.4.0", - "lodash.merge": "^4.4.0", - "lodash.pick": "^4.2.1", - "lodash.reduce": "^4.4.0", - "lodash.reject": "^4.4.0", - "lodash.some": "^4.4.0" - } - }, - "css-select": { - "version": "1.2.0", - "resolved": "https://registry.npmjs.org/css-select/-/css-select-1.2.0.tgz", - "integrity": "sha1-KzoRBTnFNV8c2NMUYj6HCxIeyFg=", - "dev": true, - "requires": { - "boolbase": "~1.0.0", - "css-what": "2.1", - "domutils": "1.5.1", - "nth-check": "~1.0.1" - } - }, - "css-what": { - "version": "2.1.3", - "resolved": "https://registry.npmjs.org/css-what/-/css-what-2.1.3.tgz", - "integrity": "sha512-a+EPoD+uZiNfh+5fxw2nO9QwFa6nJe2Or35fGY6Ipw1R3R4AGz1d1TEZrCegvw2YTmZ0jXirGYlzxxpYSHwpEg==", - "dev": true - }, - "dom-serializer": { - "version": "0.1.1", - "resolved": "https://registry.npmjs.org/dom-serializer/-/dom-serializer-0.1.1.tgz", - "integrity": "sha512-l0IU0pPzLWSHBcieZbpOKgkIn3ts3vAh7ZuFyXNwJxJXk/c4Gwj9xaTJwIDVQCXawWD0qb3IzMGH5rglQaO0XA==", - "dev": true, - "requires": { - "domelementtype": "^1.3.0", - "entities": "^1.1.1" - } - }, - "domelementtype": { - "version": "1.3.1", - "resolved": "https://registry.npmjs.org/domelementtype/-/domelementtype-1.3.1.tgz", - "integrity": "sha512-BSKB+TSpMpFI/HOxCNr1O8aMOTZ8hT3pM3GQ0w/mWRmkhEDSFJkkyzz4XQsBV44BChwGkrDfMyjVD0eA2aFV3w==", - "dev": true - }, - "domhandler": { - "version": "2.4.2", - "resolved": "https://registry.npmjs.org/domhandler/-/domhandler-2.4.2.tgz", - "integrity": "sha512-JiK04h0Ht5u/80fdLMCEmV4zkNh2BcoMFBmZ/91WtYZ8qVXSKjiw7fXMgFPnHcSZgOo3XdinHvmnDUeMf5R4wA==", - "dev": true, - "requires": { - "domelementtype": "1" - } - }, - "domutils": { - "version": "1.5.1", - "resolved": "https://registry.npmjs.org/domutils/-/domutils-1.5.1.tgz", - "integrity": "sha1-3NhIiib1Y9YQeeSMn3t+Mjc2gs8=", - "dev": true, - "requires": { - "dom-serializer": "0", - "domelementtype": "1" - } - }, - "entities": { - "version": "1.1.2", - "resolved": "https://registry.npmjs.org/entities/-/entities-1.1.2.tgz", - "integrity": "sha512-f2LZMYl1Fzu7YSBKg+RoROelpOaNrcGmE9AZubeDfrCEia483oW4MI4VyFd5VNHIgQ/7qm1I0wUHK1eJnn2y2w==", - "dev": true - }, - "htmlparser2": { - "version": "3.10.1", - "resolved": "https://registry.npmjs.org/htmlparser2/-/htmlparser2-3.10.1.tgz", - "integrity": "sha512-IgieNijUMbkDovyoKObU1DUhm1iwNYE/fuifEoEHfd1oZKZDaONBSkal7Y01shxsM49R4XaMdGez3WnF9UfiCQ==", - "dev": true, - "requires": { - "domelementtype": "^1.3.1", - "domhandler": "^2.3.0", - "domutils": "^1.5.1", - "entities": "^1.1.1", - "inherits": "^2.0.1", - "readable-stream": "^3.1.1" - } - }, - "nth-check": { - "version": "1.0.2", - "resolved": "https://registry.npmjs.org/nth-check/-/nth-check-1.0.2.tgz", - "integrity": "sha512-WeBOdju8SnzPN5vTUJYxYUxLeXpCaVP5i5e0LF8fg7WORF2Wd7wFX/pk0tYZk7s8T+J7VLy0Da6J1+wCT0AtHg==", - "dev": true, - "requires": { - "boolbase": "~1.0.0" - } - }, - "readable-stream": { - "version": "3.6.0", - "resolved": "https://registry.npmjs.org/readable-stream/-/readable-stream-3.6.0.tgz", - "integrity": "sha512-BViHy7LKeTz4oNnkcLJ+lVSL6vpiFeX6/d3oSH8zCW7UxP2onchk+vTGB143xuFjHS3deTgkKoXXymXqymiIdA==", - "dev": true, - "requires": { - "inherits": "^2.0.3", - "string_decoder": "^1.1.1", - "util-deprecate": "^1.0.1" - } - } - } - }, "internal-ip": { "version": "4.3.0", "resolved": "https://registry.npmjs.org/internal-ip/-/internal-ip-4.3.0.tgz", @@ -15084,135 +14754,6 @@ "integrity": "sha1-HADHQ7QzzQpOgHWPe2SldEDZ/wA=", "dev": true }, - "list-stylesheets": { - "version": "1.2.9", - "resolved": "https://registry.npmjs.org/list-stylesheets/-/list-stylesheets-1.2.9.tgz", - "integrity": "sha512-d0Mlv8tlsstnwW8yIJLPRBoXczmQj4uh66lp8pWn1/aiyVXb3tBS8flUuYsgvKfJdKJBiHJ5m8PLDcx5EikDOg==", - "dev": true, - "requires": { - "cheerio": "^0.22.0", - "pick-util": "^1.1.3" - }, - "dependencies": { - "cheerio": { - "version": "0.22.0", - "resolved": "https://registry.npmjs.org/cheerio/-/cheerio-0.22.0.tgz", - "integrity": "sha1-qbqoYKP5tZWmuBsahocxIe06Jp4=", - "dev": true, - "requires": { - "css-select": "~1.2.0", - "dom-serializer": "~0.1.0", - "entities": "~1.1.1", - "htmlparser2": "^3.9.1", - "lodash.assignin": "^4.0.9", - "lodash.bind": "^4.1.4", - "lodash.defaults": "^4.0.1", - "lodash.filter": "^4.4.0", - "lodash.flatten": "^4.2.0", - "lodash.foreach": "^4.3.0", - "lodash.map": "^4.4.0", - "lodash.merge": "^4.4.0", - "lodash.pick": "^4.2.1", - "lodash.reduce": "^4.4.0", - "lodash.reject": "^4.4.0", - "lodash.some": "^4.4.0" - } - }, - "css-select": { - "version": "1.2.0", - "resolved": "https://registry.npmjs.org/css-select/-/css-select-1.2.0.tgz", - "integrity": "sha1-KzoRBTnFNV8c2NMUYj6HCxIeyFg=", - "dev": true, - "requires": { - "boolbase": "~1.0.0", - "css-what": "2.1", - "domutils": "1.5.1", - "nth-check": "~1.0.1" - } - }, - "css-what": { - "version": "2.1.3", - "resolved": "https://registry.npmjs.org/css-what/-/css-what-2.1.3.tgz", - "integrity": "sha512-a+EPoD+uZiNfh+5fxw2nO9QwFa6nJe2Or35fGY6Ipw1R3R4AGz1d1TEZrCegvw2YTmZ0jXirGYlzxxpYSHwpEg==", - "dev": true - }, - "dom-serializer": { - "version": "0.1.1", - "resolved": "https://registry.npmjs.org/dom-serializer/-/dom-serializer-0.1.1.tgz", - "integrity": "sha512-l0IU0pPzLWSHBcieZbpOKgkIn3ts3vAh7ZuFyXNwJxJXk/c4Gwj9xaTJwIDVQCXawWD0qb3IzMGH5rglQaO0XA==", - "dev": true, - "requires": { - "domelementtype": "^1.3.0", - "entities": "^1.1.1" - } - }, - "domelementtype": { - "version": "1.3.1", - "resolved": "https://registry.npmjs.org/domelementtype/-/domelementtype-1.3.1.tgz", - "integrity": "sha512-BSKB+TSpMpFI/HOxCNr1O8aMOTZ8hT3pM3GQ0w/mWRmkhEDSFJkkyzz4XQsBV44BChwGkrDfMyjVD0eA2aFV3w==", - "dev": true - }, - "domhandler": { - "version": "2.4.2", - "resolved": "https://registry.npmjs.org/domhandler/-/domhandler-2.4.2.tgz", - "integrity": "sha512-JiK04h0Ht5u/80fdLMCEmV4zkNh2BcoMFBmZ/91WtYZ8qVXSKjiw7fXMgFPnHcSZgOo3XdinHvmnDUeMf5R4wA==", - "dev": true, - "requires": { - "domelementtype": "1" - } - }, - "domutils": { - "version": "1.5.1", - "resolved": "https://registry.npmjs.org/domutils/-/domutils-1.5.1.tgz", - "integrity": "sha1-3NhIiib1Y9YQeeSMn3t+Mjc2gs8=", - "dev": true, - "requires": { - "dom-serializer": "0", - "domelementtype": "1" - } - }, - "entities": { - "version": "1.1.2", - "resolved": "https://registry.npmjs.org/entities/-/entities-1.1.2.tgz", - "integrity": "sha512-f2LZMYl1Fzu7YSBKg+RoROelpOaNrcGmE9AZubeDfrCEia483oW4MI4VyFd5VNHIgQ/7qm1I0wUHK1eJnn2y2w==", - "dev": true - }, - "htmlparser2": { - "version": "3.10.1", - "resolved": "https://registry.npmjs.org/htmlparser2/-/htmlparser2-3.10.1.tgz", - "integrity": "sha512-IgieNijUMbkDovyoKObU1DUhm1iwNYE/fuifEoEHfd1oZKZDaONBSkal7Y01shxsM49R4XaMdGez3WnF9UfiCQ==", - "dev": true, - "requires": { - "domelementtype": "^1.3.1", - "domhandler": "^2.3.0", - "domutils": "^1.5.1", - "entities": "^1.1.1", - "inherits": "^2.0.1", - "readable-stream": "^3.1.1" - } - }, - "nth-check": { - "version": "1.0.2", - "resolved": "https://registry.npmjs.org/nth-check/-/nth-check-1.0.2.tgz", - "integrity": "sha512-WeBOdju8SnzPN5vTUJYxYUxLeXpCaVP5i5e0LF8fg7WORF2Wd7wFX/pk0tYZk7s8T+J7VLy0Da6J1+wCT0AtHg==", - "dev": true, - "requires": { - "boolbase": "~1.0.0" - } - }, - "readable-stream": { - "version": "3.6.0", - "resolved": "https://registry.npmjs.org/readable-stream/-/readable-stream-3.6.0.tgz", - "integrity": "sha512-BViHy7LKeTz4oNnkcLJ+lVSL6vpiFeX6/d3oSH8zCW7UxP2onchk+vTGB143xuFjHS3deTgkKoXXymXqymiIdA==", - "dev": true, - "requires": { - "inherits": "^2.0.3", - "string_decoder": "^1.1.1", - "util-deprecate": "^1.0.1" - } - } - } - }, "load-json-file": { "version": "4.0.0", "resolved": "https://registry.npmjs.org/load-json-file/-/load-json-file-4.0.0.tgz", @@ -15274,18 +14815,6 @@ "resolved": "https://registry.npmjs.org/lodash-es/-/lodash-es-4.17.20.tgz", "integrity": "sha512-JD1COMZsq8maT6mnuz1UMV0jvYD0E0aUsSOdrr1/nAG3dhqQXwRRgeW0cSqH1U43INKcqxaiVIQNOUDld7gRDA==" }, - "lodash.assignin": { - "version": "4.2.0", - "resolved": "https://registry.npmjs.org/lodash.assignin/-/lodash.assignin-4.2.0.tgz", - "integrity": "sha1-uo31+4QesKPoBEIysOJjqNxqKKI=", - "dev": true - }, - "lodash.bind": { - "version": "4.2.1", - "resolved": "https://registry.npmjs.org/lodash.bind/-/lodash.bind-4.2.1.tgz", - "integrity": "sha1-euMBfpOWIqwxt9fX3LGzTbFpDTU=", - "dev": true - }, "lodash.camelcase": { "version": "4.3.0", "resolved": "https://registry.npmjs.org/lodash.camelcase/-/lodash.camelcase-4.3.0.tgz", @@ -15306,30 +14835,12 @@ "resolved": "https://registry.npmjs.org/lodash.debounce/-/lodash.debounce-4.0.8.tgz", "integrity": "sha1-gteb/zCmfEAF/9XiUVMArZyk168=" }, - "lodash.defaults": { - "version": "4.2.0", - "resolved": "https://registry.npmjs.org/lodash.defaults/-/lodash.defaults-4.2.0.tgz", - "integrity": "sha1-0JF4cW/+pN3p5ft7N/bwgCJ0WAw=", - "dev": true - }, "lodash.escape": { "version": "4.0.1", "resolved": "https://registry.npmjs.org/lodash.escape/-/lodash.escape-4.0.1.tgz", "integrity": "sha1-yQRGkMIeBClL6qUXcS/e0fqI3pg=", "dev": true }, - "lodash.filter": { - "version": "4.6.0", - "resolved": "https://registry.npmjs.org/lodash.filter/-/lodash.filter-4.6.0.tgz", - "integrity": "sha1-ZosdSYFgOuHMWm+nYBQ+SAtMSs4=", - "dev": true - }, - "lodash.flatten": { - "version": "4.4.0", - "resolved": "https://registry.npmjs.org/lodash.flatten/-/lodash.flatten-4.4.0.tgz", - "integrity": "sha1-8xwiIlqWMtK7+OSt2+8kCqdlph8=", - "dev": true - }, "lodash.flattendeep": { "version": "4.4.0", "resolved": "https://registry.npmjs.org/lodash.flattendeep/-/lodash.flattendeep-4.4.0.tgz", @@ -15341,12 +14852,6 @@ "resolved": "https://registry.npmjs.org/lodash.flow/-/lodash.flow-3.5.0.tgz", "integrity": "sha1-h79AKSuM+D5OjOGjrkIJ4gBxZ1o=" }, - "lodash.foreach": { - "version": "4.5.0", - "resolved": "https://registry.npmjs.org/lodash.foreach/-/lodash.foreach-4.5.0.tgz", - "integrity": "sha1-Gmo16s5AEoDH8G3d7DUWWrJ+PlM=", - "dev": true - }, "lodash.has": { "version": "4.5.2", "resolved": "https://registry.npmjs.org/lodash.has/-/lodash.has-4.5.2.tgz", @@ -15388,52 +14893,16 @@ "resolved": "https://registry.npmjs.org/lodash.isstring/-/lodash.isstring-4.0.1.tgz", "integrity": "sha1-1SfftUVuynzJu5XV2ur4i6VKVFE=" }, - "lodash.map": { - "version": "4.6.0", - "resolved": "https://registry.npmjs.org/lodash.map/-/lodash.map-4.6.0.tgz", - "integrity": "sha1-dx7Hg540c9nEzeKLGTlMNWL09tM=", - "dev": true - }, "lodash.memoize": { "version": "4.1.2", "resolved": "https://registry.npmjs.org/lodash.memoize/-/lodash.memoize-4.1.2.tgz", "integrity": "sha1-vMbEmkKihA7Zl/Mj6tpezRguC/4=" }, - "lodash.merge": { - "version": "4.6.2", - "resolved": "https://registry.npmjs.org/lodash.merge/-/lodash.merge-4.6.2.tgz", - "integrity": "sha512-0KpjqXRVvrYyCsX1swR/XTK0va6VQkQM6MNo7PqW77ByjAhoARA8EfrP1N4+KlKj8YS0ZUCtRT/YUuhyYDujIQ==", - "dev": true - }, "lodash.once": { "version": "4.1.1", "resolved": "https://registry.npmjs.org/lodash.once/-/lodash.once-4.1.1.tgz", "integrity": "sha1-DdOXEhPHxW34gJd9UEyI+0cal6w=" }, - "lodash.pick": { - "version": "4.4.0", - "resolved": "https://registry.npmjs.org/lodash.pick/-/lodash.pick-4.4.0.tgz", - "integrity": "sha1-UvBWEP/53tQiYRRB7R/BI6AwAbM=", - "dev": true - }, - "lodash.reduce": { - "version": "4.6.0", - "resolved": "https://registry.npmjs.org/lodash.reduce/-/lodash.reduce-4.6.0.tgz", - "integrity": "sha1-8atrg5KZrUj3hKu/R2WW8DuRTTs=", - "dev": true - }, - "lodash.reject": { - "version": "4.6.0", - "resolved": "https://registry.npmjs.org/lodash.reject/-/lodash.reject-4.6.0.tgz", - "integrity": "sha1-gNZJLcFHCGS79YNTO2UfQqn1JBU=", - "dev": true - }, - "lodash.some": { - "version": "4.6.0", - "resolved": "https://registry.npmjs.org/lodash.some/-/lodash.some-4.6.0.tgz", - "integrity": "sha1-G7nzFO9ri63tE7VJFpsqlF62jk0=", - "dev": true - }, "lodash.sortby": { "version": "4.7.0", "resolved": "https://registry.npmjs.org/lodash.sortby/-/lodash.sortby-4.7.0.tgz", @@ -15630,23 +15099,6 @@ "integrity": "sha1-hxDXrwqmJvj/+hzgAWhUUmMlV0g=", "dev": true }, - "mediaquery-text": { - "version": "1.1.5", - "resolved": "https://registry.npmjs.org/mediaquery-text/-/mediaquery-text-1.1.5.tgz", - "integrity": "sha512-T27sUGebV4BhxKpvBThwlZHnMR5elqw4hDSXs0ohHBRGh7k79LaR3lmJHJlIjrNa+LHTl35OWUW56dSGtMNzXQ==", - "dev": true, - "requires": { - "cssom": "^0.4.4" - }, - "dependencies": { - "cssom": { - "version": "0.4.4", - "resolved": "https://registry.npmjs.org/cssom/-/cssom-0.4.4.tgz", - "integrity": "sha512-p3pvU7r1MyyqbTk+WbNJIgJjG2VmTIaB10rI93LzVPrmDJKkzKYMtxxyAvQXR/NS6otuzveI7+7BBq3SjBS2mw==", - "dev": true - } - } - }, "mem": { "version": "4.3.0", "resolved": "https://registry.npmjs.org/mem/-/mem-4.3.0.tgz", @@ -16112,12 +15564,6 @@ "integrity": "sha512-Yd3UES5mWCSqR+qNT93S3UoYUkqAZ9lLg8a7g9rimsWmYGK8cVToA4/sF3RrshdyV3sAGMXVUmpMYOw+dLpOuw==", "dev": true }, - "netmask": { - "version": "1.0.6", - "resolved": "https://registry.npmjs.org/netmask/-/netmask-1.0.6.tgz", - "integrity": "sha1-ICl+idhvb2QA8lDZ9Pa0wZRfzTU=", - "dev": true - }, "next-tick": { "version": "1.0.0", "resolved": "https://registry.npmjs.org/next-tick/-/next-tick-1.0.0.tgz", @@ -16861,34 +16307,6 @@ "resolved": "https://registry.npmjs.org/p-try/-/p-try-2.2.0.tgz", "integrity": "sha512-R4nPAVTAU0B9D35/Gk3uJf/7XYbQcyohSKdvAxIRSNghFl4e71hVoGnBNQz9cWaXxO2I10KTC+3jMdvvoKw6dQ==" }, - "pac-proxy-agent": { - "version": "4.1.0", - "resolved": "https://registry.npmjs.org/pac-proxy-agent/-/pac-proxy-agent-4.1.0.tgz", - "integrity": "sha512-ejNgYm2HTXSIYX9eFlkvqFp8hyJ374uDf0Zq5YUAifiSh1D6fo+iBivQZirGvVv8dCYUsLhmLBRhlAYvBKI5+Q==", - "dev": true, - "requires": { - "@tootallnate/once": "1", - "agent-base": "6", - "debug": "4", - "get-uri": "3", - "http-proxy-agent": "^4.0.1", - "https-proxy-agent": "5", - "pac-resolver": "^4.1.0", - "raw-body": "^2.2.0", - "socks-proxy-agent": "5" - } - }, - "pac-resolver": { - "version": "4.1.0", - "resolved": "https://registry.npmjs.org/pac-resolver/-/pac-resolver-4.1.0.tgz", - "integrity": "sha512-d6lf2IrZJJ7ooVHr7BfwSjRO1yKSJMaiiWYSHcrxSIUtZrCa4KKGwcztdkZ/E9LFleJfjoi1yl+XLR7AX24nbQ==", - "dev": true, - "requires": { - "degenerator": "^2.2.0", - "ip": "^1.1.5", - "netmask": "^1.0.6" - } - }, "pako": { "version": "1.0.11", "resolved": "https://registry.npmjs.org/pako/-/pako-1.0.11.tgz", @@ -17143,15 +16561,6 @@ "resolved": "https://registry.npmjs.org/performance-now/-/performance-now-2.1.0.tgz", "integrity": "sha1-Ywn04OX6kT7BxpMHrjZLSzd8nns=" }, - "pick-util": { - "version": "1.1.3", - "resolved": "https://registry.npmjs.org/pick-util/-/pick-util-1.1.3.tgz", - "integrity": "sha512-nQnaPOPjkXCCXBiUELsJrM795/mOQAHH4TyCdiS8mXL6ihj7sfyen/2rPfT8veWnnUnyFdWZawIiKMy7CD7wBQ==", - "dev": true, - "requires": { - "@jonkemp/package-utils": "^1.0.6" - } - }, "picomatch": { "version": "2.2.2", "resolved": "https://registry.npmjs.org/picomatch/-/picomatch-2.2.2.tgz", @@ -17576,39 +16985,6 @@ "ipaddr.js": "1.9.1" } }, - "proxy-agent": { - "version": "4.0.1", - "resolved": "https://registry.npmjs.org/proxy-agent/-/proxy-agent-4.0.1.tgz", - "integrity": "sha512-ODnQnW2jc/FUVwHHuaZEfN5otg/fMbvMxz9nMSUQfJ9JU7q2SZvSULSsjLloVgJOiv9yhc8GlNMKc4GkFmcVEA==", - "dev": true, - "requires": { - "agent-base": "^6.0.0", - "debug": "4", - "http-proxy-agent": "^4.0.0", - "https-proxy-agent": "^5.0.0", - "lru-cache": "^5.1.1", - "pac-proxy-agent": "^4.1.0", - "proxy-from-env": "^1.0.0", - "socks-proxy-agent": "^5.0.0" - }, - "dependencies": { - "lru-cache": { - "version": "5.1.1", - "resolved": "https://registry.npmjs.org/lru-cache/-/lru-cache-5.1.1.tgz", - "integrity": "sha512-KpNARQA3Iwv+jTA0utUVVbrh+Jlrr1Fv0e56GGzAFOXN7dk/FviaDW8LHmK52DlcH4WP2n6gI8vN1aesBFgo9w==", - "dev": true, - "requires": { - "yallist": "^3.0.2" - } - }, - "yallist": { - "version": "3.1.1", - "resolved": "https://registry.npmjs.org/yallist/-/yallist-3.1.1.tgz", - "integrity": "sha512-a4UGQaWPH59mOXUYnAG2ewncQS4i4F43Tv3JoAM+s2VDAmS9NsK8GpDMLrCHPksFT7h3K6TOoUNn2pb7RoXx4g==", - "dev": true - } - } - }, "proxy-from-env": { "version": "1.1.0", "resolved": "https://registry.npmjs.org/proxy-from-env/-/proxy-from-env-1.1.0.tgz", @@ -17836,18 +17212,6 @@ "integrity": "sha512-Hrgsx+orqoygnmhFbKaHE6c296J+HTAQXoxEF6gNupROmmGJRoyzfG3ccAveqCBrwr/2yxQ5BVd/GTl5agOwSg==", "dev": true }, - "raw-body": { - "version": "2.4.1", - "resolved": "https://registry.npmjs.org/raw-body/-/raw-body-2.4.1.tgz", - "integrity": "sha512-9WmIKF6mkvA0SLmA2Knm9+qj89e+j1zqgyn8aXGd7+nAduPoqgI9lO57SAZNn/Byzo5P7JhXTyg9PzaJbH73bA==", - "dev": true, - "requires": { - "bytes": "3.1.0", - "http-errors": "1.7.3", - "iconv-lite": "0.4.24", - "unpipe": "1.0.0" - } - }, "raw-loader": { "version": "0.5.1", "resolved": "https://registry.npmjs.org/raw-loader/-/raw-loader-0.5.1.tgz", @@ -18443,17 +17807,6 @@ "xtend": "^4.0.1" } }, - "remote-content": { - "version": "1.2.3", - "resolved": "https://registry.npmjs.org/remote-content/-/remote-content-1.2.3.tgz", - "integrity": "sha512-cxyyyURneyIeUHWLdQ+G3BLT9LP4KY0lljsuUHYh9XBVOB1R+ChmgjirEQKKE4CV9VlbqvtGZ2qOafufenoT+A==", - "dev": true, - "requires": { - "proxy-from-env": "^1.0.0", - "superagent": "^5.2.1", - "superagent-proxy": "^2.0.0" - } - }, "remove-trailing-separator": { "version": "1.1.0", "resolved": "https://registry.npmjs.org/remove-trailing-separator/-/remove-trailing-separator-1.1.0.tgz", @@ -19395,18 +18748,6 @@ } } }, - "slick": { - "version": "1.12.2", - "resolved": "https://registry.npmjs.org/slick/-/slick-1.12.2.tgz", - "integrity": "sha1-vQSN23TefRymkV+qSldXCzVQwtc=", - "dev": true - }, - "smart-buffer": { - "version": "4.1.0", - "resolved": "https://registry.npmjs.org/smart-buffer/-/smart-buffer-4.1.0.tgz", - "integrity": "sha512-iVICrxOzCynf/SNaBQCw34eM9jROU/s5rzIhpOvzhzuYHfJR/DhZfDkXiZSgKXfgv26HT3Yni3AV/DGw0cGnnw==", - "dev": true - }, "snapdragon": { "version": "0.8.2", "resolved": "https://registry.npmjs.org/snapdragon/-/snapdragon-0.8.2.tgz", @@ -19562,27 +18903,6 @@ } } }, - "socks": { - "version": "2.5.1", - "resolved": "https://registry.npmjs.org/socks/-/socks-2.5.1.tgz", - "integrity": "sha512-oZCsJJxapULAYJaEYBSzMcz8m3jqgGrHaGhkmU/o/PQfFWYWxkAaA0UMGImb6s6tEXfKi959X6VJjMMQ3P6TTQ==", - "dev": true, - "requires": { - "ip": "^1.1.5", - "smart-buffer": "^4.1.0" - } - }, - "socks-proxy-agent": { - "version": "5.0.0", - "resolved": "https://registry.npmjs.org/socks-proxy-agent/-/socks-proxy-agent-5.0.0.tgz", - "integrity": "sha512-lEpa1zsWCChxiynk+lCycKuC502RxDWLKJZoIhnxrWNjLSDGYRFflHA1/228VkRcnv9TIb8w98derGbpKxJRgA==", - "dev": true, - "requires": { - "agent-base": "6", - "debug": "4", - "socks": "^2.3.3" - } - }, "source-list-map": { "version": "2.0.1", "resolved": "https://registry.npmjs.org/source-list-map/-/source-list-map-2.0.1.tgz", @@ -19716,12 +19036,6 @@ } } }, - "specificity": { - "version": "0.3.2", - "resolved": "https://registry.npmjs.org/specificity/-/specificity-0.3.2.tgz", - "integrity": "sha512-Nc/QN/A425Qog7j9aHmwOrlwX2e7pNI47ciwxwy4jOlvbbMHkNNJchit+FX+UjF3IAdiaaV5BKeWuDUnws6G1A==", - "dev": true - }, "split-string": { "version": "3.1.0", "resolved": "https://registry.npmjs.org/split-string/-/split-string-3.1.0.tgz", @@ -19988,136 +19302,6 @@ "resolved": "https://registry.npmjs.org/strip-json-comments/-/strip-json-comments-2.0.1.tgz", "integrity": "sha1-PFMZQukIwml8DsNEhYwobHygpgo=" }, - "style-data": { - "version": "1.4.7", - "resolved": "https://registry.npmjs.org/style-data/-/style-data-1.4.7.tgz", - "integrity": "sha512-JUm9y0IOnyaoQprqIEP7H3DtDOX8I7wfbkHPSdq2kRCXommqzvP+f+HNkM6F7gweOBRdFRcp/uoBPif02P/N/A==", - "dev": true, - "requires": { - "cheerio": "^0.22.0", - "mediaquery-text": "^1.1.5", - "pick-util": "^1.1.3" - }, - "dependencies": { - "cheerio": { - "version": "0.22.0", - "resolved": "https://registry.npmjs.org/cheerio/-/cheerio-0.22.0.tgz", - "integrity": "sha1-qbqoYKP5tZWmuBsahocxIe06Jp4=", - "dev": true, - "requires": { - "css-select": "~1.2.0", - "dom-serializer": "~0.1.0", - "entities": "~1.1.1", - "htmlparser2": "^3.9.1", - "lodash.assignin": "^4.0.9", - "lodash.bind": "^4.1.4", - "lodash.defaults": "^4.0.1", - "lodash.filter": "^4.4.0", - "lodash.flatten": "^4.2.0", - "lodash.foreach": "^4.3.0", - "lodash.map": "^4.4.0", - "lodash.merge": "^4.4.0", - "lodash.pick": "^4.2.1", - "lodash.reduce": "^4.4.0", - "lodash.reject": "^4.4.0", - "lodash.some": "^4.4.0" - } - }, - "css-select": { - "version": "1.2.0", - "resolved": "https://registry.npmjs.org/css-select/-/css-select-1.2.0.tgz", - "integrity": "sha1-KzoRBTnFNV8c2NMUYj6HCxIeyFg=", - "dev": true, - "requires": { - "boolbase": "~1.0.0", - "css-what": "2.1", - "domutils": "1.5.1", - "nth-check": "~1.0.1" - } - }, - "css-what": { - "version": "2.1.3", - "resolved": "https://registry.npmjs.org/css-what/-/css-what-2.1.3.tgz", - "integrity": "sha512-a+EPoD+uZiNfh+5fxw2nO9QwFa6nJe2Or35fGY6Ipw1R3R4AGz1d1TEZrCegvw2YTmZ0jXirGYlzxxpYSHwpEg==", - "dev": true - }, - "dom-serializer": { - "version": "0.1.1", - "resolved": "https://registry.npmjs.org/dom-serializer/-/dom-serializer-0.1.1.tgz", - "integrity": "sha512-l0IU0pPzLWSHBcieZbpOKgkIn3ts3vAh7ZuFyXNwJxJXk/c4Gwj9xaTJwIDVQCXawWD0qb3IzMGH5rglQaO0XA==", - "dev": true, - "requires": { - "domelementtype": "^1.3.0", - "entities": "^1.1.1" - } - }, - "domelementtype": { - "version": "1.3.1", - "resolved": "https://registry.npmjs.org/domelementtype/-/domelementtype-1.3.1.tgz", - "integrity": "sha512-BSKB+TSpMpFI/HOxCNr1O8aMOTZ8hT3pM3GQ0w/mWRmkhEDSFJkkyzz4XQsBV44BChwGkrDfMyjVD0eA2aFV3w==", - "dev": true - }, - "domhandler": { - "version": "2.4.2", - "resolved": "https://registry.npmjs.org/domhandler/-/domhandler-2.4.2.tgz", - "integrity": "sha512-JiK04h0Ht5u/80fdLMCEmV4zkNh2BcoMFBmZ/91WtYZ8qVXSKjiw7fXMgFPnHcSZgOo3XdinHvmnDUeMf5R4wA==", - "dev": true, - "requires": { - "domelementtype": "1" - } - }, - "domutils": { - "version": "1.5.1", - "resolved": "https://registry.npmjs.org/domutils/-/domutils-1.5.1.tgz", - "integrity": "sha1-3NhIiib1Y9YQeeSMn3t+Mjc2gs8=", - "dev": true, - "requires": { - "dom-serializer": "0", - "domelementtype": "1" - } - }, - "entities": { - "version": "1.1.2", - "resolved": "https://registry.npmjs.org/entities/-/entities-1.1.2.tgz", - "integrity": "sha512-f2LZMYl1Fzu7YSBKg+RoROelpOaNrcGmE9AZubeDfrCEia483oW4MI4VyFd5VNHIgQ/7qm1I0wUHK1eJnn2y2w==", - "dev": true - }, - "htmlparser2": { - "version": "3.10.1", - "resolved": "https://registry.npmjs.org/htmlparser2/-/htmlparser2-3.10.1.tgz", - "integrity": "sha512-IgieNijUMbkDovyoKObU1DUhm1iwNYE/fuifEoEHfd1oZKZDaONBSkal7Y01shxsM49R4XaMdGez3WnF9UfiCQ==", - "dev": true, - "requires": { - "domelementtype": "^1.3.1", - "domhandler": "^2.3.0", - "domutils": "^1.5.1", - "entities": "^1.1.1", - "inherits": "^2.0.1", - "readable-stream": "^3.1.1" - } - }, - "nth-check": { - "version": "1.0.2", - "resolved": "https://registry.npmjs.org/nth-check/-/nth-check-1.0.2.tgz", - "integrity": "sha512-WeBOdju8SnzPN5vTUJYxYUxLeXpCaVP5i5e0LF8fg7WORF2Wd7wFX/pk0tYZk7s8T+J7VLy0Da6J1+wCT0AtHg==", - "dev": true, - "requires": { - "boolbase": "~1.0.0" - } - }, - "readable-stream": { - "version": "3.6.0", - "resolved": "https://registry.npmjs.org/readable-stream/-/readable-stream-3.6.0.tgz", - "integrity": "sha512-BViHy7LKeTz4oNnkcLJ+lVSL6vpiFeX6/d3oSH8zCW7UxP2onchk+vTGB143xuFjHS3deTgkKoXXymXqymiIdA==", - "dev": true, - "requires": { - "inherits": "^2.0.3", - "string_decoder": "^1.1.1", - "util-deprecate": "^1.0.1" - } - } - } - }, "style-loader": { "version": "0.23.0", "resolved": "https://registry.npmjs.org/style-loader/-/style-loader-0.23.0.tgz", @@ -20170,79 +19354,6 @@ "resolved": "https://registry.npmjs.org/stylis-rule-sheet/-/stylis-rule-sheet-0.0.10.tgz", "integrity": "sha512-nTbZoaqoBnmK+ptANthb10ZRZOGC+EmTLLUxeYIuHNkEKcmKgXX1XWKkUBT2Ac4es3NybooPe0SmvKdhKJZAuw==" }, - "superagent": { - "version": "5.3.1", - "resolved": "https://registry.npmjs.org/superagent/-/superagent-5.3.1.tgz", - "integrity": "sha512-wjJ/MoTid2/RuGCOFtlacyGNxN9QLMgcpYLDQlWFIhhdJ93kNscFonGvrpAHSCVjRVj++DGCglocF7Aej1KHvQ==", - "dev": true, - "requires": { - "component-emitter": "^1.3.0", - "cookiejar": "^2.1.2", - "debug": "^4.1.1", - "fast-safe-stringify": "^2.0.7", - "form-data": "^3.0.0", - "formidable": "^1.2.2", - "methods": "^1.1.2", - "mime": "^2.4.6", - "qs": "^6.9.4", - "readable-stream": "^3.6.0", - "semver": "^7.3.2" - }, - "dependencies": { - "form-data": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/form-data/-/form-data-3.0.0.tgz", - "integrity": "sha512-CKMFDglpbMi6PyN+brwB9Q/GOw0eAnsrEZDgcsH5Krhz5Od/haKHAX0NmQfha2zPPz0JpWzA7GJHGSnvCRLWsg==", - "dev": true, - "requires": { - "asynckit": "^0.4.0", - "combined-stream": "^1.0.8", - "mime-types": "^2.1.12" - } - }, - "readable-stream": { - "version": "3.6.0", - "resolved": "https://registry.npmjs.org/readable-stream/-/readable-stream-3.6.0.tgz", - "integrity": "sha512-BViHy7LKeTz4oNnkcLJ+lVSL6vpiFeX6/d3oSH8zCW7UxP2onchk+vTGB143xuFjHS3deTgkKoXXymXqymiIdA==", - "dev": true, - "requires": { - "inherits": "^2.0.3", - "string_decoder": "^1.1.1", - "util-deprecate": "^1.0.1" - } - }, - "semver": { - "version": "7.3.4", - "resolved": "https://registry.npmjs.org/semver/-/semver-7.3.4.tgz", - "integrity": "sha512-tCfb2WLjqFAtXn4KEdxIhalnRtoKFN7nAwj0B3ZXCbQloV2tq5eDbcTmT68JJD3nRJq24/XgxtQKFIpQdtvmVw==", - "dev": true, - "requires": { - "lru-cache": "^6.0.0" - } - } - } - }, - "superagent-proxy": { - "version": "2.1.0", - "resolved": "https://registry.npmjs.org/superagent-proxy/-/superagent-proxy-2.1.0.tgz", - "integrity": "sha512-DnarpKN6Xn8e3pYlFV4Yvsj9yxLY4q5FIsUe5JvN7vjzP+YCfzXv03dTkZSD2yzrSadsNYHf0IgOUJwKjX457A==", - "dev": true, - "requires": { - "debug": "^3.1.0", - "proxy-agent": "^4.0.0" - }, - "dependencies": { - "debug": { - "version": "3.2.7", - "resolved": "https://registry.npmjs.org/debug/-/debug-3.2.7.tgz", - "integrity": "sha512-CFjzYYAi4ThfiQvizrFQevTTXHtnCqWfe7x1AhgEscTz6ZbLbfoLRLPugTQyBth6f8ZERVUSyWHFD/7Wu4t1XQ==", - "dev": true, - "requires": { - "ms": "^2.1.1" - } - } - } - }, "supports-color": { "version": "5.5.0", "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-5.5.0.tgz", diff --git a/package.json b/package.json index d7498a3c9..49c0e471c 100644 --- a/package.json +++ b/package.json @@ -151,7 +151,6 @@ "html-loader": "0.5.5", "html-loader-jest": "0.2.1", "html-webpack-plugin": "3.2.0", - "inline-css": "2.2.5", "jest": "25.5.4", "jest-canvas-mock": "2.1.0", "jest-puppeteer": "4.4.0", From 63e13cdabe14ec01ec9645c4bc034bd904890187 Mon Sep 17 00:00:00 2001 From: Steve Faulkner Date: Tue, 30 Mar 2021 09:31:21 -0500 Subject: [PATCH 08/12] Remove Explorer.nonSystemDatabases (#538) * Remove Explorer.nonSystemDatabases * Fix tests --- .../SettingsComponent.test.tsx.snap | 8 --- .../ContainerSampleGenerator.test.ts | 8 +-- .../DataSamples/DataSamplesUtil.test.ts | 10 ++-- src/Explorer/DataSamples/DataSamplesUtil.ts | 6 +- src/Explorer/Explorer.tsx | 17 ------ .../Panes/CassandraAddCollectionPane.html | 2 +- .../Panes/CassandraAddCollectionPane.ts | 6 +- src/Explorer/Tree/ResourceTreeAdapter.test.ts | 6 +- src/Explorer/Tree/ResourceTreeAdapter.tsx | 59 +++++++++---------- src/hooks/useKnockoutExplorer.ts | 2 +- 10 files changed, 48 insertions(+), 76 deletions(-) diff --git a/src/Explorer/Controls/Settings/__snapshots__/SettingsComponent.test.tsx.snap b/src/Explorer/Controls/Settings/__snapshots__/SettingsComponent.test.tsx.snap index f9640bb5f..db5addf25 100644 --- a/src/Explorer/Controls/Settings/__snapshots__/SettingsComponent.test.tsx.snap +++ b/src/Explorer/Controls/Settings/__snapshots__/SettingsComponent.test.tsx.snap @@ -32,7 +32,6 @@ exports[`SettingsComponent renders 1`] = ` "_closeSynapseLinkModalDialog": [Function], "_isAfecFeatureRegistered": [Function], "_isInitializingNotebooks": false, - "_isSystemDatabasePredicate": [Function], "_panes": Array [ AddDatabasePane { "autoPilotUsageCost": [Function], @@ -974,7 +973,6 @@ exports[`SettingsComponent renders 1`] = ` "title": [Function], "visible": [Function], }, - "nonSystemDatabases": [Function], "notebookBasePath": [Function], "notebookServerInfo": [Function], "onRefreshDatabasesKeyPress": [Function], @@ -1228,7 +1226,6 @@ exports[`SettingsComponent renders 1`] = ` "_closeSynapseLinkModalDialog": [Function], "_isAfecFeatureRegistered": [Function], "_isInitializingNotebooks": false, - "_isSystemDatabasePredicate": [Function], "_panes": Array [ AddDatabasePane { "autoPilotUsageCost": [Function], @@ -2170,7 +2167,6 @@ exports[`SettingsComponent renders 1`] = ` "title": [Function], "visible": [Function], }, - "nonSystemDatabases": [Function], "notebookBasePath": [Function], "notebookServerInfo": [Function], "onRefreshDatabasesKeyPress": [Function], @@ -2437,7 +2433,6 @@ exports[`SettingsComponent renders 1`] = ` "_closeSynapseLinkModalDialog": [Function], "_isAfecFeatureRegistered": [Function], "_isInitializingNotebooks": false, - "_isSystemDatabasePredicate": [Function], "_panes": Array [ AddDatabasePane { "autoPilotUsageCost": [Function], @@ -3379,7 +3374,6 @@ exports[`SettingsComponent renders 1`] = ` "title": [Function], "visible": [Function], }, - "nonSystemDatabases": [Function], "notebookBasePath": [Function], "notebookServerInfo": [Function], "onRefreshDatabasesKeyPress": [Function], @@ -3633,7 +3627,6 @@ exports[`SettingsComponent renders 1`] = ` "_closeSynapseLinkModalDialog": [Function], "_isAfecFeatureRegistered": [Function], "_isInitializingNotebooks": false, - "_isSystemDatabasePredicate": [Function], "_panes": Array [ AddDatabasePane { "autoPilotUsageCost": [Function], @@ -4575,7 +4568,6 @@ exports[`SettingsComponent renders 1`] = ` "title": [Function], "visible": [Function], }, - "nonSystemDatabases": [Function], "notebookBasePath": [Function], "notebookServerInfo": [Function], "onRefreshDatabasesKeyPress": [Function], diff --git a/src/Explorer/DataSamples/ContainerSampleGenerator.test.ts b/src/Explorer/DataSamples/ContainerSampleGenerator.test.ts index ce917e840..13ec16270 100644 --- a/src/Explorer/DataSamples/ContainerSampleGenerator.test.ts +++ b/src/Explorer/DataSamples/ContainerSampleGenerator.test.ts @@ -2,17 +2,17 @@ jest.mock("../Graph/GraphExplorerComponent/GremlinClient"); jest.mock("../../Common/dataAccess/createCollection"); jest.mock("../../Common/dataAccess/createDocument"); import * as ko from "knockout"; -import * as ViewModels from "../../Contracts/ViewModels"; import Q from "q"; -import { ContainerSampleGenerator } from "./ContainerSampleGenerator"; import { createDocument } from "../../Common/dataAccess/createDocument"; -import Explorer from "../Explorer"; +import * as ViewModels from "../../Contracts/ViewModels"; import { updateUserContext } from "../../UserContext"; +import Explorer from "../Explorer"; +import { ContainerSampleGenerator } from "./ContainerSampleGenerator"; describe("ContainerSampleGenerator", () => { const createExplorerStub = (database: ViewModels.Database): Explorer => { const explorerStub = {} as Explorer; - explorerStub.nonSystemDatabases = ko.computed(() => [database]); + explorerStub.databases = ko.observableArray([database]); explorerStub.isPreferredApiGraph = ko.computed(() => false); explorerStub.isPreferredApiMongoDB = ko.computed(() => false); explorerStub.isPreferredApiDocumentDB = ko.computed(() => false); diff --git a/src/Explorer/DataSamples/DataSamplesUtil.test.ts b/src/Explorer/DataSamples/DataSamplesUtil.test.ts index 634354c8d..9a35158f5 100644 --- a/src/Explorer/DataSamples/DataSamplesUtil.test.ts +++ b/src/Explorer/DataSamples/DataSamplesUtil.test.ts @@ -1,9 +1,9 @@ -import { DataSamplesUtil } from "./DataSamplesUtil"; -import * as sinon from "sinon"; -import { ContainerSampleGenerator } from "./ContainerSampleGenerator"; import * as ko from "knockout"; +import * as sinon from "sinon"; +import { Collection, Database } from "../../Contracts/ViewModels"; import Explorer from "../Explorer"; -import { Database, Collection } from "../../Contracts/ViewModels"; +import { ContainerSampleGenerator } from "./ContainerSampleGenerator"; +import { DataSamplesUtil } from "./DataSamplesUtil"; describe("DataSampleUtils", () => { const sampleCollectionId = "sampleCollectionId"; @@ -16,7 +16,7 @@ describe("DataSampleUtils", () => { collections: ko.observableArray([collection]), } as Database; const explorer = {} as Explorer; - explorer.nonSystemDatabases = ko.computed(() => [database]); + explorer.databases = ko.observableArray([database]); explorer.showOkModalDialog = () => {}; const dataSamplesUtil = new DataSamplesUtil(explorer); diff --git a/src/Explorer/DataSamples/DataSamplesUtil.ts b/src/Explorer/DataSamples/DataSamplesUtil.ts index 81e191048..aa3d01253 100644 --- a/src/Explorer/DataSamples/DataSamplesUtil.ts +++ b/src/Explorer/DataSamples/DataSamplesUtil.ts @@ -1,8 +1,8 @@ import * as ViewModels from "../../Contracts/ViewModels"; -import { ContainerSampleGenerator } from "./ContainerSampleGenerator"; import * as NotificationConsoleUtils from "../../Utils/NotificationConsoleUtils"; -import { ConsoleDataType } from "../Menus/NotificationConsole/NotificationConsoleComponent"; import Explorer from "../Explorer"; +import { ConsoleDataType } from "../Menus/NotificationConsole/NotificationConsoleComponent"; +import { ContainerSampleGenerator } from "./ContainerSampleGenerator"; export class DataSamplesUtil { private static readonly DialogTitle = "Create Sample Container"; @@ -17,7 +17,7 @@ export class DataSamplesUtil { const databaseName = generator.getDatabaseId(); const containerName = generator.getCollectionId(); - if (this.hasContainer(databaseName, containerName, this.container.nonSystemDatabases())) { + if (this.hasContainer(databaseName, containerName, this.container.databases())) { const msg = `The container ${containerName} in database ${databaseName} already exists. Please delete it and retry.`; this.container.showOkModalDialog(DataSamplesUtil.DialogTitle, msg); NotificationConsoleUtils.logConsoleMessage(ConsoleDataType.Error, msg); diff --git a/src/Explorer/Explorer.tsx b/src/Explorer/Explorer.tsx index 2bd45e796..73e6342f7 100644 --- a/src/Explorer/Explorer.tsx +++ b/src/Explorer/Explorer.tsx @@ -180,7 +180,6 @@ export default class Explorer { // Resource Tree public databases: ko.ObservableArray; - public nonSystemDatabases: ko.Computed; public selectedDatabaseId: ko.Computed; public selectedCollectionId: ko.Computed; public isLeftPaneExpanded: ko.Observable; @@ -257,7 +256,6 @@ export default class Explorer { public closeDialog: ExplorerParams["closeDialog"]; private _panes: ContextualPaneBase[] = []; - private _isSystemDatabasePredicate: (database: ViewModels.Database) => boolean = (database) => false; private _isInitializingNotebooks: boolean; private notebookBasePath: ko.Observable; private _arcadiaManager: ArcadiaResourceManager; @@ -528,17 +526,6 @@ export default class Explorer { configContext.platform === Platform.Portal && !this.isRunningOnNationalCloud() && !this.isPreferredApiGraph() ); this.isRightPanelV2Enabled = ko.computed(() => userContext.features.enableRightPanelV2); - this.defaultExperience.subscribe((defaultExperience: string) => { - if ( - defaultExperience && - defaultExperience.toLowerCase() === Constants.DefaultAccountExperience.Cassandra.toLowerCase() - ) { - this._isSystemDatabasePredicate = (database: ViewModels.Database): boolean => { - return database.id() === "system"; - }; - } - }); - this.selectedDatabaseId = ko.computed(() => { const selectedNode = this.selectedNode(); if (!selectedNode) { @@ -560,10 +547,6 @@ export default class Explorer { } }); - this.nonSystemDatabases = ko.computed(() => { - return this.databases().filter((database: ViewModels.Database) => !this._isSystemDatabasePredicate(database)); - }); - this.addDatabasePane = new AddDatabasePane({ id: "adddatabasepane", visible: ko.observable(false), diff --git a/src/Explorer/Panes/CassandraAddCollectionPane.html b/src/Explorer/Panes/CassandraAddCollectionPane.html index c426a272e..2450196ee 100644 --- a/src/Explorer/Panes/CassandraAddCollectionPane.html +++ b/src/Explorer/Panes/CassandraAddCollectionPane.html @@ -114,7 +114,7 @@ aria-label="Keyspace id" /> - + diff --git a/src/Explorer/Panes/CassandraAddCollectionPane.ts b/src/Explorer/Panes/CassandraAddCollectionPane.ts index 92bfa87bc..44cf83a7f 100644 --- a/src/Explorer/Panes/CassandraAddCollectionPane.ts +++ b/src/Explorer/Panes/CassandraAddCollectionPane.ts @@ -261,10 +261,8 @@ export default class CassandraAddCollectionPane extends ContextualPaneBase { }); this.keyspaceIds(cachedKeyspaceIdsList); }; - this.container.nonSystemDatabases.subscribe((newDatabases: ViewModels.Database[]) => - updateKeyspaceIds(newDatabases) - ); - updateKeyspaceIds(this.container.nonSystemDatabases()); + this.container.databases.subscribe((newDatabases: ViewModels.Database[]) => updateKeyspaceIds(newDatabases)); + updateKeyspaceIds(this.container.databases()); } this.autoPilotUsageCost = ko.pureComputed(() => { diff --git a/src/Explorer/Tree/ResourceTreeAdapter.test.ts b/src/Explorer/Tree/ResourceTreeAdapter.test.ts index 5102149c1..e65ee1011 100644 --- a/src/Explorer/Tree/ResourceTreeAdapter.test.ts +++ b/src/Explorer/Tree/ResourceTreeAdapter.test.ts @@ -1,8 +1,8 @@ -import Explorer from "../Explorer"; import * as ko from "knockout"; -import { ResourceTreeAdapter } from "./ResourceTreeAdapter"; import * as ViewModels from "../../Contracts/ViewModels"; +import Explorer from "../Explorer"; import TabsBase from "../Tabs/TabsBase"; +import { ResourceTreeAdapter } from "./ResourceTreeAdapter"; describe("ResourceTreeAdapter", () => { const mockContainer = (): Explorer => @@ -18,7 +18,7 @@ describe("ResourceTreeAdapter", () => { } as TabsBase), }, isNotebookEnabled: ko.observable(true), - nonSystemDatabases: ko.observable([]), + databases: ko.observable([]), } as unknown) as Explorer); // TODO isDataNodeSelected needs a better design and refactor, but for now, we protect some of the code paths diff --git a/src/Explorer/Tree/ResourceTreeAdapter.tsx b/src/Explorer/Tree/ResourceTreeAdapter.tsx index 06a7d51d4..bb8dac7e8 100644 --- a/src/Explorer/Tree/ResourceTreeAdapter.tsx +++ b/src/Explorer/Tree/ResourceTreeAdapter.tsx @@ -1,39 +1,38 @@ import * as ko from "knockout"; +import { Callout, DirectionalHint, ICalloutProps, ILinkProps, Link, Stack, Text } from "office-ui-fabric-react"; import * as React from "react"; -import { ReactAdapter } from "../../Bindings/ReactBindingHandler"; -import { AccordionComponent, AccordionItemComponent } from "../Controls/Accordion/AccordionComponent"; -import { TreeComponent, TreeNode, TreeNodeMenuItem, TreeNodeComponent } from "../Controls/TreeComponent/TreeComponent"; -import * as ViewModels from "../../Contracts/ViewModels"; -import { NotebookContentItem, NotebookContentItemType } from "../Notebook/NotebookContentItem"; -import { ResourceTreeContextMenuButtonFactory } from "../ContextMenuButtonFactory"; -import { mostRecentActivity } from "../MostRecentActivity/MostRecentActivity"; -import CopyIcon from "../../../images/notebook/Notebook-copy.svg"; import CosmosDBIcon from "../../../images/Azure-Cosmos-DB.svg"; -import CollectionIcon from "../../../images/tree-collection.svg"; import DeleteIcon from "../../../images/delete.svg"; -import NotebookIcon from "../../../images/notebook/Notebook-resource.svg"; -import RefreshIcon from "../../../images/refresh-cosmos.svg"; -import NewNotebookIcon from "../../../images/notebook/Notebook-new.svg"; -import FileIcon from "../../../images/notebook/file-cosmos.svg"; -import PublishIcon from "../../../images/notebook/publish_content.svg"; -import { ArrayHashMap } from "../../Common/ArrayHashMap"; -import { NotebookUtil } from "../Notebook/NotebookUtil"; -import _ from "underscore"; -import { IPinnedRepo } from "../../Juno/JunoClient"; -import * as TelemetryProcessor from "../../Shared/Telemetry/TelemetryProcessor"; -import { Action, ActionModifiers, Source } from "../../Shared/Telemetry/TelemetryConstants"; -import { Areas } from "../../Common/Constants"; -import * as GitHubUtils from "../../Utils/GitHubUtils"; import GalleryIcon from "../../../images/GalleryIcon.svg"; -import { Callout, Text, Link, DirectionalHint, Stack, ICalloutProps, ILinkProps } from "office-ui-fabric-react"; +import FileIcon from "../../../images/notebook/file-cosmos.svg"; +import CopyIcon from "../../../images/notebook/Notebook-copy.svg"; +import NewNotebookIcon from "../../../images/notebook/Notebook-new.svg"; +import NotebookIcon from "../../../images/notebook/Notebook-resource.svg"; +import PublishIcon from "../../../images/notebook/publish_content.svg"; +import RefreshIcon from "../../../images/refresh-cosmos.svg"; +import CollectionIcon from "../../../images/tree-collection.svg"; +import { ReactAdapter } from "../../Bindings/ReactBindingHandler"; +import { ArrayHashMap } from "../../Common/ArrayHashMap"; +import { Areas } from "../../Common/Constants"; +import * as DataModels from "../../Contracts/DataModels"; +import * as ViewModels from "../../Contracts/ViewModels"; +import { IPinnedRepo } from "../../Juno/JunoClient"; import { LocalStorageUtility, StorageKey } from "../../Shared/StorageUtility"; +import { Action, ActionModifiers, Source } from "../../Shared/Telemetry/TelemetryConstants"; +import * as TelemetryProcessor from "../../Shared/Telemetry/TelemetryProcessor"; +import { userContext } from "../../UserContext"; +import * as GitHubUtils from "../../Utils/GitHubUtils"; +import { ResourceTreeContextMenuButtonFactory } from "../ContextMenuButtonFactory"; +import { AccordionComponent, AccordionItemComponent } from "../Controls/Accordion/AccordionComponent"; +import { TreeComponent, TreeNode, TreeNodeMenuItem } from "../Controls/TreeComponent/TreeComponent"; import Explorer from "../Explorer"; -import UserDefinedFunction from "./UserDefinedFunction"; +import { mostRecentActivity } from "../MostRecentActivity/MostRecentActivity"; +import { NotebookContentItem, NotebookContentItemType } from "../Notebook/NotebookContentItem"; +import { NotebookUtil } from "../Notebook/NotebookUtil"; +import TabsBase from "../Tabs/TabsBase"; import StoredProcedure from "./StoredProcedure"; import Trigger from "./Trigger"; -import TabsBase from "../Tabs/TabsBase"; -import { userContext } from "../../UserContext"; -import * as DataModels from "../../Contracts/DataModels"; +import UserDefinedFunction from "./UserDefinedFunction"; export class ResourceTreeAdapter implements ReactAdapter { public static readonly MyNotebooksTitle = "My Notebooks"; @@ -64,7 +63,7 @@ export class ResourceTreeAdapter implements ReactAdapter { this.koSubsCollectionIdMap = new ArrayHashMap(); this.databaseCollectionIdMap = new ArrayHashMap(); - this.container.nonSystemDatabases.subscribe((databases: ViewModels.Database[]) => { + this.container.databases.subscribe((databases: ViewModels.Database[]) => { // Clean up old databases this.cleanupDatabasesKoSubs(); @@ -72,7 +71,7 @@ export class ResourceTreeAdapter implements ReactAdapter { this.triggerRender(); }); - this.container.nonSystemDatabases().forEach((database: ViewModels.Database) => this.watchDatabase(database)); + this.container.databases().forEach((database: ViewModels.Database) => this.watchDatabase(database)); this.triggerRender(); } @@ -190,7 +189,7 @@ export class ResourceTreeAdapter implements ReactAdapter { } private buildDataTree(): TreeNode { - const databaseTreeNodes: TreeNode[] = this.container.nonSystemDatabases().map((database: ViewModels.Database) => { + const databaseTreeNodes: TreeNode[] = this.container.databases().map((database: ViewModels.Database) => { const databaseNode: TreeNode = { label: database.id(), iconSrc: CosmosDBIcon, diff --git a/src/hooks/useKnockoutExplorer.ts b/src/hooks/useKnockoutExplorer.ts index 495e4c8f3..80dd38a68 100644 --- a/src/hooks/useKnockoutExplorer.ts +++ b/src/hooks/useKnockoutExplorer.ts @@ -260,7 +260,7 @@ async function configurePortal(explorerParams: ExplorerParams): Promise Date: Tue, 30 Mar 2021 10:11:43 -0700 Subject: [PATCH 09/12] Added support for self serve telemetry + Localization fixes (#580) * initial telemetry commit * Added localization changes * moved telemetrymessage types to selfservetypes * fixed compile errors * fixed failing test * changed translation file format * Addressed PR comments * modified test --- .../SmartUi/SmartUiComponent.test.tsx | 10 +- .../Controls/SmartUi/SmartUiComponent.tsx | 2 +- src/Localization/en/Common.json | 5 + src/Localization/en/SelfServeExample.json | 31 + src/Localization/en/SqlX.json | 52 + src/Localization/en/translations.json | 92 -- src/SelfServe/Example/SelfServeExample.tsx | 6 +- src/SelfServe/SelfServe.tsx | 26 +- src/SelfServe/SelfServeComponent.test.tsx | 24 +- src/SelfServe/SelfServeComponent.tsx | 95 +- src/SelfServe/SelfServeTelemetryProcessor.ts | 69 ++ src/SelfServe/SelfServeTypes.ts | 8 +- src/SelfServe/SelfServeUtils.test.tsx | 12 +- src/SelfServe/SelfServeUtils.tsx | 2 +- src/SelfServe/SqlX/SqlX.tsx | 11 +- .../SelfServeComponent.test.tsx.snap | 1043 ++++++++++++++++- src/Shared/Telemetry/TelemetryConstants.ts | 1 + src/i18n.ts | 10 +- 18 files changed, 1306 insertions(+), 193 deletions(-) create mode 100644 src/Localization/en/Common.json create mode 100644 src/Localization/en/SelfServeExample.json create mode 100644 src/Localization/en/SqlX.json delete mode 100644 src/Localization/en/translations.json create mode 100644 src/SelfServe/SelfServeTelemetryProcessor.ts diff --git a/src/Explorer/Controls/SmartUi/SmartUiComponent.test.tsx b/src/Explorer/Controls/SmartUi/SmartUiComponent.test.tsx index 91bc16815..ec3298812 100644 --- a/src/Explorer/Controls/SmartUi/SmartUiComponent.test.tsx +++ b/src/Explorer/Controls/SmartUi/SmartUiComponent.test.tsx @@ -1,7 +1,7 @@ -import React from "react"; import { shallow } from "enzyme"; +import React from "react"; +import { DescriptionType, NumberUiType, SmartUiInput } from "../../../SelfServe/SelfServeTypes"; import { SmartUiComponent, SmartUiDescriptor } from "./SmartUiComponent"; -import { NumberUiType, SmartUiInput, DescriptionType } from "../../../SelfServe/SelfServeTypes"; describe("SmartUiComponent", () => { const exampleData: SmartUiDescriptor = { @@ -97,9 +97,9 @@ describe("SmartUiComponent", () => { dataFieldName: "database", type: "object", choices: [ - { label: "Database 1", key: "db1" }, - { label: "Database 2", key: "db2" }, - { label: "Database 3", key: "db3" }, + { labelTKey: "Database 1", key: "db1" }, + { labelTKey: "Database 2", key: "db2" }, + { labelTKey: "Database 3", key: "db3" }, ], defaultKey: "db2", }, diff --git a/src/Explorer/Controls/SmartUi/SmartUiComponent.tsx b/src/Explorer/Controls/SmartUi/SmartUiComponent.tsx index 4ca14a266..34e7be8bb 100644 --- a/src/Explorer/Controls/SmartUi/SmartUiComponent.tsx +++ b/src/Explorer/Controls/SmartUi/SmartUiComponent.tsx @@ -334,7 +334,7 @@ export class SmartUiComponent extends React.Component ({ key: c.key, - text: this.props.getTranslation(c.label), + text: this.props.getTranslation(c.labelTKey), }))} styles={{ root: { width: 400 }, diff --git a/src/Localization/en/Common.json b/src/Localization/en/Common.json new file mode 100644 index 000000000..0e58fa4d4 --- /dev/null +++ b/src/Localization/en/Common.json @@ -0,0 +1,5 @@ +{ + "Save": "Save", + "Discard": "Discard", + "Refresh": "Refesh" +} \ No newline at end of file diff --git a/src/Localization/en/SelfServeExample.json b/src/Localization/en/SelfServeExample.json new file mode 100644 index 000000000..2d28615c7 --- /dev/null +++ b/src/Localization/en/SelfServeExample.json @@ -0,0 +1,31 @@ +{ + "NorthCentralUS": "North Central US", + "WestUS": "West US", + "EastUS2": "East US 2", + "Current Region": "Current Region", + "RegionDropdownInfo": "More regions can be added in the future.", + "RegionsAndAccountNameValidationError": "Regions and account name should not be empty.", + "DbThroughputValidationError": "Please update throughput for database.", + "DescriptionLabel": "Description", + "DescriptionText": "This class sets collection and database throughput.", + "DecriptionLinkText": "Click here for more information", + "Regions": "Regions", + "RegionsPlaceholder": "Select a region", + "Enable Logging": "Enable Logging", + "Enable": "Enable", + "Disable": "Disable", + "Account Name": "Account Name", + "AccountNamePlaceHolder": "Enter the account name", + "Collection Throughput": "Collection Throughput", + "Enable DB level throughput": "Enable Database Level Throughput", + "Database Throughput": "Database Throughput", + "UpdateInProgressMessage": "Data is being updated", + "UpdateCompletedMessageTitle": "Update succeeded", + "UpdateCompletedMessageText": "Data update completed.", + "SubmissionMessageSuccessTitle": "Update started", + "SubmissionMessageForNewRegionText": "Data update started. Region changed.", + "SubmissionMessageForSameRegionText": "Data update started. Region not changed.", + "SubmissionMessageErrorTitle": "Data update failed", + "SubmissionMessageErrorText": "Data update failed because of errors.", + "OnSaveFailureMessage": "Data save operation not currently permitted." +} \ No newline at end of file diff --git a/src/Localization/en/SqlX.json b/src/Localization/en/SqlX.json new file mode 100644 index 000000000..465cba248 --- /dev/null +++ b/src/Localization/en/SqlX.json @@ -0,0 +1,52 @@ +{ + "DedicatedGatewayDescription": "Provision a dedicated gateway cluster for your Azure Cosmos DB account. A dedicated gateway is compute that is a front-end to data in your Azure Cosmos DB account. Your dedicated gateway automatically includes the integrated cache, which can improve read performance.", + "DedicatedGateway": "Dedicated Gateway", + "Enable": "Enable", + "Disable": "Disable", + "LearnAboutDedicatedGateway": "Learn more about dedicated gateway.", + "DeprovisioningDetailsText": "Learn more about deprovisioning the dedicated gateway.", + "DedicatedGatewayPricing": "Learn more about dedicated gateway pricing.", + "SKUs": "SKUs", + "SKUsPlaceHolder": "Select SKUs", + "NumberOfInstances": "Number of instances", + "CosmosD4s": "Cosmos.D4s (General Purpose Cosmos Compute with 4 vCPUs, 16 GB Memory)", + "CosmosD8s": "Cosmos.D8s (General Purpose Cosmos Compute with 8 vCPUs, 32 GB Memory)", + "CosmosD16s": "Cosmos.D16s (General Purpose Cosmos Compute with 16 vCPUs, 64 GB Memory)", + "CosmosD32s": "Cosmos.D32s (General Purpose Cosmos Compute with 32 vCPUs, 128 GB Memory)", + "CreateMessage": "Dedicated gateway resource is being created.", + "CreateInitializeTitle": "Provisioning resource", + "CreateInitializeMessage": "Dedicated gateway resource will be provisioned.", + "CreateSuccessTitle": "Resource provisioned", + "CreateSuccesseMessage": "Dedicated gateway resource provisioned.", + "CreateFailureTitle": "Failed to provision resource", + "CreateFailureMessage": "Dedicated gateway resource provisioning failed.", + "UpdateMessage": "Dedicated gateway resource is being updated.", + "UpdateInitializeTitle": "Updating resource", + "UpdateInitializeMessage": "Dedicated gateway resource will be updated.", + "UpdateSuccessTitle": "Resource updated", + "UpdateSuccesseMessage": "Dedicated gateway resource updated.", + "UpdateFailureTitle": "Failed to update resource", + "UpdateFailureMessage": "Dedicated gateway resource updation failed.", + "DeleteMessage": "Dedicated gateway resource is being deleted.", + "DeleteInitializeTitle": "Deleting resource", + "DeleteInitializeMessage": "Dedicated gateway resource will be deleted.", + "DeleteSuccessTitle": "Resource deleted", + "DeleteSuccesseMessage": "Dedicated gateway resource deleted.", + "DeleteFailureTitle": "Failed to delete resource", + "DeleteFailureMessage": "Dedicated gateway resource deletion failed.", + "CannotSave": "Cannot save the changes to the Dedicated gateway resource at the moment.", + "DedicatedGatewayEndpoint": "Dedicated gatewayEndpoint", + "NoValue": "", + "SKUDetails": "SKU Details:", + "CosmosD4Details": "General Purpose Cosmos Compute with 4 vCPUs, 16 GB Memory", + "CosmosD8Details": "General Purpose Cosmos Compute with 8 vCPUs, 32 GB Memory", + "CosmosD16Details": "General Purpose Cosmos Compute with 16 vCPUs, 64 GB Memory", + "CosmosD32Details": "General Purpose Cosmos Compute with 32 vCPUs, 128 GB Memory", + "Cost": "Cost", + "CostText": "Hourly cost of the dedicated gateway resource depends on the SKU selection, number of instances per region, and number of regions.", + "ConnectionString": "Connection String", + "ConnectionStringText": "To use the dedicated gateway, use the connection string shown in ", + "KeysBlade": "the keys blade", + "WarningBannerOnUpdate": "Adding or modifying dedicated gateway instances may affect your bill.", + "WarningBannerOnDelete": "After deprovisioning the dedicated gateway, you must update any applications using the old dedicated gateway connection string." +} \ No newline at end of file diff --git a/src/Localization/en/translations.json b/src/Localization/en/translations.json deleted file mode 100644 index 44d4506cd..000000000 --- a/src/Localization/en/translations.json +++ /dev/null @@ -1,92 +0,0 @@ -{ - "translations": { - "Common": { - "Save": "Save", - "Discard": "Discard", - "Refresh": "Refesh" - }, - "SelfServeExample": { - "North Central US": "North Central US", - "West US": "West US", - "East US 2": "East US 2", - "Current Region": "Current Region", - "RegionDropdownInfo": "More regions can be added in the future.", - "RegionsAndAccountNameValidationError": "Regions and account name should not be empty.", - "DbThroughputValidationError": "Please update throughput for database.", - "DescriptionLabel": "Description", - "DescriptionText": "This class sets collection and database throughput.", - "DecriptionLinkText": "Click here for more information", - "Regions": "Regions", - "RegionsPlaceholder": "Select a region", - "Enable Logging": "Enable Logging", - "Enable": "Enable", - "Disable": "Disable", - "Account Name": "Account Name", - "AccountNamePlaceHolder": "Enter the account name", - "Collection Throughput": "Collection Throughput", - "Enable DB level throughput": "Enable Database Level Throughput", - "Database Throughput": "Database Throughput", - "UpdateInProgressMessage": "Data is being updated", - "UpdateCompletedMessageTitle": "Update succeeded", - "UpdateCompletedMessageText": "Data update completed.", - "SubmissionMessageSuccessTitle": "Update started", - "SubmissionMessageForNewRegionText": "Data update started. Region changed.", - "SubmissionMessageForSameRegionText": "Data update started. Region not changed.", - "SubmissionMessageErrorTitle": "Data update failed", - "SubmissionMessageErrorText": "Data update failed because of errors.", - "OnSaveFailureMessage": "Data save operation not currently permitted." - }, - "SqlX": { - "DedicatedGatewayDescription": "Provision a dedicated gateway cluster for your Azure Cosmos DB account. A dedicated gateway is compute that is a front-end to data in your Azure Cosmos DB account. Your dedicated gateway automatically includes the integrated cache, which can improve read performance. ", - "DedicatedGateway": "Dedicated Gateway", - "Enable": "Enable", - "Disable": "Disable", - "LearnAboutDedicatedGateway": "Learn more about dedicated gateway.", - "DeprovisioningDetailsText": "Learn more about deprovisioning the dedicated gateway.", - "DedicatedGatewayPricing": "Learn more about dedicated gateway pricing", - "SKUs": "SKUs", - "SKUsPlaceHolder": "Select SKUs", - "NumberOfInstances": "Number of instances", - "CosmosD4s": "Cosmos.D4s (General Purpose Cosmos Compute with 4 vCPUs, 16 GB Memory)", - "CosmosD8s": "Cosmos.D8s (General Purpose Cosmos Compute with 8 vCPUs, 32 GB Memory)", - "CosmosD16s": "Cosmos.D16s (General Purpose Cosmos Compute with 16 vCPUs, 64 GB Memory)", - "CosmosD32s": "Cosmos.D32s (General Purpose Cosmos Compute with 32 vCPUs, 128 GB Memory)", - "CreateMessage": "Dedicated gateway resource is being created.", - "CreateInitializeTitle": "Provisioning resource", - "CreateInitializeMessage": "Dedicated gateway resource will be provisioned.", - "CreateSuccessTitle": "Resource provisioned", - "CreateSuccesseMessage": "Dedicated gateway resource provisioned.", - "CreateFailureTitle": "Failed to provision resource", - "CreateFailureMessage": "Dedicated gateway resource provisioning failed.", - "UpdateMessage": "Dedicated gateway resource is being updated.", - "UpdateInitializeTitle": "Updating resource", - "UpdateInitializeMessage": "Dedicated gateway resource will be updated.", - "UpdateSuccessTitle": "Resource updated", - "UpdateSuccesseMessage": "Dedicated gateway resource updated.", - "UpdateFailureTitle": "Failed to update resource", - "UpdateFailureMessage": "Dedicated gateway resource updation failed.", - "DeleteMessage": "Dedicated gateway resource is being deleted.", - "DeleteInitializeTitle": "Deleting resource", - "DeleteInitializeMessage": "Dedicated gateway resource will be deleted.", - "DeleteSuccessTitle": "Resource deleted", - "DeleteSuccesseMessage": "Dedicated gateway resource deleted.", - "DeleteFailureTitle": "Failed to delete resource", - "DeleteFailureMessage": "Dedicated gateway resource deletion failed.", - "CannotSave": "Cannot save the changes to the Dedicated gateway resource at the moment", - "DedicatedGatewayEndpoint": "Dedicated gatewayEndpoint", - "NoValue": "", - "SKUDetails": "SKU Details: ", - "CosmosD4Details": "General Purpose Cosmos Compute with 4 vCPUs, 16 GB Memory", - "CosmosD8Details": "General Purpose Cosmos Compute with 8 vCPUs, 32 GB Memory", - "CosmosD16Details": "General Purpose Cosmos Compute with 16 vCPUs, 64 GB Memory", - "CosmosD32Details": "General Purpose Cosmos Compute with 32 vCPUs, 128 GB Memory", - "Cost": "Cost", - "CostText": "Hourly cost of the dedicated gateway resource depends on the SKU selection, number of instances per region, and number of regions.", - "ConnectionString": "Connection String", - "ConnectionStringText": "To use the dedicated gateway, use the connection string shown in ", - "KeysBlade": "the keys blade", - "WarningBannerOnUpdate": "Adding or modifying dedicated gateway instances may affect your bill.", - "WarningBannerOnDelete": "After deprovisioning the dedicated gateway, you must update any applications using the old dedicated gateway connection string." - } - } -} \ No newline at end of file diff --git a/src/SelfServe/Example/SelfServeExample.tsx b/src/SelfServe/Example/SelfServeExample.tsx index df994d0a7..a533a26f7 100644 --- a/src/SelfServe/Example/SelfServeExample.tsx +++ b/src/SelfServe/Example/SelfServeExample.tsx @@ -23,9 +23,9 @@ import { } from "./SelfServeExample.rp"; const regionDropdownItems: ChoiceItem[] = [ - { label: "North Central US", key: Regions.NorthCentralUS }, - { label: "West US", key: Regions.WestUS }, - { label: "East US 2", key: Regions.EastUS2 }, + { labelTKey: "NorthCentralUS", key: Regions.NorthCentralUS }, + { labelTKey: "WestUS", key: Regions.WestUS }, + { labelTKey: "EastUS2", key: Regions.EastUS2 }, ]; const regionDropdownInfo: Info = { diff --git a/src/SelfServe/SelfServe.tsx b/src/SelfServe/SelfServe.tsx index 4ad49b2f2..062d07289 100644 --- a/src/SelfServe/SelfServe.tsx +++ b/src/SelfServe/SelfServe.tsx @@ -2,10 +2,12 @@ import { Spinner, SpinnerSize } from "office-ui-fabric-react"; import { initializeIcons } from "office-ui-fabric-react/lib/Icons"; import * as React from "react"; import ReactDOM from "react-dom"; +import { withTranslation } from "react-i18next"; import { normalizeArmEndpoint } from "../Common/EnvironmentUtility"; import { sendReadyMessage } from "../Common/MessageHandler"; import { configContext, updateConfigContext } from "../ConfigContext"; import { SelfServeFrameInputs } from "../Contracts/ViewModels"; +import i18n from "../i18n"; import { updateUserContext } from "../UserContext"; import { isInvalidParentFrameOrigin } from "../Utils/MessageValidation"; import "./SelfServe.less"; @@ -14,14 +16,35 @@ import { SelfServeDescriptor } from "./SelfServeTypes"; import { SelfServeType } from "./SelfServeUtils"; initializeIcons(); +const loadTranslationFile = async (className: string): Promise => { + const language = i18n.languages[0]; + const fileName = `${className}.json`; + + // eslint-disable-next-line @typescript-eslint/no-explicit-any + let translations: any; + try { + translations = await import(`../Localization/${language}/${fileName}`); + } catch (e) { + translations = await import(`../Localization/en/${fileName}`); + } + i18n.addResourceBundle(language, className, translations.default, true); +}; + +const loadTranslations = async (className: string): Promise => { + await loadTranslationFile("Common"); + await loadTranslationFile(className); +}; + const getDescriptor = async (selfServeType: SelfServeType): Promise => { switch (selfServeType) { case SelfServeType.example: { const SelfServeExample = await import(/* webpackChunkName: "SelfServeExample" */ "./Example/SelfServeExample"); + await loadTranslations(SelfServeExample.default.name); return new SelfServeExample.default().toSelfServeDescriptor(); } case SelfServeType.sqlx: { const SqlX = await import(/* webpackChunkName: "SqlX" */ "./SqlX/SqlX"); + await loadTranslations(SqlX.default.name); return new SqlX.default().toSelfServeDescriptor(); } default: @@ -33,7 +56,8 @@ const renderComponent = (selfServeDescriptor: SelfServeDescriptor): JSX.Element if (!selfServeDescriptor) { return

Invalid self serve type!

; } - return ; + const SelfServeComponentTranslated = withTranslation()(SelfServeComponent); + return ; }; const renderSpinner = (): JSX.Element => { diff --git a/src/SelfServe/SelfServeComponent.test.tsx b/src/SelfServe/SelfServeComponent.test.tsx index 80ec112af..81bbb905b 100644 --- a/src/SelfServe/SelfServeComponent.test.tsx +++ b/src/SelfServe/SelfServeComponent.test.tsx @@ -1,5 +1,5 @@ -import React from "react"; import { shallow } from "enzyme"; +import React from "react"; import { SelfServeComponent, SelfServeComponentState } from "./SelfServeComponent"; import { NumberUiType, OnSaveResult, SelfServeDescriptor, SmartUiInput } from "./SelfServeTypes"; @@ -87,9 +87,9 @@ describe("SelfServeComponent", () => { dataFieldName: "database", type: "object", choices: [ - { label: "Database 1", key: "db1" }, - { label: "Database 2", key: "db2" }, - { label: "Database 3", key: "db3" }, + { labelTKey: "Database 1", key: "db1" }, + { labelTKey: "Database 2", key: "db2" }, + { labelTKey: "Database 3", key: "db3" }, ], defaultKey: "db2", }, @@ -106,7 +106,9 @@ describe("SelfServeComponent", () => { }; it("should render and honor save, discard, refresh actions", async () => { - const wrapper = shallow(); + const wrapper = shallow( + + ); await new Promise((resolve) => setTimeout(resolve, 0)); expect(wrapper).toMatchSnapshot(); @@ -158,7 +160,9 @@ describe("SelfServeComponent", () => { }); it("getResolvedValue", async () => { - const wrapper = shallow(); + const wrapper = shallow( + + ); await new Promise((resolve) => setTimeout(resolve, 0)); const selfServeComponent = wrapper.instance() as SelfServeComponent; @@ -179,7 +183,9 @@ describe("SelfServeComponent", () => { it("message bar and spinner snapshots", async () => { const newDescriptor = { ...exampleData, onRefresh: onRefreshIsUpdatingMock }; - let wrapper = shallow(); + let wrapper = shallow( + + ); await new Promise((resolve) => setTimeout(resolve, 0)); let selfServeComponent = wrapper.instance() as SelfServeComponent; selfServeComponent.onSaveButtonClick(); @@ -187,7 +193,9 @@ describe("SelfServeComponent", () => { expect(wrapper).toMatchSnapshot(); newDescriptor.onRefresh = onRefreshMock; - wrapper = shallow(); + wrapper = shallow( + + ); await new Promise((resolve) => setTimeout(resolve, 0)); selfServeComponent = wrapper.instance() as SelfServeComponent; selfServeComponent.onSaveButtonClick(); diff --git a/src/SelfServe/SelfServeComponent.tsx b/src/SelfServe/SelfServeComponent.tsx index 649dc2bdc..0de97c8bd 100644 --- a/src/SelfServe/SelfServeComponent.tsx +++ b/src/SelfServe/SelfServeComponent.tsx @@ -8,15 +8,15 @@ import { Spinner, SpinnerSize, Stack, + Text, } from "office-ui-fabric-react"; import promiseRetry, { AbortError } from "p-retry"; import React from "react"; -import { Translation } from "react-i18next"; +import { WithTranslation } from "react-i18next"; import * as _ from "underscore"; import { sendMessage } from "../Common/MessageHandler"; import { SelfServeMessageTypes } from "../Contracts/SelfServeContracts"; import { SmartUiComponent, SmartUiDescriptor } from "../Explorer/Controls/SmartUi/SmartUiComponent"; -import "../i18n"; import { commandBarItemStyles, commandBarStyles, containerStackTokens, separatorStyles } from "./SelfServeStyles"; import { AnyDisplay, @@ -57,7 +57,7 @@ interface PortalNotificationContent { }; } -export interface SelfServeComponentProps { +export interface SelfServeComponentProps extends WithTranslation { descriptor: SelfServeDescriptor; } @@ -108,6 +108,9 @@ export class SelfServeComponent extends React.Component { @@ -391,8 +394,8 @@ export class SelfServeComponent extends React.Component { - const translationKey = `${prefix}.${messageKey}`; + private getTranslation = (messageKey: string, namespace = `${this.smartUiGeneratorClassName}`): string => { + const translationKey = `${namespace}:${messageKey}`; const translation = this.translationFunction ? this.translationFunction(translationKey) : messageKey; if (translation === translationKey) { return messageKey; @@ -441,53 +444,45 @@ export class SelfServeComponent extends React.Component{this.state.compileErrorMessage}; + return ( + + {this.state.compileErrorMessage} + + ); } return ( - - {(translate) => { - if (!this.translationFunction) { - this.translationFunction = translate; - } - - return ( -
- - - - - - {this.state.isInitializing ? ( - - ) : ( - <> - {this.state.notification && ( - this.setState({ notification: undefined }) - : undefined - } - > - {this.state.notification.message} - - )} - - - )} - -
- ); - }} -
+
+ + + + + + {this.state.isInitializing ? ( + + ) : ( + <> + {this.state.notification && ( + this.setState({ notification: undefined }) : undefined + } + > + {this.state.notification.message} + + )} + + + )} + +
); } } diff --git a/src/SelfServe/SelfServeTelemetryProcessor.ts b/src/SelfServe/SelfServeTelemetryProcessor.ts new file mode 100644 index 000000000..f26b05a1e --- /dev/null +++ b/src/SelfServe/SelfServeTelemetryProcessor.ts @@ -0,0 +1,69 @@ +import { sendMessage } from "../Common/MessageHandler"; +import { configContext } from "../ConfigContext"; +import { SelfServeMessageTypes } from "../Contracts/SelfServeContracts"; +import { appInsights } from "../Shared/appInsights"; +import { Action, ActionModifiers } from "../Shared/Telemetry/TelemetryConstants"; +import { userContext } from "../UserContext"; +import { SelfServeTelemetryMessage } from "./SelfServeTypes"; + +const action = Action.SelfServe; + +export const trace = (data: SelfServeTelemetryMessage): void => { + sendSelfServeTelemetryMessage(ActionModifiers.Mark, data); + appInsights.trackEvent({ name: Action[action] }, decorateData(data, ActionModifiers.Mark)); +}; + +export const traceStart = (data: SelfServeTelemetryMessage): number => { + const timestamp: number = Date.now(); + sendSelfServeTelemetryMessage(ActionModifiers.Start, data); + appInsights.startTrackEvent(Action[action]); + return timestamp; +}; + +export const traceSuccess = (data: SelfServeTelemetryMessage, timestamp?: number): void => { + sendSelfServeTelemetryMessage(ActionModifiers.Success, data, timestamp || Date.now()); + appInsights.stopTrackEvent(Action[action], decorateData(data, ActionModifiers.Success)); +}; + +export const traceFailure = (data: SelfServeTelemetryMessage, timestamp?: number): void => { + sendSelfServeTelemetryMessage(ActionModifiers.Failed, data, timestamp || Date.now()); + appInsights.stopTrackEvent(Action[action], decorateData(data, ActionModifiers.Failed)); +}; + +export const traceCancel = (data: SelfServeTelemetryMessage, timestamp?: number): void => { + sendSelfServeTelemetryMessage(ActionModifiers.Cancel, data, timestamp || Date.now()); + appInsights.stopTrackEvent(Action[action], decorateData(data, ActionModifiers.Cancel)); +}; + +const sendSelfServeTelemetryMessage = ( + actionModifier: string, + data: SelfServeTelemetryMessage, + timeStamp?: number +): void => { + // eslint-disable-next-line @typescript-eslint/no-explicit-any + const dataToSend: any = { + type: SelfServeMessageTypes.TelemetryInfo, + data: { + action: Action[action], + actionModifier: actionModifier, + data: JSON.stringify(decorateData(data)), + }, + }; + if (timeStamp) { + dataToSend.data.timeStamp = timeStamp; + } + sendMessage(dataToSend); +}; + +const decorateData = (data: SelfServeTelemetryMessage, actionModifier?: string) => { + return { + databaseAccountName: userContext.databaseAccount?.name, + defaultExperience: userContext.defaultExperience, + authType: userContext.authType, + subscriptionId: userContext.subscriptionId, + platform: configContext.platform, + env: process.env.NODE_ENV, + actionModifier, + ...data, + } as { [key: string]: string }; +}; diff --git a/src/SelfServe/SelfServeTypes.ts b/src/SelfServe/SelfServeTypes.ts index 611d19364..a86b74c04 100644 --- a/src/SelfServe/SelfServeTypes.ts +++ b/src/SelfServe/SelfServeTypes.ts @@ -98,7 +98,7 @@ export enum NumberUiType { Slider = "Slider", } -export type ChoiceItem = { label: string; key: string }; +export type ChoiceItem = { labelTKey: string; key: string }; export type InputType = number | string | boolean | ChoiceItem | Description; @@ -157,3 +157,9 @@ export interface RefreshResult { export interface RefreshParams { retryIntervalInMs: number; } + +export interface SelfServeTelemetryMessage { + selfServeClassName: string; + // eslint-disable-next-line @typescript-eslint/no-explicit-any + data?: any; +} diff --git a/src/SelfServe/SelfServeUtils.test.tsx b/src/SelfServe/SelfServeUtils.test.tsx index e1fe1a3f8..0efe7bd5f 100644 --- a/src/SelfServe/SelfServeUtils.test.tsx +++ b/src/SelfServe/SelfServeUtils.test.tsx @@ -131,9 +131,9 @@ describe("SelfServeUtils", () => { type: "object", labelTKey: "Regions", choices: [ - { label: "South West US", key: "SWUS" }, - { label: "North Central US", key: "NCUS" }, - { label: "East US 2", key: "EUS2" }, + { labelTKey: "South West US", key: "SWUS" }, + { labelTKey: "North Central US", key: "NCUS" }, + { labelTKey: "East US 2", key: "EUS2" }, ], }, ], @@ -238,9 +238,9 @@ describe("SelfServeUtils", () => { type: "object", labelTKey: "Regions", choices: [ - { label: "South West US", key: "SWUS" }, - { label: "North Central US", key: "NCUS" }, - { label: "East US 2", key: "EUS2" }, + { labelTKey: "South West US", key: "SWUS" }, + { labelTKey: "North Central US", key: "NCUS" }, + { labelTKey: "East US 2", key: "EUS2" }, ], }, children: [] as Node[], diff --git a/src/SelfServe/SelfServeUtils.tsx b/src/SelfServe/SelfServeUtils.tsx index 8d1cec9a3..8106153a2 100644 --- a/src/SelfServe/SelfServeUtils.tsx +++ b/src/SelfServe/SelfServeUtils.tsx @@ -195,5 +195,5 @@ export const generateBladeLink = (blade: BladeType): string => { const subscriptionId = userContext.subscriptionId; const resourceGroupName = userContext.resourceGroup; const databaseAccountName = userContext.databaseAccount.name; - return `https://portal.azure.com/#@microsoft.onmicrosoft.com/resource/subscriptions/${subscriptionId}/resourceGroups/${resourceGroupName}/providers/Microsoft.DocumentDb/databaseAccounts/${databaseAccountName}/${blade}`; + return `${document.referrer}#@microsoft.onmicrosoft.com/resource/subscriptions/${subscriptionId}/resourceGroups/${resourceGroupName}/providers/Microsoft.DocumentDb/databaseAccounts/${databaseAccountName}/${blade}`; }; diff --git a/src/SelfServe/SqlX/SqlX.tsx b/src/SelfServe/SqlX/SqlX.tsx index e8308b651..41d855fee 100644 --- a/src/SelfServe/SqlX/SqlX.tsx +++ b/src/SelfServe/SqlX/SqlX.tsx @@ -1,4 +1,5 @@ import { IsDisplayable, OnChange, RefreshOptions, Values } from "../Decorators"; +import { trace } from "../SelfServeTelemetryProcessor"; import { ChoiceItem, Description, @@ -147,10 +148,10 @@ const onEnableDedicatedGatewayChange = ( }; const skuDropDownItems: ChoiceItem[] = [ - { label: "CosmosD4s", key: CosmosD4s }, - { label: "CosmosD8s", key: CosmosD8s }, - { label: "CosmosD16s", key: CosmosD16s }, - { label: "CosmosD32s", key: CosmosD32s }, + { labelTKey: "CosmosD4s", key: CosmosD4s }, + { labelTKey: "CosmosD8s", key: CosmosD8s }, + { labelTKey: "CosmosD16s", key: CosmosD16s }, + { labelTKey: "CosmosD32s", key: CosmosD32s }, ]; const getSkus = async (): Promise => { @@ -176,6 +177,8 @@ export default class SqlX extends SelfServeBaseClass { currentValues: Map, baselineValues: Map ): Promise => { + trace({ selfServeClassName: "SqlX" }); + const dedicatedGatewayCurrentlyEnabled = currentValues.get("enableDedicatedGateway")?.value as boolean; const dedicatedGatewayOriginallyEnabled = baselineValues.get("enableDedicatedGateway")?.value as boolean; diff --git a/src/SelfServe/__snapshots__/SelfServeComponent.test.tsx.snap b/src/SelfServe/__snapshots__/SelfServeComponent.test.tsx.snap index 09c5ae177..1ba9afb95 100644 --- a/src/SelfServe/__snapshots__/SelfServeComponent.test.tsx.snap +++ b/src/SelfServe/__snapshots__/SelfServeComponent.test.tsx.snap @@ -1,33 +1,1050 @@ // Jest Snapshot v1, https://goo.gl/fbAQLP exports[`SelfServeComponent message bar and spinner snapshots 1`] = ` - - - +
+ + + + + + + + refresh performed successfully + + + Object { + "disabled": false, + "hidden": false, + "value": 450, + }, + "analyticalStore" => Object { + "disabled": false, + "hidden": false, + "value": false, + }, + "database" => Object { + "disabled": false, + "hidden": false, + "value": "db2", + }, + } + } + descriptor={ + Object { + "initialize": [MockFunction] { + "calls": Array [ + Array [], + Array [], + Array [], + ], + "results": Array [ + Object { + "type": "return", + "value": Promise {}, + }, + Object { + "type": "return", + "value": Promise {}, + }, + Object { + "type": "return", + "value": Promise {}, + }, + ], + }, + "inputNames": Array [ + "throughput", + "analyticalStore", + "database", + ], + "onRefresh": [MockFunction] { + "calls": Array [ + Array [], + Array [], + Array [], + Array [], + ], + "results": Array [ + Object { + "type": "return", + "value": Promise {}, + }, + Object { + "type": "return", + "value": Promise {}, + }, + Object { + "type": "return", + "value": Promise {}, + }, + Object { + "type": "return", + "value": Promise {}, + }, + ], + }, + "onSave": [MockFunction] { + "calls": Array [ + Array [ + Map { + "throughput" => Object { + "disabled": false, + "hidden": false, + "value": 450, + }, + "analyticalStore" => Object { + "disabled": false, + "hidden": false, + "value": false, + }, + "database" => Object { + "disabled": false, + "hidden": false, + "value": "db2", + }, + }, + Map { + "throughput" => Object { + "disabled": false, + "hidden": false, + "value": 450, + }, + "analyticalStore" => Object { + "disabled": false, + "hidden": false, + "value": false, + }, + "database" => Object { + "disabled": false, + "hidden": false, + "value": "db2", + }, + }, + ], + Array [ + Map { + "throughput" => Object { + "disabled": false, + "hidden": false, + "value": 450, + }, + "analyticalStore" => Object { + "disabled": false, + "hidden": false, + "value": false, + }, + "database" => Object { + "disabled": false, + "hidden": false, + "value": "db2", + }, + }, + Map { + "throughput" => Object { + "disabled": false, + "hidden": false, + "value": 450, + }, + "analyticalStore" => Object { + "disabled": false, + "hidden": false, + "value": false, + }, + "database" => Object { + "disabled": false, + "hidden": false, + "value": "db2", + }, + }, + ], + ], + "results": Array [ + Object { + "type": "return", + "value": Promise {}, + }, + Object { + "type": "return", + "value": Promise {}, + }, + ], + }, + "root": Object { + "children": Array [ + Object { + "id": "throughput", + "info": undefined, + "input": Object { + "dataFieldName": "throughput", + "defaultValue": 400, + "labelTKey": "Throughput (input)", + "max": 500, + "min": 400, + "placeholderTKey": undefined, + "step": 10, + "type": "number", + "uiType": "Spinner", + }, + }, + Object { + "id": "containerId", + "info": undefined, + "input": Object { + "dataFieldName": "containerId", + "labelTKey": "Container id", + "placeholderTKey": undefined, + "type": "string", + }, + }, + Object { + "id": "analyticalStore", + "info": undefined, + "input": Object { + "dataFieldName": "analyticalStore", + "defaultValue": true, + "falseLabelTKey": "Disabled", + "labelTKey": "Analytical Store", + "placeholderTKey": undefined, + "trueLabelTKey": "Enabled", + "type": "boolean", + }, + }, + Object { + "id": "database", + "info": undefined, + "input": Object { + "choices": Array [ + Object { + "key": "db1", + "labelTKey": "Database 1", + }, + Object { + "key": "db2", + "labelTKey": "Database 2", + }, + Object { + "key": "db3", + "labelTKey": "Database 3", + }, + ], + "dataFieldName": "database", + "defaultKey": "db2", + "labelTKey": "Database", + "placeholderTKey": undefined, + "type": "object", + }, + }, + ], + "id": "root", + "info": Object { + "link": Object { + "href": "https://aka.ms/azure-cosmos-db-pricing", + "textTKey": "More Details", + }, + "messageTKey": "Start at $24/mo per database", + }, + }, + } + } + disabled={true} + getTranslation={[Function]} + onError={[Function]} + onInputChange={[Function]} + /> + +
`; exports[`SelfServeComponent message bar and spinner snapshots 2`] = ` - - - +
+ + + + + + Object { + "disabled": false, + "hidden": false, + "value": 450, + }, + "analyticalStore" => Object { + "disabled": false, + "hidden": false, + "value": false, + }, + "database" => Object { + "disabled": false, + "hidden": false, + "value": "db2", + }, + } + } + descriptor={ + Object { + "initialize": [MockFunction] { + "calls": Array [ + Array [], + Array [], + Array [], + Array [], + ], + "results": Array [ + Object { + "type": "return", + "value": Promise {}, + }, + Object { + "type": "return", + "value": Promise {}, + }, + Object { + "type": "return", + "value": Promise {}, + }, + Object { + "type": "return", + "value": Promise {}, + }, + ], + }, + "inputNames": Array [ + "throughput", + "analyticalStore", + "database", + ], + "onRefresh": [MockFunction] { + "calls": Array [ + Array [], + Array [], + Array [], + Array [], + Array [], + Array [], + Array [], + Array [], + ], + "results": Array [ + Object { + "type": "return", + "value": Promise {}, + }, + Object { + "type": "return", + "value": Promise {}, + }, + Object { + "type": "return", + "value": Promise {}, + }, + Object { + "type": "return", + "value": Promise {}, + }, + Object { + "type": "return", + "value": Promise {}, + }, + Object { + "type": "return", + "value": Promise {}, + }, + Object { + "type": "return", + "value": Promise {}, + }, + Object { + "type": "return", + "value": Promise {}, + }, + ], + }, + "onSave": [MockFunction] { + "calls": Array [ + Array [ + Map { + "throughput" => Object { + "disabled": false, + "hidden": false, + "value": 450, + }, + "analyticalStore" => Object { + "disabled": false, + "hidden": false, + "value": false, + }, + "database" => Object { + "disabled": false, + "hidden": false, + "value": "db2", + }, + }, + Map { + "throughput" => Object { + "disabled": false, + "hidden": false, + "value": 450, + }, + "analyticalStore" => Object { + "disabled": false, + "hidden": false, + "value": false, + }, + "database" => Object { + "disabled": false, + "hidden": false, + "value": "db2", + }, + }, + ], + Array [ + Map { + "throughput" => Object { + "disabled": false, + "hidden": false, + "value": 450, + }, + "analyticalStore" => Object { + "disabled": false, + "hidden": false, + "value": false, + }, + "database" => Object { + "disabled": false, + "hidden": false, + "value": "db2", + }, + }, + Map { + "throughput" => Object { + "disabled": false, + "hidden": false, + "value": 450, + }, + "analyticalStore" => Object { + "disabled": false, + "hidden": false, + "value": false, + }, + "database" => Object { + "disabled": false, + "hidden": false, + "value": "db2", + }, + }, + ], + Array [ + Map { + "throughput" => Object { + "disabled": false, + "hidden": false, + "value": 450, + }, + "analyticalStore" => Object { + "disabled": false, + "hidden": false, + "value": false, + }, + "database" => Object { + "disabled": false, + "hidden": false, + "value": "db2", + }, + }, + Map { + "throughput" => Object { + "disabled": false, + "hidden": false, + "value": 450, + }, + "analyticalStore" => Object { + "disabled": false, + "hidden": false, + "value": false, + }, + "database" => Object { + "disabled": false, + "hidden": false, + "value": "db2", + }, + }, + ], + ], + "results": Array [ + Object { + "type": "return", + "value": Promise {}, + }, + Object { + "type": "return", + "value": Promise {}, + }, + Object { + "type": "return", + "value": Promise {}, + }, + ], + }, + "root": Object { + "children": Array [ + Object { + "id": "throughput", + "info": undefined, + "input": Object { + "dataFieldName": "throughput", + "defaultValue": 400, + "labelTKey": "Throughput (input)", + "max": 500, + "min": 400, + "placeholderTKey": undefined, + "step": 10, + "type": "number", + "uiType": "Spinner", + }, + }, + Object { + "id": "containerId", + "info": undefined, + "input": Object { + "dataFieldName": "containerId", + "labelTKey": "Container id", + "placeholderTKey": undefined, + "type": "string", + }, + }, + Object { + "id": "analyticalStore", + "info": undefined, + "input": Object { + "dataFieldName": "analyticalStore", + "defaultValue": true, + "falseLabelTKey": "Disabled", + "labelTKey": "Analytical Store", + "placeholderTKey": undefined, + "trueLabelTKey": "Enabled", + "type": "boolean", + }, + }, + Object { + "id": "database", + "info": undefined, + "input": Object { + "choices": Array [ + Object { + "key": "db1", + "labelTKey": "Database 1", + }, + Object { + "key": "db2", + "labelTKey": "Database 2", + }, + Object { + "key": "db3", + "labelTKey": "Database 3", + }, + ], + "dataFieldName": "database", + "defaultKey": "db2", + "labelTKey": "Database", + "placeholderTKey": undefined, + "type": "object", + }, + }, + ], + "id": "root", + "info": Object { + "link": Object { + "href": "https://aka.ms/azure-cosmos-db-pricing", + "textTKey": "More Details", + }, + "messageTKey": "Start at $24/mo per database", + }, + }, + } + } + disabled={false} + getTranslation={[Function]} + onError={[Function]} + onInputChange={[Function]} + /> + +
`; exports[`SelfServeComponent message bar and spinner snapshots 3`] = ` - - - +
+ + + + + + + +
`; exports[`SelfServeComponent message bar and spinner snapshots 4`] = ` - sample error message + + sample error message + `; exports[`SelfServeComponent should render and honor save, discard, refresh actions 1`] = ` - - - +
+ + + + + + Object { + "disabled": false, + "hidden": false, + "value": 450, + }, + "analyticalStore" => Object { + "disabled": false, + "hidden": false, + "value": false, + }, + "database" => Object { + "disabled": false, + "hidden": false, + "value": "db2", + }, + } + } + descriptor={ + Object { + "initialize": [MockFunction] { + "calls": Array [ + Array [], + ], + "results": Array [ + Object { + "type": "return", + "value": Promise {}, + }, + ], + }, + "inputNames": Array [ + "throughput", + "analyticalStore", + "database", + ], + "onRefresh": [MockFunction] { + "calls": Array [ + Array [], + ], + "results": Array [ + Object { + "type": "return", + "value": Promise {}, + }, + ], + }, + "onSave": [MockFunction], + "root": Object { + "children": Array [ + Object { + "id": "throughput", + "info": undefined, + "input": Object { + "dataFieldName": "throughput", + "defaultValue": 400, + "labelTKey": "Throughput (input)", + "max": 500, + "min": 400, + "placeholderTKey": undefined, + "step": 10, + "type": "number", + "uiType": "Spinner", + }, + }, + Object { + "id": "containerId", + "info": undefined, + "input": Object { + "dataFieldName": "containerId", + "labelTKey": "Container id", + "placeholderTKey": undefined, + "type": "string", + }, + }, + Object { + "id": "analyticalStore", + "info": undefined, + "input": Object { + "dataFieldName": "analyticalStore", + "defaultValue": true, + "falseLabelTKey": "Disabled", + "labelTKey": "Analytical Store", + "placeholderTKey": undefined, + "trueLabelTKey": "Enabled", + "type": "boolean", + }, + }, + Object { + "id": "database", + "info": undefined, + "input": Object { + "choices": Array [ + Object { + "key": "db1", + "labelTKey": "Database 1", + }, + Object { + "key": "db2", + "labelTKey": "Database 2", + }, + Object { + "key": "db3", + "labelTKey": "Database 3", + }, + ], + "dataFieldName": "database", + "defaultKey": "db2", + "labelTKey": "Database", + "placeholderTKey": undefined, + "type": "object", + }, + }, + ], + "id": "root", + "info": Object { + "link": Object { + "href": "https://aka.ms/azure-cosmos-db-pricing", + "textTKey": "More Details", + }, + "messageTKey": "Start at $24/mo per database", + }, + }, + } + } + disabled={false} + getTranslation={[Function]} + onError={[Function]} + onInputChange={[Function]} + /> + +
`; diff --git a/src/Shared/Telemetry/TelemetryConstants.ts b/src/Shared/Telemetry/TelemetryConstants.ts index 9f28a87c5..f14cfaf7e 100644 --- a/src/Shared/Telemetry/TelemetryConstants.ts +++ b/src/Shared/Telemetry/TelemetryConstants.ts @@ -114,6 +114,7 @@ export enum Action { NotebooksGalleryPublicGalleryCount, NotebooksGalleryFavoritesCount, NotebooksGalleryPublishedCount, + SelfServe, } export const ActionModifiers = { diff --git a/src/i18n.ts b/src/i18n.ts index f91c17138..37d0d7cdf 100644 --- a/src/i18n.ts +++ b/src/i18n.ts @@ -1,22 +1,14 @@ import i18n from "i18next"; import LanguageDetector from "i18next-browser-languagedetector"; import { initReactI18next } from "react-i18next"; -import XHR from "i18next-http-backend"; -import EnglishTranslations from "./Localization/en/translations.json"; i18n - .use(XHR) .use(LanguageDetector) .use(initReactI18next) .init({ - resources: { - en: EnglishTranslations, - }, fallbackLng: "en", detection: { order: ["navigator", "cookie", "localStorage", "sessionStorage", "querystring", "htmlTag"] }, debug: process.env.NODE_ENV === "development", - ns: ["translations"], - defaultNS: "translations", keySeparator: ".", interpolation: { formatSeparator: ",", @@ -29,3 +21,5 @@ i18n useSuspense: false, }, }); + +export default i18n; From a9ed187213fe7a352930364dcb8ef98f9e9abbd4 Mon Sep 17 00:00:00 2001 From: Jordi Bunster Date: Tue, 30 Mar 2021 13:59:04 -0700 Subject: [PATCH 10/12] Bugfix: this was not really used at all (#596) --- src/Explorer/Tabs/MongoQueryTab.html | 120 --------------------------- src/Explorer/Tabs/MongoQueryTab.ts | 2 - 2 files changed, 122 deletions(-) delete mode 100644 src/Explorer/Tabs/MongoQueryTab.html diff --git a/src/Explorer/Tabs/MongoQueryTab.html b/src/Explorer/Tabs/MongoQueryTab.html deleted file mode 100644 index 4302c986f..000000000 --- a/src/Explorer/Tabs/MongoQueryTab.html +++ /dev/null @@ -1,120 +0,0 @@ -
- -
-
- - - Run - - - Run - - -
-
- - -
-
- Start by writing a Mongo query, for example: {'id':'foo'} or { } to get all the - documents. -
- -
- Errors -
- - - -
- -
-
- Results: - | Request Charge: - | - - - Next - - - - Next - -
-
-
- - - -
- -
- : -
- -
- -
- -
diff --git a/src/Explorer/Tabs/MongoQueryTab.ts b/src/Explorer/Tabs/MongoQueryTab.ts index fcf029759..53ba3271e 100644 --- a/src/Explorer/Tabs/MongoQueryTab.ts +++ b/src/Explorer/Tabs/MongoQueryTab.ts @@ -5,10 +5,8 @@ import QueryTab from "./QueryTab"; import * as HeadersUtility from "../../Common/HeadersUtility"; import { queryIterator } from "../../Common/MongoProxyClient"; import { MinimalQueryIterator } from "../../Common/IteratorUtilities"; -import template from "./MongoQueryTab.html"; export default class MongoQueryTab extends QueryTab { - public static readonly component = { name: "mongo-query-tab", template }; public collection: ViewModels.Collection; constructor(options: ViewModels.QueryTabOptions) { From 813dbfee5b3d11db49a134a130110b6d787ce536 Mon Sep 17 00:00:00 2001 From: Jordi Bunster Date: Tue, 30 Mar 2021 14:01:30 -0700 Subject: [PATCH 11/12] Defensively set feature flags from window.parent (#594) This doesn't really fix the fact that portal feature flags are not being set, but it does re-enable feature flags in hosted mode. --- src/Platform/Hosted/extractFeatures.ts | 15 +++++++++++---- 1 file changed, 11 insertions(+), 4 deletions(-) diff --git a/src/Platform/Hosted/extractFeatures.ts b/src/Platform/Hosted/extractFeatures.ts index 4636c947e..eda8458ff 100644 --- a/src/Platform/Hosted/extractFeatures.ts +++ b/src/Platform/Hosted/extractFeatures.ts @@ -23,11 +23,18 @@ export type Features = { readonly ttl90Days: boolean; }; -export function extractFeatures(params?: URLSearchParams): Features { - params = params || new URLSearchParams(window.location.search); +export function extractFeatures(given = new URLSearchParams()): Features { const downcased = new URLSearchParams(); - params.forEach((value, key) => downcased.append(key.toLocaleLowerCase(), value)); - const get = (key: string) => downcased.get("feature." + key.toLocaleLowerCase()) ?? undefined; + const set = (value: string, key: string) => downcased.set(key.toLowerCase(), value); + const get = (key: string) => downcased.get("feature." + key) ?? undefined; + + try { + new URLSearchParams(window.parent.location.search).forEach(set); + } catch { + // + } finally { + given.forEach(set); + } return { canExceedMaximumValue: "true" === get("canexceedmaximumvalue"), From b1a904a98fd1916c2887483f8aebef1a88310727 Mon Sep 17 00:00:00 2001 From: Steve Faulkner Date: Tue, 30 Mar 2021 16:35:45 -0500 Subject: [PATCH 12/12] Remove TelemetrtData Type Restriction (#595) --- src/Shared/Telemetry/TelemetryProcessor.ts | 57 ++-------------------- 1 file changed, 5 insertions(+), 52 deletions(-) diff --git a/src/Shared/Telemetry/TelemetryProcessor.ts b/src/Shared/Telemetry/TelemetryProcessor.ts index 1ca45b9e5..e261f3635 100644 --- a/src/Shared/Telemetry/TelemetryProcessor.ts +++ b/src/Shared/Telemetry/TelemetryProcessor.ts @@ -1,58 +1,11 @@ -import { Action, ActionModifiers } from "./TelemetryConstants"; -import { sendMessage } from "../../Common/MessageHandler"; -import { MessageTypes } from "../../Contracts/ExplorerContracts"; -import { appInsights } from "../appInsights"; +import { sendMessage } from "../../Common/MessageHandler"; import { configContext } from "../../ConfigContext"; +import { MessageTypes } from "../../Contracts/ExplorerContracts"; import { userContext } from "../../UserContext"; +import { appInsights } from "../appInsights"; +import { Action, ActionModifiers } from "./TelemetryConstants"; -// TODO: Remove this. It is perfectly find to pass any data to telemtry methods. -// This was added only to maintain stability while removing dependencies on explorer.databaseAccount and explorer.defaultExperience -type allowedKeys = - | "notebookId" - | "collectionId" - | "collectionName" - | "error" - | "isSample" - | "downloadCount" - | "baseUrl" - | "source" - | "description" - | "dataExplorerArea" - | "databaseName" - | "downloadCount" - | "favoriteCount" - | "abuseCategory" - | "errorStack" - | "tabTitle" - | "tabId" - | "conflictResourceType" - | "conflictOperationType" - | "conflictResourceId" - | "message" - | "files" - | "notebooks" - | "directories" - | "tabName" - | "databaseId" - | "queryName" - | "isPublishPending" - | "label" - | "scopesSelected" - | "title" - | "level" - | "changedSelectedValueTo" - | "area" - | "area" - | "paneTitle" - | "notebookUrl" - | "isNotebookEnabled" - | "commandButtonClicked" - | "count" - | "publishedCount" - | "underReviewCount" - | "removedCount"; - -type TelemetryData = { [key in allowedKeys]?: unknown }; +type TelemetryData = { [key: string]: unknown }; export function trace(action: Action, actionModifier: string = ActionModifiers.Mark, data: TelemetryData = {}): void { sendMessage({