From 08cc2942980d49931853c65fefb9db0e676492c5 Mon Sep 17 00:00:00 2001 From: Sean Sundberg Date: Sun, 24 Sep 2023 14:04:30 -0500 Subject: [PATCH] Add chat function to data extract fixes #51 Signed-off-by: Sean Sundberg --- package-lock.json | 14 ++++++++++++++ package.json | 1 + src/views/DataExtraction/DataExtraction.tsx | 8 ++++++++ 3 files changed, 23 insertions(+) diff --git a/package-lock.json b/package-lock.json index db7b72e..e96dcf4 100644 --- a/package-lock.json +++ b/package-lock.json @@ -13,6 +13,7 @@ "@carbon/grid": "^11.20.0", "@carbon/icons-react": "^11.27.0", "@carbon/react": "^1.38.0", + "@ibm-watson/assistant-web-chat-react": "^1.0.4", "dayjs": "^1.11.10", "graphql-ws": "^5.14.0", "jotai": "^2.4.2", @@ -745,6 +746,19 @@ "integrity": "sha512-ZnQMnLV4e7hDlUvw8H+U8ASL02SS2Gn6+9Ac3wGGLIe7+je2AeAOxPY+izIPJDfFDb7eDjev0Us8MO1iFRN8hA==", "dev": true }, + "node_modules/@ibm-watson/assistant-web-chat-react": { + "version": "1.0.4", + "resolved": "https://registry.npmjs.org/@ibm-watson/assistant-web-chat-react/-/assistant-web-chat-react-1.0.4.tgz", + "integrity": "sha512-oJuclFkGgkK98HS7S2DyBC6/plKIcTFkG/A7WGEiq1Y4DQGnJ2uOUkO6qquz/daxs6ReNK6Z0ilq1g2nvrg2CA==", + "engines": { + "node": ">=14", + "npm": ">=6" + }, + "peerDependencies": { + "react": ">= 16.8.0", + "react-dom": ">= 16.8.0" + } + }, "node_modules/@nodelib/fs.scandir": { "version": "2.1.5", "resolved": "https://registry.npmjs.org/@nodelib/fs.scandir/-/fs.scandir-2.1.5.tgz", diff --git a/package.json b/package.json index 26d0787..14e1646 100644 --- a/package.json +++ b/package.json @@ -15,6 +15,7 @@ "@carbon/grid": "^11.20.0", "@carbon/icons-react": "^11.27.0", "@carbon/react": "^1.38.0", + "@ibm-watson/assistant-web-chat-react": "^1.0.4", "dayjs": "^1.11.10", "graphql-ws": "^5.14.0", "jotai": "^2.4.2", diff --git a/src/views/DataExtraction/DataExtraction.tsx b/src/views/DataExtraction/DataExtraction.tsx index 1bf217e..17d4989 100644 --- a/src/views/DataExtraction/DataExtraction.tsx +++ b/src/views/DataExtraction/DataExtraction.tsx @@ -25,6 +25,7 @@ import {DataTable, Stack} from "../../components"; import {DataExtractionQuestionModel} from "../../models"; import {Loadable} from "jotai/vanilla/utils/loadable"; import {handleFileUploaderChange} from "../KYC/KYCCaseDetail/util"; +import {WebChatConfig, WebChatContainer} from "@ibm-watson/assistant-web-chat-react"; export interface DataExtractionProps { } @@ -113,6 +114,12 @@ export const DataExtraction: React.FunctionComponent = () = setResults(Promise.resolve([])) } + const webChatConfig: WebChatConfig = { + integrationID: '76f5a344-3d6e-4e87-89d4-ec4fb39ee08a', // The ID of this integration. + region: 'us-south', // The region your integration is hosted in. + serviceInstanceID: '683c39a0-98db-4651-b97d-49f770fb058c', // The ID of your service instance. + } + return (
@@ -163,6 +170,7 @@ export const DataExtraction: React.FunctionComponent = () =
+
)