fix(ui): mergeData crash

This commit is contained in:
Guillaume Chau
2018-04-09 20:12:38 +02:00
parent 90e0901994
commit 2ef69009db
7 changed files with 23 additions and 16 deletions

View File

@@ -62,7 +62,7 @@
"uglifyjs-webpack-plugin": "^1.2.2",
"url-loader": "^1.0.1",
"vue-loader": "^14.2.1",
"vue-template-compiler": "^2.5.13",
"vue-template-compiler": "^2.5.17-beta.0",
"webpack": "^3.10.0",
"webpack-chain": "^4.5.0",
"webpack-dev-server": "^2.11.1",

View File

@@ -18,10 +18,10 @@
"@vue/eslint-config-standard": "^3.0.0-beta.3",
"stylus": "^0.54.5",
"stylus-loader": "^3.0.1",
"vue-template-compiler": "^2.5.13"
"vue-template-compiler": "^2.5.17-beta.0"
},
"peerDependencies": {
"vue": "^2.5.13"
"vue": "^2.5.17-beta.0"
},
"browserslist": [
"> 1%",

View File

@@ -34,7 +34,7 @@
"shortid": "^2.2.8",
"subscriptions-transport-ws": "^0.9.5",
"terminate": "^2.1.0",
"vue": "^2.5.13",
"vue": "^2.5.17-beta.0",
"vue-apollo": "^3.0.0-beta.5",
"vue-i18n": "^7.6.0",
"vue-instantsearch": "^1.5.1",
@@ -52,7 +52,7 @@
"stylus": "^0.54.5",
"stylus-loader": "^3.0.1",
"vue-cli-plugin-apollo": "^0.7.1",
"vue-template-compiler": "^2.5.13"
"vue-template-compiler": "^2.5.17-beta.0"
},
"browserslist": [
"> 1%",

View File

@@ -9,13 +9,14 @@ import * as Filters from './filters'
import './register-components'
import ClientAddonApi from './util/ClientAddonApi'
import Responsive from './util/responsive'
import SharedData from './util/SharedData'
import PluginAction from './util/PluginAction'
import SharedData from './util/shared-data'
import PluginAction from './util/plugin-action'
import gql from 'graphql-tag'
window.gql = gql
Vue.use(VueUi)
Vue.use(SharedData)
Vue.use(PluginAction)
Vue.use(InstantSearch)
Vue.use(Responsive, {
computed: {
@@ -30,8 +31,7 @@ Vue.use(Responsive, {
}
}
})
Vue.use(SharedData)
Vue.use(PluginAction)
Vue.use(VueUi)
for (const key in Filters) {
Vue.filter(key, Filters[key])

View File

@@ -8,7 +8,7 @@ export default {
install (Vue) {
Vue.mixin({
methods: {
$callAction (id, params) {
$callPluginAction (id, params) {
return this.$apollo.mutate({
mutation: PLUGIN_ACTION_CALL,
variables: {
@@ -17,13 +17,13 @@ export default {
}
})
},
$onActionCalled (cb) {
$onPluginActionCalled (cb) {
return this.$apollo.addSmartSubscription(`plugin-action-called-${uid++}`, {
query: PLUGIN_ACTION_CALLED,
result: cb
})
},
$onActionResolved (cb) {
$onPluginActionResolved (cb) {
return this.$apollo.addSmartSubscription(`plugin-action-resolved-${uid++}`, {
query: PLUGIN_ACTION_RESOLVED,
result: cb

View File

@@ -62,6 +62,7 @@ export default {
})
return result.sharedData.value
},
$watchSharedData (id, cb) {
return this.$apollo.addSmartQuery(id, {
...genQuery(id),
@@ -71,6 +72,7 @@ export default {
}
})
},
$setSharedData (id, value) {
return this.$apollo.mutate({
mutation: SHARED_DATA_UPDATE,
@@ -80,6 +82,7 @@ export default {
}
})
},
$syncSharedData (options) {
const smartQueries = []
for (const key in options) {