Commit c9e3d1c4 authored by LE GAC Renaud's avatar LE GAC Renaud
Browse files

Merge branch '13-namespace' into 'master'

13 namespace

* Migrate to `pluigin_dbui` 0.9.0
* Change the javaScript namespace to `Dbui` and `TrackEvents`
* Close #13 

See merge request !16
parents de2948de e3816a3d
......@@ -76,12 +76,12 @@ def graph_mpl():
def grid():
"""Render the report through the C{App.grid.Panel}.
"""Render the report through the C{Dbui.grid.Panel}.
The report can be a list, a metrics 1d or 2d.
The controller extracts the configuration of the report form the database.
It builds the DataFrame, extracts the the configuration
for the C{Ext.data.Store} as well as the C{App.grid.Panel}.
for the C{Ext.data.Store} as well as the C{Dbui.grid.Panel}.
The former contains the data displayed in the grid.
The report identifier is defined in the viewport
......@@ -117,7 +117,7 @@ def grid():
except (IndexError, ReportException, TypeError, ValueError) as e:
return INLINE_ALERT % ("JSON Error...", e)
# extract the configurations for the Ext.data.Store and App.grid.Panel.
# extract the configurations for the Ext.data.Store and Dbui.grid.Panel.
store = report.to_store()
grid = report.to_grid()
......
......@@ -428,12 +428,12 @@ class List(BaseReport):
Summary information can be computed for each group as well as for
the whole table.
The list is displayed as the ``App.grid.Panel`` widget.
The list is displayed as the ``Dbui.grid.Panel`` widget.
The configuration of the list columns is the configuration of
the ``App.grid.Panel`` object.
the ``Dbui.grid.Panel`` object.
More technically, this class interfaces the database and the
``App.grid.Panel`` thought the underlying ``Ext.data.Store``.
``Dbui.grid.Panel`` thought the underlying ``Ext.data.Store``.
Its configuration is returned by the method *to_store*.
Args:
......@@ -684,11 +684,11 @@ class List(BaseReport):
store.fields.append(cfg)
def to_grid(self):
"""Build the configuration for the ``App.grid.Panel``.
"""Build the configuration for the ``Dbui.grid.Panel``.
Returns:
plugin_dbui.Grid:
the configuration of the ``App.grid.Panel``.
the configuration of the ``Dbui.grid.Panel``.
The properties columns and features are JSON encoded.
"""
......@@ -931,11 +931,11 @@ class Metric1D(List):
store.sorters = [index_groupby]
def to_grid(self):
"""Build the configuration for the ``App.grid.Panel``.
"""Build the configuration for the ``Dbui.grid.Panel``.
Returns:
plugin_dbui.Grid:
the configuration of the ``App.grid.Panel``.
the configuration of the ``Dbui.grid.Panel``.
The columns and features property are JSON encoded.
"""
......@@ -1136,11 +1136,11 @@ class Metric2D(BaseReport):
store.sorters = [index_group_y]
def to_grid(self):
"""Build the configuration for the ``App.grid.Panel``.
"""Build the configuration for the ``Dbui.grid.Panel``.
Returns:
plugin_dbui.Grid:
the configuration of the ``App.grid.Panel``.
the configuration of the ``Dbui.grid.Panel``.
The columns and features properties are JSON encoded.
"""
......
......@@ -4,10 +4,10 @@
*/
// Activate the dynamic loading for Ext JS and application classes
App.setDynamicLoading(App.debug);
Dbui.setDynamicLoading(Dbui.debug);
Ext.require('App.container.Viewport');
Ext.require('App.plugin.MathJax');
Ext.require('Dbui.container.Viewport');
Ext.require('Dbui.plugin.MathJax');
Ext.require('Ext.direct.Manager');
Ext.require('Ext.direct.RemotingProvider');
Ext.require('Ext.EventManager');
......@@ -22,17 +22,17 @@ Ext.onReady(function(){
Ext.QuickTips.init();
// Expose the remote methods
Ext.direct.Manager.addProvider(App.REMOTE_API);
Ext.direct.Manager.addProvider(Dbui.REMOTE_API);
// define the models
App.defineModels();
Dbui.defineModels();
// Close user session on the server.
// Action trigger when the page is refreshed or when the tab is closed.
// NOTE: It should work when the browser is closed to.
// Not working with FireFox 17.0.8, web2py 2.4.5 and Ext JS 3.4.0.
Ext.EventManager.on(window, 'beforeunload', App.closeUserSession);
Ext.EventManager.on(window, 'beforeunload', Dbui.closeUserSession);
// Instantiate the application
app = Ext.create('App.container.Viewport', App.config.viewport);
app = Ext.create('Dbui.container.Viewport', Dbui.config.viewport);
});
\ No newline at end of file
......@@ -3,8 +3,8 @@
*
*/
Ext.define('MyApp.locale.form.field.UserData', {
override : "MyApp.form.field.UserData",
Ext.define('TrackEvents.locale.form.field.UserData', {
override : "TrackEvents.form.field.UserData",
textAddMenu: "ajouter",
textAddTitle: "Entrer une nouvelle propriété",
textDestroyMenu: "Détruire",
......@@ -20,8 +20,8 @@ Ext.define('MyApp.locale.form.field.UserData', {
textValue: "valeur"
});
Ext.define('MyApp.locale.form.plugin.UserDataConsistency', {
override : "MyApp.form.plugin.UserDataConsistency",
Ext.define('TrackEvents.locale.form.plugin.UserDataConsistency', {
override : "TrackEvents.form.plugin.UserDataConsistency",
textError : "Erreur en mettant à jour l'historique...",
textInfo : "Information...",
textUpdate: "Mise à jour de l'historique..."
......
......@@ -2,7 +2,7 @@
* Dedicated form field to setup the user data block
*
*/
Ext.define('MyApp.form.field.UserData', {
Ext.define('TrackEvents.form.field.UserData', {
extend: 'Ext.form.FieldContainer',
mixins: {
......
// require to load the base class when running in debug mode
Ext.Loader.setPath('App', '../static/plugin_dbui/src');
Ext.Loader.setPath('Dbui', '../static/plugin_dbui/src');
/**
* A dictionary handling several user data block definition.
......@@ -15,9 +15,9 @@ Ext.Loader.setPath('App', '../static/plugin_dbui/src');
* change. Value is equal to null when the conversion failed.
*
*/
Ext.define('MyApp.form.field.UserDataMultiDefault', {
Ext.define('TrackEvents.form.field.UserDataMultiDefault', {
extend: 'App.form.field.DictMultiDefault',
extend: 'Dbui.form.field.DictMultiDefault',
alias: 'widget.xuserdatamultidefault',
//
......@@ -93,10 +93,10 @@ Ext.define('MyApp.form.field.UserDataMultiDefault', {
case 'reference':
map = defaultValue.split('.');
editor = Ext.create('App.form.field.ComboBoxUserReset', {
editor = Ext.create('Dbui.form.field.ComboBoxUserReset', {
store: map[0] + 'Store',
displayField: App.encodeField(map[0], map[1]),
valueField: App.encodeField(map[0], map[1])
displayField: Dbui.encodeField(map[0], map[1]),
valueField: Dbui.encodeField(map[0], map[1])
});
defaultValue = null;
sourceConfig[property].editor = editor;
......
......@@ -10,7 +10,7 @@
* This is the job of this plugin.
*
*/
Ext.define('MyApp.form.plugin.UserDataConsistency', {
Ext.define('TrackEvents.form.plugin.UserDataConsistency', {
extend: 'Ext.AbstractPlugin',
alias: 'plugin.pUserDataConsistency',
......@@ -136,7 +136,7 @@ Ext.define('MyApp.form.plugin.UserDataConsistency', {
// refresh the content of the history store
if (!me.historyStore) {
me.historyStore = App.getStore('historyStore');
me.historyStore = Dbui.getStore('historyStore');
}
current = me.historyStore.currentPage;
me.historyStore.loadPage(current);
......@@ -145,7 +145,7 @@ Ext.define('MyApp.form.plugin.UserDataConsistency', {
//
// Add change to the list of modifications applied to the dictionary.
//
// @param {App.form.field.Dict} field
// @param {Dbui.form.field.Dict} field
// @param {String} action
// @param {String} oldKey
// @param {String} newKey
......@@ -179,7 +179,7 @@ Ext.define('MyApp.form.plugin.UserDataConsistency', {
//send a request to the server
Ext.Ajax.request({
url: '/' + App.name + '/' + me.controller,
url: '/' + Dbui.name + '/' + me.controller,
params: {
fieldEvent: me.fieldEvent.getValue(),
fieldData: Ext.JSON.encode(me.fieldData.getValue()),
......
......@@ -41,7 +41,7 @@
//
// instantiate the grid
//
grid = Ext.create('App.grid.Panel', {
grid = Ext.create('Dbui.grid.Panel', {
plugins: ['pGridExport', 'pMathJax'],
store: cfgStore,
columns: columns,
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment