backend-plus 1.19.5 → 1.19.7

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.
@@ -338,4 +338,8 @@ th.th-agg
338
338
  outline 1px solid #997
339
339
  left 0
340
340
 
341
- /* background-clip: padding-box; outline:2px solid black; */
341
+ /* background-clip: padding-box; outline:2px solid black; */
342
+
343
+ .my-grid > tbody > [not-here=yes] > td
344
+ background-color #ccc
345
+ color #888
@@ -647,14 +647,17 @@ myOwn.tableGrid = function tableGrid(tableName, mainElement, opts){
647
647
  })
648
648
  if(!thereIsANewRecord){
649
649
  var i = 0;
650
- while (i < grid.depots.length) {
651
- var depot = grid.depots[i];
652
- if (depot.tick != tick) {
653
- depot.manager.displayAsDeleted(depot);
654
- } else {
655
- i++;
650
+ var depotsToDelete = grid.depots.filter(depot => depot.tick != tick);
651
+ var depot;
652
+ if (myOwn.config.config['grid-row-retain-moved-or-deleted']) {
653
+ var depotsToRetain = grid.depots.filter(depot => depot.tick == tick);
654
+ for (depot of depotsToRetain) {
655
+ if (depot.tr && depot.tr.getAttribute('not-here')) depot.tr.removeAttribute('not-here')
656
656
  }
657
657
  }
658
+ while (depot = depotsToDelete.pop()) {
659
+ depot.manager.displayAsDeleted(depot, 'unknown');
660
+ }
658
661
  }
659
662
  })
660
663
  }
