backend-plus 1.13.3 → 1.13.8
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/for-client/my-menu.js +10 -6
- package/for-client/my-tables.js +15 -6
- package/lib/procedures-table.js +20 -0
- package/package.json +23 -23
package/for-client/my-menu.js
CHANGED
|
@@ -287,12 +287,16 @@ myOwn.showPage = function showPage(pageDef){
|
|
|
287
287
|
}else if(typeof my.wScreens[w] === 'object'){
|
|
288
288
|
wScreen = my.wScreens[w];
|
|
289
289
|
if(wScreen.parameters){
|
|
290
|
-
wScreen.
|
|
291
|
-
|
|
292
|
-
|
|
293
|
-
|
|
294
|
-
|
|
295
|
-
|
|
290
|
+
if(wScreen.autoproced && addrParams[wScreen.parameters[0].name]!=null){
|
|
291
|
+
wScreen.mainAction(addrParams,main_layout,null)
|
|
292
|
+
}else {
|
|
293
|
+
wScreen.mainFunction=wScreen.mainFunction||function(addrParams){
|
|
294
|
+
my.wScreens.procAux.showParams({
|
|
295
|
+
parameters:wScreen.parameters,
|
|
296
|
+
resultClass:wScreen.resultClass,
|
|
297
|
+
proceedLabel:wScreen.proceedLabel,
|
|
298
|
+
}, main_layout, addrParams, wScreen.mainAction);
|
|
299
|
+
}
|
|
296
300
|
}
|
|
297
301
|
}
|
|
298
302
|
}else{
|
package/for-client/my-tables.js
CHANGED
|
@@ -89,8 +89,10 @@ myOwn.i18n.messages.en=changing(myOwn.i18n.messages.en, {
|
|
|
89
89
|
preparingForExport: "preparing for export",
|
|
90
90
|
recordsReimaining: "{$r} records remains in the table",
|
|
91
91
|
refresh: "refresh - retrive data from database",
|
|
92
|
+
replaceNewLineWithSpace: 'replace new lines with spaces',
|
|
92
93
|
showInheritedKeys: "show inherited keys",
|
|
93
94
|
similarTo:'similar to',
|
|
95
|
+
simplificateSpaces:'simplificate spaces',
|
|
94
96
|
skippedColumn:'skipped column',
|
|
95
97
|
skippedColumns:'skipped columns',
|
|
96
98
|
skipUnknownFieldsAtImport:'skip unknown fields at import',
|
|
@@ -151,8 +153,10 @@ myOwn.i18n.messages.es=changing(myOwn.i18n.messages.es, {
|
|
|
151
153
|
preparingForExport: "preparando para exportar",
|
|
152
154
|
recordsReimaining: "quedan {$r} registros en la tabla",
|
|
153
155
|
refresh: "refrescar la grilla desde la base de datos",
|
|
156
|
+
replaceNewLineWithSpace: 'replazar saltos de línea por espacios',
|
|
154
157
|
showInheritedKeys: "mostrar las columnas relacionadas",
|
|
155
158
|
similarTo:'parecido a',
|
|
159
|
+
simplificateSpaces:'simplificar espacios',
|
|
156
160
|
skippedColumn:'Columna salteada',
|
|
157
161
|
skippedColumns:'Columnas salteadas',
|
|
158
162
|
skipUnknownFieldsAtImport:'saltear columnas que no existan',
|
|
@@ -1659,15 +1663,20 @@ myOwn.dialogUpload = function dialogUpload(ajaxPath, ajaxParams, ajaxPrepareResu
|
|
|
1659
1663
|
}),{uploading:uploadingProgress, informProgress:informProgress}).then(eButton,eButton);
|
|
1660
1664
|
}).then(ajaxPrepareResultFun).then(this.dialogPromiseDone,this.dialogPromiseDone);
|
|
1661
1665
|
});
|
|
1662
|
-
var
|
|
1663
|
-
|
|
1664
|
-
|
|
1665
|
-
|
|
1666
|
+
var optsNames = ['skipUnknownFieldsAtImport','simplificateSpaces','replaceNewLineWithSpace'];
|
|
1667
|
+
var buttons = {}
|
|
1668
|
+
optsNames.map((name, i)=>{
|
|
1669
|
+
var defValue = !!i;
|
|
1670
|
+
ajaxParams[name]=defValue;
|
|
1671
|
+
buttons[name] = html.input({type:'checkbox', checked:defValue}).create()
|
|
1672
|
+
buttons[name].onchange = function(){
|
|
1673
|
+
ajaxParams[name] = buttons[name].checked;
|
|
1674
|
+
}
|
|
1675
|
+
});
|
|
1666
1676
|
simpleFormPromise({elementsList:[
|
|
1667
1677
|
messages.importDataFromFile,
|
|
1668
1678
|
buttonFile,
|
|
1669
|
-
html.br().create(),
|
|
1670
|
-
html.label([skipUnknownFieldsAtImportButton, messages.skipUnknownFieldsAtImport]).create(),
|
|
1679
|
+
...(optsNames.map(name => html.label([html.br(), buttons[name], messages[name]]).create())),
|
|
1671
1680
|
html.br().create(),
|
|
1672
1681
|
buttonConfirmImport,
|
|
1673
1682
|
html.br().create(),
|
package/lib/procedures-table.js
CHANGED
|
@@ -647,6 +647,8 @@ ProcedureTables = [
|
|
|
647
647
|
{name: 'table'},
|
|
648
648
|
{name: 'prefilledFields'},
|
|
649
649
|
{name: 'skipUnknownFieldsAtImport'},
|
|
650
|
+
{name: 'simplificateSpaces'},
|
|
651
|
+
{name: 'replaceNewLineWithSpace'},
|
|
650
652
|
],
|
|
651
653
|
files:{count:1},
|
|
652
654
|
coreFunction:async function(context, parameters, files){
|
|
@@ -684,6 +686,10 @@ ProcedureTables = [
|
|
|
684
686
|
fieldName=fieldName.toLowerCase();
|
|
685
687
|
defField=tableDef.field[fieldName];
|
|
686
688
|
}
|
|
689
|
+
if(!defField){
|
|
690
|
+
fieldName=fieldName.toLowerCase().trim();
|
|
691
|
+
defField=tableDef.fields.find(f =>(f.title??f.label??f.name).toLowerCase().trim() == fieldName);
|
|
692
|
+
}
|
|
687
693
|
if(!defField && !tableDef.JSONFieldForOtherFields){
|
|
688
694
|
if(skipUnknownFieldsAtImport){
|
|
689
695
|
skippedColumns.push(fieldName);
|
|
@@ -759,6 +765,12 @@ ProcedureTables = [
|
|
|
759
765
|
if(field.defaultForOtherFields){
|
|
760
766
|
addFieldToOthers(othersArray, field, value);
|
|
761
767
|
}else{
|
|
768
|
+
if(value != null && parameters.replaceNewLineWithSpace){
|
|
769
|
+
value = value.replace(/\s*\r?\n\s*/g,' ').trim()
|
|
770
|
+
}
|
|
771
|
+
if(value != null && parameters.skipUnknownFieldsAtImport){
|
|
772
|
+
value = value.replace(/(\s|\u00A0)+/g,' ').trim()
|
|
773
|
+
}
|
|
762
774
|
newRow[field.name]=value;
|
|
763
775
|
}
|
|
764
776
|
});
|
|
@@ -822,6 +834,14 @@ ProcedureTables = [
|
|
|
822
834
|
}
|
|
823
835
|
}else{
|
|
824
836
|
value=typeStore.typerFrom(field).fromExcelCell(cell);
|
|
837
|
+
if(field.typeName == 'text'){
|
|
838
|
+
if(value != null && parameters.replaceNewLineWithSpace){
|
|
839
|
+
value = value.replace(/\s*\r?\n\s*/g,' ').trim()
|
|
840
|
+
}
|
|
841
|
+
if(value != null && parameters.skipUnknownFieldsAtImport){
|
|
842
|
+
value = value.replace(/(\s|\u00A0)+/g,' ').trim()
|
|
843
|
+
}
|
|
844
|
+
}
|
|
825
845
|
}
|
|
826
846
|
if(Number.isNaN(value)){
|
|
827
847
|
value=null;
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "backend-plus",
|
|
3
3
|
"description": "Backend for typed controls",
|
|
4
|
-
"version": "1.13.
|
|
4
|
+
"version": "1.13.8",
|
|
5
5
|
"author": "Codenautas <codenautas@googlegroups.com>",
|
|
6
6
|
"license": "MIT",
|
|
7
7
|
"repository": "codenautas/backend-plus",
|
|
@@ -28,17 +28,17 @@
|
|
|
28
28
|
}
|
|
29
29
|
],
|
|
30
30
|
"dependencies": {
|
|
31
|
-
"ajax-best-promise": "
|
|
32
|
-
"backend-skins": "
|
|
33
|
-
"best-globals": "
|
|
31
|
+
"ajax-best-promise": "^0.3.7",
|
|
32
|
+
"backend-skins": "^0.1.15",
|
|
33
|
+
"best-globals": "^1.0.0",
|
|
34
34
|
"big.js": "^6.1.1",
|
|
35
|
-
"body-parser": "^1.19.
|
|
35
|
+
"body-parser": "^1.19.1",
|
|
36
36
|
"cast-error": "^0.1.0",
|
|
37
|
-
"castellano": "
|
|
37
|
+
"castellano": "^0.1.3",
|
|
38
38
|
"connect-pg-simple": "^7.0.0",
|
|
39
39
|
"cookie-parser": "^1.4.6",
|
|
40
|
-
"dialog-promise": "
|
|
41
|
-
"discrepances": "
|
|
40
|
+
"dialog-promise": "^0.9.14",
|
|
41
|
+
"discrepances": "^0.2.6",
|
|
42
42
|
"express": "^4.17.1",
|
|
43
43
|
"express-session": "^1.17.2",
|
|
44
44
|
"express-useragent": "^1.0.15",
|
|
@@ -46,13 +46,13 @@
|
|
|
46
46
|
"js-to-html": "^1.2.1",
|
|
47
47
|
"js-yaml": "^4.1.0",
|
|
48
48
|
"json4all": "^1.1.0",
|
|
49
|
-
"lazy-some": "
|
|
50
|
-
"like-ar": "
|
|
49
|
+
"lazy-some": "^0.1.0",
|
|
50
|
+
"like-ar": "^0.3.6",
|
|
51
51
|
"@upgraded/locate-path": "^6.0.0-alfa.1",
|
|
52
52
|
"login-plus": "^1.6.2",
|
|
53
53
|
"memorystore": "^1.6.6",
|
|
54
54
|
"mini-tools": "^1.11.1",
|
|
55
|
-
"nodemailer": "^6.7.
|
|
55
|
+
"nodemailer": "^6.7.2",
|
|
56
56
|
"moment": "^2.29.1",
|
|
57
57
|
"multiparty": "^4.2.2",
|
|
58
58
|
"numeral": "^2.0.6",
|
|
@@ -60,16 +60,16 @@
|
|
|
60
60
|
"pikaday": "^1.8.2",
|
|
61
61
|
"pug": "^3.0.2",
|
|
62
62
|
"read-yaml-promise": "^1.0.2",
|
|
63
|
-
"regexplicit": "
|
|
64
|
-
"require-bro": "
|
|
65
|
-
"self-explain": "
|
|
66
|
-
"serve-content": "
|
|
63
|
+
"regexplicit": "^0.1.3",
|
|
64
|
+
"require-bro": "^0.2.2",
|
|
65
|
+
"self-explain": "^0.10.22",
|
|
66
|
+
"serve-content": "^0.3.16",
|
|
67
67
|
"session-file-store": "^1.5.0",
|
|
68
|
-
"sql-tools": "
|
|
69
|
-
"stack-trace": "
|
|
70
|
-
"stylus": "
|
|
71
|
-
"type-store": "
|
|
72
|
-
"typed-controls": "
|
|
68
|
+
"sql-tools": "^0.1.0",
|
|
69
|
+
"stack-trace": "^0.0.10",
|
|
70
|
+
"stylus": "^0.55.0",
|
|
71
|
+
"type-store": "^0.2.41",
|
|
72
|
+
"typed-controls": "^0.10.0",
|
|
73
73
|
"xlsx": "^0.17.4",
|
|
74
74
|
"xlsx-style": "^0.8.13"
|
|
75
75
|
},
|
|
@@ -83,7 +83,7 @@
|
|
|
83
83
|
"@types/mocha": "^9.0.0",
|
|
84
84
|
"@types/nodemailer": "^6.4.4",
|
|
85
85
|
"@types/multiparty": "~0.0.33",
|
|
86
|
-
"@types/node": "^16.11.
|
|
86
|
+
"@types/node": "^16.11.13",
|
|
87
87
|
"@types/numeral": "~2.0.2",
|
|
88
88
|
"@types/session-file-store": "^1.2.2",
|
|
89
89
|
"@types/stack-trace": "~0.0.29",
|
|
@@ -99,11 +99,11 @@
|
|
|
99
99
|
"kill-9": "~0.4.3",
|
|
100
100
|
"mocha": "^9.1.3",
|
|
101
101
|
"nyc": "^15.1.0",
|
|
102
|
-
"puppeteer": "^
|
|
102
|
+
"puppeteer": "^13.0.0",
|
|
103
103
|
"sinon": "^12.0.1",
|
|
104
104
|
"supertest": "^6.1.6",
|
|
105
105
|
"types.d.ts": "~0.6.4",
|
|
106
|
-
"typescript": "^4.5.
|
|
106
|
+
"typescript": "^4.5.4",
|
|
107
107
|
"why-is-node-running": "^2.2.0"
|
|
108
108
|
},
|
|
109
109
|
"engines": {
|