Skip to content

Commit

Permalink
fix tests
Browse files Browse the repository at this point in the history
  • Loading branch information
petschki committed Sep 25, 2024
1 parent f735816 commit 6942d30
Showing 1 changed file with 7 additions and 5 deletions.
12 changes: 7 additions & 5 deletions src/pat/querystring/querystring.js
Original file line number Diff line number Diff line change
Expand Up @@ -644,6 +644,8 @@ export default Base.extend({
showPreviews: true,
},
init: async function () {
await import("../select2/select2");

import("./querystring.scss");

var self = this;
Expand Down Expand Up @@ -705,10 +707,10 @@ export default Base.extend({
self.criterias = [];

// create populated criterias
if (self.$el.val()) {
$.each(JSON.parse(self.$el.val()), function (i, item) {
if (self.el.value) {
for (const item of JSON.parse(self.el.value)) {
self.createCriteria(item.i, item.o, item.v);
});
}
}

// add empty criteria which enables users to create new cr
Expand Down Expand Up @@ -910,12 +912,12 @@ export default Base.extend({
var self = this;

var criteriastrs = [];
$.each(self.criterias, function (i, criteria) {
for (const criteria of self.criterias) {
var jsonstr = criteria.getJSONListStr();
if (jsonstr !== "") {
criteriastrs.push(jsonstr);
}
});
}
var val = "[" + criteriastrs.join(",") + "]";
self.$el.val(val);
self.$el.trigger("change");
Expand Down

0 comments on commit 6942d30

Please sign in to comment.