Skip to content

Commit 73e94fa

Browse files
committed
chore: refactor message service
1 parent f256e86 commit 73e94fa

21 files changed

+1784
-506
lines changed

packages/ai-chat/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -150,7 +150,7 @@
150150
"postinstall": "ibmtelemetry --config=telemetry.yml",
151151
"start": "concurrently \"rollup -c ./tasks/rollup.aichat.js --watch\" \"typedoc --watch\" \"serve dist/docs/carbon-tsdocs -l 5001 --no-port-switching\" \"wait-on dist/docs/carbon-tsdocs/index.html && open http://localhost:5001\"",
152152
"telemetry:config": "npx -y @ibm/telemetry-js-config-generator generate --id ef967584-5788-47d4-b9c2-a60da7ad901d --endpoint https://www-api.ibm.com/ibm-telemetry/v1/metrics --files ./src --wc",
153-
"test": "jest"
153+
"test": "jest --coverage --coverageReporters=text --coverageReporters=text-summary"
154154
},
155155
"repository": {
156156
"type": "git",

packages/ai-chat/src/chat/components-legacy/humanAgent/AvailabilityMessage.tsx

Lines changed: 14 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,6 @@ import React from "react";
1111
import { FormattedMessage } from "react-intl";
1212

1313
import { isNil } from "../../utils/lang/langUtils";
14-
import { addHTMLSupport } from "../../utils/languages";
1514
import RichText from "../responseTypes/util/RichText";
1615
import { AgentAvailability } from "../../../types/config/ServiceDeskConfig";
1716
import { LanguagePack } from "../../../types/config/PublicConfig";
@@ -56,4 +55,18 @@ function AvailabilityMessage({
5655
);
5756
}
5857

58+
function addHTMLSupport(values: Record<string, any>) {
59+
values.b = handleBTag;
60+
values.br = handleBRTag;
61+
return values;
62+
}
63+
64+
function handleBTag(chunks: any) {
65+
return <b>{chunks}</b>;
66+
}
67+
68+
function handleBRTag() {
69+
return <br />;
70+
}
71+
5972
export { AvailabilityMessage };

packages/ai-chat/src/chat/components-legacy/responseTypes/datePicker/DatePickerComponent.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@ import {
3434
toUserDateFormat,
3535
} from "../../../utils/dateUtils";
3636
import { uuid, UUIDType } from "../../../utils/lang/uuid";
37-
import { loadDayjsLocale } from "../../../utils/languages";
37+
import { loadDayjsLocale } from "../../../utils/languageUtils";
3838
import { createMessageRequestForDate } from "../../../utils/messageUtils";
3939
import { consoleError } from "../../../utils/miscUtils";
4040
import {

packages/ai-chat/src/chat/languages/en.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@
2121
"errors_somethingWrong": "Something went wrong",
2222
"input_ariaLabel": "Message to send",
2323
"input_placeholder": "Type something...",
24-
"input_buttonLabel": "Click to send message",
24+
"input_buttonLabel": "Send message",
2525
"input_uploadButtonLabel": "Add files to upload",
2626
"window_title": "Chat window",
2727
"window_ariaChatRegion": "Chat",

0 commit comments

Comments
 (0)