Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion packages/help-center/src/components/help-center.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@
*/
import UnifiedAIAgent from '@automattic/agents-manager';
import { initializeAnalytics } from '@automattic/calypso-analytics';
import { useGetSupportInteractions } from '@automattic/odie-client/src/data/use-get-support-interactions';
import { useCanConnectToZendeskMessaging } from '@automattic/zendesk-client';
import { useSelect } from '@wordpress/data';
import { createPortal, useEffect, useState } from '@wordpress/element';
Expand All @@ -16,6 +15,7 @@ import {
useHelpCenterContext,
type HelpCenterRequiredInformation,
} from '../contexts/HelpCenterContext';
import { useGetSupportInteractions } from '../data/use-get-support-interactions';
import { useChatStatus, useShouldUseUnifiedAgent } from '../hooks';
import { HELP_CENTER_STORE } from '../stores';
import { Container } from '../types';
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import { handleSupportInteractionsFetch } from '@automattic/odie-client/src/data/handle-support-interactions-fetch';
import { isTestModeEnvironment, useCanConnectToZendeskMessaging } from '@automattic/zendesk-client';
import { useQuery } from '@tanstack/react-query';
import { handleSupportInteractionsFetch } from './handle-support-interactions-fetch';
import type { SupportProvider } from '../types';

/**
Expand Down
2 changes: 1 addition & 1 deletion packages/help-center/src/hooks/use-get-history-chats.ts
Original file line number Diff line number Diff line change
@@ -1,14 +1,14 @@
/* eslint-disable no-restricted-imports */
import { HelpCenterSelect } from '@automattic/data-stores';
import { useGetOdieConversations } from '@automattic/odie-client/src/data/use-get-odie-conversations';
import { useGetSupportInteractions } from '@automattic/odie-client/src/data/use-get-support-interactions';
import { useSelect } from '@wordpress/data';
import { useEffect, useMemo, useState } from '@wordpress/element';
import {
filterAndUpdateConversationsWithStatus,
getLastMessage,
getZendeskConversations,
} from '../components/utils';
import { useGetSupportInteractions } from '../data/use-get-support-interactions';
import { HELP_CENTER_STORE } from '../stores';
import type {
Conversations,
Expand Down
2 changes: 2 additions & 0 deletions packages/help-center/src/types.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
import type { HelpCenterSite, SiteDetails } from '@automattic/data-stores';
import type { ReactElement } from 'react';

export type SupportProvider = 'zendesk' | 'odie' | 'zendesk-staging';

export interface Container {
handleClose: () => void;
defaultFooterContent?: ReactElement;
Expand Down
9 changes: 3 additions & 6 deletions packages/odie-client/src/components/message/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -4,14 +4,11 @@ import { useState } from 'react';
import ReactDOM from 'react-dom';
import { useOdieAssistantContext } from '../../context';
import { MessageContent } from './message-content';
import type { CurrentUser, Message } from '../../types';
import type { Message } from '../../types';
import './style.scss';

export type ChatMessageProps = {
message: Message;
currentUser: CurrentUser;
displayChatWithSupportLabel?: boolean;
displayCSAT?: boolean;
header?: React.ReactNode;
};

Expand All @@ -22,7 +19,7 @@ export type MessageIndicators = {
isLastMessage: boolean;
};

const ChatMessage = ( { message, currentUser, header }: ChatMessageProps ) => {
const ChatMessage = ( { message, header }: ChatMessageProps ) => {
const { botName } = useOdieAssistantContext();
const [ isFullscreen, setIsFullscreen ] = useState( false );

Expand All @@ -34,7 +31,7 @@ const ChatMessage = ( { message, currentUser, header }: ChatMessageProps ) => {
event.stopPropagation();
};

if ( ! currentUser || ! botName ) {
if ( ! botName ) {
return null;
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@ import { __ } from '@wordpress/i18n';
import cx from 'clsx';
import { Fragment } from 'react';
import ChatMessage from '..';
import { useOdieAssistantContext } from '../../../context';
import { isCSATMessage } from '../../../utils';
import {
hasFeedbackForm,
Expand Down Expand Up @@ -109,7 +108,6 @@ function clusterMessagesBySender( messages: Message[] ) {

export function MessagesClusterizer( { messages }: { messages: Message[] } ) {
const groups = clusterMessagesBySender( messages );
const { currentUser } = useOdieAssistantContext();

return groups.map( ( group ) => {
const startingHumanSupport = group.messages.some( isTransitionToSupportMessage );
Expand Down Expand Up @@ -139,7 +137,6 @@ export function MessagesClusterizer( { messages }: { messages: Message[] } ) {
<ChatMessage
key={ getMessageUniqueIdentifier( message, `${ group.id }-${ index }` ) }
message={ message }
currentUser={ currentUser }
header={ index === 0 ? messageHeader() : undefined }
/>
) ) }
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -136,8 +136,6 @@ export const MessagesContainer = ( { currentUser }: ChatMessagesProps ) => {
currentUser?.display_name
) }
key={ 0 }
currentUser={ currentUser }
displayChatWithSupportLabel={ false }
/>
) }
{ chat.messages?.length > 0 && <MessagesClusterizer messages={ chat.messages } /> }
Expand Down
1 change: 0 additions & 1 deletion packages/odie-client/src/data/index.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
export { handleSupportInteractionsFetch } from './handle-support-interactions-fetch';
export { useGetSupportInteractions } from './use-get-support-interactions';
export { useGetZendeskConversation, useGetUnreadConversations } from '@automattic/zendesk-client';
export { useManageSupportInteraction } from './use-manage-support-interaction';
export { broadcastOdieMessage, useOdieBroadcastWithCallbacks } from './broadcast-messages';
Expand Down

This file was deleted.