Docker-in-Docker (DinD) capabilities of public runners deactivated. More info

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

Merge branch 'master' into 'production'

Master

Release 0.7.1
* Improve the `Preferences` widget

See merge request !7
parents 5e1c96ec 4912cbca
......@@ -2,7 +2,7 @@
HEAD
0.7.0 (Jul 2015)
0.7.0 - 0.7.1 (Jul 2015)
- Add the new widget preferences.
0.6.3 - 0.6.5 (Apr 2015 - June 2015)
......
......@@ -119,8 +119,9 @@ Ext.define('App.local.fr.grid.plugin.RowEditorContextMenu', {
Ext.define('App.local.fr.grid.property.Preferences', {
override: 'App.grid.property.Preferences',
textReset : 'Annuler',
textUpdate : 'Actualiser'
textDefinition: 'Définition',
textReset : 'Annuler',
textUpdate : 'Actualiser'
});
Ext.define('App.local.fr.panel.BaseWithSelector', {
......
......@@ -15,7 +15,7 @@ Ext.define('App', {
* The version of the plugin
* @property {String}
*/
version: '0.7.0',
version: '0.7.1',
/**
* The name of the application
......
......@@ -4,6 +4,13 @@
*
* It is designed to handle the preference of the application.
*
* The widget is linked to a database table. It should contains
* at least three fields: property, value and definition.
* The type of property and definition are sting while the type
* of the value field has to be JSON.
*
* @since 0.7.0
*
*/
Ext.define('App.grid.property.Preferences', {
......@@ -26,22 +33,32 @@ Ext.define('App.grid.property.Preferences', {
/**
* @cfg {String} fieldProperty
* The database field containing the property names
* The database field containing the property names.
*/
fieldProperty: "property",
/**
* @cfg {String} fieldValue
* The database field containing the property values
* The database field containing the property values.
* The type of the database field has to be json.
*/
fieldValue: "value",
/**
* @cfg {String} propertyTemplate
* The template to add the tool tip to the property.
* It contains two entry the property definition and the property name.
* The former will be displayed as a tool tip.
*/
propertyTemplate: "<div data-qtip='{0}' data-qtitle='{1}' data-qwidth='200'>{2}</div>",
// private
// The Ext.data.Store containing the properties and their values.
//
refStore: null,
// private properties for internationalization
textDefinition: 'Definition',
textReset: 'Reset',
textUpdate: 'Update',
......@@ -82,6 +99,10 @@ Ext.define('App.grid.property.Preferences', {
me.fieldProperty = App.encodeField(me.dbtable, me.fieldProperty);
me.fieldValue = App.encodeField(me.dbtable, me.fieldValue);
// instantiate the property template
me.propertyTemplate = new Ext.Template(me.propertyTemplate);
me.propertyTemplate.compile();
// initialise the base class
me.callParent(arguments);
......@@ -104,16 +125,24 @@ Ext.define('App.grid.property.Preferences', {
data = {};
records.forEach(function (record) {
var definition, property, value;
var definition, property, propertyWithTip, value;
definition = record.get(me.fieldDefinition);
property = record.get(me.fieldProperty);
value = record.get(me.fieldValue);
// property includes its definition as a tool tip
property = "<div data-qtip='" + definition + "'>" + property + "</div>";
propertyWithTip = me.propertyTemplate.apply([definition,
me.textDefinition,
property]);
// update the sourceConfig to propagate the tool tip
if (me.sourceConfig && me.sourceConfig.hasOwnProperty(property)) {
me.sourceConfig[propertyWithTip] = me.sourceConfig[property];
delete me.sourceConfig[property];
}
data[property] = value;
data[propertyWithTip] = value;
});
me.setSource(data, me.sourceConfig);
......
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