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:
parent
8e2e790a93
commit
c96d634db2
|
|
@ -26,14 +26,14 @@ jobs:
|
||||||
uses: actions/setup-node@v4
|
uses: actions/setup-node@v4
|
||||||
with:
|
with:
|
||||||
node-version: ${{ matrix.node-version }}
|
node-version: ${{ matrix.node-version }}
|
||||||
check-latest: false
|
|
||||||
cache: 'pnpm'
|
cache: 'pnpm'
|
||||||
- run: npm i -g pnpm
|
cache-dependency-path: 'pnpm-lock.yaml'
|
||||||
- run: pnpm install
|
- run: pnpm install
|
||||||
- run: ./node_modules/.bin/cypress install
|
|
||||||
- run: pnpm lint
|
- run: pnpm lint
|
||||||
- run: pnpm build
|
- run: pnpm build
|
||||||
- name: Install dependencies
|
- name: Cypress install
|
||||||
|
run: pnpm cypress install
|
||||||
|
- name: Install dependencies (Cypress Action)
|
||||||
uses: cypress-io/github-action@v6
|
uses: cypress-io/github-action@v6
|
||||||
with:
|
with:
|
||||||
working-directory: ./
|
working-directory: ./
|
||||||
|
|
|
||||||
|
|
@ -20,7 +20,7 @@ class ExaSearch_Tools implements INode {
|
||||||
constructor() {
|
constructor() {
|
||||||
this.label = 'Exa Search'
|
this.label = 'Exa Search'
|
||||||
this.name = 'exaSearch'
|
this.name = 'exaSearch'
|
||||||
this.version = 1.0
|
this.version = 1.1
|
||||||
this.type = 'ExaSearch'
|
this.type = 'ExaSearch'
|
||||||
this.icon = 'exa.svg'
|
this.icon = 'exa.svg'
|
||||||
this.category = 'Tools'
|
this.category = 'Tools'
|
||||||
|
|
@ -58,8 +58,8 @@ class ExaSearch_Tools implements INode {
|
||||||
name: 'neural'
|
name: 'neural'
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
label: 'magic',
|
label: 'auto',
|
||||||
name: 'magic',
|
name: 'auto',
|
||||||
description: 'decides between keyword and neural'
|
description: 'decides between keyword and neural'
|
||||||
}
|
}
|
||||||
],
|
],
|
||||||
|
|
@ -200,7 +200,7 @@ class ExaSearch_Tools implements INode {
|
||||||
async init(nodeData: INodeData, _: string, options: ICommonObject): Promise<any> {
|
async init(nodeData: INodeData, _: string, options: ICommonObject): Promise<any> {
|
||||||
const description = nodeData.inputs?.description as string
|
const description = nodeData.inputs?.description as string
|
||||||
const numResults = nodeData.inputs?.numResults 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 useAutoprompt = nodeData.inputs?.useAutoprompt as boolean
|
||||||
const category = nodeData.inputs?.category as string
|
const category = nodeData.inputs?.category as string
|
||||||
const includeDomains = nodeData.inputs?.includeDomains as string
|
const includeDomains = nodeData.inputs?.includeDomains as string
|
||||||
|
|
@ -219,7 +219,7 @@ class ExaSearch_Tools implements INode {
|
||||||
numResults: numResults ? parseFloat(numResults) : undefined,
|
numResults: numResults ? parseFloat(numResults) : undefined,
|
||||||
type: type || undefined,
|
type: type || undefined,
|
||||||
useAutoprompt: useAutoprompt || undefined,
|
useAutoprompt: useAutoprompt || undefined,
|
||||||
category: category || undefined,
|
category: (category as any) || undefined,
|
||||||
includeDomains: includeDomains ? includeDomains.split(',') : undefined,
|
includeDomains: includeDomains ? includeDomains.split(',') : undefined,
|
||||||
excludeDomains: excludeDomains ? excludeDomains.split(',') : undefined,
|
excludeDomains: excludeDomains ? excludeDomains.split(',') : undefined,
|
||||||
startCrawlDate: startCrawlDate || undefined,
|
startCrawlDate: startCrawlDate || undefined,
|
||||||
|
|
|
||||||
|
|
@ -173,12 +173,14 @@ const ViewMessagesDialog = ({ show, dialogProps, onCancel }) => {
|
||||||
getChatmessageApi.request(dialogProps.chatflow.id, {
|
getChatmessageApi.request(dialogProps.chatflow.id, {
|
||||||
startDate: updatedDate,
|
startDate: updatedDate,
|
||||||
endDate: endDate,
|
endDate: endDate,
|
||||||
chatType: chatTypeFilter.length ? chatTypeFilter : undefined
|
chatType: chatTypeFilter.length ? chatTypeFilter : undefined,
|
||||||
|
feedbackType: feedbackTypeFilter.length ? feedbackTypeFilter : undefined
|
||||||
})
|
})
|
||||||
getStatsApi.request(dialogProps.chatflow.id, {
|
getStatsApi.request(dialogProps.chatflow.id, {
|
||||||
startDate: updatedDate,
|
startDate: updatedDate,
|
||||||
endDate: endDate,
|
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, {
|
getChatmessageApi.request(dialogProps.chatflow.id, {
|
||||||
endDate: updatedDate,
|
endDate: updatedDate,
|
||||||
startDate: startDate,
|
startDate: startDate,
|
||||||
chatType: chatTypeFilter.length ? chatTypeFilter : undefined
|
chatType: chatTypeFilter.length ? chatTypeFilter : undefined,
|
||||||
|
feedbackType: feedbackTypeFilter.length ? feedbackTypeFilter : undefined
|
||||||
})
|
})
|
||||||
getStatsApi.request(dialogProps.chatflow.id, {
|
getStatsApi.request(dialogProps.chatflow.id, {
|
||||||
endDate: updatedDate,
|
endDate: updatedDate,
|
||||||
startDate: startDate,
|
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, {
|
getChatmessageApi.request(dialogProps.chatflow.id, {
|
||||||
chatType: chatTypes.length ? chatTypes : undefined,
|
chatType: chatTypes.length ? chatTypes : undefined,
|
||||||
startDate: startDate,
|
startDate: startDate,
|
||||||
endDate: endDate
|
endDate: endDate,
|
||||||
|
feedbackType: feedbackTypeFilter.length ? feedbackTypeFilter : undefined
|
||||||
})
|
})
|
||||||
getStatsApi.request(dialogProps.chatflow.id, {
|
getStatsApi.request(dialogProps.chatflow.id, {
|
||||||
chatType: chatTypes.length ? chatTypes : undefined,
|
chatType: chatTypes.length ? chatTypes : undefined,
|
||||||
startDate: startDate,
|
startDate: startDate,
|
||||||
endDate: endDate
|
endDate: endDate,
|
||||||
|
feedbackType: feedbackTypeFilter.length ? feedbackTypeFilter : undefined
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -282,12 +288,14 @@ const ViewMessagesDialog = ({ show, dialogProps, onCancel }) => {
|
||||||
getChatmessageApi.request(chatflowid, {
|
getChatmessageApi.request(chatflowid, {
|
||||||
chatType: chatTypeFilter.length ? chatTypeFilter : undefined,
|
chatType: chatTypeFilter.length ? chatTypeFilter : undefined,
|
||||||
startDate: startDate,
|
startDate: startDate,
|
||||||
endDate: endDate
|
endDate: endDate,
|
||||||
|
feedbackType: feedbackTypeFilter.length ? feedbackTypeFilter : undefined
|
||||||
})
|
})
|
||||||
getStatsApi.request(chatflowid, {
|
getStatsApi.request(chatflowid, {
|
||||||
chatType: chatTypeFilter.length ? chatTypeFilter : undefined,
|
chatType: chatTypeFilter.length ? chatTypeFilter : undefined,
|
||||||
startDate: startDate,
|
startDate: startDate,
|
||||||
endDate: endDate
|
endDate: endDate,
|
||||||
|
feedbackType: feedbackTypeFilter.length ? feedbackTypeFilter : undefined
|
||||||
})
|
})
|
||||||
} catch (error) {
|
} catch (error) {
|
||||||
console.error(error)
|
console.error(error)
|
||||||
|
|
@ -427,8 +435,18 @@ const ViewMessagesDialog = ({ show, dialogProps, onCancel }) => {
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
getChatmessageApi.request(chatflowid)
|
getChatmessageApi.request(chatflowid, {
|
||||||
getStatsApi.request(chatflowid) // update stats
|
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) {
|
} catch (error) {
|
||||||
enqueueSnackbar({
|
enqueueSnackbar({
|
||||||
message: typeof error.response.data === 'object' ? error.response.data.message : error.response.data,
|
message: typeof error.response.data === 'object' ? error.response.data.message : error.response.data,
|
||||||
|
|
@ -689,8 +707,14 @@ const ViewMessagesDialog = ({ show, dialogProps, onCancel }) => {
|
||||||
|
|
||||||
useEffect(() => {
|
useEffect(() => {
|
||||||
if (dialogProps.chatflow) {
|
if (dialogProps.chatflow) {
|
||||||
getChatmessageApi.request(dialogProps.chatflow.id)
|
getChatmessageApi.request(dialogProps.chatflow.id, {
|
||||||
getStatsApi.request(dialogProps.chatflow.id)
|
startDate: startDate,
|
||||||
|
endDate: endDate
|
||||||
|
})
|
||||||
|
getStatsApi.request(dialogProps.chatflow.id, {
|
||||||
|
startDate: startDate,
|
||||||
|
endDate: endDate
|
||||||
|
})
|
||||||
}
|
}
|
||||||
|
|
||||||
return () => {
|
return () => {
|
||||||
|
|
@ -720,8 +744,16 @@ const ViewMessagesDialog = ({ show, dialogProps, onCancel }) => {
|
||||||
if (dialogProps.chatflow) {
|
if (dialogProps.chatflow) {
|
||||||
// when the filter is cleared fetch all messages
|
// when the filter is cleared fetch all messages
|
||||||
if (feedbackTypeFilter.length === 0) {
|
if (feedbackTypeFilter.length === 0) {
|
||||||
getChatmessageApi.request(dialogProps.chatflow.id)
|
getChatmessageApi.request(dialogProps.chatflow.id, {
|
||||||
getStatsApi.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
|
// eslint-disable-next-line react-hooks/exhaustive-deps
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue