Skip to content

Commit a5c657f

Browse files
committed
fix(vue): query params prop validation
1 parent 2a67d69 commit a5c657f

File tree

3 files changed

+10
-43
lines changed

3 files changed

+10
-43
lines changed

packages/vue/src/components/ReactiveBase/index.jsx

Lines changed: 9 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ import { isEqual, transformRequestUsingEndpoint } from '@appbaseio/reactivecore/
33
import { updateAnalyticsConfig } from '@appbaseio/reactivecore/lib/actions/analytics';
44
import VueTypes from 'vue-types';
55
import Appbase from 'appbase-js';
6-
import AppbaseAnalytics from '@appbaseio/analytics'
6+
import AppbaseAnalytics from '@appbaseio/analytics';
77
import 'url-search-params-polyfill';
88

99
import Provider from '../Provider';
@@ -38,7 +38,6 @@ const ReactiveBase = {
3838
enableAppbase: VueTypes.bool.def(false),
3939
credentials: types.string,
4040
headers: types.headers,
41-
queryParams: types.string,
4241
theme: VueTypes.object.def({}),
4342
themePreset: VueTypes.string.def('light'),
4443
type: types.string,
@@ -207,7 +206,8 @@ const ReactiveBase = {
207206
credentials: appbaseRef.credentials,
208207
// When endpoint prop is used index is not defined, so we use _default
209208
index: appbaseRef.app || '_default',
210-
globalCustomEvents: this.$props.appbaseConfig && this.$props.appbaseConfig.customEvents,
209+
globalCustomEvents:
210+
this.$props.appbaseConfig && this.$props.appbaseConfig.customEvents,
211211
};
212212

213213
try {
@@ -217,10 +217,13 @@ const ReactiveBase = {
217217
/\/\/(.*?)\/.*/,
218218
'//$1',
219219
);
220-
const headerCredentials = this.$props.endpoint.headers && this.$props.endpoint.headers.Authorization;
221-
analyticsInitConfig.credentials = headerCredentials && headerCredentials.replace('Basic ', '');
220+
const headerCredentials
221+
= this.$props.endpoint.headers && this.$props.endpoint.headers.Authorization;
222+
analyticsInitConfig.credentials
223+
= headerCredentials && headerCredentials.replace('Basic ', '');
222224
// Decode the credentials
223-
analyticsInitConfig.credentials = analyticsInitConfig.credentials && atob(analyticsInitConfig.credentials);
225+
analyticsInitConfig.credentials
226+
= analyticsInitConfig.credentials && atob(analyticsInitConfig.credentials);
224227
}
225228
} catch (e) {
226229
console.error('Endpoint not set correctly for analytics');

packages/vue/src/utils/vueTypes.js

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -159,6 +159,7 @@ const types = {
159159
useCache: VueTypes.bool,
160160
customEvents: VueTypes.object,
161161
enableTelemetry: VueTypes.bool.def(true),
162+
queryParams: VueTypes.object,
162163
}).def({}),
163164
mongodb: VueTypes.shape({
164165
db: VueTypes.string,

yarn.lock

Lines changed: 0 additions & 37 deletions
Original file line numberDiff line numberDiff line change
@@ -163,17 +163,6 @@
163163
tocbot "^4.18.0"
164164
yarn "^1.22.18"
165165

166-
"@appbaseio/[email protected]":
167-
version "10.0.0-alpha.3"
168-
resolved "https://registry.yarnpkg.com/@appbaseio/reactivecore/-/reactivecore-10.0.0-alpha.3.tgz#21c7db36664acf9a652238ea1df7a6599edca531"
169-
integrity sha512-LievnS/UYyN4j6VZ2eaNkwm3VwfYM1zLttJ92ydyN2S71QXqmLjZtx941zLCILdzYXVzd3sV+YaOf0a+E/mmEQ==
170-
dependencies:
171-
cross-fetch "^3.0.4"
172-
dayjs "^1.11.7"
173-
prop-types "^15.6.0"
174-
redux "^4.0.0"
175-
redux-thunk "^2.3.0"
176-
177166
"@appbaseio/[email protected]":
178167
version "4.0.0-rc"
179168
resolved "https://registry.yarnpkg.com/@appbaseio/reactivemaps/-/reactivemaps-4.0.0-rc.tgz#f410820e3a9e38595e4e9f434cb95bfd4ca78d9f"
@@ -191,32 +180,6 @@
191180
prop-types "^15.6.0"
192181
react-leaflet "^2.1.3"
193182

194-
"@appbaseio/[email protected]":
195-
version "4.0.0-rc.1"
196-
resolved "https://registry.yarnpkg.com/@appbaseio/reactivesearch/-/reactivesearch-4.0.0-rc.1.tgz#4eb81a5a097d8e33ea3cee8eb7b847d2afaa3a18"
197-
integrity sha512-qIHrGlBrc1hvI1oshNVNfFIyARVdoWrITtfl6mzOfwNrhFwMHcR0SxtoV5fcWY0MGCTiVv90T3QPibBQ45HG4Q==
198-
dependencies:
199-
"@appbaseio/analytics" "^1.1.1"
200-
"@appbaseio/reactivecore" "10.0.0-alpha.3"
201-
"@appbaseio/rheostat" "^1.0.0-alpha.15"
202-
"@emotion/core" "^10.0.28"
203-
"@emotion/styled" "^10.0.27"
204-
appbase-js "^5.2.0"
205-
cross-env "^5.2.0"
206-
dayjs "^1.11.7"
207-
downshift "^1.31.2"
208-
echarts "^5.3.3"
209-
echarts-for-react "^3.0.2"
210-
emotion-theming "^10.0.27"
211-
hoist-non-react-statics "^3.2.1"
212-
hotkeys-js "^3.8.7"
213-
polished "^1.9.3"
214-
prop-types "^15.6.0"
215-
react-day-picker "^7.0.5"
216-
react-redux "^6.0.1"
217-
url-search-params-polyfill "^7.0.0"
218-
xss "^1.0.11"
219-
220183
"@appbaseio/rheostat@^1.0.0-alpha.15":
221184
version "1.0.0-alpha.15"
222185
resolved "https://registry.yarnpkg.com/@appbaseio/rheostat/-/rheostat-1.0.0-alpha.15.tgz#c4db000c7e0adf973aaf95951ab9b4e90d806b26"

0 commit comments

Comments
 (0)