diff --git a/package-lock.json b/package-lock.json index b1f0117..3942fb6 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,12 +1,12 @@ { "name": "@gisce/ooui", - "version": "2.10.0-alpha.3", + "version": "2.10.0", "lockfileVersion": 2, "requires": true, "packages": { "": { "name": "@gisce/ooui", - "version": "2.10.0-alpha.3", + "version": "2.10.0", "dependencies": { "@gisce/conscheck": "1.0.9", "html-entities": "^2.3.3", diff --git a/package.json b/package.json index 28ac8d4..5b52a74 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "@gisce/ooui", - "version": "2.10.0-alpha.3", + "version": "2.10.0", "engines": { "node": "20.5.0" }, diff --git a/src/helpers/attributeParser.ts b/src/helpers/attributeParser.ts index 0670a25..38dd758 100644 --- a/src/helpers/attributeParser.ts +++ b/src/helpers/attributeParser.ts @@ -94,7 +94,8 @@ const evaluateFieldComparison = ({ valueInObject === undefined && fields[fieldName].type !== "boolean" && fields[fieldName].type !== "many2one" && - fields[fieldName].type !== "selection" + fields[fieldName].type !== "selection" && + typeof expectedValue !== "boolean" ) { return { modifiedValueInObject: null, diff --git a/src/spec/Form.spec.ts b/src/spec/Form.spec.ts index 216943c..56528cd 100644 --- a/src/spec/Form.spec.ts +++ b/src/spec/Form.spec.ts @@ -5773,4 +5773,27 @@ describe("A Form", () => { expect(form.contextForFields.street).toBeDefined(); expect(form.contextForFields.street).toEqual({ active_test: false }); }); + it("Should be able to parse attributes with an undefined char value and exist condition in attrs", () => { + const arch = `
`; + const fields = { + cups: { + is_function: false, + size: 22, + string: "CUPS (*)", + type: "char", + views: {}, + }, + }; + const form = new Form(fields); + form.parse(arch, { values: { cups: undefined } }); + expect(form.type).toBe("form"); + const alert1 = form.findById("alert1")!; + const alert2 = form.findById("alert2")!; + expect(alert1).toBeDefined(); + expect(alert2).toBeDefined(); + expect(alert1.invisible).toBeFalsy(); + expect(alert2.invisible).toBeTruthy(); + }); });