Skip to content

Commit

Permalink
fix: filter out falsy members
Browse files Browse the repository at this point in the history
  • Loading branch information
YakovlevCoded authored Jul 15, 2020
1 parent 6ea7e2d commit 65b19c9
Show file tree
Hide file tree
Showing 4 changed files with 37 additions and 28 deletions.
21 changes: 12 additions & 9 deletions packages/cubejs-client-vue/dist/cubejs-client-vue.esm.js
Original file line number Diff line number Diff line change
Expand Up @@ -711,7 +711,7 @@ var QueryBuilder = {
var name = element.charAt(0).toUpperCase() + element.slice(1);
var mem;
var elements = [];
members.forEach(function (m) {
members.filter(Boolean).forEach(function (m) {
if (element === 'timeDimensions') {
mem = _this5["available".concat(name)].find(function (x) {
return x.name === m.dimension;
Expand Down Expand Up @@ -768,15 +768,18 @@ var QueryBuilder = {
}
},
watch: {
query: function query() {
if (!this.meta) {
// this is ok as if meta has not been loaded by the time query prop has changed,
// then the promise for loading meta (found in mounted()) will call
// copyQueryFromProps and will therefore update anyway.
return;
}
query: {
deep: true,
handler: function handler() {
if (!this.meta) {
// this is ok as if meta has not been loaded by the time query prop has changed,
// then the promise for loading meta (found in mounted()) will call
// copyQueryFromProps and will therefore update anyway.
return;
}

this.copyQueryFromProps();
this.copyQueryFromProps();
}
}
}
};
Expand Down
21 changes: 12 additions & 9 deletions packages/cubejs-client-vue/dist/cubejs-client-vue.js
Original file line number Diff line number Diff line change
Expand Up @@ -717,7 +717,7 @@ var QueryBuilder = {
var name = element.charAt(0).toUpperCase() + element.slice(1);
var mem;
var elements = [];
members.forEach(function (m) {
members.filter(Boolean).forEach(function (m) {
if (element === 'timeDimensions') {
mem = _this5["available".concat(name)].find(function (x) {
return x.name === m.dimension;
Expand Down Expand Up @@ -774,15 +774,18 @@ var QueryBuilder = {
}
},
watch: {
query: function query() {
if (!this.meta) {
// this is ok as if meta has not been loaded by the time query prop has changed,
// then the promise for loading meta (found in mounted()) will call
// copyQueryFromProps and will therefore update anyway.
return;
}
query: {
deep: true,
handler: function handler() {
if (!this.meta) {
// this is ok as if meta has not been loaded by the time query prop has changed,
// then the promise for loading meta (found in mounted()) will call
// copyQueryFromProps and will therefore update anyway.
return;
}

this.copyQueryFromProps();
this.copyQueryFromProps();
}
}
}
};
Expand Down
21 changes: 12 additions & 9 deletions packages/cubejs-client-vue/dist/cubejs-client-vue.umd.js
Original file line number Diff line number Diff line change
Expand Up @@ -9469,7 +9469,7 @@
var name = element.charAt(0).toUpperCase() + element.slice(1);
var mem;
var elements = [];
members.forEach(function (m) {
members.filter(Boolean).forEach(function (m) {
if (element === 'timeDimensions') {
mem = _this5["available".concat(name)].find(function (x) {
return x.name === m.dimension;
Expand Down Expand Up @@ -9526,15 +9526,18 @@
}
},
watch: {
query: function query() {
if (!this.meta) {
// this is ok as if meta has not been loaded by the time query prop has changed,
// then the promise for loading meta (found in mounted()) will call
// copyQueryFromProps and will therefore update anyway.
return;
}
query: {
deep: true,
handler: function handler() {
if (!this.meta) {
// this is ok as if meta has not been loaded by the time query prop has changed,
// then the promise for loading meta (found in mounted()) will call
// copyQueryFromProps and will therefore update anyway.
return;
}

this.copyQueryFromProps();
this.copyQueryFromProps();
}
}
}
};
Expand Down
2 changes: 1 addition & 1 deletion packages/cubejs-client-vue/src/QueryBuilder.js
Original file line number Diff line number Diff line change
Expand Up @@ -335,7 +335,7 @@ export default {
let mem;
const elements = [];

members.forEach((m) => {
members.filter(Boolean).forEach((m) => {
if (element === 'timeDimensions') {
mem = this[`available${name}`].find(x => x.name === m.dimension);
if (mem) {
Expand Down

0 comments on commit 65b19c9

Please sign in to comment.