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 24 additions and 1 deletions
Showing only changes of commit ec02972efb - Show all commits

View File

@ -10,6 +10,7 @@
panel="vn-ticket-search-panel"
info="Search ticket by id or alias"
model="model"
filter="$ctrl.filterParams"
fetch-params="$ctrl.fetchParams($params)">
</vn-searchbar>
</vn-portal>

View File

@ -2,6 +2,24 @@ import ngModule from '../module';
import ModuleMain from 'salix/components/module-main';
export default class Ticket extends ModuleMain {
constructor($element, $) {
super($element, $);
if (!this.$state.q) {
const today = Date.vnNew();
today.setHours(0, 0, 0, 0);
const tomorrow = Date.vnNew();
tomorrow.setHours(23, 59, 59, 59);
tomorrow.setDate(tomorrow.getDate() + 1);
this.filterParams = {
from: today,
to: tomorrow
};
}
}
fetchParams($params) {
const excludedParams = [
'from',
@ -17,6 +35,10 @@ export default class Ticket extends ModuleMain {
const hasExcludedParams = excludedParams.some(param => {
return $params && $params[param] != undefined;
});
// const seachPanelParams = Object.entries($params);
// const hasFromParam = seachPanelParams.some(subarray => subarray.length > 0 && subarray[0] === 'from');
// const hasToParam = seachPanelParams.some(subarray => subarray.length > 0 && subarray[0] === 'to');
const hasParams = Object.entries($params).length;
if (!hasParams || !hasExcludedParams)
$params.scopeDays = 1;