From b2f78352b012820c1bbf4a6caa49d2380d9a3145 Mon Sep 17 00:00:00 2001 From: senator <lebbeous@esilibrary.com> Date: Fri, 22 Apr 2011 11:45:49 -0400 Subject: [PATCH] some changes in the UI to reflect DB side changes Negation and quality are now ignored for operator nodes, and are not settable in the UI. Also in the UI, you can no longer replace the root node of the tree with a non-op node, meaning the root of a tree is always AND or OR. This is due to some bug that hangs the UI now when you try to save a single-non-op-node tree, and it's not worth debugging: just remove the feature. --- Open-ILS/web/js/dojo/openils/vandelay/TreeDndSource.js | 7 ++----- .../js/ui/default/conify/global/vandelay/match_set.js | 16 +++++++--------- 2 files changed, 9 insertions(+), 14 deletions(-) diff --git a/Open-ILS/web/js/dojo/openils/vandelay/TreeDndSource.js b/Open-ILS/web/js/dojo/openils/vandelay/TreeDndSource.js index c0586b5d32..7dd9fa5f52 100644 --- a/Open-ILS/web/js/dojo/openils/vandelay/TreeDndSource.js +++ b/Open-ILS/web/js/dojo/openils/vandelay/TreeDndSource.js @@ -9,12 +9,9 @@ dojo.declare( "openils.vandelay.TreeDndSource", dijit._tree.dndSource, { "_is_replaceable": function(spoint, dpoint, disroot) { /* An OP can replace anything, but non-OPs can only replace other - * non-OPs, EXCEPT when the dest is the root node (this allows - * for simple "trees" with only a single non-OP node. + * non-OPs. */ - if (disroot) - return true; - else if (spoint.bool_op()) + if (spoint.bool_op()) return true; else if (!dpoint.bool_op()) return true; diff --git a/Open-ILS/web/js/ui/default/conify/global/vandelay/match_set.js b/Open-ILS/web/js/ui/default/conify/global/vandelay/match_set.js index dfcfc447fe..5128bd2a36 100644 --- a/Open-ILS/web/js/ui/default/conify/global/vandelay/match_set.js +++ b/Open-ILS/web/js/ui/default/conify/global/vandelay/match_set.js @@ -205,7 +205,8 @@ function NodeEditor() { var nodes = _factories_by_type[type](); for (var i = 0; i < nodes.length; i++) dojo.place(nodes[i], table); - this._add_consistent_controls(table); + if (type != "bool_op") + this._add_consistent_controls(table); dojo.create( "input", { @@ -231,13 +232,11 @@ function NodeEditor() { } function render_vmsp_label(point, minimal) { - /* "minimal" mode has two implications: - * 1) for svf, only show the code, not the longer label. - * 2) for bool ops, completely ingore negation + /* "minimal" has this implication: + * for svf, only show the code, not the longer label. */ if (point.bool_op()) { - return (!minimal && openils.Util.isTrue(point.negate()) ? "N" : "") + - point.bool_op(); + return point.bool_op(); } else if (point.svf()) { return (openils.Util.isTrue(point.negate()) ? "NOT " : "") + ( minimal ? point.svf() : @@ -364,9 +363,8 @@ function redraw_expression_preview() { function render_expression_preview(r) { if (r.children().length) { - return (openils.Util.isTrue(r.negate()) ? "NOT " : "") + - "(" + r.children().map(render_expression_preview).join( - " " + render_vmsp_label(r, true /* minimal */) + " " + return "(" + r.children().map(render_expression_preview).join( + " " + render_vmsp_label(r) + " " ) + ")"; } else if (!r.bool_op()) { return render_vmsp_label(r, true /* minimal */); -- 2.11.0