@buerokratt-ria/common-gui-components 0.0.44 → 0.0.45

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/CHANGELOG.md CHANGED
@@ -4,6 +4,10 @@ All changes to this project will be documented in this file.
4
4
 
5
5
  ## Template [MajorVersion.MediterraneanVersion.MinorVersion] - DD-MM-YYYY
6
6
 
7
+ ## [0.0.45] - 07.04.2026
8
+
9
+ - Enhanced downloadChatHistory
10
+
7
11
  ## [0.0.44] - 26.02.2026
8
12
 
9
13
  - Removed _ from chosen CSA's list
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@buerokratt-ria/common-gui-components",
3
- "version": "0.0.44",
3
+ "version": "0.0.45",
4
4
  "description": "Common GUI components and pre defined templates.",
5
5
  "main": "index.ts",
6
6
  "author": "ExiRai",
@@ -933,26 +933,22 @@ const ChatHistory: FC<PropsWithChildren<HistoryProps>> = ({
933
933
  sortBy = `${sorting[0].id} ${sortType}`;
934
934
  }
935
935
 
936
- const chats = await apiDevEnded.post('agents/chats/ended', {
937
- customerSupportIds: passedCustomerSupportIds,
936
+ const { headers } = mapChatsToExportRows([], endedChatsColumns, selectedColumns, t);
937
+ const activeColumns = selectedColumns.length > 0
938
+ ? endedChatsColumns.filter((col) => col.id && col.id !== 'detail' && selectedColumns.includes(col.id))
939
+ : endedChatsColumns.filter((col) => col.id && col.id !== 'detail');
940
+ const columnIds = activeColumns.map((col) => col.id!);
941
+
942
+ const response = await apiDevEnded.post('chats/ended/download', {
943
+ headers,
944
+ columnIds,
945
+ language: i18n.language,
938
946
  startDate: formatISO(startOfDay(new Date(startDate))),
939
947
  endDate: formatISO(endOfDay(new Date(endDate))),
940
948
  urls: getDomainsArray(currentDomains),
941
- page: 1,
942
- page_size: 1000,
943
949
  sorting: sortBy,
944
950
  search,
945
- });
946
-
947
- const {headers, rows, chatIds} = mapChatsToExportRows(
948
- chats.data.response,
949
- endedChatsColumns,
950
- selectedColumns,
951
- t
952
- );
953
-
954
- const response = await apiDevEnded.post('chats/ended/download', {
955
- headers, rows, chatIds, language: i18n.language
951
+ customerSupportIds: passedCustomerSupportIds,
956
952
  });
957
953
 
958
954