Merge pull request #3142 from Budibase/scope-or-view
Scope view filters to table always
This commit is contained in:
commit
073f8ade1f
|
@ -44,7 +44,7 @@ Object {
|
||||||
exports[`viewBuilder Filter creates a view with multiple filters and conjunctions 1`] = `
|
exports[`viewBuilder Filter creates a view with multiple filters and conjunctions 1`] = `
|
||||||
Object {
|
Object {
|
||||||
"map": "function (doc) {
|
"map": "function (doc) {
|
||||||
if (doc.tableId === \\"14f1c4e94d6a47b682ce89d35d4c78b0\\" && doc[\\"Name\\"] === \\"Test\\" || doc[\\"Yes\\"] > \\"Value\\") {
|
if (doc.tableId === \\"14f1c4e94d6a47b682ce89d35d4c78b0\\" && (doc[\\"Name\\"] === \\"Test\\" || doc[\\"Yes\\"] > \\"Value\\")) {
|
||||||
emit(doc[\\"_id\\"], doc[\\"undefined\\"]);
|
emit(doc[\\"_id\\"], doc[\\"undefined\\"]);
|
||||||
}
|
}
|
||||||
}",
|
}",
|
||||||
|
|
|
@ -126,7 +126,7 @@ function viewTemplate({ field, tableId, groupBy, filters = [], calculation }) {
|
||||||
delete filters[0].conjunction
|
delete filters[0].conjunction
|
||||||
}
|
}
|
||||||
const parsedFilters = parseFilterExpression(filters)
|
const parsedFilters = parseFilterExpression(filters)
|
||||||
const filterExpression = parsedFilters ? `&& ${parsedFilters}` : ""
|
const filterExpression = parsedFilters ? `&& (${parsedFilters})` : ""
|
||||||
|
|
||||||
const emitExpression = parseEmitExpression(field, groupBy)
|
const emitExpression = parseEmitExpression(field, groupBy)
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue