diff --git a/package-lock.json b/package-lock.json index 821db0e4f3..6186494f48 100644 --- a/package-lock.json +++ b/package-lock.json @@ -4772,7 +4772,8 @@ "decode-uri-component": { "version": "0.2.0", "resolved": "https://registry.npmjs.org/decode-uri-component/-/decode-uri-component-0.2.0.tgz", - "integrity": "sha1-6zkTMzRYd1y4TNGh+uBiEGu4dUU=" + "integrity": "sha1-6zkTMzRYd1y4TNGh+uBiEGu4dUU=", + "dev": true }, "decomment": { "version": "0.9.4", @@ -15185,24 +15186,6 @@ "resolved": "https://registry.npmjs.org/qs/-/qs-6.7.0.tgz", "integrity": "sha512-VCdBRNFTX1fyE7Nb6FYoURo/SPe62QCaAyzJvUjwRaIsc+NePBEniHlvxFmmX56+HZphIGtV0XeCirBtpDrTyQ==" }, - "query-string": { - "version": "6.14.1", - "resolved": "https://registry.npmjs.org/query-string/-/query-string-6.14.1.tgz", - "integrity": "sha512-XDxAeVmpfu1/6IjyT/gXHOl+S0vQ9owggJ30hhWKdHAsNPOcasn5o9BW0eejZqL2e4vMjhAxoW3jVHcD6mbcYw==", - "requires": { - "decode-uri-component": "^0.2.0", - "filter-obj": "^1.1.0", - "split-on-first": "^1.0.0", - "strict-uri-encode": "^2.0.0" - }, - "dependencies": { - "filter-obj": { - "version": "1.1.0", - "resolved": "https://registry.npmjs.org/filter-obj/-/filter-obj-1.1.0.tgz", - "integrity": "sha1-mzERErxsYSehbgFsbF1/GeCAXFs=" - } - } - }, "queue-microtask": { "version": "1.2.3", "resolved": "https://registry.npmjs.org/queue-microtask/-/queue-microtask-1.2.3.tgz", @@ -17044,11 +17027,6 @@ "through": "2" } }, - "split-on-first": { - "version": "1.1.0", - "resolved": "https://registry.npmjs.org/split-on-first/-/split-on-first-1.1.0.tgz", - "integrity": "sha512-43ZssAJaMusuKWL8sKUBQXHWOpq8d6CfN/u1p4gUzfJkM05C8rxTmYrkIPTXapZpORA6LkkzcUulJ8FqA7Uudw==" - }, "split-string": { "version": "3.1.0", "resolved": "https://registry.npmjs.org/split-string/-/split-string-3.1.0.tgz", @@ -17191,11 +17169,6 @@ } } }, - "strict-uri-encode": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/strict-uri-encode/-/strict-uri-encode-2.0.0.tgz", - "integrity": "sha1-ucczDHBChi9rFC3CdLvMWGbONUY=" - }, "string-length": { "version": "2.0.0", "resolved": "https://registry.npmjs.org/string-length/-/string-length-2.0.0.tgz", diff --git a/package.json b/package.json index 1f3fea1b0b..d35497e1b9 100644 --- a/package.json +++ b/package.json @@ -61,7 +61,6 @@ "prismjs": "1.25.0", "prop-types": "15.7.2", "qrcode": "1.4.4", - "query-string": "6.14.1", "react": "16.14.0", "react-ace": "9.4.3", "react-dnd": "10.0.2", diff --git a/src/dashboard/Data/Browser/Browser.react.js b/src/dashboard/Data/Browser/Browser.react.js index 031ad71cff..b6e91ea62c 100644 --- a/src/dashboard/Data/Browser/Browser.react.js +++ b/src/dashboard/Data/Browser/Browser.react.js @@ -34,7 +34,6 @@ import stringCompare from 'lib/stringCompare'; import styles from 'dashboard/Data/Browser/Browser.scss'; import subscribeTo from 'lib/subscribeTo'; import * as ColumnPreferences from 'lib/ColumnPreferences'; -import * as queryString from 'query-string'; import { Helmet } from 'react-helmet'; import PropTypes from 'lib/PropTypes'; import ParseApp from 'lib/ParseApp'; @@ -213,9 +212,9 @@ class Browser extends DashboardView { if (!props || !props.location || !props.location.search) { return filters; } - const query = queryString.parse(props.location.search); - if (query.filters) { - const queryFilters = JSON.parse(query.filters); + const query = new URLSearchParams(props.location.search); + if (query.has('filters')) { + const queryFilters = JSON.parse(query.get('filters')); queryFilters.forEach((filter) => filters = filters.push(new Map(filter))); } return filters; diff --git a/src/dashboard/Push/PushNew.react.js b/src/dashboard/Push/PushNew.react.js index e75704644b..ad5ecc2171 100644 --- a/src/dashboard/Push/PushNew.react.js +++ b/src/dashboard/Push/PushNew.react.js @@ -36,7 +36,6 @@ import Toggle from 'components/Toggle/Toggle.react'; import Toolbar from 'components/Toolbar/Toolbar.react'; import { Directions } from 'lib/Constants'; import { extractExpiration, extractPushTime } from 'lib/extractTime'; -import * as queryString from 'query-string'; const PARSE_SERVER_SUPPORTS_AB_TESTING = false; @@ -148,11 +147,11 @@ class PushNew extends DashboardView { componentWillMount() { this.props.schema.dispatch(SchemaStore.ActionTypes.FETCH); let options = { xhrKey: XHR_KEY }; - const query = queryString.parse(this.props.location.search); - if (query.audienceId) { + const query = new URLSearchParams(this.props.location.search); + if (query.has('audienceId')) { options.limit = PushConstants.SHOW_MORE_LIMIT; options.min = PushConstants.INITIAL_PAGE_SIZE; - this.setState({ initialAudienceId: query.audienceId }); + this.setState({ initialAudienceId: query.get('audienceId') }); } this.props.pushaudiences.dispatch(PushAudiencesStore.ActionTypes.FETCH, options).then(() => {