@buerokratt-ria/common-gui-components 0.0.48 → 0.0.50
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.50] - 04.05.2026
|
|
8
|
+
|
|
9
|
+
- Added authenticated person column
|
|
10
|
+
|
|
11
|
+
## [0.0.49] - 29.04.2026
|
|
12
|
+
|
|
13
|
+
- Fixed chat history XLSX download to use the S3 signed URL returned by the API instead of the previous base64 payload.
|
|
14
|
+
|
|
7
15
|
## [0.0.48] - 23.04.2026
|
|
8
16
|
|
|
9
17
|
- Added chats preserve feature
|
package/package.json
CHANGED
package/services/file.ts
CHANGED
|
@@ -1,42 +1,11 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
const
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
};
|
|
12
|
-
|
|
13
|
-
export const saveFile = async (base64String: string, fileName: `${string}.${string}`, type: string) => {
|
|
14
|
-
const bytes = base64ToUint8Array(base64String);
|
|
15
|
-
const blob = new Blob([bytes], {
|
|
16
|
-
type: type,
|
|
17
|
-
});
|
|
18
|
-
|
|
19
|
-
const extension = fileName.split('.').pop();
|
|
20
|
-
|
|
21
|
-
if (window.showSaveFilePicker) {
|
|
22
|
-
const handle = await window.showSaveFilePicker({
|
|
23
|
-
suggestedName: fileName,
|
|
24
|
-
types: [
|
|
25
|
-
{
|
|
26
|
-
description: extension!.toUpperCase() + ' file',
|
|
27
|
-
accept: { [type]: [`.${extension}` as `.${string}`] },
|
|
28
|
-
},
|
|
29
|
-
],
|
|
30
|
-
});
|
|
31
|
-
const writable = await handle.createWritable();
|
|
32
|
-
await writable.write(blob);
|
|
33
|
-
writable.close();
|
|
34
|
-
} else {
|
|
35
|
-
const url = window.URL.createObjectURL(blob);
|
|
36
|
-
const a = document.createElement('a');
|
|
37
|
-
a.href = url;
|
|
38
|
-
a.download = fileName;
|
|
39
|
-
a.click();
|
|
40
|
-
window.URL.revokeObjectURL(url);
|
|
41
|
-
}
|
|
1
|
+
export const saveFile = async (
|
|
2
|
+
fileUrl: string,
|
|
3
|
+
fileName: `${string}.${string}`,
|
|
4
|
+
) => {
|
|
5
|
+
const a = document.createElement('a');
|
|
6
|
+
a.href = fileUrl;
|
|
7
|
+
a.download = fileName;
|
|
8
|
+
document.body.appendChild(a);
|
|
9
|
+
a.click();
|
|
10
|
+
a.remove();
|
|
42
11
|
};
|
|
@@ -739,21 +739,15 @@ const ChatHistory: FC<PropsWithChildren<HistoryProps>> = ({
|
|
|
739
739
|
}
|
|
740
740
|
),
|
|
741
741
|
columnHelper.accessor(
|
|
742
|
-
(row) =>
|
|
742
|
+
(row) => {
|
|
743
|
+
const hasData = row.endUserFirstName || row.endUserLastName || row.endUserId || row.contactsMessage;
|
|
744
|
+
return hasData ? t('global.yes') : '';
|
|
745
|
+
},
|
|
743
746
|
{
|
|
744
|
-
id:
|
|
745
|
-
header: t('
|
|
747
|
+
id: 'authenticatedPerson',
|
|
748
|
+
header: t('chat.history.authenticatedPerson') ?? '',
|
|
746
749
|
}
|
|
747
750
|
),
|
|
748
|
-
columnHelper.accessor('endUserId', {
|
|
749
|
-
id: 'endUserId',
|
|
750
|
-
header: t('global.idCode') ?? '',
|
|
751
|
-
}),
|
|
752
|
-
columnHelper.accessor('contactsMessage', {
|
|
753
|
-
id: 'contactsMessage',
|
|
754
|
-
header: t('chat.history.contact') ?? '',
|
|
755
|
-
cell: (props) => (props.getValue() ? t('global.yes') : t('global.no')),
|
|
756
|
-
}),
|
|
757
751
|
columnHelper.accessor('comment', {
|
|
758
752
|
id: 'comment',
|
|
759
753
|
header: t('chat.history.comment') ?? '',
|
|
@@ -1024,15 +1018,15 @@ const ChatHistory: FC<PropsWithChildren<HistoryProps>> = ({
|
|
|
1024
1018
|
customerSupportIds: passedCustomerSupportIds,
|
|
1025
1019
|
});
|
|
1026
1020
|
|
|
1021
|
+
const downloadData = response.data.data ?? response.data;
|
|
1027
1022
|
|
|
1028
1023
|
await saveFile(
|
|
1029
|
-
|
|
1024
|
+
downloadData.url,
|
|
1030
1025
|
'history.xlsx',
|
|
1031
|
-
'application/vnd.openxmlformats-officedocument.spreadsheetml.sheet'
|
|
1032
1026
|
);
|
|
1033
1027
|
|
|
1034
1028
|
} catch (error) {
|
|
1035
|
-
console.error('Error
|
|
1029
|
+
console.error('Error downloading chat history file:', error);
|
|
1036
1030
|
} finally {
|
|
1037
1031
|
setLoading(false);
|
|
1038
1032
|
}
|