Bugfix/update view message dialog (#3994)

* update view message dialog

* update lock file

* update github main action

* update github main action

* Update style.scss

* Update pnpm-lock.yaml

* Update pnpm-lock.yaml
This commit is contained in:
Henry Heng 2025-02-06 11:05:06 +00:00 committed by GitHub
parent 8e2e790a93
commit c96d634db2
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
3 changed files with 55 additions and 23 deletions

View File

@ -26,14 +26,14 @@ jobs:
uses: actions/setup-node@v4
with:
node-version: ${{ matrix.node-version }}
check-latest: false
cache: 'pnpm'
- run: npm i -g pnpm
cache-dependency-path: 'pnpm-lock.yaml'
- run: pnpm install
- run: ./node_modules/.bin/cypress install
- run: pnpm lint
- run: pnpm build
- name: Install dependencies
- name: Cypress install
run: pnpm cypress install
- name: Install dependencies (Cypress Action)
uses: cypress-io/github-action@v6
with:
working-directory: ./

View File

@ -20,7 +20,7 @@ class ExaSearch_Tools implements INode {
constructor() {
this.label = 'Exa Search'
this.name = 'exaSearch'
this.version = 1.0
this.version = 1.1
this.type = 'ExaSearch'
this.icon = 'exa.svg'
this.category = 'Tools'
@ -58,8 +58,8 @@ class ExaSearch_Tools implements INode {
name: 'neural'
},
{
label: 'magic',
name: 'magic',
label: 'auto',
name: 'auto',
description: 'decides between keyword and neural'
}
],
@ -200,7 +200,7 @@ class ExaSearch_Tools implements INode {
async init(nodeData: INodeData, _: string, options: ICommonObject): Promise<any> {
const description = nodeData.inputs?.description as string
const numResults = nodeData.inputs?.numResults as string
const type = nodeData.inputs?.type as string
const type = nodeData.inputs?.type as 'keyword' | 'neural' | 'auto' | undefined
const useAutoprompt = nodeData.inputs?.useAutoprompt as boolean
const category = nodeData.inputs?.category as string
const includeDomains = nodeData.inputs?.includeDomains as string
@ -219,7 +219,7 @@ class ExaSearch_Tools implements INode {
numResults: numResults ? parseFloat(numResults) : undefined,
type: type || undefined,
useAutoprompt: useAutoprompt || undefined,
category: category || undefined,
category: (category as any) || undefined,
includeDomains: includeDomains ? includeDomains.split(',') : undefined,
excludeDomains: excludeDomains ? excludeDomains.split(',') : undefined,
startCrawlDate: startCrawlDate || undefined,

View File

@ -173,12 +173,14 @@ const ViewMessagesDialog = ({ show, dialogProps, onCancel }) => {
getChatmessageApi.request(dialogProps.chatflow.id, {
startDate: updatedDate,
endDate: endDate,
chatType: chatTypeFilter.length ? chatTypeFilter : undefined
chatType: chatTypeFilter.length ? chatTypeFilter : undefined,
feedbackType: feedbackTypeFilter.length ? feedbackTypeFilter : undefined
})
getStatsApi.request(dialogProps.chatflow.id, {
startDate: updatedDate,
endDate: endDate,
chatType: chatTypeFilter.length ? chatTypeFilter : undefined
chatType: chatTypeFilter.length ? chatTypeFilter : undefined,
feedbackType: feedbackTypeFilter.length ? feedbackTypeFilter : undefined
})
}
@ -189,12 +191,14 @@ const ViewMessagesDialog = ({ show, dialogProps, onCancel }) => {
getChatmessageApi.request(dialogProps.chatflow.id, {
endDate: updatedDate,
startDate: startDate,
chatType: chatTypeFilter.length ? chatTypeFilter : undefined
chatType: chatTypeFilter.length ? chatTypeFilter : undefined,
feedbackType: feedbackTypeFilter.length ? feedbackTypeFilter : undefined
})
getStatsApi.request(dialogProps.chatflow.id, {
endDate: updatedDate,
startDate: startDate,
chatType: chatTypeFilter.length ? chatTypeFilter : undefined
chatType: chatTypeFilter.length ? chatTypeFilter : undefined,
feedbackType: feedbackTypeFilter.length ? feedbackTypeFilter : undefined
})
}
@ -203,12 +207,14 @@ const ViewMessagesDialog = ({ show, dialogProps, onCancel }) => {
getChatmessageApi.request(dialogProps.chatflow.id, {
chatType: chatTypes.length ? chatTypes : undefined,
startDate: startDate,
endDate: endDate
endDate: endDate,
feedbackType: feedbackTypeFilter.length ? feedbackTypeFilter : undefined
})
getStatsApi.request(dialogProps.chatflow.id, {
chatType: chatTypes.length ? chatTypes : undefined,
startDate: startDate,
endDate: endDate
endDate: endDate,
feedbackType: feedbackTypeFilter.length ? feedbackTypeFilter : undefined
})
}
@ -282,12 +288,14 @@ const ViewMessagesDialog = ({ show, dialogProps, onCancel }) => {
getChatmessageApi.request(chatflowid, {
chatType: chatTypeFilter.length ? chatTypeFilter : undefined,
startDate: startDate,
endDate: endDate
endDate: endDate,
feedbackType: feedbackTypeFilter.length ? feedbackTypeFilter : undefined
})
getStatsApi.request(chatflowid, {
chatType: chatTypeFilter.length ? chatTypeFilter : undefined,
startDate: startDate,
endDate: endDate
endDate: endDate,
feedbackType: feedbackTypeFilter.length ? feedbackTypeFilter : undefined
})
} catch (error) {
console.error(error)
@ -427,8 +435,18 @@ const ViewMessagesDialog = ({ show, dialogProps, onCancel }) => {
)
}
})
getChatmessageApi.request(chatflowid)
getStatsApi.request(chatflowid) // update stats
getChatmessageApi.request(chatflowid, {
startDate: startDate,
endDate: endDate,
chatType: chatTypeFilter.length ? chatTypeFilter : undefined,
feedbackType: feedbackTypeFilter.length ? feedbackTypeFilter : undefined
})
getStatsApi.request(chatflowid, {
startDate: startDate,
endDate: endDate,
chatType: chatTypeFilter.length ? chatTypeFilter : undefined,
feedbackType: feedbackTypeFilter.length ? feedbackTypeFilter : undefined
})
} catch (error) {
enqueueSnackbar({
message: typeof error.response.data === 'object' ? error.response.data.message : error.response.data,
@ -689,8 +707,14 @@ const ViewMessagesDialog = ({ show, dialogProps, onCancel }) => {
useEffect(() => {
if (dialogProps.chatflow) {
getChatmessageApi.request(dialogProps.chatflow.id)
getStatsApi.request(dialogProps.chatflow.id)
getChatmessageApi.request(dialogProps.chatflow.id, {
startDate: startDate,
endDate: endDate
})
getStatsApi.request(dialogProps.chatflow.id, {
startDate: startDate,
endDate: endDate
})
}
return () => {
@ -720,8 +744,16 @@ const ViewMessagesDialog = ({ show, dialogProps, onCancel }) => {
if (dialogProps.chatflow) {
// when the filter is cleared fetch all messages
if (feedbackTypeFilter.length === 0) {
getChatmessageApi.request(dialogProps.chatflow.id)
getStatsApi.request(dialogProps.chatflow.id)
getChatmessageApi.request(dialogProps.chatflow.id, {
startDate: startDate,
endDate: endDate,
chatType: chatTypeFilter.length ? chatTypeFilter : undefined
})
getStatsApi.request(dialogProps.chatflow.id, {
startDate: startDate,
endDate: endDate,
chatType: chatTypeFilter.length ? chatTypeFilter : undefined
})
}
}
// eslint-disable-next-line react-hooks/exhaustive-deps