@@ -1014,7 +1017,7 @@ myOwn.DataColumnGrid.prototype.td = function td(depot, iColumn, tr, saveRow){
1014
1017
  var grid = this.grid;
1015
1018
  var fieldDef = this.fieldDef;
1016
1019
  var forInsert = false; // TODO: Verificar que esto está en desuso
1017
- var enabledInput=depot.allow.update !== false && grid.def.allow.update && !grid.connector.fixedField[fieldDef.name] && (forInsert?fieldDef.allow.insert:fieldDef.allow.update);
1020
+ var enabledInput=depot.allow.update !== false && grid.def.allow.update /* && !grid.connector.fixedField[fieldDef.name] */ && (forInsert?fieldDef.allow.insert:fieldDef.allow.update);
1018
1021
  var directInput=true;
1019
1022
  var control;
1020
1023
  var td;
@@ -2261,7 +2264,7 @@ myOwn.TableGrid.prototype.displayGrid = function displayGrid(){
2261
2264
  return fieldDef.visible;
2262
2265
  }).forEach(function(fieldDef){
2263
2266
  var td = depot.rowControls[fieldDef.name];
2264
- var editable=depot.allow.update !== false && grid.connector.def.allow.update && !grid.connector.fixedField[fieldDef.name] && (forInsert?fieldDef.allow.insert:fieldDef.allow.update && grid.connector.def.field[fieldDef.name].allow.update);
2267
+ var editable=depot.allow.update !== false && grid.connector.def.allow.update /* && !grid.connector.fixedField[fieldDef.name]*/ && (forInsert?fieldDef.allow.insert:fieldDef.allow.update && grid.connector.def.field[fieldDef.name].allow.update);
2265
2268
  td.disable(!editable);
2266
2269
  if(fieldDef.clientSide){
2267
2270
  if(!td.clientSidePrepared){
@@ -2696,39 +2699,43 @@ myOwn.TableGrid.prototype.displayGrid = function displayGrid(){
2696
2699
  grid.displayBody();
2697
2700
  };
2698
2701
 
2699
- myOwn.TableGrid.prototype.displayAsDeleted = function displayAsDeleted(depot){
2702
+ myOwn.TableGrid.prototype.displayAsDeleted = function displayAsDeleted(depot, mode){
2700
2703
  var grid = this;
2701
- var position = Math.min(grid.depots.length,Math.max(0,depot.tr.sectionRowIndex));
2702
- if(grid.depots[position] !== depot){
2703
- position = grid.depots.indexOf(depot);
2704
- }
2705
- if(position>=0){
2706
- grid.depots.splice(position,1);
2707
- }
2708
- if(grid.vertical){
2709
- var compareColNumberFun = function compareColNumberFun(a, b) {
2710
- var colNumberA = a.colNumber;
2711
- var colNumberB = b.colNumber;
2712
- return(colNumberA > colNumberB)?1:((colNumberA < colNumberB)?-1:0)
2713
- }
2714
- var i = 0;
2715
- Array.prototype.forEach.call(grid.dom.table.rows,function(tr){
2716
- if(i < grid.dom.table.rows.length-1 && tr.childNodes[depot.colNumber]){
2717
- depot.my.fade(tr.childNodes[depot.colNumber]);
2718
- }
2719
- i++;
2720
- });
2721
- var depots = grid.depots.sort(compareColNumberFun);
2722
- for(var j = depot.colNumber; j <= depots.length; j++){
2723
- depots[j-1].colNumber = j;
2704
+ if (mode == 'unknown' && myOwn.config.config['grid-row-retain-moved-or-deleted']) {
2705
+ depot.tr.setAttribute('not-here', 'yes');
2706
+ } else {
2707
+ var position = Math.min(grid.depots.length,Math.max(0,depot.tr.sectionRowIndex));
2708
+ if(grid.depots[position] !== depot){
2709
+ position = grid.depots.indexOf(depot);
2724
2710
  }
2725
- }else{
2726
- depot.my.fade(depot.tr);
2727
- for(var detailControl in depot.detailControls){
2728
- if(depot.detailControls[detailControl].tr){
2729
- depot.my.fade(depot.detailControls[detailControl].tr);
2711
+ if(position>=0){
2712
+ grid.depots.splice(position,1);
2713
+ }
2714
+ if(grid.vertical){
2715
+ var compareColNumberFun = function compareColNumberFun(a, b) {
2716
+ var colNumberA = a.colNumber;
2717
+ var colNumberB = b.colNumber;
2718
+ return(colNumberA > colNumberB)?1:((colNumberA < colNumberB)?-1:0)
2730
2719
  }
2731
- };
2720
+ var i = 0;
2721
+ Array.prototype.forEach.call(grid.dom.table.rows,function(tr){
2722
+ if(i < grid.dom.table.rows.length-1 && tr.childNodes[depot.colNumber]){
2723
+ depot.my.fade(tr.childNodes[depot.colNumber]);
2724
+ }
2725
+ i++;
2726
+ });
2727
+ var depots = grid.depots.sort(compareColNumberFun);
2728
+ for(var j = depot.colNumber; j <= depots.length; j++){
2729
+ depots[j-1].colNumber = j;
2730
+ }
2731
+ }else{
2732
+ depot.my.fade(depot.tr);
2733
+ for(var detailControl in depot.detailControls){
2734
+ if(depot.detailControls[detailControl].tr){
2735
+ depot.my.fade(depot.detailControls[detailControl].tr);
2736
+ }
2737
+ };
2738
+ }
2732
2739
  }
2733
2740
  grid.updateTotals(grid.depots.length?1:0, grid.depots.length);
2734
2741
  };
@@ -2757,7 +2764,7 @@ myOwn.tableAction={
2757
2764
  return depot.my.confirmDelete(depot, opts).then(function(result){
2758
2765
  if(result){
2759
2766
  return depot.connector.deleteRecord(depot, changing({reject:false},opts)).then(function(){
2760
- depot.manager.displayAsDeleted(depot);
2767
+ depot.manager.displayAsDeleted(depot, 'deleted');
2761
2768
  depot.manager.refreshAggregates();
2762
2769
  }).catch(depot.my.alertError);
2763
2770
  }
@@ -1312,6 +1312,7 @@ AppBackend.prototype.addProcedureServices = function addProcedureServices(forUnl
1312
1312
  var params={};
1313
1313
  procedureDef.parameters.forEach(function(paramDef){
1314
1314
  var undecodedValue = req[source][paramDef.name];
1315
+ undecodedValue = paramDef.encoding == 'plain' || undecodedValue === undefined ? undecodedValue : undecodedValue + '';
1315
1316
  var value = undecodedValue===undefined?undecodedValue:myOwn.encoders[paramDef.encoding].parse(undecodedValue);
1316
1317
  if(undecodedValue===undefined){
1317
1318
  if(paramDef.defaultSpecial === 'currentYear'){
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.19.5",
4
+ "version": "1.19.7",
5
5
  "author": "Codenautas <codenautas@googlegroups.com>",
6
6
  "license": "MIT",
7
7
  "repository": "codenautas/backend-plus",
@@ -81,7 +81,7 @@
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.3.0",
84
+ "@types/node": "^20.3.1",
85
85
  "@types/nodemailer": "^6.4.8",
86
86
  "@types/numeral": "~2.0.2",
87
87
  "@types/session-file-store": "^1.2.2",
@@ -98,8 +98,8 @@
98
98
  "kill-9": "~0.4.3",
99
99
  "mocha": "^10.2.0",
100
100
  "nyc": "^15.1.0",
101
- "puppeteer": "^20.5.0",
102
- "sinon": "^15.1.0",
101
+ "puppeteer": "^20.7.2",
102
+ "sinon": "^15.1.2",
103
103
  "supertest": "^6.3.3",
104
104
  "types.d.ts": "~0.6.15",
105
105
  "typescript": "^5.1.3",