@buerokratt-ria/common-gui-components 0.0.43 → 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,14 @@ 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
+
11
+ ## [0.0.44] - 26.02.2026
12
+
13
+ - Removed _ from chosen CSA's list
14
+
7
15
  ## [0.0.43] - 06.02.2026
8
16
 
9
17
  - Prevent url fetch in markdownify for non image urls
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@buerokratt-ria/common-gui-components",
3
- "version": "0.0.43",
3
+ "version": "0.0.45",
4
4
  "description": "Common GUI components and pre defined templates.",
5
5
  "main": "index.ts",
6
6
  "author": "ExiRai",
@@ -356,7 +356,6 @@ const ChatHistory: FC<PropsWithChildren<HistoryProps>> = ({
356
356
  }),
357
357
  onSuccess: (res: any) => {
358
358
  setCustomerSupportAgents([
359
- {label: '-', value: '-'},
360
359
  {label: 'Bürokratt', value: 'chatbot'},
361
360
  ...res.data.response.map((item) => ({
362
361
  label: [item.firstName, item.lastName].join(' ').trim(),
@@ -934,26 +933,22 @@ const ChatHistory: FC<PropsWithChildren<HistoryProps>> = ({
934
933
  sortBy = `${sorting[0].id} ${sortType}`;
935
934
  }
936
935
 
937
- const chats = await apiDevEnded.post('agents/chats/ended', {
938
- 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,
939
946
  startDate: formatISO(startOfDay(new Date(startDate))),
940
947
  endDate: formatISO(endOfDay(new Date(endDate))),
941
948
  urls: getDomainsArray(currentDomains),
942
- page: 1,
943
- page_size: 1000,
944
949
  sorting: sortBy,
945
950
  search,
946
- });
947
-
948
- const {headers, rows, chatIds} = mapChatsToExportRows(
949
- chats.data.response,
950
- endedChatsColumns,
951
- selectedColumns,
952
- t
953
- );
954
-
955
- const response = await apiDevEnded.post('chats/ended/download', {
956
- headers, rows, chatIds, language: i18n.language
951
+ customerSupportIds: passedCustomerSupportIds,
957
952
  });
958
953
 
959
954
 
@@ -1114,18 +1109,27 @@ const ChatHistory: FC<PropsWithChildren<HistoryProps>> = ({
1114
1109
  setSearchParams((params) => {
1115
1110
  params.delete('customerSupportIds');
1116
1111
  params.set('page', '1');
1117
- selection?.forEach((s) =>
1118
- params.append('customerSupportIds', s.value)
1119
- );
1112
+ selection?.forEach((s) => {
1113
+ params.append("customerSupportIds", s.value);
1114
+ if (s.value === "chatbot") params.append("customerSupportIds", "-");
1115
+ return params;
1116
+ });
1120
1117
  return params;
1121
1118
  });
1122
1119
 
1123
1120
  setPagination({pageIndex: 0, pageSize: pagination.pageSize});
1124
1121
 
1122
+ const customerSupportIds =
1123
+ selection?.reduce((acc, s) => {
1124
+ acc.push(s.value);
1125
+ if (s.value === "chatbot") acc.push("-");
1126
+ return acc;
1127
+ }, []) || [];
1128
+
1125
1129
  getAllEndedChats.mutate({
1126
1130
  startDate,
1127
1131
  endDate,
1128
- customerSupportIds: selection?.map((s) => s.value) || [],
1132
+ customerSupportIds: customerSupportIds,
1129
1133
  pagination: {pageIndex: 0, pageSize: pagination.pageSize},
1130
1134
  sorting,
1131
1135
  search,