diff --git a/ee/app/engagement-dashboard/client/components/ChannelsTab/TableSection.js b/ee/app/engagement-dashboard/client/components/ChannelsTab/TableSection.js index 0e87072186fd..9fbf33d21ac4 100644 --- a/ee/app/engagement-dashboard/client/components/ChannelsTab/TableSection.js +++ b/ee/app/engagement-dashboard/client/components/ChannelsTab/TableSection.js @@ -75,13 +75,16 @@ const TableSection = () => { }, [data]); const downloadData = () => { - const data = channels.map(({ - createdAt, - messagesCount, - name, - t, - updatedAt, - }) => [t, name, messagesCount, updatedAt, createdAt]); + const data = [ + ['Room type', 'Name', 'Messages', 'Last Update Date', 'Creation Date'], + ...channels.map(({ + createdAt, + messagesCount, + name, + t, + updatedAt, + }) => [t, name, messagesCount, updatedAt, createdAt]), + ]; downloadCsvAs(data, `Channels_start_${ params.start }_end_${ params.end }`); }; diff --git a/ee/app/engagement-dashboard/client/components/MessagesTab/MessagesPerChannelSection.js b/ee/app/engagement-dashboard/client/components/MessagesTab/MessagesPerChannelSection.js index dbc2bc035cf6..ca54427e1d16 100644 --- a/ee/app/engagement-dashboard/client/components/MessagesTab/MessagesPerChannelSection.js +++ b/ee/app/engagement-dashboard/client/components/MessagesTab/MessagesPerChannelSection.js @@ -66,7 +66,10 @@ const MessagesPerChannelSection = () => { }, [pieData, tableData]); const downloadData = () => { - const data = pieData.origins.map(({ t, messages }) => [t, messages]); + const data = [ + ['Room Type', 'Messages'], + ...pieData.origins.map(({ t, messages }) => [t, messages]), + ]; downloadCsvAs(data, `MessagesPerChannelSection_start_${ params.start }_end_${ params.end }`); }; diff --git a/ee/app/engagement-dashboard/client/components/MessagesTab/MessagesSentSection.js b/ee/app/engagement-dashboard/client/components/MessagesTab/MessagesSentSection.js index 69a26c9a9a1a..7871259261a7 100644 --- a/ee/app/engagement-dashboard/client/components/MessagesTab/MessagesSentSection.js +++ b/ee/app/engagement-dashboard/client/components/MessagesTab/MessagesSentSection.js @@ -83,7 +83,10 @@ const MessagesSentSection = () => { }, [data, period]); const downloadData = () => { - const data = values.map(({ date, newMessages }) => [date, newMessages]); + const data = [ + ['Date', 'Messages'], + ...values.map(({ date, newMessages }) => [date, newMessages]), + ]; downloadCsvAs(data, `MessagesSentSection_start_${ params.start }_end_${ params.end }`); }; diff --git a/ee/app/engagement-dashboard/client/components/UsersTab/UsersByTimeOfTheDaySection.js b/ee/app/engagement-dashboard/client/components/UsersTab/UsersByTimeOfTheDaySection.js index 91ad6a30a48a..415a01214142 100644 --- a/ee/app/engagement-dashboard/client/components/UsersTab/UsersByTimeOfTheDaySection.js +++ b/ee/app/engagement-dashboard/client/components/UsersTab/UsersByTimeOfTheDaySection.js @@ -101,18 +101,21 @@ const UsersByTimeOfTheDaySection = ({ timezone }) => { }, [data, period.end, period.start, utc]); const downloadData = () => { - const _data = data.week.map(({ - users, - hour, - day, - month, - year, - }) => ({ - date: moment([year, month - 1, day, hour, 0, 0, 0]), - users, - })) - .sort((a, b) => a > b) - .map(({ date, users }) => [date.toISOString(), users]); + const _data = [ + ['Date', 'Users'], + ...data.week.map(({ + users, + hour, + day, + month, + year, + }) => ({ + date: moment([year, month - 1, day, hour, 0, 0, 0]), + users, + })) + .sort((a, b) => a > b) + .map(({ date, users }) => [date.toISOString(), users]), + ]; downloadCsvAs(_data, `UsersByTimeOfTheDaySection_start_${ params.start }_end_${ params.end }`); }; return