backend-plus 2.0.0-beta.15 → 2.0.0-beta.16

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.
@@ -699,10 +699,11 @@ myOwn.tableGrid = function tableGrid(tableName, mainElement, opts){
699
699
  }
700
700
  })
701
701
  }
702
- if(grid.def.refrescable){
702
+ if(grid.def.refrescable && !grid.def.forInsertOnlyMode){
703
+ if (window.currentAutofrefresh) clearInterval(window.currentAutofrefresh);
703
704
  window.currentAutofrefresh = setInterval(grid.refreshAllRows,8000);
704
705
  }
705
- if (grid.def.selfRefresh) {
706
+ if (grid.def.selfRefresh && !grid.def.forInsertOnlyMode) {
706
707
  var refresh = function refresh(){
707
708
  grid.refreshAllRows();
708
709
  }
@@ -319,7 +319,8 @@ export type TableDefinition = EditableDbDefinition & {
319
319
  specialValidator?:string
320
320
  saveAfter?:boolean
321
321
  selfRefresh?:boolean
322
- filterColumns?:{column:string, operator:string, value:any}[]
322
+ filterColumns?:{column:string, operator:string, value:any}[],
323
+ gridAlias?:string /* front-end css my-table = gridAlias */
323
324
  }
324
325
  export type OtherTableDefs = TableDefinition['sql']['otherTableDefs']
325
326
  export interface DetailTable { table?: string, fields: FieldsForConnectDetailTable, abr: string, label?: string, refreshParent?:boolean, refreshFromParent?:boolean, wScreen?:string, condition?:string }
@@ -9,6 +9,7 @@ var typeStore=require('type-store');
9
9
  var likeAr=require('like-ar');
10
10
  const f = require('session-file-store');
11
11
  const { expected } = require('cast-error');
12
+ const bestGlobals = require('best-globals');
12
13
 
13
14
  const PANIC_IMPORT = true;
14
15
 
@@ -157,35 +158,17 @@ ProcedureTables = [
157
158
  queryValues
158
159
  ).fetchAll().then(function(result){
159
160
  if (parameters.pick) {
160
- // /*
161
- return result.rows.filter(row=>{
161
+ var pickParts = bestGlobals.hyperSimplifyText(parameters.pick).split(/\s+/).filter(p => p);
162
+ return result.rows.filter(row => {
162
163
  var line = likeAr(row).join(' ').trim().split(/\s+/);
163
- return parameters.pick.split(' ').map(p=>p.toLocaleLowerCase()).every(palabraBuscada=>
164
- line.map(p=>p.toLocaleLowerCase()).filter(palabra=>
164
+ return pickParts.every(palabraBuscada =>
165
+ line.map(p => bestGlobals.hyperSimplifyText(p)).filter(palabra =>
165
166
  palabraBuscada.length <= 3
166
- ? palabra == palabraBuscada.toLocaleLowerCase()
167
- : palabra.includes(palabraBuscada.toLocaleLowerCase()
168
- )).length
167
+ ? palabra == palabraBuscada
168
+ : palabra.includes(palabraBuscada)
169
+ ).length
169
170
  )
170
171
  });
171
- // */
172
- /*
173
- var filter = parameters.pick.split('|').map(andPart=>andPart.trim().split(/\s+/));
174
- return result.rows.filter(row=>{
175
- var line = likeAr(row).join(' ').trim().split(/\s+/);
176
- for (var orPart of filter){
177
- var allFound = true;
178
- for (var andPart of orPart){
179
- if (!line.includes(andPart)) {
180
- allFound = false;
181
- break;
182
- }
183
- }
184
- if (allFound) return true;
185
- }
186
- return false;
187
- })
188
- */
189
172
  }
190
173
  return result.rows;
191
174
  }).catch(function(err){
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "backend-plus",
3
3
  "description": "Backend for the anti Pareto rule",
4
- "version": "2.0.0-beta.15",
4
+ "version": "2.0.0-beta.16",
5
5
  "author": "Codenautas <codenautas@googlegroups.com>",
6
6
  "license": "MIT",
7
7
  "repository": "codenautas/backend-plus",