[CW-53] feat: allow downloading heatmap report (#6683)

* feat: add control header slot

* feat: add download API call

* feat: add conversation traffic template

* feat: allow downloading heatmap content

* feat: wire up download

* fix: grid layout for mobile

* chore: revert formatting

* revert: en.yml file

* feat: add conversation traffic text

* feat: disable rule for map block

* test: conversation traffic

* fix: timezone offset

* feat: download report in UTC

* feat: add UTC warning

* chore: revert formatting

* feat: add traffic text

* chore: fix whitespace change
This commit is contained in:
Shivam Mishra
2023-03-20 15:46:29 +05:30
committed by GitHub
parent 4f936aada5
commit e5134c9ef5
10 changed files with 192 additions and 30 deletions

View File

@@ -1,7 +1,7 @@
/* eslint no-console: 0 */
import * as types from '../mutation-types';
import Report from '../../api/reports';
import { downloadCsvFile } from '../../helper/downloadHelper';
import { downloadCsvFile, generateFileName } from '../../helper/downloadHelper';
import AnalyticsHelper from '../../helper/AnalyticsHelper';
import { REPORTS_EVENTS } from '../../helper/AnalyticsHelper/events';
import {
@@ -179,6 +179,26 @@ export const actions = {
console.error(error);
});
},
downloadAccountConversationHeatmap(_, reportObj) {
Report.getConversationTrafficCSV(reportObj)
.then(response => {
downloadCsvFile(
generateFileName({
type: 'Conversation traffic',
to: reportObj.to,
}),
response.data
);
AnalyticsHelper.track(REPORTS_EVENTS.DOWNLOAD_REPORT, {
reportType: 'conversation_heatmap',
businessHours: false,
});
})
.catch(error => {
console.error(error);
});
},
};
const mutations = {