@buerokratt-ria/common-gui-components 0.0.45 → 0.0.47
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.47] - 21.04.2026
|
|
8
|
+
|
|
9
|
+
- Added total chat counter under chat history
|
|
10
|
+
|
|
11
|
+
## [0.0.46] - 10.04.2026
|
|
12
|
+
|
|
13
|
+
- Fixed CHAT_STATUS import
|
|
14
|
+
|
|
7
15
|
## [0.0.45] - 07.04.2026
|
|
8
16
|
|
|
9
17
|
- Enhanced downloadChatHistory
|
package/package.json
CHANGED
|
@@ -106,6 +106,7 @@ const ChatHistory: FC<PropsWithChildren<HistoryProps>> = ({
|
|
|
106
106
|
right: ['detail'],
|
|
107
107
|
};
|
|
108
108
|
const [totalPages, setTotalPages] = useState<number>(1);
|
|
109
|
+
const [totalCount, setTotalCount] = useState<number | null>(null);
|
|
109
110
|
const [initialLoad, setInitialLoad] = useState<boolean>(true);
|
|
110
111
|
const [filteredEndedChatsList, setFilteredEndedChatsList] = useState<
|
|
111
112
|
ChatType[]
|
|
@@ -331,6 +332,7 @@ const ChatHistory: FC<PropsWithChildren<HistoryProps>> = ({
|
|
|
331
332
|
});
|
|
332
333
|
filterChatsList(res.data.response ?? []);
|
|
333
334
|
setTotalPages(res?.data?.response[0]?.totalPages ?? 1);
|
|
335
|
+
setTotalCount(res?.data?.response[0]?.totalCount ?? null);
|
|
334
336
|
},
|
|
335
337
|
});
|
|
336
338
|
|
|
@@ -972,7 +974,7 @@ const ChatHistory: FC<PropsWithChildren<HistoryProps>> = ({
|
|
|
972
974
|
return (
|
|
973
975
|
<>
|
|
974
976
|
{displayTitle && (
|
|
975
|
-
<h1>{t('chat.history.title')}</h1>
|
|
977
|
+
<h1>{t('chat.history.title')}{totalCount === null ? '' : ` (${totalCount.toLocaleString('et-EE')})`}</h1>
|
|
976
978
|
)}
|
|
977
979
|
|
|
978
980
|
{showDownload && (
|
|
@@ -1191,6 +1193,7 @@ const ChatHistory: FC<PropsWithChildren<HistoryProps>> = ({
|
|
|
1191
1193
|
}}
|
|
1192
1194
|
isClientSide={false}
|
|
1193
1195
|
pagesCount={totalPages}
|
|
1196
|
+
totalCountLabel={totalCount === null ? null : `${t('chat.history.title')} ${totalCount.toLocaleString('et-EE')}`}
|
|
1194
1197
|
/>
|
|
1195
1198
|
</Card>
|
|
1196
1199
|
</div>
|
package/types/chat.ts
CHANGED
|
@@ -55,6 +55,7 @@ type DataTableProps = {
|
|
|
55
55
|
pagesCount?: number;
|
|
56
56
|
meta?: TableMeta<any>;
|
|
57
57
|
selectedRow?: (row: Row<any>) => boolean;
|
|
58
|
+
totalCountLabel?: string | null;
|
|
58
59
|
};
|
|
59
60
|
|
|
60
61
|
type ColumnMeta = {
|
|
@@ -115,6 +116,7 @@ const DataTable: FC<DataTableProps> = ({
|
|
|
115
116
|
pagesCount,
|
|
116
117
|
meta,
|
|
117
118
|
selectedRow,
|
|
119
|
+
totalCountLabel,
|
|
118
120
|
}) => {
|
|
119
121
|
const id = useId();
|
|
120
122
|
const { t } = useTranslation();
|
|
@@ -408,6 +410,7 @@ const DataTable: FC<DataTableProps> = ({
|
|
|
408
410
|
</div>
|
|
409
411
|
)}
|
|
410
412
|
<div className="data-table__page-size">
|
|
413
|
+
{totalCountLabel && <><span>{totalCountLabel}</span><span>|</span></>}
|
|
411
414
|
<label htmlFor={id}>{t('global.resultCount')}</label>
|
|
412
415
|
<select
|
|
413
416
|
id={id}
|
|
@@ -416,7 +419,7 @@ const DataTable: FC<DataTableProps> = ({
|
|
|
416
419
|
table.setPageSize(Number(e.target.value));
|
|
417
420
|
}}
|
|
418
421
|
>
|
|
419
|
-
{[10, 20, 30, 40, 50].map((pageSize) => (
|
|
422
|
+
{[10, 20, 30, 40, 50, 100, 150, 200].map((pageSize) => (
|
|
420
423
|
<option key={pageSize} value={pageSize}>
|
|
421
424
|
{pageSize}
|
|
422
425
|
</option>
|
|
@@ -5,7 +5,7 @@ import { MdOutlineModeEditOutline, MdOutlineSave } from "react-icons/md";
|
|
|
5
5
|
|
|
6
6
|
import { Button, FormSelect, FormTextarea, Icon, Track } from "../";
|
|
7
7
|
import { ReactComponent as BykLogoWhite } from "../../assets/logo-white.svg";
|
|
8
|
-
import { CHAT_EVENTS, Chat as ChatType, BACKOFFICE_NAME } from "../../types/chat";
|
|
8
|
+
import { CHAT_EVENTS, Chat as ChatType, BACKOFFICE_NAME, CHAT_STATUS } from "../../types/chat";
|
|
9
9
|
import { Message } from "../../types/message";
|
|
10
10
|
import ChatMessage from "./ChatMessage";
|
|
11
11
|
import "./HistoricalChat.scss";
|