Skip to content

Commit

Permalink
Revert "Merge branch 'fix/bug-invisible-attrs-json-tags' into v2"
Browse files Browse the repository at this point in the history
This reverts commit 9d4075a, reversing
changes made to 757cb8f.
  • Loading branch information
mguellsegarra committed Oct 17, 2024
1 parent e16ff63 commit a8d26af
Show file tree
Hide file tree
Showing 2 changed files with 1 addition and 36 deletions.
2 changes: 1 addition & 1 deletion src/helpers/attributeParser.ts
Original file line number Diff line number Diff line change
Expand Up @@ -274,8 +274,8 @@ const evaluateAttributes = ({
}

return {
...finalTagAttributes,
...tagAttributes,
...finalTagAttributes,
attrs: undefined,
json_attrs: undefined,
};
Expand Down
35 changes: 0 additions & 35 deletions src/spec/Form.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5796,39 +5796,4 @@ describe("A Form", () => {
expect(alert1.invisible).toBeFalsy();
expect(alert2.invisible).toBeTruthy();
});
it("Should not be able to view the Autoconsum tab since it's invisible due to tags and attrs", () => {
const xml = `
<form string="polisses">
<notebook
colspan="6">
<page name="page-autoconsum" string="Autoconsum"
attrs="{'invisible':[('autoconsum_id', '=', False)]}" invisible="1"
json_attrs="{&quot;invisible&quot;: {&quot;rules&quot;: [{&quot;operator&quot;: &quot;=&quot;, &quot;field&quot;: &quot;autoconsum_id&quot;, &quot;value&quot;: false}], &quot;condition&quot;: &quot;AND&quot;}}">
<field name="autoconsum_id" />
</page>
</notebook>
</form>
`;
const form = new Form({
autoconsum_id: {
context: "",
digits: [16, 2],
domain: [],
is_function: true,
readonly: 1,
relation: "giscedata.autoconsum",
string: "Autoconsum",
type: "many2one",
views: {},
},
});
form.parse(xml, {
values: {
autoconsum_id: [1, "ES0318363477145938GEA000"],
},
});
const pageAutoconsum = form.findById("page-autoconsum") as Page;
expect(pageAutoconsum).toBeDefined();
expect(pageAutoconsum.invisible).toBeTruthy();
});
});

0 comments on commit a8d26af

Please sign in to comment.