232201_test_to_master #1582

Merged
alexm merged 126 commits from 232201_test_to_master into master 2023-06-01 06:16:49 +00:00
2 changed files with 19 additions and 3 deletions
Showing only changes of commit 5ec107188c - Show all commits

View File

@ -1,5 +1,6 @@
import ngModule from '../module'; import ngModule from '../module';
import ModuleMain from 'salix/components/module-main'; import ModuleMain from 'salix/components/module-main';
const UserError = require('vn-loopback/util/user-error');
export default class Ticket extends ModuleMain { export default class Ticket extends ModuleMain {
constructor($element, $) { constructor($element, $) {
@ -35,9 +36,23 @@ export default class Ticket extends ModuleMain {
const hasExcludedParams = excludedParams.some(param => { const hasExcludedParams = excludedParams.some(param => {
return $params && $params[param] != undefined; return $params && $params[param] != undefined;
}); });
// const seachPanelParams = Object.entries($params);
// const hasFromParam = seachPanelParams.some(subarray => subarray.length > 0 && subarray[0] === 'from'); const seachPanelParams = Object.entries($params);
// const hasToParam = seachPanelParams.some(subarray => subarray.length > 0 && subarray[0] === 'to'); const hasFromParam = seachPanelParams.some(subarray => subarray.length > 0 && subarray[0] === 'from');
const hasToParam = seachPanelParams.some(subarray => subarray.length > 0 && subarray[0] === 'to');
const hasScopeDays = seachPanelParams.some(subarray => subarray.length > 0 && subarray[0] === 'scopeDays');
if (!hasFromParam)
delete this.filterParams.from;
if (!hasToParam)
delete this.filterParams.to;
if (!hasScopeDays)
delete this.filterParams.scopeDays;
if ((!hasFromParam || !hasToParam) && !hasScopeDays)
throw new UserError(`The filter 'From' and 'To' or 'Days onward' must be filled in`);
const hasParams = Object.entries($params).length; const hasParams = Object.entries($params).length;
if (!hasParams || !hasExcludedParams) if (!hasParams || !hasExcludedParams)

View File

@ -0,0 +1 @@
The filter 'From' and 'To' or 'Days onward' must be filled in: El filtro 'Desde' y 'Hasta' o 'Dias adelante' debe estar rellenado