@servicetitan/titan-chatbot-ui 3.1.1 → 3.1.3
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 +24 -0
- package/dist/components/chatbot/__tests-cy__/chatbot-help-center.test.js +1 -1
- package/dist/components/chatbot/__tests-cy__/chatbot-help-center.test.js.map +1 -1
- package/dist/components/chatbot/__tests-cy__/chatbot-live.test.js +1 -1
- package/dist/components/chatbot/__tests-cy__/chatbot-live.test.js.map +1 -1
- package/dist/components/chatbot/__tests-cy__/chatbot-titan-chatbot.test.js +1 -1
- package/dist/components/chatbot/__tests-cy__/chatbot-titan-chatbot.test.js.map +1 -1
- package/dist/components/chatbot/__tests-cy__/chatbot.test.js +1 -1
- package/dist/components/chatbot/__tests-cy__/chatbot.test.js.map +1 -1
- package/dist/components/chatbot/dialog/__tests-cy__/chatbot-restart-dialog.test.js +1 -1
- package/dist/components/chatbot/dialog/__tests-cy__/chatbot-restart-dialog.test.js.map +1 -1
- package/dist/components/chatbot/dialog/__tests-cy__/chatbot-restart-link.test.js +1 -1
- package/dist/components/chatbot/dialog/__tests-cy__/chatbot-restart-link.test.js.map +1 -1
- package/dist/components/chatbot/feedback/__tests-cy__/chatbot-message-feedback-form-guardrail.test.js +1 -1
- package/dist/components/chatbot/feedback/__tests-cy__/chatbot-message-feedback-form-guardrail.test.js.map +1 -1
- package/dist/components/chatbot/feedback/__tests-cy__/chatbot-message-feedback-form.test.js +1 -1
- package/dist/components/chatbot/feedback/__tests-cy__/chatbot-message-feedback-form.test.js.map +1 -1
- package/dist/components/chatbot/feedback/__tests-cy__/chatbot-message-feedback-popover.test.js +1 -1
- package/dist/components/chatbot/feedback/__tests-cy__/chatbot-message-feedback-popover.test.js.map +1 -1
- package/dist/components/chatbot/feedback/__tests-cy__/chatbot-session-feedback-modal.test.js +1 -1
- package/dist/components/chatbot/feedback/__tests-cy__/chatbot-session-feedback-modal.test.js.map +1 -1
- package/dist/components/chatbot/feedback/chatbot-message-feedback-form-guardrail.d.ts.map +1 -1
- package/dist/components/chatbot/feedback/chatbot-message-feedback-form-guardrail.js +10 -3
- package/dist/components/chatbot/feedback/chatbot-message-feedback-form-guardrail.js.map +1 -1
- package/dist/components/chatbot/feedback/chatbot-message-feedback-form.d.ts.map +1 -1
- package/dist/components/chatbot/feedback/chatbot-message-feedback-form.js +13 -1
- package/dist/components/chatbot/feedback/chatbot-message-feedback-form.js.map +1 -1
- package/dist/components/chatbot/feedback/chatbot-session-feedback-modal.d.ts.map +1 -1
- package/dist/components/chatbot/feedback/chatbot-session-feedback-modal.js +3 -1
- package/dist/components/chatbot/feedback/chatbot-session-feedback-modal.js.map +1 -1
- package/dist/components/chatbot/filters/__tests-cy__/chatbot-filters.test.js +1 -1
- package/dist/components/chatbot/filters/__tests-cy__/chatbot-filters.test.js.map +1 -1
- package/dist/components/chatbot/messages/__tests-cy__/chatbot-links.test.js +1 -1
- package/dist/components/chatbot/messages/__tests-cy__/chatbot-links.test.js.map +1 -1
- package/dist/components/chatbot/messages/__tests-cy__/chatbot-message-answer-readonly.test.js +1 -1
- package/dist/components/chatbot/messages/__tests-cy__/chatbot-message-answer-readonly.test.js.map +1 -1
- package/dist/components/chatbot/messages/__tests-cy__/chatbot-message-answer.test.js +1 -1
- package/dist/components/chatbot/messages/__tests-cy__/chatbot-message-answer.test.js.map +1 -1
- package/dist/components/chatbot/messages/__tests-cy__/chatbot-message-typing.test.js +1 -1
- package/dist/components/chatbot/messages/__tests-cy__/chatbot-message-typing.test.js.map +1 -1
- package/package.json +8 -10
- package/src/components/chatbot/__tests-cy__/chatbot-help-center.test.tsx +1 -1
- package/src/components/chatbot/__tests-cy__/chatbot-live.test.tsx +1 -1
- package/src/components/chatbot/__tests-cy__/chatbot-titan-chatbot.test.tsx +1 -1
- package/src/components/chatbot/__tests-cy__/chatbot.test.tsx +1 -1
- package/src/components/chatbot/dialog/__tests-cy__/chatbot-restart-dialog.test.tsx +1 -1
- package/src/components/chatbot/dialog/__tests-cy__/chatbot-restart-link.test.tsx +1 -1
- package/src/components/chatbot/feedback/__tests-cy__/chatbot-message-feedback-form-guardrail.test.tsx +1 -1
- package/src/components/chatbot/feedback/__tests-cy__/chatbot-message-feedback-form.test.tsx +1 -1
- package/src/components/chatbot/feedback/__tests-cy__/chatbot-message-feedback-popover.test.tsx +1 -1
- package/src/components/chatbot/feedback/__tests-cy__/chatbot-session-feedback-modal.test.tsx +1 -1
- package/src/components/chatbot/feedback/chatbot-message-feedback-form-guardrail.tsx +26 -6
- package/src/components/chatbot/feedback/chatbot-message-feedback-form.tsx +19 -7
- package/src/components/chatbot/feedback/chatbot-session-feedback-modal.tsx +6 -2
- package/src/components/chatbot/filters/__tests-cy__/chatbot-filters.test.tsx +1 -1
- package/src/components/chatbot/messages/__tests-cy__/chatbot-links.test.tsx +1 -1
- package/src/components/chatbot/messages/__tests-cy__/chatbot-message-answer-readonly.test.tsx +1 -1
- package/src/components/chatbot/messages/__tests-cy__/chatbot-message-answer.test.tsx +1 -1
- package/src/components/chatbot/messages/__tests-cy__/chatbot-message-typing.test.tsx +1 -1
- package/tsconfig.json +1 -1
- package/tsconfig.tsbuildinfo +1 -1
|
@@ -3,7 +3,7 @@ import { useDependencies } from '@servicetitan/react-ioc';
|
|
|
3
3
|
import { MessageFeedbackStore } from '@servicetitan/titan-chatbot-api';
|
|
4
4
|
import classNames from 'classnames';
|
|
5
5
|
import { observer } from 'mobx-react';
|
|
6
|
-
import { FC } from 'react';
|
|
6
|
+
import { ChangeEvent, FC } from 'react';
|
|
7
7
|
import * as Styles from './chatbot-message-feedback-form.module.less';
|
|
8
8
|
|
|
9
9
|
export const ChatbotMessageFeedbackForm: FC = observer(() => {
|
|
@@ -14,35 +14,45 @@ export const ChatbotMessageFeedbackForm: FC = observer(() => {
|
|
|
14
14
|
label="Answer is unrelated to my question"
|
|
15
15
|
className={Styles.formItem}
|
|
16
16
|
value={store.formState.$.unrelated.value}
|
|
17
|
-
onChange={
|
|
17
|
+
onChange={(_, checked) => {
|
|
18
|
+
store.formState.$.unrelated.onChange(!!checked);
|
|
19
|
+
}}
|
|
18
20
|
data-cy="titan-chatbot-message-feedback-form-unrelated"
|
|
19
21
|
/>
|
|
20
22
|
<Form.Checkbox
|
|
21
23
|
label="Answer is unclear, not sure what it means"
|
|
22
24
|
className={Styles.formItem}
|
|
23
25
|
value={store.formState.$.unclear.value}
|
|
24
|
-
onChange={
|
|
26
|
+
onChange={(_, checked) => {
|
|
27
|
+
store.formState.$.unclear.onChange(!!checked);
|
|
28
|
+
}}
|
|
25
29
|
data-cy="titan-chatbot-message-feedback-form-unclear"
|
|
26
30
|
/>
|
|
27
31
|
<Form.Checkbox
|
|
28
32
|
label="Answer doesn’t fully address the question"
|
|
29
33
|
className={Styles.formItem}
|
|
30
34
|
value={store.formState.$.notFull.value}
|
|
31
|
-
onChange={
|
|
35
|
+
onChange={(_, checked) => {
|
|
36
|
+
store.formState.$.notFull.onChange(!!checked);
|
|
37
|
+
}}
|
|
32
38
|
data-cy="titan-chatbot-message-feedback-form-not-full"
|
|
33
39
|
/>
|
|
34
40
|
<Form.Checkbox
|
|
35
41
|
label="Answer is incorrect or doesn’t work"
|
|
36
42
|
className={Styles.formItem}
|
|
37
43
|
value={store.formState.$.incorrect.value}
|
|
38
|
-
onChange={
|
|
44
|
+
onChange={(_, checked) => {
|
|
45
|
+
store.formState.$.incorrect.onChange(!!checked);
|
|
46
|
+
}}
|
|
39
47
|
data-cy="titan-chatbot-message-feedback-form-incorrect"
|
|
40
48
|
/>
|
|
41
49
|
<Form.Checkbox
|
|
42
50
|
label="Other"
|
|
43
51
|
className={Styles.formItem}
|
|
44
52
|
value={store.formState.$.other.value}
|
|
45
|
-
onChange={
|
|
53
|
+
onChange={(_, checked) => {
|
|
54
|
+
store.formState.$.other.onChange(!!checked);
|
|
55
|
+
}}
|
|
46
56
|
data-cy="titan-chatbot-message-feedback-form-other"
|
|
47
57
|
/>
|
|
48
58
|
{store.isTextAreaVisible && (
|
|
@@ -51,7 +61,9 @@ export const ChatbotMessageFeedbackForm: FC = observer(() => {
|
|
|
51
61
|
className={classNames(Styles.formItem, Styles.textArea)}
|
|
52
62
|
error={store.formState.$.otherComment.error}
|
|
53
63
|
value={store.formState.$.otherComment.value}
|
|
54
|
-
onChange={
|
|
64
|
+
onChange={(e: ChangeEvent<HTMLTextAreaElement>) => {
|
|
65
|
+
store.formState.$.otherComment.onChange(e.currentTarget.value);
|
|
66
|
+
}}
|
|
55
67
|
onBlur={store.formState.$.otherComment.enableAutoValidationAndValidate}
|
|
56
68
|
data-cy="titan-chatbot-message-feedback-form-other-comment"
|
|
57
69
|
/>
|
|
@@ -2,7 +2,7 @@ import { BodyText, Button, ButtonGroup, Form, Modal, Stack } from '@servicetitan
|
|
|
2
2
|
import { provide, useDependencies } from '@servicetitan/react-ioc';
|
|
3
3
|
import { CHATBOT_UI_STORE_TOKEN, SessionFeedbackStore } from '@servicetitan/titan-chatbot-api';
|
|
4
4
|
import { observer } from 'mobx-react';
|
|
5
|
-
import { FC, useCallback } from 'react';
|
|
5
|
+
import { ChangeEvent, FC, useCallback } from 'react';
|
|
6
6
|
|
|
7
7
|
export const ChatbotSessionFeedbackModal: FC<{ onClose: () => void }> = provide({
|
|
8
8
|
singletons: [SessionFeedbackStore],
|
|
@@ -85,7 +85,11 @@ export const ChatbotSessionFeedbackModal: FC<{ onClose: () => void }> = provide(
|
|
|
85
85
|
label="Tell us more"
|
|
86
86
|
maxRows={3}
|
|
87
87
|
value={chatbotFeedbackStore.formState.$.comment.value}
|
|
88
|
-
onChange={
|
|
88
|
+
onChange={(e: ChangeEvent<HTMLTextAreaElement>) => {
|
|
89
|
+
chatbotFeedbackStore.formState.$.comment.onChange(
|
|
90
|
+
e.currentTarget.value
|
|
91
|
+
);
|
|
92
|
+
}}
|
|
89
93
|
data-cy="titan-chatbot-session-feedback-comment"
|
|
90
94
|
/>
|
|
91
95
|
</Stack>
|
package/src/components/chatbot/messages/__tests-cy__/chatbot-message-answer-readonly.test.tsx
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { runChatbotMessageAnswerReadonlySharedTests } from '@servicetitan/
|
|
1
|
+
import { runChatbotMessageAnswerReadonlySharedTests } from '@servicetitan/cypress-shared';
|
|
2
2
|
import { ChatbotMessageAnswerReadonly } from '../chatbot-message-answer-readonly';
|
|
3
3
|
|
|
4
4
|
describe('[ChatbotMessageAnswerReadonly]', () => {
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { runChatbotMessageAnswerSharedTests } from '@servicetitan/
|
|
1
|
+
import { runChatbotMessageAnswerSharedTests } from '@servicetitan/cypress-shared';
|
|
2
2
|
import { ChatbotMessageAnswer } from '../chatbot-message-answer';
|
|
3
3
|
|
|
4
4
|
describe('[ChatbotMessageAnswer]', () => {
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { runChatbotMessageTypingSharedTests } from '@servicetitan/
|
|
1
|
+
import { runChatbotMessageTypingSharedTests } from '@servicetitan/cypress-shared';
|
|
2
2
|
import { ChatbotMessageTyping } from '../chatbot-message-typing';
|
|
3
3
|
|
|
4
4
|
describe('[ChatbotMessageTyping]', () => {
|