@buerokratt-ria/common-gui-components 0.0.10 → 0.0.12
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,15 @@ 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.12] - 22-04-2025
|
|
8
|
+
|
|
9
|
+
- Modified Markdowify Logic to handle the case only the list line ends with : followed by space
|
|
10
|
+
|
|
11
|
+
## [0.0.11] - 01-04-2025
|
|
12
|
+
|
|
13
|
+
- Updated preference page loading
|
|
14
|
+
- Updated date formating for ended chats to hold only date without time.
|
|
15
|
+
|
|
7
16
|
## [0.0.10] - 14-04-2025
|
|
8
17
|
|
|
9
18
|
- Changed dialog visibility
|
package/package.json
CHANGED
|
@@ -131,12 +131,17 @@ const ChatHistory: FC<PropsWithChildren<HistoryProps>> = ({user, toastContext, o
|
|
|
131
131
|
page_name: window.location.pathname,
|
|
132
132
|
},
|
|
133
133
|
});
|
|
134
|
-
if (response.data
|
|
135
|
-
const
|
|
134
|
+
if (response.data) {
|
|
135
|
+
const currentColumns = response.data.selectedColumns;
|
|
136
|
+
const newPageResults = response.data.pageResults !== undefined ? response.data.pageResults : 10;
|
|
137
|
+
const updatedPagination = updatePagePreference(newPageResults);
|
|
138
|
+
|
|
139
|
+
let newSelectedColumns = [];
|
|
140
|
+
if(currentColumns !== undefined && currentColumns.length > 0 && currentColumns[0] !== "") {
|
|
141
|
+
newSelectedColumns = currentColumns;
|
|
142
|
+
}
|
|
136
143
|
setSelectedColumns(newSelectedColumns)
|
|
137
|
-
|
|
138
|
-
response.data.pageResults ?? 10
|
|
139
|
-
);
|
|
144
|
+
|
|
140
145
|
setCounterKey(counterKey + 1)
|
|
141
146
|
getAllEndedChats.mutate({
|
|
142
147
|
startDate: format(new Date(startDate), 'yyyy-MM-dd'),
|
|
@@ -148,7 +153,7 @@ const ChatHistory: FC<PropsWithChildren<HistoryProps>> = ({user, toastContext, o
|
|
|
148
153
|
});
|
|
149
154
|
}
|
|
150
155
|
} catch (err) {
|
|
151
|
-
console.error('Failed to fetch data');
|
|
156
|
+
console.error('Failed to fetch data', err);
|
|
152
157
|
}
|
|
153
158
|
};
|
|
154
159
|
|
|
@@ -211,8 +216,8 @@ const ChatHistory: FC<PropsWithChildren<HistoryProps>> = ({user, toastContext, o
|
|
|
211
216
|
|
|
212
217
|
return apiDev.post('agents/chats/ended', {
|
|
213
218
|
customerSupportIds: data.customerSupportIds,
|
|
214
|
-
startDate: data.startDate,
|
|
215
|
-
endDate: data.endDate,
|
|
219
|
+
startDate: format(new Date(data.startDate), 'yyyy-MM-dd'),
|
|
220
|
+
endDate: format(new Date(data.endDate), 'yyyy-MM-dd'),
|
|
216
221
|
page: data.pagination.pageIndex + 1,
|
|
217
222
|
page_size: data.pagination.pageSize,
|
|
218
223
|
sorting: sortBy,
|
|
@@ -41,6 +41,8 @@ const LinkPreview: React.FC<{
|
|
|
41
41
|
);
|
|
42
42
|
};
|
|
43
43
|
|
|
44
|
+
const hasSpecialFormat = (m: string) => m.includes("\n\n") && m.indexOf(".") > 0 && m.indexOf(":") > m.indexOf(".");
|
|
45
|
+
|
|
44
46
|
const Markdownify: React.FC<MarkdownifyProps> = ({ message, sanitizeLinks = false }) => (
|
|
45
47
|
<div className={"reset"}>
|
|
46
48
|
<Markdown
|
|
@@ -58,10 +60,8 @@ const Markdownify: React.FC<MarkdownifyProps> = ({ message, sanitizeLinks = fals
|
|
|
58
60
|
}}
|
|
59
61
|
>
|
|
60
62
|
{message
|
|
61
|
-
?.replace(/&#x([0-9A-Fa-f]+);/g, (_, hex) =>
|
|
62
|
-
|
|
63
|
-
})
|
|
64
|
-
.replace(/(?<=\n)\d+\.\s/g, "\n\n$&") ?? ""}
|
|
63
|
+
?.replace(/&#x([0-9A-Fa-f]+);/g, (_, hex) => String.fromCharCode(parseInt(hex, 16)))
|
|
64
|
+
?.replace(/(?<=\n)\d+\.\s/g, hasSpecialFormat(message) ? "\n\n$&" : "$&") ?? ""}
|
|
65
65
|
</Markdown>
|
|
66
66
|
</div>
|
|
67
67
|
);
|