[
https://issues.apache.org/jira/browse/QPID-7248?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=15372510#comment-15372510
]
Alex Rudyy commented on QPID-7248:
----------------------------------
Keith,
I would like to suggest changing QueryWidget to emit change notifications only
when query value is changed, something like
{code}
---
broker-plugins/management-http/src/main/java/resources/js/qpid/management/query/QueryWidget.js
+++
broker-plugins/management-http/src/main/java/resources/js/qpid/management/query/QueryWidget.js
@@ -31,6 +31,7 @@ define(["dojo/_base/declare",
"dojox/html/entities",
"dgrid/extensions/ColumnReorder",
"dgrid/extensions/ColumnHider",
+ "qpid/common/util",
"qpid/management/query/QueryGrid",
"qpid/management/query/DropDownSelect",
"qpid/management/query/WhereExpression",
@@ -56,6 +57,7 @@ define(["dojo/_base/declare",
entities,
ColumnReorder,
ColumnHider,
+ util,
QueryGrid)
{
var predefinedCategories = [{
@@ -296,6 +298,7 @@ define(["dojo/_base/declare",
_lastStandardModeSelect: null,
_lastHeaders: null,
_queryCloneDialogForm: null,
+ _lastQuery: null,
postCreate: function ()
{
@@ -377,6 +380,7 @@ define(["dojo/_base/declare",
// if the preference has an id, then we know it is in the
store
this.deleteButton.set("disabled", this.preference != null
&& this.preference.id != null ? false : true);
+ this._lastQuery = this._getQuery();
},
search: function ()
{
@@ -1113,7 +1117,11 @@ define(["dojo/_base/declare",
var queryParameters = this._getQuery(query);
var pref = lang.clone(this.preference);
pref.value = queryParameters;
- this.emit("change", {preference: pref});
+ if (!this._lastQuery || !util.equals(this._lastQuery,
queryParameters))
+ {
+ this._lastQuery = queryParameters;
+ this.emit("change", {preference: pref});
+ }
}
});
{code}
Arguably we do not need to emit preference: emitting of query object should be
sufficient for a tab.
> Extend the UI to allow queries to be saved, retrieved and re-run
> ----------------------------------------------------------------
>
> Key: QPID-7248
> URL: https://issues.apache.org/jira/browse/QPID-7248
> Project: Qpid
> Issue Type: Improvement
> Components: Java Broker
> Reporter: Keith Wall
> Fix For: qpid-java-6.1
>
> Attachments:
> 0001-QPID-7248-Java-Broker-Preferences-show-preferences-b.patch,
> extend-query-ui-to-allow-queries-to-be-saved.tar.gz,
> query-browser-patches.tar.gz
>
>
> Extend the UI to allow the user to save a query so that it is available for
> use later on. The user should be able to see a list of saved queries, pick
> one and rerun it or change it. The user should be able to delete queries too.
> The user should also be able to see queries that are visible to him. He
> should be able to select these queries and execute them.
> * When defining a query, the UI should offer a 'save as' button allowing the
> query to be named, visibility to be chosen, and saved.
> * If the query has been saved already, the name should be filled in already.
> * Saved queries and queries that are visible to the user will appear to the
> user as a list (expandable/collapsible widget)
> * From the list the user will be able to delete queries that belong to him.
> * Also from the list, the user will be able to recall queries (either queries
> that belong to him or ones that are visible). The query will be recalled in
> the advanced
> view, even if the query is representable in standard view.
--
This message was sent by Atlassian JIRA
(v6.3.4#6332)
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]