Skip to content
Merged
Changes from 1 commit
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
45 changes: 36 additions & 9 deletions packages/core/src/amazonq/webview/ui/apps/testChatConnector.ts
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ import { TabsStorage, TabType } from '../storages/tabsStorage'
import { TestMessageType } from '../../../../amazonqTest/chat/views/connector/connector'
import { ChatPayload } from '../connector'
import { BaseConnector, BaseConnectorProps } from './baseConnector'
import { FollowUpTypes } from '../../../commons/types'

export interface ConnectorProps extends BaseConnectorProps {
sendMessageToExtension: (message: ExtensionMessage) => void
Expand All @@ -35,6 +36,7 @@ export interface MessageData {
}
// TODO: Refactor testChatConnector, scanChatConnector and other apps connector files post RIV
export class Connector extends BaseConnector {
connector: any
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What is this? Looks unused.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

addressed

override getTabType(): TabType {
return 'testgen'
}
Expand Down Expand Up @@ -107,15 +109,40 @@ export class Connector extends BaseConnector {
}

onFileDiff = (tabID: string, filePath: string, deleted: boolean, messageId?: string): void => {
// TODO: add this back once we can advance flow from here
// this.sendMessageToExtension({
// command: 'open-diff',
// tabID,
// filePath,
// deleted,
// messageId,
// tabType: 'testgen',
// })
// Open diff view
this.sendMessageToExtension({
command: 'open-diff',
tabID,
filePath,
deleted,
messageId,
tabType: 'testgen',
})
this.onChatAnswerReceived?.(
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Make the property required to remove the ?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

addressed

tabID,
{
type: ChatItemType.ANSWER,
messageId: messageId,
followUp: {
text: ' ',
options: [
{
type: FollowUpTypes.AcceptCode,
pillText: 'Accept',
status: 'success',
icon: MynahIcons.OK,
},
{
type: FollowUpTypes.RejectCode,
pillText: 'Reject',
status: 'error',
icon: MynahIcons.REVERT,
},
],
},
},
{}
)
}

private processChatMessage = async (messageData: any): Promise<void> => {
Expand Down
Loading