Change KnockoutJS to just warn for missing Observables.

Sieve doesn't need them, for now.
This commit is contained in:
the-djmaze 2024-09-24 11:33:49 +02:00
parent 76ade5eac0
commit 96d034b36a
17 changed files with 78 additions and 130 deletions

View file

@ -9,7 +9,7 @@ import {
MULTILINE_DOTSTART
} from 'Sieve/RegEx';
import { arrayToString, getMatchTypes, getComparators, koObserve } from 'Sieve/Utils';
import { arrayToString, getMatchTypes, getComparators } from 'Sieve/Utils';
/**
* abstract
@ -154,7 +154,6 @@ export /*abstract*/ class TestCommand extends GrammarCommand
this._comparator = '';
this._match_type = '';
this.relational_match = ''; // GrammarQuotedString DQUOTE ( "gt" / "ge" / "lt" / "le" / "eq" / "ne" ) DQUOTE
koObserve(this, 'match_type');
}
get require() { return /:value|:count/.test(this._match_type) ? 'relational' : ''; }

View file

@ -58,18 +58,6 @@ export const
serverErrorDesc(text);
},
koObserve = (obj, prop) => {
// Object.getOwnPropertyNames(obj).forEach(prop => {
// prop = prop.replace(/^_/, '');
obj['ko_' + prop] = ko.computed({
read: () => obj[prop],
write: (v) => obj[prop] = v,
pure:true
});
// });
// Object.preventExtensions(obj);
},
getComparators = (validOnly = 0) => {
let result = [
// Default