Skip to content

Commit

Permalink
Merge branch 'master' into develop
Browse files Browse the repository at this point in the history
  • Loading branch information
mguellsegarra committed Dec 29, 2023
2 parents 9c624ea + a7854f5 commit 092154a
Show file tree
Hide file tree
Showing 4 changed files with 23 additions and 4 deletions.
4 changes: 2 additions & 2 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@gisce/ooui",
"version": "0.22.6",
"version": "0.22.7",
"main": "./dist/ooui.umd.js",
"module": "./dist/ooui.es.js",
"types": "./dist/index.d.ts",
Expand Down
3 changes: 2 additions & 1 deletion src/helpers/attributeParser.ts
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,8 @@ const evaluateCondition = ({
if (
values[fieldName] === undefined &&
fields[fieldName].type !== "boolean" &&
fields[fieldName].type !== "many2one"
fields[fieldName].type !== "many2one" &&
fields[fieldName].type !== "selection"
) {
return false;
}
Expand Down
18 changes: 18 additions & 0 deletions src/spec/Form.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3258,4 +3258,22 @@ describe("A Form", () => {
const buttonWidget = form.findById("example_button") as Button;
expect(buttonWidget.readOnly).toBeFalsy();
});
it("Should be able to set an invisible group when attrs have a field that has not value", () => {
const arch = `<form>
<group name="group" colspan="4" col="4" attrs="{'invisible':[('formulari','!=','b1')]}">
<field name="at_prefix" />
<field name="bt_prefix" />
</group>
</form>`;
const form = new Form({
formulari: {
type: "selection",
},
at_prefix: { type: "char" },
bt_prefix: { type: "char" },
});
form.parse(arch);
const groupWidget = form.findById("group") as Group;
expect(groupWidget.invisible).toBeTruthy();
});
});

0 comments on commit 092154a

Please sign in to comment.