3
0

Fix evaluated filters overwriting configuration

This commit is contained in:
Jože Fortun 2024-12-11 14:23:22 +01:00
parent b6b8f1b8b7
commit 03ec8d3930
3 changed files with 40 additions and 43 deletions

View File

@ -328,10 +328,7 @@ export default {
case compose.PageBlockCalendar.feedResources.record:
return this.findModuleByID({ namespace: this.namespace, moduleID: feed.options.moduleID })
.then(module => {
const ff = {
...feed,
options: { ...feed.options },
}
const ff = compose.PageBlockCalendar.makeFeed(feed) // Clone feed, so we don't modify the original
// Interpolate prefilter variables
if (ff.options.prefilter) {

View File

@ -190,9 +190,8 @@ export default {
}
Promise.all(this.options.feeds.filter(f => f.isValid()).map((feed, idx) => {
return this.findModuleByID({ namespace: this.namespace, moduleID: feed.options.moduleID })
.then(module => {
const f = { ...feed } // Clone feed, so we dont modify the original
return this.findModuleByID({ namespace: this.namespace, moduleID: feed.options.moduleID }).then(module => {
const f = compose.PageBlockGeometry.makeFeed(feed) // Clone feed, so we don't modify the original
// Interpolate prefilter variables
if (f.options.prefilter) {

View File

@ -166,6 +166,7 @@ export default {
if (m.moduleID) {
// prepare a fresh metric with an evaluated prefilter
const auxM = { ...m }
if (auxM.filter) {
auxM.filter = evaluatePrefilter(auxM.filter, {
record: this.record,