git://git.onelab.eu
/
myslice.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
|
inline
| side by side (parent:
4a99831
)
Fixed bug: select columns all checked in filters, autocomplete based on query_all...
author
Loic Baron
<loic.baron@lip6.fr>
Tue, 15 Oct 2013 15:51:03 +0000
(17:51 +0200)
committer
Loic Baron
<loic.baron@lip6.fr>
Tue, 15 Oct 2013 15:51:03 +0000
(17:51 +0200)
plugins/hazelnut/static/js/hazelnut.js
patch
|
blob
|
history
plugins/query_editor/__init__.py
patch
|
blob
|
history
plugins/query_editor/static/js/query_editor.js
patch
|
blob
|
history
portal/sliceview.py
patch
|
blob
|
history
diff --git
a/plugins/hazelnut/static/js/hazelnut.js
b/plugins/hazelnut/static/js/hazelnut.js
index
249d2b4
..
bdb2de7
100644
(file)
--- a/
plugins/hazelnut/static/js/hazelnut.js
+++ b/
plugins/hazelnut/static/js/hazelnut.js
@@
-133,8
+133,8
@@
/* Processing hidden_columns */
$.each(this.options.hidden_columns, function(i, field) {
/* Processing hidden_columns */
$.each(this.options.hidden_columns, function(i, field) {
- manifold.raise_event(self.options.query_all_uuid, FIELD_REMOVED, field);
-
//
self.hide_column(field);
+
//
manifold.raise_event(self.options.query_all_uuid, FIELD_REMOVED, field);
+ self.hide_column(field);
});
}, // initialize_table
});
}, // initialize_table
diff --git
a/plugins/query_editor/__init__.py
b/plugins/query_editor/__init__.py
index
0312ef1
..
2d73053
100644
(file)
--- a/
plugins/query_editor/__init__.py
+++ b/
plugins/query_editor/__init__.py
@@
-5,6
+5,12
@@
from django.template.loader import render_to_string
# XXX We need naming helpers in the python Plugin class also, used in template
class QueryEditor(Plugin):
# XXX We need naming helpers in the python Plugin class also, used in template
class QueryEditor(Plugin):
+ def __init__ (self, query, query_all = None, **settings):
+ Plugin.__init__ (self, **settings)
+ self.query=query
+ self.query_uuid = query.query_uuid
+ self.query_all = query_all
+ self.query_all_uuid = query_all.query_uuid if query_all else None
def template_file(self):
return "query_editor.html"
def template_file(self):
return "query_editor.html"
@@
-22,9
+28,6
@@
class QueryEditor(Plugin):
}
return reqs
}
return reqs
- def json_settings_list (self):
- return ['plugin_uuid', 'domid', 'query_uuid']
-
def export_json_settings (self):
return True
def export_json_settings (self):
return True
@@
-82,4
+85,7
@@
class QueryEditor(Plugin):
'checked': md_field['name'] in self.query.get_select()
})
#return { 'fields': fields, 'hidden_columns': hidden_columns }
'checked': md_field['name'] in self.query.get_select()
})
#return { 'fields': fields, 'hidden_columns': hidden_columns }
+ #return { 'fields': fields , 'query_uuid': self.query_uuid, 'query_all_uuid': self.query_all_uuid }
return { 'fields': fields }
return { 'fields': fields }
+
+ def json_settings_list (self): return ['plugin_uuid', 'domid', 'query_uuid', 'query_all_uuid', ]
diff --git
a/plugins/query_editor/static/js/query_editor.js
b/plugins/query_editor/static/js/query_editor.js
index
9858818
..
7338b69
100644
(file)
--- a/
plugins/query_editor/static/js/query_editor.js
+++ b/
plugins/query_editor/static/js/query_editor.js
@@
-41,6
+41,10
@@
init: function(options, element) {
this._super(options, element);
this.listen_query(options.query_uuid);
init: function(options, element) {
this._super(options, element);
this.listen_query(options.query_uuid);
+ // this one is the complete list of resources
+ // and will be bound to callbacks like on_all_new_record
+ this.listen_query(options.query_all_uuid, 'all');
+
this.elts('queryeditor-auto-filter').change(this.event_filter_added('='));
this.elts('queryeditor-filter').change(this.event_filter_added('='));
this.elts('queryeditor-auto-filter').change(this.event_filter_added('='));
this.elts('queryeditor-filter').change(this.event_filter_added('='));
@@
-185,10
+189,9
@@
//console.log("Query_Editor: query_done!");
//console.log(this.availableTags);
},
//console.log("Query_Editor: query_done!");
//console.log(this.availableTags);
},
- on_new_record: function(record)
+ /* Autocomplete based on query_all to get all the fields, where query get only the fields selected */
+ on_all_new_record: function(record)
{
{
- //console.log("Query_Editor: new_record!");
- //console.log(record);
availableTags = this.availableTags;
jQuery.each(record,function(key,value){
value = unfold.get_value(value);
availableTags = this.availableTags;
jQuery.each(record,function(key,value){
value = unfold.get_value(value);
diff --git
a/portal/sliceview.py
b/portal/sliceview.py
index
9b96d4f
..
1ff92d3
100644
(file)
--- a/
portal/sliceview.py
+++ b/
portal/sliceview.py
@@
-117,7
+117,8
@@
class SliceView (LoginRequiredAutoLogoutView):
filter_query_editor = QueryEditor(
page = page,
filter_query_editor = QueryEditor(
page = page,
- query = query_resource_all,
+ query = sq_resource,
+ query_all = query_resource_all,
title = "Select Columns",
domid = 'select-columns',
)
title = "Select Columns",
domid = 'select-columns',
)