Skip to content
Snippets Groups Projects
Commit 4b34c79b authored by LE GAC Renaud's avatar LE GAC Renaud
Browse files

Merge branch 'master' into 'production'

Release 0.9.5

* Migrate to `ExtJS 6.2.0`
* Update `Dbui.form.field.ComboBoxUserReset`
* Update `configure_build.py` to export the plugin `MathJax 2.7.0`
* Add the tool `Dbui.form.plugin.Mapper`


See merge request !33
parents f14cd00c 722d0fe5
No related branches found
No related tags found
1 merge request!33Release 0.9.5
[submodule "static/plugin_mathjax"]
path = static/plugin_mathjax
url = https://github.com/mathjax/MathJax.git
0.9.4 0.9.5
\ No newline at end of file \ No newline at end of file
...@@ -101,7 +101,6 @@ PLUGINS_FILES["extjs"] = [ ...@@ -101,7 +101,6 @@ PLUGINS_FILES["extjs"] = [
PLUGINS_FILES["mathjax"] = [ PLUGINS_FILES["mathjax"] = [
"static/plugin_mathjax/fonts/HTML-CSS/TeX/woff", "static/plugin_mathjax/fonts/HTML-CSS/TeX/woff",
"static/plugin_mathjax/images",
"static/plugin_mathjax/jax", "static/plugin_mathjax/jax",
"static/plugin_mathjax/extensions", "static/plugin_mathjax/extensions",
"static/plugin_mathjax/MathJax.js"] "static/plugin_mathjax/MathJax.js"]
...@@ -164,7 +163,6 @@ def get_plugin_version(plugin): ...@@ -164,7 +163,6 @@ def get_plugin_version(plugin):
with open(VERSION, "rb") as tmpfile: with open(VERSION, "rb") as tmpfile:
release = tmpfile.read() release = tmpfile.read()
release = release.replace(".", "")
elif plugin == "extjs": elif plugin == "extjs":
...@@ -205,6 +203,7 @@ def get_plugin_version(plugin): ...@@ -205,6 +203,7 @@ def get_plugin_version(plugin):
error("\n\tUnknown plugin %" % plugin) error("\n\tUnknown plugin %" % plugin)
sys.exit(1) sys.exit(1)
release = release.replace(".", "")
if len(release) == 2: if len(release) == 2:
release = "%s0" % release release = "%s0" % release
......
...@@ -2,6 +2,11 @@ ...@@ -2,6 +2,11 @@
HEAD HEAD
0.9.5 (Nov 2016)
- Migrate to Ext JS 6.2.0
- Update configure_build to export the plugin MathJax 2.7.0
- Add Dbui.form.plugin.Mapper
0.9.4 (Oct 2016) 0.9.4 (Oct 2016)
- Fix AceEditor class in order to run with Ext JS 6 - Fix AceEditor class in order to run with Ext JS 6
- Remove the JavaScript class DictMultiDefault. - Remove the JavaScript class DictMultiDefault.
......
...@@ -15,7 +15,7 @@ Ext.define('Dbui', { ...@@ -15,7 +15,7 @@ Ext.define('Dbui', {
* The version of the plugin * The version of the plugin
* @property {String} * @property {String}
*/ */
version: '0.9.4', version: '0.9.5',
/** /**
* The name of the application * The name of the application
......
...@@ -14,9 +14,18 @@ Ext.define('Dbui.form.field.ComboBoxUserReset', { ...@@ -14,9 +14,18 @@ Ext.define('Dbui.form.field.ComboBoxUserReset', {
/** /**
* @cfg {String} emptyText (required) * @cfg {String} emptyText (required)
* Define the content of the first row which is used to reset the ComboBox. * Define the content of the first row which is used to reset the ComboBox.
* EmptyText matches the displayField while emptyId matches valueField
*/ */
emptyText: 'select...', emptyText: 'select...',
/**
* @cfg {Number/String} emptyValue (required)
* Define the content of the first row which is used to reset the ComboBox.
* EmptyText matches the displayField while emptyId matches valueField
*/
emptyValue: -1,
// private // private
refStore: null, refStore: null,
...@@ -115,6 +124,8 @@ Ext.define('Dbui.form.field.ComboBoxUserReset', { ...@@ -115,6 +124,8 @@ Ext.define('Dbui.form.field.ComboBoxUserReset', {
// create the first item "select..." // create the first item "select..."
record = me.store.model.create(); record = me.store.model.create();
record.set(displayField, me.emptyText); record.set(displayField, me.emptyText);
record.set(me.valueField, me.emptyValue);
store.add(record); store.add(record);
// list of records to be load on the new store // list of records to be load on the new store
......
/**
* Mapper for Form, FieldContainer and FieldSet.
*
* Modify a set of fields arranged via a vertical layout into a more complex
* organization like an Accordion or Card layout.
*
* The organisation is defined by the property #layout and #mapFields.
*
* @since 0.9.5
*
*/
Ext.define('Dbui.form.plugin.Mapper', {
extend: 'Ext.AbstractPlugin',
alias: 'plugin.pMapper',
/**
* @cfg {String} layout
* The layout for the new organisation of the fields, e.g accordion, card:
*
* {
* 'type': 'accordion',
* 'titleCollapse': True
* }
*
*/
/**
* @cfg {Array} mapFields
* The new organisation for fields.
* for example for an accordion layout:
*
* [{
* title: 'panel1',
* layout: 'fit',
* items: ['fieldname4', 'fieldname2']
* }, {
* title: 'panel2',
* items: ['fieldname3', 'fieldname1']
* }]
*
*/
/**
* Initialize the plugin.
*
* @param {Ext.form.Panel/Ext.form.FieldSet/Ext.form.FieldContainer} cmp
*
*
*/
init: function (cmp) {
"use strict";
var me = this,
mapFields = me.mapFields,
nameToField = {};
// build the dictionary fieldname → fieldconfiguration
cmp.items.each(function (field) {
var name = field.name;
if (!Ext.isEmpty(name)) {
nameToField[name] = field;
}
});
// copy the field configuration into mapFields
mapFields.forEach(function(panel, ipanel) {
panel.items.forEach(function(fieldName, ifield) {
if (fieldName in nameToField) {
mapFields[ipanel].items[ifield] = nameToField[fieldName];
}
});
});
// remove existing items keeping the field configuration
cmp.removeAll(false, false);
// add the new items and change the layout
cmp.add(mapFields);
cmp.setLayout(me.layout);
}
});
\ No newline at end of file
Subproject commit da8d4885fb70c09624dfef641e0f326e9961bb24
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment