@buerokratt-ria/common-gui-components 0.0.26 → 0.0.28
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 +8 -0
- package/buerokratt-ria-common-gui-components-0.0.27.tgz +0 -0
- package/buerokratt-ria-common-gui-components-0.0.28.tgz +0 -0
- package/package.json +1 -1
- package/services/api.ts +16 -1
- package/templates/history-page/src/index.tsx +7 -4
- package/buerokratt-ria-common-gui-components-0.0.26.tgz +0 -0
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.28] - 03-10-2025
|
|
8
|
+
|
|
9
|
+
- Defined new endpoint specifically for ended chats. REACT_APP_RUUTER_PRIVATE_ENDED_API_URL
|
|
10
|
+
|
|
11
|
+
## [0.0.27] - 02-10-2025
|
|
12
|
+
|
|
13
|
+
- Adding missing showTest with default to true if undefined.
|
|
14
|
+
|
|
7
15
|
## [0.0.26] - 15-09-2025
|
|
8
16
|
|
|
9
17
|
- Added download button do download chat history with currently selected criteriasa
|
|
Binary file
|
|
Binary file
|
package/package.json
CHANGED
package/services/api.ts
CHANGED
|
@@ -20,6 +20,16 @@ const apiDev = axios.create({
|
|
|
20
20
|
withCredentials: true,
|
|
21
21
|
});
|
|
22
22
|
|
|
23
|
+
const apiDevEnded = axios.create({
|
|
24
|
+
baseURL: import.meta.env.REACT_APP_RUUTER_PRIVATE_ENDED_API_URL,
|
|
25
|
+
headers: {
|
|
26
|
+
Accept: 'application/json',
|
|
27
|
+
'Content-Type': 'application/json',
|
|
28
|
+
},
|
|
29
|
+
withCredentials: true,
|
|
30
|
+
});
|
|
31
|
+
|
|
32
|
+
|
|
23
33
|
const AxiosInterceptor = ({ children }) => {
|
|
24
34
|
const { t } = useTranslation();
|
|
25
35
|
|
|
@@ -71,4 +81,9 @@ apiDev.interceptors.request.use(
|
|
|
71
81
|
handleRequestError
|
|
72
82
|
);
|
|
73
83
|
|
|
74
|
-
|
|
84
|
+
apiDevEnded.interceptors.request.use(
|
|
85
|
+
(axiosRequest) => axiosRequest,
|
|
86
|
+
handleRequestError
|
|
87
|
+
);
|
|
88
|
+
|
|
89
|
+
export { api, apiDev, apiDevEnded,AxiosInterceptor };
|
|
@@ -25,7 +25,7 @@ import {
|
|
|
25
25
|
} from '../../../ui-components';
|
|
26
26
|
|
|
27
27
|
import {Chat as ChatType, CHAT_EVENTS, CHAT_STATUS} from '../../../types/chat';
|
|
28
|
-
import {apiDev} from '../../../services';
|
|
28
|
+
import {apiDev, apiDevEnded} from '../../../services';
|
|
29
29
|
import {Controller, useForm} from 'react-hook-form';
|
|
30
30
|
import {useLocation, useSearchParams} from 'react-router-dom';
|
|
31
31
|
import {unifyDateFromat} from './unfiyDate';
|
|
@@ -121,6 +121,8 @@ const ChatHistory: FC<PropsWithChildren<HistoryProps>> = ({
|
|
|
121
121
|
const currentDomains = useStore.getState().userDomains;
|
|
122
122
|
const multiDomainEnabled = import.meta.env.REACT_APP_ENABLE_MULTI_DOMAIN?.toLowerCase() === 'true';
|
|
123
123
|
const testMessageEnabled = import.meta.env.REACT_APP_SHOW_TEST_MESSAGE?.toLowerCase() === 'true';
|
|
124
|
+
const envVal = import.meta.env.REACT_APP_SHOW_TEST_CONVERSATIONS;
|
|
125
|
+
const showTest = envVal === undefined ? true : envVal.toLowerCase() === 'true';
|
|
124
126
|
const [loading, setLoading] = useState(false);
|
|
125
127
|
|
|
126
128
|
const parseDateParam = (dateString: string | null) => {
|
|
@@ -296,11 +298,12 @@ const ChatHistory: FC<PropsWithChildren<HistoryProps>> = ({
|
|
|
296
298
|
sortBy = `${sorting[0].id} ${sortType}`;
|
|
297
299
|
}
|
|
298
300
|
|
|
299
|
-
return
|
|
301
|
+
return apiDevEnded.post('agents/chats/ended', {
|
|
300
302
|
customerSupportIds: data.customerSupportIds,
|
|
301
303
|
startDate: formatISO(startOfDay(new Date(data.startDate))),
|
|
302
304
|
endDate: formatISO(endOfDay(new Date(data.endDate))),
|
|
303
305
|
urls: getDomainsArray(currentDomains),
|
|
306
|
+
showTest: showTest,
|
|
304
307
|
page: data.pagination.pageIndex + 1,
|
|
305
308
|
page_size: data.pagination.pageSize,
|
|
306
309
|
sorting: sortBy,
|
|
@@ -899,7 +902,7 @@ const ChatHistory: FC<PropsWithChildren<HistoryProps>> = ({
|
|
|
899
902
|
sortBy = `${sorting[0].id} ${sortType}`;
|
|
900
903
|
}
|
|
901
904
|
|
|
902
|
-
const chats = await
|
|
905
|
+
const chats = await apiDevEnded.post('agents/chats/ended', {
|
|
903
906
|
customerSupportIds: passedCustomerSupportIds,
|
|
904
907
|
startDate: formatISO(startOfDay(new Date(startDate))),
|
|
905
908
|
endDate: formatISO(endOfDay(new Date(endDate))),
|
|
@@ -917,7 +920,7 @@ const ChatHistory: FC<PropsWithChildren<HistoryProps>> = ({
|
|
|
917
920
|
t
|
|
918
921
|
);
|
|
919
922
|
|
|
920
|
-
const response = await
|
|
923
|
+
const response = await apiDevEnded.post('chats/ended/download', {
|
|
921
924
|
headers, rows, chatIds
|
|
922
925
|
});
|
|
923
926
|
|
|
Binary file
|