backend-plus 1.18.7 → 1.18.9

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.
@@ -39,7 +39,7 @@ myOwn.i18n.messages.es=changing(myOwn.i18n.messages.es, {
39
39
  myOwn.wScreens.table = function(addrParams){
40
40
  setTimeout(function(){
41
41
  var layout = document.getElementById('main_layout');
42
- var opts={tableDef:{}};
42
+ var opts={tableDef: addrParams.td ?? {}};
43
43
  if(addrParams.ff){
44
44
  if(addrParams.ff instanceof Array){
45
45
  opts.fixedFields=addrParams.ff;
@@ -1417,7 +1417,10 @@ myOwn.TableGrid.prototype.prepareMenu = function prepareMenu(button){
1417
1417
  },
1418
1418
  showWithMiniMenu,
1419
1419
  messages,
1420
- grid
1420
+ grid,
1421
+ false,
1422
+ false,
1423
+ ['skipUnknownFieldsAtImport','simplificateSpaces','replaceNewLineWithSpace']
1421
1424
  )
1422
1425
  );
1423
1426
  }
@@ -1674,8 +1677,9 @@ myOwn.dialogDownload = function dialogDownload(grid){
1674
1677
  });
1675
1678
  };
1676
1679
 
1677
- myOwn.dialogUpload = function dialogUpload(ajaxPath, ajaxParams, ajaxPrepareResultFun, showWithMiniMenu, messages, refresheable, acceptPhotos){
1680
+ myOwn.dialogUpload = function dialogUpload(ajaxPath, ajaxParams, ajaxPrepareResultFun, showWithMiniMenu, messages, refresheable, acceptPhotos, optsNames){
1678
1681
  messages = changing(my.messages, messages||{})
1682
+ optsNames = optsNames || [];
1679
1683
  var doneFun = function doneFun(){
1680
1684
  var fileAttr={class:'import-button',type:'file',style:'min-width:400px'};
1681
1685
  if(acceptPhotos){
@@ -1683,11 +1687,15 @@ myOwn.dialogUpload = function dialogUpload(ajaxPath, ajaxParams, ajaxPrepareResu
1683
1687
  }
1684
1688
  var buttonFile=html.input(fileAttr).create();
1685
1689
  var buttonConfirmImport=html.input({class:'import-button',type:'button', value:messages.import}).create();
1690
+ buttonConfirmImport.disabled = true;
1686
1691
  var laodingIndicator=html.div({class:'indicator'},' ').create();
1687
1692
  var loadingBar=html.div({class:'progress-bar', style:'width:400px; height:8px;'},[laodingIndicator]).create();
1688
1693
  var divProgress=html.div({class:'result-progress', style:'width:400px; height:20px; margin:0px;'}).create();
1689
1694
  var progressIndicator=html.div({class:'indicator'},' ').create();
1690
1695
  var progressBar=html.div({class:'progress-bar', style:'width:400px; height:8px;'},[progressIndicator]).create();
1696
+ buttonFile.onchange = function(){
1697
+ buttonConfirmImport.disabled = false;
1698
+ }
1691
1699
  var displayProgressBar = function displayProgressBar(progress, progressIndicator){
1692
1700
  if(!progress){
1693
1701
  return;
@@ -1733,7 +1741,6 @@ myOwn.dialogUpload = function dialogUpload(ajaxPath, ajaxParams, ajaxPrepareResu
1733
1741
  }),{uploading:uploadingProgress, informProgress:informProgress}).then(eButton,eButton);
1734
1742
  }).then(ajaxPrepareResultFun).then(this.dialogPromiseDone,this.dialogPromiseDone);
1735
1743
  });
1736
- var optsNames = ['skipUnknownFieldsAtImport','simplificateSpaces','replaceNewLineWithSpace'];
1737
1744
  var buttons = {}
1738
1745
  optsNames.map((name, i)=>{
1739
1746
  var defValue = !!i;
@@ -123,6 +123,7 @@ export type MenuInfoTable = {
123
123
  ff?:{fieldName:string, value:any}[]
124
124
  fc?:{fieldName:string, operator:string, value:any}[]
125
125
  pf?:any
126
+ td?:TableDefinition
126
127
  detailing?:any
127
128
  } & MenuInfoMinimo;
128
129
  export type MenuInfoProc={
@@ -135,7 +136,7 @@ export type MenuInfoPath={
135
136
  path:string
136
137
  } & MenuInfoMinimo;
137
138
  export interface ClientModuleDefinition{
138
- type:'js'|'css'
139
+ type:'js'|'css'|'ttf'
139
140
  module?:string // module where to search in node_modules (node_modules/module/modPath/file) to serve
140
141
  modPath?:string // path inside module where to find file to serve
141
142
  src?:string // full path where browser search file (path/file)
@@ -345,12 +346,14 @@ export type UnloggedRequest = {
345
346
  version?:string
346
347
  }
347
348
  }
348
- export type OptsClientPage = {
349
+ export interface OptsClientPage {
349
350
  hideBEPlusInclusions?:boolean
350
351
  skipMenu?:boolean
351
352
  manifestPath?:string
353
+ webManifestPath?:string
352
354
  extraFiles?:ClientModuleDefinition[]
353
355
  icon?:string
356
+ icons?:Record<string,string>
354
357
  }
355
358
 
356
359
  export type DumpOptions={complete?:boolean, skipEnance?:boolean, disableDBFunctions?:boolean}
@@ -2466,7 +2466,9 @@ AppBackend.prototype.dumpDbCreateDatabase = function dumpDbCreateDatabase(){
2466
2466
  throw new Error('Lack of config.db.password in local-config');
2467
2467
  }
2468
2468
  lines.push("create user "+db.quoteIdent(be.config.db.user)+" password "+db.quoteLiteral(be.config.db.password)+";");
2469
- lines.push("create database "+db.quoteIdent(be.config.db.database)+" owner "+owner+";");
2469
+ lines.push("create database "+db.quoteIdent(be.config.db.database)+" owner "+owner+
2470
+ (be.config.db.tablespace?" tablespace "+db.quoteIdent(be.config.db.tablespace):"")+
2471
+ ";");
2470
2472
  lines.push("grant connect, temporary on database "+db.quoteIdent(be.config.db.database)+" to "+db.quoteIdent(be.config.db.user)+";");
2471
2473
  lines.push("\\c "+db.quoteIdent(be.config.db.database));
2472
2474
  return fs.writeFile('local-db-dump-create-db.sql', lines.join('\n')+'\n');
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.18.7",
4
+ "version": "1.18.9",
5
5
  "author": "Codenautas <codenautas@googlegroups.com>",
6
6
  "license": "MIT",
7
7
  "repository": "codenautas/backend-plus",
@@ -81,8 +81,8 @@
81
81
  "@types/js-yaml": "^4.0.5",
82
82
  "@types/mocha": "^10.0.1",
83
83
  "@types/multiparty": "~0.0.33",
84
- "@types/node": "^20.1.4",
85
- "@types/nodemailer": "^6.4.7",
84
+ "@types/node": "^20.2.3",
85
+ "@types/nodemailer": "^6.4.8",
86
86
  "@types/numeral": "~2.0.2",
87
87
  "@types/session-file-store": "^1.2.2",
88
88
  "@types/stack-trace": "~0.0.30",
@@ -98,10 +98,10 @@
98
98
  "kill-9": "~0.4.3",
99
99
  "mocha": "^10.2.0",
100
100
  "nyc": "^15.1.0",
101
- "puppeteer": "^20.2.0",
102
- "sinon": "^15.0.4",
101
+ "puppeteer": "^20.2.1",
102
+ "sinon": "^15.1.0",
103
103
  "supertest": "^6.3.3",
104
- "types.d.ts": "~0.6.13",
104
+ "types.d.ts": "~0.6.14",
105
105
  "typescript": "^5.0.4",
106
106
  "why-is-node-running": "^2.2.2"
107
107
  },
@@ -584,7 +584,8 @@ myAjax.UriSearchToObjectParams={
584
584
  fc :{ encode:function(x){ return JSON.stringify(x); }, U:function(x){ return JSON.parse(x)} },
585
585
  ff :{ encode:function(x){ return json4all.toUrl(x); }, decode:function(x){ return json4all.parse(x)} },
586
586
  up :{ encode:function(x){ return json4all.toUrl(x); }, decode:function(x){ return json4all.parse(x)} },
587
- pf :{ encode:function(x){ return JSON.stringify(x); }, decode:function(x){ return JSON.parse(x)} },
587
+ pf :{ encode:function(x){ return JSON.stringify(x); }, decode:function(x){ return JSON.parse(x)} },
588
+ td :{ encode:function(x){ return json4all.toUrl(x); }, decode:function(x){ return json4all.parse(x)} },
588
589
  today :{ encode:function(x){ return JSON.stringify(x); }, decode:function(x){ return bestGlobals.date.iso((x+'').substr(0,10))} },
589
590
  section :{ showInMenu:true , encode:noChange , decode:noChange },
590
591
  directUrl :{ hide:true },