Commit ba7f2857 authored by Gabriel Monnerat's avatar Gabriel Monnerat

erp5_officejs_support_request_ui: Add begin date to the query when user click...

erp5_officejs_support_request_ui: Add begin date to the query when user click on "Last Month Activity"

The filter when the user click on the "Last Month Activity" chart filter Support Request only by status (Submitted / Open / Suspended / Closed). So on the table "Recent updates", all the support request with the chosen status appear. There is no filter by "Begin Date" for the last 30 days, which is no coherent with the "Last Month Activity". => It should appear only the support request with the chosen status with a begin date < D - 30 days
parent 091dcb4e
Pipeline #10714 failed with stage
......@@ -60,17 +60,17 @@
.declareMethod('getSearchCriteria', function (name, seriesName) {
var search_criteria, cur_mid_night = new Date(), days_2 = new Date(),
days_7 = new Date(), days_30 = new Date(), begin_date, end_date;
cur_mid_night.setHours(0, 0, 0, 0);
cur_mid_night.setDate(cur_mid_night.getDate() + 1);
days_30.setDate(cur_mid_night.getDate() - 30);
days_30.setHours(0, 0, 0, 0);
if (seriesName !== 'Support Request') {
// Situation 1: Search Support Request with date.
cur_mid_night.setHours(0, 0, 0, 0);
cur_mid_night.setDate(cur_mid_night.getDate() + 1);
days_2.setDate(cur_mid_night.getDate() - 2);
days_7.setDate(cur_mid_night.getDate() - 7);
days_30.setDate(cur_mid_night.getDate() - 30);
days_2.setHours(0, 0, 0, 0);
days_7.setHours(0, 0, 0, 0);
days_30.setHours(0, 0, 0, 0);
if (name === '< 2') {
begin_date = days_2;
......@@ -88,8 +88,8 @@
}
search_criteria = '( translated_simulation_state_title: "' + seriesName + '" AND delivery.start_date: >= ' + begin_date.toISOString().slice(0, 10) + ' AND delivery.start_date: < ' + end_date.toISOString().slice(0, 10) + ' )';
} else {
// Situation 2: Search Support Request without date.
search_criteria = '( translated_simulation_state_title: "' + name + '")';
// Situation 2: Search Support Request by state with limit of 30 days.
search_criteria = '( translated_simulation_state_title: "' + name + '" AND delivery.start_date: >= ' + days_30.toISOString().slice(0, 10) + ' )';
}
return search_criteria;
})
......
......@@ -246,7 +246,7 @@
</item>
<item>
<key> <string>serial</string> </key>
<value> <string>983.46010.49549.22528</string> </value>
<value> <string>985.27934.60177.32068</string> </value>
</item>
<item>
<key> <string>state</string> </key>
......@@ -264,7 +264,7 @@
</tuple>
<state>
<tuple>
<float>1588755553.56</float>
<float>1595449693.01</float>
<string>UTC</string>
</tuple>
</state>
......
......@@ -142,7 +142,7 @@ and compare real click with simulated clicks.
<td>relative=top</td><td></td></tr>
<tr><td>waitForText</td>
<td>//h1[contains(text(), "Recent Updates")]</td>
<td>Recent Updates (3)</td></tr> <!-- FIXME: this should be 2 here. 123dsfa is not "last month" -->
<td>Recent Updates (2)</td></tr>
<tr><td>waitForText</td>
<td>//h1[contains(text(), "Recent Updates")]/../..//td[1]/a</td>
<td>Yesterday - RobotMaking - Submitted</td></tr>
......@@ -150,6 +150,9 @@ and compare real click with simulated clicks.
<!-- reset filter is now enabled -->
<tr><td>waitForElementPresent</td>
<td>//input[@data-i18n="[value]Reset Filter" and not(@disabled)]</td><td></td></tr>
<tr><td>assertTextNotPresent</td>
<td>123dsfa</td>
<td></td></tr>
<tr><td>click</td>
<td>//input[@data-i18n="[value]Reset Filter"]</td><td></td></tr>
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment