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

Commit 3f7ff919 authored by LE GAC Renaud's avatar LE GAC Renaud
Browse files

Merge branch 'master' into 'production'

Release 0.9.1

* Migrate to Ext JS 6.0.1
* Migrate to the build system *build-bersion6* in `w2pext/utilities`

See merge request !27
parents 6cc06a90 7ea9c85b
......@@ -12,11 +12,11 @@ errors/
httpserver.log
private/
sessions/
static/plugin_ace/
static/plugin_ace*/
static/plugin_dbui/dbui-debug.js
static/plugin_dbui/dbui-min.js
static/plugin_extjs/
static/plugin_extjs*/
static/plugin_dbui/docs/
static/plugin_mathjax/
static/plugin_mathjax*/
uploads/
web2py.plugin.dbui.*.w2p
[submodule "static/plugin_extjs"]
path = static/plugin_extjs
url = https://github.com/probonogeek/extjs.git
[submodule "static/plugin_mathjax"]
path = static/plugin_mathjax
url = https://github.com/mathjax/MathJax.git
0.9.0
\ No newline at end of file
0.9.1
\ No newline at end of file
This diff is collapsed.
# -*- coding: utf-8 -*-
"""
Configure the build process for the plugin dbui
"""
import datetime
import os
import re
import tempfile
from subprocess import call, check_output
from IPython.utils.io import stderr
NOW = datetime.datetime.now()
# ............................................................................
#
# JAVASCRIPT LIBRARY
# JavaScript source code and compile version
# paths are relative to the static directory
#
SENCHA_CLS = [
"plugin_extjs/packages/core/src",
"plugin_extjs/classic/classic/src",
"plugin_extjs/classic/classic/overrides",
"plugin_dbui/src"]
SENCHA_NS = "Ext"
JSLIBDEBUG = "plugin_dbui/dbui-debug.js"
JSLIBMIN = "plugin_dbui/dbui-min.js"
# ...........................................................................
#
# DOCUMENTATION
# output directories for documentation
# paths are relative to the static directory
#
DOCS_DIR = "plugin_dbui/docs"
JSDOC = "plugin_dbui/docs/jsduck"
LATEXDOC = "plugin_dbui/docs/latex"
PDFDOC = "plugin_dbui/docs/pdf"
# ...........................................................................
#
# PLUGINS
# ace, dbui, extjs and mathjax
# paths are relative to the application directory
#
PLUGINS_FILES = {}
PLUGINS_FILES["default"] = [
"controllers/plugin_%s.py",
"models/plugin_%s.py",
"modules/plugin_%s",
"private/plugin_%s",
"static/plugin_%s",
"views/plugin_%s"]
PLUGINS_FILES["ace"] = [
"static/plugin_ace/src-min-noconflict/ace.js",
"static/plugin_ace/src-min-noconflict/mode-json.js",
"static/plugin_ace/src-min-noconflict/theme-crimson_editor.js",
"static/plugin_ace/src-min-noconflict/worker-json.js"]
PLUGINS_FILES["dbui"] = [
"modules/plugin_dbui",
"models/plugin_dbui.py",
"controllers/plugin_dbui.py",
"views/plugin_dbui",
"static/plugin_dbui/resources/css/kde-oxygen.css",
"static/plugin_dbui/resources/css/dbui.css",
"static/plugin_dbui/resources/icons",
"static/plugin_dbui/src",
"static/plugin_dbui/locale/dbui-lang-en.js",
"static/plugin_dbui/locale/dbui-lang-fr.js",
"static/plugin_dbui/dbui-min.js",
"static/plugin_dbui/docs"]
PLUGINS_FILES["extjs"] = [
"static/plugin_extjs/build/classic/locale",
"static/plugin_extjs/build/classic/theme-classic",
"static/plugin_extjs/build/ext-all.js",
"static/plugin_extjs/build/ext-all-debug.js",
"static/plugin_extjs/classic/classic/src",
"static/plugin_extjs/classic/classic/overrides",
"static/plugin_extjs/packages/core/src",
"static/plugin_extjs/version.properties"]
PLUGINS_FILES["mathjax"] = [
"static/plugin_mathjax/fonts/HTML-CSS/TeX/woff",
"static/plugin_mathjax/images",
"static/plugin_mathjax/jax",
"static/plugin_mathjax/extensions",
"static/plugin_mathjax/MathJax.js"]
# ............................................................................
#
# REFERENCE FILES
#
CHANGELOG = "static/plugin_dbui/CHANGELOG"
DBUIJS = "static/plugin_dbui/src/Dbui.js"
VERSION = "VERSION"
def commit_release():
"""Commit release CHANGELOG, VERSION and DBUIJS files
"""
print "\n", "."*79
print "\n\tCommit CHANGELOG, DBUIJS, VERSION, ..."
# move to the master branch
with tempfile.TemporaryFile() as fi:
print "\tMove to the master branch"
call(["git", "checkout", "master"], stdout=fi, stderr=fi)
# Commit modified files
print '\n\tgit add', DBUIJS, CHANGELOG, VERSION
call(["git", "add", DBUIJS, CHANGELOG, VERSION])
msg = "Start release candidate %s" % get_version()
print '\tgit commit:', msg
call(["git", "commit", "-m", msg])
def get_plugin_version(plugin):
"""
Args:
plugin (str): name of the plugin
Return:
str: the plugin version
"""
if plugin == "ace":
cwd = os.getcwd()
os.chdir("static/plugin_ace")
with tempfile.TemporaryFile() as tmpfile:
call(["git", "describe", "--tags"], stdout=tmpfile)
tmpfile.seek(0)
release = tmpfile.read()
release = release.replace("v", "").replace("\n", "")
os.chdir(cwd)
elif plugin == "dbui":
with open(DBUIJS, "rb") as tmpfile:
text = tmpfile.read()
match = re.match(r"(.+ version: ')([\w._-]*)('.+)", text, re.DOTALL)
release = match.group(2)
elif plugin == "extjs":
fn = os.path.join('static', 'plugin_extjs', 'version.properties')
if not os.path.exists(fn):
error("\n\tNo version file for the plugin extjs !")
sys.exit(1)
with open(fn, 'rb') as fi:
s = fi.read()
match = re.search(r"version.release=(\d+(\.\d+)*)", s)
if not match:
error("\n\tExt JS release number not defined !")
sys.exit(1)
release = match.group(1)
elif plugin == "mathjax":
filename = os.path.join('static', 'plugin_mathjax', 'MathJax.js')
with open(filename, 'rb') as tmpfile:
text = tmpfile.read()
match = re.match(r'.+MathJax.version="(\d+(\.\d+)*)";', text, re.DOTALL)
if not match:
error("\n\tMathJax release number not defined !")
sys.exit(1)
release = match.group(1)
else:
error("\n\tUnknown plugin %" % plugin)
sys.exit(1)
# shrink the release identifier 4.2.1 or 4.2.1.883 -> 421
li = release.split('.')
release = ''.join(li) if len(li) < 4 else ''.join(li[:-1])
if len(release) == 2:
release = "%s0" % release
return release
def get_version():
"""Get the current release identifier in VERSION.
Returns:
str: the version number
"""
with open(VERSION, "rb") as fi:
return fi.read()
def set_version(version):
"""Set release identifier in CHANGELOG, VERSION and Dbui.js
Args:
version (str): release identifier
"""
print "\n", "."*79
print "\tUpdate CHANGELOG and Dbui.js files with release", version, "..."
# check tag in git
if version in check_output(["git", "tag"]).split("\n"):
print "\n\tRelease %s already exit in git" % version
sys.exit(1)
print '\tSet release', version, 'in', DBUIJS
with open(DBUIJS) as fi:
txt = fi.read()
# look for a pattern Dbui.version = '0.8.3'; in appbase.js
# split the the string in 3 parts (pre, version, post)
match = re.match(r"(.+ version: ')([\w._-]*)('.+)", txt, re.DOTALL)
if match.group(2) == version:
msg = '\n\tVersion "%s" already exists in the Dbui.js file !'
print msg % version
rep = raw_input('\tDo you want to continue [n]? ')
if rep not in ('y', 'yes'):
sys.exit(1)
# update the version and write a new file
txt = match.group(1) + version + match.group(3)
with open(DBUIJS, 'w') as fi:
fi.write(txt)
# look for a pattern HEAD in the CHANGELOG
# split the the string in 2 parts (pre HEAD, post HEAD)
print '\tSet release', version, 'in', CHANGELOG
with open(CHANGELOG) as fi:
txt = fi.read()
match = re.match("(.+HEAD\n)(.*)", txt, re.DOTALL)
if match is None:
print '\n\tNo HEAD tag in the CHANGELOG!\n'
rep = raw_input('\tDo you want to continue [n]?')
if rep not in ('y', 'yes'):
sys.exit(1)
# update the version and edit the CHANGELOG
tpl = (match.group(1), version, NOW.strftime('%b %Y'), match.group(2))
txt = '%s\n%s (%s)\n%s' % tpl
with open(CHANGELOG, 'w') as fi:
fi.write(txt)
call(["vim", CHANGELOG])
# update VERSION
print '\tSet release', version, 'in', VERSION
with open(VERSION, 'w') as fi:
fi.write(version)
# cleaning
fn = "%s~" % CHANGELOG
if os.path.exists(fn):
os.remove(fn)
......@@ -190,9 +190,8 @@ def debug():
# debug version of the javascript libraries
response.files.extend(get_file_paths(plugin.ace_libmin, ext='.js'))
response.files.extend(get_file_paths(plugin.mathjax_libmin, ext='.js'))
response.files.extend(get_file_paths(plugin.extjs_debug, ext='.js'))
response.files.extend(get_file_paths(plugin.extjs_debug, ext='.js', alpha=False))
response.files.extend(get_file_paths(plugin.dbui_debug, ext='.js'))
response.files.extend(get_file_paths(plugin.app_debug, ext='.js'))
......@@ -276,7 +275,7 @@ def documentations():
r4 = dict(code=a % ("http://www.sencha.com/products/extjs/", "Ext JS"),
developer="",
python="",
javascript=a % ("http://docs.sencha.com/extjs/4.2.1/", trJS))
javascript=a % ("http://docs.sencha.com/extjs/6.0.1-classic/", trJS))
r5 = dict(code=a % ("http://www.mathjax.org/", "MathJax"),
developer="",
......@@ -360,7 +359,7 @@ def index():
response.files.extend(get_file_paths(plugin.ace_libmin, ext='.js'))
response.files.extend(get_file_paths(plugin.mathjax_libmin, ext='.js'))
response.files.extend(get_file_paths(plugin.extjs_libmin, ext='.js'))
response.files.extend(get_file_paths(plugin.extjs_libmin, ext='.js', alpha=False))
response.files.extend(get_file_paths(plugin.dbui_libmin, ext='.js'))
response.files.extend(get_file_paths(plugin.app_libmin, ext='.js'))
......
This diff is collapsed.
......@@ -18,6 +18,7 @@
'collaborations': 'collaborations',
'Collections': 'Collections',
'Conference': 'Conférence',
'contains': 'contiens',
'Controller': 'Controller',
'countries': 'pays',
'Country': 'Pays',
......@@ -40,6 +41,7 @@
'enter an integer between %(min)g and %(max)g': 'enter an integer between %(min)g and %(max)g',
'enter an integer greater than or equal to %(min)g': 'enter an integer greater than or equal to %(min)g',
'Enter an integer greater than or equal to %(min)g': 'Enter an integer greater than or equal to %(min)g',
'Filter': 'Filtrer',
'Filter categories': 'Filter categories',
'Filter collaborations': 'Filter collaborations',
'Filter countries': 'Filter countries',
......@@ -64,6 +66,7 @@
'install': 'installé',
'Invalid json': 'Invalid json',
'invalid json': 'invalid json',
'is equal to': 'est équal à',
'Javascript API': 'Javascript API',
'Json': 'Json',
'Last Page': 'Dernière Page',
......
......@@ -50,10 +50,12 @@ plugins = PluginManager('dbui',
ace_libmin='static/plugin_ace/src-min-noconflict/ace.js',
ace_css='static/plugin_ace/css/editor.css',
extjs_css='static/plugin_extjs/resources/css/ext-all.css',
extjs_debug='static/plugin_extjs/ext-dev.js',
extjs_libmin='static/plugin_extjs/ext-all.js',
extjs_lg='static/plugin_extjs/locale/ext-lang-%s.js' % lg,
extjs_css='static/plugin_extjs/build/classic/theme-classic/resources/theme-classic-all.css',
extjs_debug=['static/plugin_extjs/build/ext-all-debug.js',
'static/plugin_extjs/build/classic/theme-classic/theme-classic-debug.js'],
extjs_libmin=['static/plugin_extjs/build/ext-all.js',
'static/plugin_extjs/build/classic/theme-classic/theme-classic.js'],
extjs_lg='static/plugin_extjs/build/classic/locale/locale-%s.js' % lg,
mathjax_libmin='static/plugin_mathjax/MathJax.js',
......
......@@ -19,6 +19,16 @@
# GRID CONFIGURATiON
#
#-------------------------------------------------------------------------------
gridModifier = dbui.GridModifier('harvesters')
gridModifier.append_filter(('id_teams', '==', T('is equal to')))
# gridModifier.append_filter(('id_projects', '==', T('is equal to')))
gridModifier.append_filter(('controller', 'contains', T('contains')))
# gridModifier.append_filter(('host', 'contains', T('contains')))
# gridModifier.append_filter(('id_categories', '==', T('is equal to')))
gridModifier.configure_filters(plugins=['pFormToolTip'], width=300)
gridModifier.configure_gridWithFilter(selectorTitle='Filter')
#-------------------------------------------------------------------------------
#
......
......@@ -708,18 +708,23 @@ def to_jsonstore(table, **kwargs):
# where: define inner join, mainly to resolve foreign key
#
# NOTE: the keyword pageParam allow to activate / inhibit pagination
# It should be equal ro "page" or undefined respectively.
# It should be equal to "page" or undefined respectively.
#
# NOTE ExtJS 6.0.1:
# asynchronousLoad = False
# It causes immediate issuing of an Ajax request when load is called
# rather than issuing the request at the end of the current event
# handler run. Such behaviour is required by the linked ComboBox
#
base_params = {'tableName': tablename, 'dbFields': []}
cfg = DirectStore(autoLoad=False,
cfg = DirectStore(asynchronousLoad=False,
autoLoad=False,
autoSync=True,
extraParams=base_params,
model=tablename,
pageParam=NOPAGE,
root=ROOT,
successProperty=SUCCESS,
storeId=get_store_id(tablename),
totalProperty=TOTAL)
storeId=get_store_id(tablename))
for field in table:
fieldname = field.name
......@@ -861,6 +866,9 @@ def to_panelWithUrlSelector(table, selectorTitle='Select', **kwargs):
# build the selector from the table
fields = to_fields(table)
selector = FieldSet(items=fields,
layout={'align': 'stretch',
'type':'vbox',
'vertical':True},
plugins=['pFormToolTip'],
title=current.T(selectorTitle))
......
......@@ -472,7 +472,8 @@ class DbSvc(BaseSvc):
table = db[tablename]
# Abort the transaction is at least one record does not exists
for rec_id in arg[ROOT]:
for record in arg[ROOT]:
rec_id = record[table_id]
if not table[rec_id]:
otd = {"success": False,
"errors": RECORD_NOT_IN_DB % (rec_id, tablename),
......@@ -480,7 +481,8 @@ class DbSvc(BaseSvc):
return otd
# delete records
for rec_id in arg[ROOT]:
for record in arg[ROOT]:
rec_id = record[table_id]
try:
rep = db(table.id == rec_id).delete()
......
......@@ -597,31 +597,22 @@ def get_versions():
# plugin dbui
fn = os.path.join(server_path, 'static', 'plugin_dbui', 'src', 'Dbui.js')
fi = open(fn, 'rb')
s = fi.read()
fi.close()
m = re.match("(.+ version: ')([\w._-]*)('.+)", s, re.DOTALL)
dbui = m.group(2)
with open(fn, 'rb') as fi:
s = fi.read()
m = re.match("(.+ version: ')([\w._-]*)('.+)", s, re.DOTALL)
dbui = m.group(2)
# plugin Ext JS
extjs = current.T('plugin not install')
path = os.path.join(server_path, 'static', 'plugin_extjs')
if os.path.exists(path):
fn = os.path.join(server_path, 'static',
'plugin_extjs',
'src',
'version',
'Version.js')
fn = os.path.join(path, 'version.properties')
fi = open(fn, 'rb')
s = fi.read()
fi.close()
m = re.match(r".+ version = '(\d+(\.\d+)*)',", s, re.DOTALL)
if m:
extjs = m.group(1)
with open(fn, 'rb') as fi:
s = fi.read()
m = re.search(r"version.release=(\d+(\.\d+)*)", s)
if m:
extjs = m.group(1)
# plugin mathjax
mathjax = current.T('plugin not install')
......@@ -632,13 +623,11 @@ def get_versions():
'plugin_mathjax',
'MathJax.js')
fi = open(fn, 'rb')
s = fi.read()
fi.close()
m = re.match(r'.+MathJax.version="(\d+(\.\d+)*)";', s, re.DOTALL)
if m:
mathjax = m.group(1)
with open(fn, 'rb') as fi:
s = fi.read()
m = re.match(r'.+MathJax.version="(\d+(\.\d+)*)";', s, re.DOTALL)
if m:
mathjax = m.group(1)
# web2py
web2py = ''
......
""" the ``Node`` class to build navigation tree.
"""
import json
import locale
from gluon import current
......@@ -38,7 +39,7 @@ class Node(object):
the widget associated to the leaf
"""
di = {'cfg': cfg, 'leaf': True, 'text': text}
di = {'cfg': json.dumps(cfg), 'leaf': True, 'text': text}
self.children.append(di)
def add_children(self, leaves, func=None, hidden=[]):
......
......@@ -32,7 +32,8 @@ Ext.onReady(function(){
// 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', Dbui.closeUserSession);
// nor with Firefox 38, web2py 2.14.6, Ext JS 6.0.1
Ext.getWin().on('beforeunload', Dbui.closeUserSession);
// Instantiate the application
app = Ext.create('Dbui.container.Viewport', Dbui.config.viewport);
......
......@@ -2,6 +2,10 @@
HEAD
0.9.1 (Aug 2016)
- Migrate to Ext JS 6.0.1.250
- Migrate to the new build system build-version6 in w2pext/utilities.
0.9.0 (Jun 2016)
- Change the name space for the JavaScript code from App to Dbui.
- Fix the latex conversion for special character.
......
......@@ -15,7 +15,7 @@ Ext.define('Dbui', {
* The version of the plugin
* @property {String}
*/
version: '0.9.0',
version: '0.9.1',
/**
* The name of the application
......
......@@ -81,7 +81,15 @@ Ext.define('Dbui.container.Viewport', {
Ext.apply(me, config);
// the TreeStore configuration
// contains the field cfg in addition to the tree node fields
treeStoreCfg = {
fields: [{
name: 'cfg',
type: 'string',
convert: function (value) {
return Ext.JSON.decode(value);
}
}],
root: {
expanded: true,
children: Dbui.config.treeNodes,
......@@ -225,7 +233,7 @@ Ext.define('Dbui.container.Viewport', {
// Create or activate the tab for a leafs
// configuration of the embedded widget
wdgcfg = record.raw.cfg;
wdgcfg = record.get('cfg');
wdgtype = wdgcfg.xtype;
// standalone window
......@@ -238,6 +246,17 @@ Ext.define('Dbui.container.Viewport', {
// unique tab identifier based on the node path
tabId = record.getPath('text', '_');
// strict rule in ExtJS 5.1 for the itemId: /^[a-z_][a-z0-9\-_]*$/i
// the itemId is the equal to the tabId
// therefore replace local character
tabId = tabId.replace(/à/g, "a");
tabId = tabId.replace(/ç/g, "c");
tabId = tabId.replace(/[éèê]/g, "e");
tabId = tabId.replace(/[ïî]/g, "i");
tabId = tabId.replace(/[öô]/g, "o");
tabId = tabId.replace(/[üû]/g, "u");
tabId = tabId.replace(/ /g, "_");
// activate an existing tab