@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
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@buerokratt-ria/common-gui-components",
3
- "version": "0.0.48",
3
+ "version": "0.0.50",
4
4
  "description": "Common GUI components and pre defined templates.",
5
5
  "main": "index.ts",
6
6
  "author": "ExiRai",
package/services/file.ts CHANGED
@@ -1,42 +1,11 @@
1
- /**
2
- * Converts a base64 string to a Uint8Array (browser-compatible alternative to Buffer)
3
- */
4
- const base64ToUint8Array = (base64: string): Uint8Array<ArrayBuffer> => {
5
- const binaryString = atob(base64);
6
- const bytes = new Uint8Array(binaryString.length);
7
- for (let i = 0; i < binaryString.length; i++) {
8
- bytes[i] = binaryString.charCodeAt(i);
9
- }
10
- return bytes;
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) => `${row.endUserFirstName} ${row.endUserLastName}`,
742
+ (row) => {
743
+ const hasData = row.endUserFirstName || row.endUserLastName || row.endUserId || row.contactsMessage;
744
+ return hasData ? t('global.yes') : '';
745
+ },
743
746
  {
744
- id: `endUserName`,
745
- header: t('global.name') ?? '',
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
- response.data.base64String,
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 getting CSV file:', error);
1029
+ console.error('Error downloading chat history file:', error);
1036
1030
  } finally {
1037
1031
  setLoading(false);
1038
1032
  }
@@ -162,6 +162,7 @@
162
162
  "endTime": "End time",
163
163
  "csaName": "Customer support name",
164
164
  "contact": "Contact",
165
+ "authenticatedPerson": "Authenticated person",
165
166
  "comment": "Comment",
166
167
  "label": "Label",
167
168
  "nps": "NPS",
@@ -162,6 +162,7 @@
162
162
  "endTime": "Lõppaeg",
163
163
  "csaName": "Nõustaja nimi",
164
164
  "contact": "Kontaktandmed",
165
+ "authenticatedPerson": "Autenditud isik",
165
166
  "comment": "Kommentaar",
166
167
  "label": "Märksõna",
167
168
  "nps": "Soovitusindeks",