diff --git a/.github/dependabot.yml b/.github/dependabot.yml index dd0799c6..a41a1f3e 100644 --- a/.github/dependabot.yml +++ b/.github/dependabot.yml @@ -8,12 +8,12 @@ updates: - package-ecosystem: "pip" # See documentation for possible values directory: "/application" # Location of package manifests schedule: - interval: "weekly" + interval: "daily" - package-ecosystem: "npm" # See documentation for possible values directory: "/frontend" # Location of package manifests schedule: - interval: "weekly" + interval: "daily" - package-ecosystem: "github-actions" directory: "/" schedule: - interval: "weekly" + interval: "daily" diff --git a/application/api/user/routes.py b/application/api/user/routes.py index 0712e8be..de701a57 100644 --- a/application/api/user/routes.py +++ b/application/api/user/routes.py @@ -185,8 +185,13 @@ class SubmitFeedback(Resource): ), "answer": fields.String(required=False, description="The AI answer"), "feedback": fields.String(required=True, description="User feedback"), - "question_index":fields.Integer(required=True, description="The question number in that particular conversation"), - "conversation_id":fields.String(required=True, description="id of the particular conversation"), + "question_index": fields.Integer( + required=True, + description="The question number in that particular conversation", + ), + "conversation_id": fields.String( + required=True, description="id of the particular conversation" + ), "api_key": fields.String(description="Optional API key"), }, ) @@ -196,21 +201,24 @@ class SubmitFeedback(Resource): ) def post(self): data = request.get_json() - required_fields = [ "feedback","conversation_id","question_index"] + required_fields = ["feedback", "conversation_id", "question_index"] missing_fields = check_required_fields(data, required_fields) if missing_fields: return missing_fields try: conversations_collection.update_one( - {"_id": ObjectId(data["conversation_id"]), f"queries.{data['question_index']}": {"$exists": True}}, - { - "$set": { - f"queries.{data['question_index']}.feedback": data["feedback"] - } - } - ) - + { + "_id": ObjectId(data["conversation_id"]), + f"queries.{data['question_index']}": {"$exists": True}, + }, + { + "$set": { + f"queries.{data['question_index']}.feedback": data["feedback"] + } + }, + ) + except Exception as err: return make_response(jsonify({"success": False, "error": str(err)}), 400) @@ -253,11 +261,9 @@ class DeleteOldIndexes(Resource): jsonify({"success": False, "message": "Missing required fields"}), 400 ) - doc = sources_collection.find_one( - {"_id": ObjectId(source_id), "user": "local"} - ) + doc = sources_collection.find_one({"_id": ObjectId(source_id), "user": "local"}) if not doc: - return make_response(jsonify({"status": "not found"}), 404) + return make_response(jsonify({"status": "not found"}), 404) try: if settings.VECTOR_STORE == "faiss": shutil.rmtree(os.path.join(current_dir, "indexes", str(doc["_id"]))) @@ -271,7 +277,7 @@ class DeleteOldIndexes(Resource): pass except Exception as err: return make_response(jsonify({"success": False, "error": str(err)}), 400) - + sources_collection.delete_one({"_id": ObjectId(source_id)}) return make_response(jsonify({"success": True}), 200) @@ -498,7 +504,9 @@ class PaginatedSources(Resource): total_documents = sources_collection.count_documents(query) total_pages = max(1, math.ceil(total_documents / rows_per_page)) - page = min(max(1, page), total_pages) # add this to make sure page inbound is within the range + page = min( + max(1, page), total_pages + ) # add this to make sure page inbound is within the range sort_order = 1 if sort_order == "asc" else -1 skip = (page - 1) * rows_per_page @@ -2098,4 +2106,3 @@ class DeleteTool(Resource): return {"success": False, "error": str(err)}, 400 return {"success": True}, 200 - \ No newline at end of file diff --git a/application/requirements.txt b/application/requirements.txt index 362fdd45..fa2c2b76 100644 --- a/application/requirements.txt +++ b/application/requirements.txt @@ -19,7 +19,7 @@ gunicorn==23.0.0 html2text==2024.2.26 javalang==0.13.0 jinja2==3.1.5 -jiter==0.5.0 +jiter==0.8.2 jmespath==1.0.1 joblib==1.4.2 jsonpatch==1.33 @@ -28,20 +28,20 @@ jsonschema==4.23.0 jsonschema-spec==0.2.4 jsonschema-specifications==2023.7.1 kombu==5.4.2 -langchain==0.3.13 -langchain-community==0.3.13 -langchain-core==0.3.28 +langchain==0.3.14 +langchain-community==0.3.14 +langchain-core==0.3.29 langchain-openai==0.2.14 langchain-text-splitters==0.3.4 langsmith==0.2.6 lazy-object-proxy==1.10.0 lxml==5.3.0 -markupsafe==2.1.5 +markupsafe==3.0.2 marshmallow==3.23.2 mpmath==1.3.0 multidict==6.1.0 mypy-extensions==1.0.0 -networkx==3.3 +networkx==3.4.2 numpy==2.2.1 openai==1.58.1 openapi-schema-validator==0.6.2 @@ -55,14 +55,14 @@ pathable==0.4.3 pillow==10.4.0 portalocker==2.10.1 prance==23.6.21.0 -primp==0.6.3 +primp==0.9.3 prompt-toolkit==3.0.47 protobuf==5.28.2 py==1.11.0 pydantic==2.9.2 pydantic-core==2.23.4 pydantic-settings==2.4.0 -pymongo==4.8.0 +pymongo==4.10.1 pypdf2==3.0.1 python-dateutil==2.9.0.post0 python-dotenv==1.0.1 @@ -70,15 +70,15 @@ python-pptx==1.0.2 qdrant-client==1.11.0 redis==5.2.1 referencing==0.30.2 -regex==2024.9.11 +regex==2024.11.6 requests==2.32.3 retry==0.9.2 sentence-transformers==3.3.1 tiktoken==0.8.0 tokenizers==0.21.0 -torch==2.4.1 +torch==2.5.1 tqdm==4.66.5 -transformers==4.47.0 +transformers==4.47.1 typing-extensions==4.12.2 typing-inspect==0.9.0 tzdata==2024.2 diff --git a/docs/package-lock.json b/docs/package-lock.json index 2e9c7f7d..9c25345a 100644 --- a/docs/package-lock.json +++ b/docs/package-lock.json @@ -8,7 +8,7 @@ "dependencies": { "@vercel/analytics": "^1.1.1", "docsgpt-react": "^0.4.8", - "next": "^14.2.20", + "next": "^14.2.22", "nextra": "^2.13.2", "nextra-theme-docs": "^2.13.2", "react": "^18.2.0", @@ -931,14 +931,14 @@ } }, "node_modules/@next/env": { - "version": "14.2.20", - "resolved": "https://registry.npmjs.org/@next/env/-/env-14.2.20.tgz", - "integrity": "sha512-JfDpuOCB0UBKlEgEy/H6qcBSzHimn/YWjUHzKl1jMeUO+QVRdzmTTl8gFJaNO87c8DXmVKhFCtwxQ9acqB3+Pw==" + "version": "14.2.22", + "resolved": "https://registry.npmjs.org/@next/env/-/env-14.2.22.tgz", + "integrity": "sha512-EQ6y1QeNQglNmNIXvwP/Bb+lf7n9WtgcWvtoFsHquVLCJUuxRs+6SfZ5EK0/EqkkLex4RrDySvKgKNN7PXip7Q==" }, "node_modules/@next/swc-darwin-arm64": { - "version": "14.2.20", - "resolved": "https://registry.npmjs.org/@next/swc-darwin-arm64/-/swc-darwin-arm64-14.2.20.tgz", - "integrity": "sha512-WDfq7bmROa5cIlk6ZNonNdVhKmbCv38XteVFYsxea1vDJt3SnYGgxLGMTXQNfs5OkFvAhmfKKrwe7Y0Hs+rWOg==", + "version": "14.2.22", + "resolved": "https://registry.npmjs.org/@next/swc-darwin-arm64/-/swc-darwin-arm64-14.2.22.tgz", + "integrity": "sha512-HUaLiehovgnqY4TMBZJ3pDaOsTE1spIXeR10pWgdQVPYqDGQmHJBj3h3V6yC0uuo/RoY2GC0YBFRkOX3dI9WVQ==", "cpu": [ "arm64" ], @@ -951,9 +951,9 @@ } }, "node_modules/@next/swc-darwin-x64": { - "version": "14.2.20", - "resolved": "https://registry.npmjs.org/@next/swc-darwin-x64/-/swc-darwin-x64-14.2.20.tgz", - "integrity": "sha512-XIQlC+NAmJPfa2hruLvr1H1QJJeqOTDV+v7tl/jIdoFvqhoihvSNykLU/G6NMgoeo+e/H7p/VeWSOvMUHKtTIg==", + "version": "14.2.22", + "resolved": "https://registry.npmjs.org/@next/swc-darwin-x64/-/swc-darwin-x64-14.2.22.tgz", + "integrity": "sha512-ApVDANousaAGrosWvxoGdLT0uvLBUC+srqOcpXuyfglA40cP2LBFaGmBjhgpxYk5z4xmunzqQvcIgXawTzo2uQ==", "cpu": [ "x64" ], @@ -966,9 +966,9 @@ } }, "node_modules/@next/swc-linux-arm64-gnu": { - "version": "14.2.20", - "resolved": "https://registry.npmjs.org/@next/swc-linux-arm64-gnu/-/swc-linux-arm64-gnu-14.2.20.tgz", - "integrity": "sha512-pnzBrHTPXIMm5QX3QC8XeMkpVuoAYOmyfsO4VlPn+0NrHraNuWjdhe+3xLq01xR++iCvX+uoeZmJDKcOxI201Q==", + "version": "14.2.22", + "resolved": "https://registry.npmjs.org/@next/swc-linux-arm64-gnu/-/swc-linux-arm64-gnu-14.2.22.tgz", + "integrity": "sha512-3O2J99Bk9aM+d4CGn9eEayJXHuH9QLx0BctvWyuUGtJ3/mH6lkfAPRI4FidmHMBQBB4UcvLMfNf8vF0NZT7iKw==", "cpu": [ "arm64" ], @@ -981,9 +981,9 @@ } }, "node_modules/@next/swc-linux-arm64-musl": { - "version": "14.2.20", - "resolved": "https://registry.npmjs.org/@next/swc-linux-arm64-musl/-/swc-linux-arm64-musl-14.2.20.tgz", - "integrity": "sha512-WhJJAFpi6yqmUx1momewSdcm/iRXFQS0HU2qlUGlGE/+98eu7JWLD5AAaP/tkK1mudS/rH2f9E3WCEF2iYDydQ==", + "version": "14.2.22", + "resolved": "https://registry.npmjs.org/@next/swc-linux-arm64-musl/-/swc-linux-arm64-musl-14.2.22.tgz", + "integrity": "sha512-H/hqfRz75yy60y5Eg7DxYfbmHMjv60Dsa6IWHzpJSz4MRkZNy5eDnEW9wyts9bkxwbOVZNPHeb3NkqanP+nGPg==", "cpu": [ "arm64" ], @@ -996,9 +996,9 @@ } }, "node_modules/@next/swc-linux-x64-gnu": { - "version": "14.2.20", - "resolved": "https://registry.npmjs.org/@next/swc-linux-x64-gnu/-/swc-linux-x64-gnu-14.2.20.tgz", - "integrity": "sha512-ao5HCbw9+iG1Kxm8XsGa3X174Ahn17mSYBQlY6VGsdsYDAbz/ZP13wSLfvlYoIDn1Ger6uYA+yt/3Y9KTIupRg==", + "version": "14.2.22", + "resolved": "https://registry.npmjs.org/@next/swc-linux-x64-gnu/-/swc-linux-x64-gnu-14.2.22.tgz", + "integrity": "sha512-LckLwlCLcGR1hlI5eiJymR8zSHPsuruuwaZ3H2uudr25+Dpzo6cRFjp/3OR5UYJt8LSwlXv9mmY4oI2QynwpqQ==", "cpu": [ "x64" ], @@ -1011,9 +1011,9 @@ } }, "node_modules/@next/swc-linux-x64-musl": { - "version": "14.2.20", - "resolved": "https://registry.npmjs.org/@next/swc-linux-x64-musl/-/swc-linux-x64-musl-14.2.20.tgz", - "integrity": "sha512-CXm/kpnltKTT7945np6Td3w7shj/92TMRPyI/VvveFe8+YE+/YOJ5hyAWK5rpx711XO1jBCgXl211TWaxOtkaA==", + "version": "14.2.22", + "resolved": "https://registry.npmjs.org/@next/swc-linux-x64-musl/-/swc-linux-x64-musl-14.2.22.tgz", + "integrity": "sha512-qGUutzmh0PoFU0fCSu0XYpOfT7ydBZgDfcETIeft46abPqP+dmePhwRGLhFKwZWxNWQCPprH26TjaTxM0Nv8mw==", "cpu": [ "x64" ], @@ -1026,9 +1026,9 @@ } }, "node_modules/@next/swc-win32-arm64-msvc": { - "version": "14.2.20", - "resolved": "https://registry.npmjs.org/@next/swc-win32-arm64-msvc/-/swc-win32-arm64-msvc-14.2.20.tgz", - "integrity": "sha512-upJn2HGQgKNDbXVfIgmqT2BN8f3z/mX8ddoyi1I565FHbfowVK5pnMEwauvLvaJf4iijvuKq3kw/b6E9oIVRWA==", + "version": "14.2.22", + "resolved": "https://registry.npmjs.org/@next/swc-win32-arm64-msvc/-/swc-win32-arm64-msvc-14.2.22.tgz", + "integrity": "sha512-K6MwucMWmIvMb9GlvT0haYsfIPxfQD8yXqxwFy4uLFMeXIb2TcVYQimxkaFZv86I7sn1NOZnpOaVk5eaxThGIw==", "cpu": [ "arm64" ], @@ -1041,9 +1041,9 @@ } }, "node_modules/@next/swc-win32-ia32-msvc": { - "version": "14.2.20", - "resolved": "https://registry.npmjs.org/@next/swc-win32-ia32-msvc/-/swc-win32-ia32-msvc-14.2.20.tgz", - "integrity": "sha512-igQW/JWciTGJwj3G1ipalD2V20Xfx3ywQy17IV0ciOUBbFhNfyU1DILWsTi32c8KmqgIDviUEulW/yPb2FF90w==", + "version": "14.2.22", + "resolved": "https://registry.npmjs.org/@next/swc-win32-ia32-msvc/-/swc-win32-ia32-msvc-14.2.22.tgz", + "integrity": "sha512-5IhDDTPEbzPR31ZzqHe90LnNe7BlJUZvC4sA1thPJV6oN5WmtWjZ0bOYfNsyZx00FJt7gggNs6SrsX0UEIcIpA==", "cpu": [ "ia32" ], @@ -1056,9 +1056,9 @@ } }, "node_modules/@next/swc-win32-x64-msvc": { - "version": "14.2.20", - "resolved": "https://registry.npmjs.org/@next/swc-win32-x64-msvc/-/swc-win32-x64-msvc-14.2.20.tgz", - "integrity": "sha512-AFmqeLW6LtxeFTuoB+MXFeM5fm5052i3MU6xD0WzJDOwku6SkZaxb1bxjBaRC8uNqTRTSPl0yMFtjNowIVI67w==", + "version": "14.2.22", + "resolved": "https://registry.npmjs.org/@next/swc-win32-x64-msvc/-/swc-win32-x64-msvc-14.2.22.tgz", + "integrity": "sha512-nvRaB1PyG4scn9/qNzlkwEwLzuoPH3Gjp7Q/pLuwUgOTt1oPMlnCI3A3rgkt+eZnU71emOiEv/mR201HoURPGg==", "cpu": [ "x64" ], @@ -6759,11 +6759,11 @@ } }, "node_modules/next": { - "version": "14.2.20", - "resolved": "https://registry.npmjs.org/next/-/next-14.2.20.tgz", - "integrity": "sha512-yPvIiWsiyVYqJlSQxwmzMIReXn5HxFNq4+tlVQ812N1FbvhmE+fDpIAD7bcS2mGYQwPJ5vAsQouyme2eKsxaug==", + "version": "14.2.22", + "resolved": "https://registry.npmjs.org/next/-/next-14.2.22.tgz", + "integrity": "sha512-Ps2caobQ9hlEhscLPiPm3J3SYhfwfpMqzsoCMZGWxt9jBRK9hoBZj2A37i8joKhsyth2EuVKDVJCTF5/H4iEDw==", "dependencies": { - "@next/env": "14.2.20", + "@next/env": "14.2.22", "@swc/helpers": "0.5.5", "busboy": "1.6.0", "caniuse-lite": "^1.0.30001579", @@ -6778,15 +6778,15 @@ "node": ">=18.17.0" }, "optionalDependencies": { - "@next/swc-darwin-arm64": "14.2.20", - "@next/swc-darwin-x64": "14.2.20", - "@next/swc-linux-arm64-gnu": "14.2.20", - "@next/swc-linux-arm64-musl": "14.2.20", - "@next/swc-linux-x64-gnu": "14.2.20", - "@next/swc-linux-x64-musl": "14.2.20", - "@next/swc-win32-arm64-msvc": "14.2.20", - "@next/swc-win32-ia32-msvc": "14.2.20", - "@next/swc-win32-x64-msvc": "14.2.20" + "@next/swc-darwin-arm64": "14.2.22", + "@next/swc-darwin-x64": "14.2.22", + "@next/swc-linux-arm64-gnu": "14.2.22", + "@next/swc-linux-arm64-musl": "14.2.22", + "@next/swc-linux-x64-gnu": "14.2.22", + "@next/swc-linux-x64-musl": "14.2.22", + "@next/swc-win32-arm64-msvc": "14.2.22", + "@next/swc-win32-ia32-msvc": "14.2.22", + "@next/swc-win32-x64-msvc": "14.2.22" }, "peerDependencies": { "@opentelemetry/api": "^1.1.0", diff --git a/docs/package.json b/docs/package.json index b9f53250..8e6ad1d3 100644 --- a/docs/package.json +++ b/docs/package.json @@ -7,8 +7,8 @@ "license": "MIT", "dependencies": { "@vercel/analytics": "^1.1.1", - "docsgpt-react": "^0.4.8", - "next": "^14.2.20", + "docsgpt-react": "^0.4.9", + "next": "^14.2.22", "nextra": "^2.13.2", "nextra-theme-docs": "^2.13.2", "react": "^18.2.0", diff --git a/extensions/react-widget/package-lock.json b/extensions/react-widget/package-lock.json index 02ef326b..bae94d08 100644 --- a/extensions/react-widget/package-lock.json +++ b/extensions/react-widget/package-lock.json @@ -1,12 +1,12 @@ { "name": "docsgpt", - "version": "0.4.8", + "version": "0.4.9", "lockfileVersion": 3, "requires": true, "packages": { "": { "name": "docsgpt", - "version": "0.4.8", + "version": "0.4.9", "license": "Apache-2.0", "dependencies": { "@babel/plugin-transform-flow-strip-types": "^7.23.3", diff --git a/extensions/react-widget/package.json b/extensions/react-widget/package.json index c6401d30..3e4f15da 100644 --- a/extensions/react-widget/package.json +++ b/extensions/react-widget/package.json @@ -1,6 +1,6 @@ { - "name": "docsgpt-react", - "version": "0.4.8", + "name": "docsgpt", + "version": "0.4.9", "private": false, "description": "DocsGPT 🦖 is an innovative open-source tool designed to simplify the retrieval of information from project documentation using advanced GPT models 🤖.", "source": "./src/index.html", diff --git a/extensions/react-widget/src/components/SearchBar.tsx b/extensions/react-widget/src/components/SearchBar.tsx index 7ab9c0ce..c7344e43 100644 --- a/extensions/react-widget/src/components/SearchBar.tsx +++ b/extensions/react-widget/src/components/SearchBar.tsx @@ -17,7 +17,7 @@ import { } from '@radix-ui/react-icons'; const themes = { dark: { - bg: '#000', + bg: '#202124', text: '#EDEDED', primary: { text: "#FAFAFA", @@ -29,7 +29,7 @@ const themes = { } }, light: { - bg: '#fff', + bg: '#EAEAEA', text: '#171717', primary: { text: "#222327", @@ -86,7 +86,7 @@ const SearchResults = styled.div` display: flex; flex-direction: column; background-color: ${props => props.theme.primary.bg}; - border: 1px solid ${props => props.theme.secondary.bg}; + border: 1px solid ${props => props.theme.bg}; border-radius: 15px; padding: 8px 0px 8px 0px; width: 792px; @@ -140,7 +140,7 @@ const Title = styled.h3` const ContentWrapper = styled.div` display: flex; flex-direction: column; - gap: 8px; + gap: 12px; `; const Content = styled.div` display: flex; @@ -170,11 +170,12 @@ const ResultWrapper = styled.div` align-items: flex-start; width: 100%; box-sizing: border-box; - padding: 12px 16px 0 16px; + padding: 8px 16px; cursor: pointer; background-color: ${props => props.theme.primary.bg}; - font-family: 'Geist',sans-serif; + font-family: 'Geist', sans-serif; transition: background-color 0.2s; + border-radius: 8px; word-wrap: break-word; overflow-wrap: break-word; @@ -183,11 +184,8 @@ const ResultWrapper = styled.div` overflow: hidden; text-overflow: ellipsis; - &.contains-source:hover { - background-color: rgba(0, 92, 197, 0.15); - ${Title} { - color: rgb(0, 126, 230); - } + &:hover { + background-color: ${props => props.theme.bg}; } ` const Markdown = styled.div` @@ -290,12 +288,11 @@ const AskAIButton = styled.button` padding: 8px 24px; border: none; border-radius: 6px; - background-color: ${props => props.theme.secondary.bg}; + background-color: ${props => props.theme.bg}; color: ${props => props.theme.text}; cursor: pointer; transition: background-color 0.2s, box-shadow 0.2s; font-size: 16px; - box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1); &:hover { opacity: 0.8; @@ -307,7 +304,7 @@ const SearchHeader = styled.div` gap: 8px; margin-bottom: 12px; padding-bottom: 12px; - border-bottom: 1px solid ${props => props.theme.secondary.bg}; + border-bottom: 1px solid ${props => props.theme.bg}; ` const TextField = styled.input` diff --git a/frontend/src/api/endpoints.ts b/frontend/src/api/endpoints.ts index 8a7f9ae2..66c334c1 100644 --- a/frontend/src/api/endpoints.ts +++ b/frontend/src/api/endpoints.ts @@ -23,6 +23,7 @@ const endpoints = { CREATE_TOOL: '/api/create_tool', UPDATE_TOOL_STATUS: '/api/update_tool_status', UPDATE_TOOL: '/api/update_tool', + DELETE_TOOL: '/api/delete_tool', }, CONVERSATION: { ANSWER: '/api/answer', diff --git a/frontend/src/api/services/userService.ts b/frontend/src/api/services/userService.ts index ab91a0a4..8a9b5858 100644 --- a/frontend/src/api/services/userService.ts +++ b/frontend/src/api/services/userService.ts @@ -45,6 +45,8 @@ const userService = { apiClient.post(endpoints.USER.UPDATE_TOOL_STATUS, data), updateTool: (data: any): Promise => apiClient.post(endpoints.USER.UPDATE_TOOL, data), + deleteTool: (data: any): Promise => + apiClient.post(endpoints.USER.DELETE_TOOL, data), }; export default userService; diff --git a/frontend/src/assets/no-files-dark.svg b/frontend/src/assets/no-files-dark.svg new file mode 100644 index 00000000..b1e28a0f --- /dev/null +++ b/frontend/src/assets/no-files-dark.svg @@ -0,0 +1,15 @@ + + + + + + + + + + + + + + + diff --git a/frontend/src/assets/no-files.svg b/frontend/src/assets/no-files.svg new file mode 100644 index 00000000..36510546 --- /dev/null +++ b/frontend/src/assets/no-files.svg @@ -0,0 +1,15 @@ + + + + + + + + + + + + + + + diff --git a/frontend/src/modals/AddToolModal.tsx b/frontend/src/modals/AddToolModal.tsx index 330cf3bb..0763321d 100644 --- a/frontend/src/modals/AddToolModal.tsx +++ b/frontend/src/modals/AddToolModal.tsx @@ -84,7 +84,7 @@ export default function AddToolModal({

Select a tool to set up

-
+
{availableTools.map((tool, index) => (
-
+

{message}

@@ -59,5 +61,3 @@ function ConfirmationModal({ ); } - -export default ConfirmationModal; diff --git a/frontend/src/modals/WrapperModal.tsx b/frontend/src/modals/WrapperModal.tsx index f17e0a8a..18d0e48e 100644 --- a/frontend/src/modals/WrapperModal.tsx +++ b/frontend/src/modals/WrapperModal.tsx @@ -1,12 +1,13 @@ import React, { useEffect, useRef } from 'react'; -import { WrapperModalProps } from './types'; -import Exit from '../assets/exit.svg'; -const WrapperModal: React.FC = ({ +import Exit from '../assets/exit.svg'; +import { WrapperModalProps } from './types'; + +export default function WrapperModal({ children, close, isPerformingTask, -}) => { +}: WrapperModalProps) { const modalRef = useRef(null); useEffect(() => { @@ -39,10 +40,13 @@ const WrapperModal: React.FC = ({
{!isPerformingTask && ( - )} @@ -50,6 +54,4 @@ const WrapperModal: React.FC = ({
); -}; - -export default WrapperModal; +} diff --git a/frontend/src/settings/ToolConfig.tsx b/frontend/src/settings/ToolConfig.tsx index 0de4dab9..cd5516fd 100644 --- a/frontend/src/settings/ToolConfig.tsx +++ b/frontend/src/settings/ToolConfig.tsx @@ -58,6 +58,12 @@ export default function ToolConfig({ handleGoBack(); }); }; + + const handleDelete = () => { + userService.deleteTool({ id: tool.id }).then(() => { + handleGoBack(); + }); + }; return (
@@ -83,7 +89,7 @@ export default function ToolConfig({ Authentication

)} -
+
{Object.keys(tool?.config).length !== 0 && (
@@ -98,12 +104,20 @@ export default function ToolConfig({ >
)} - +
+ + +
@@ -118,7 +132,7 @@ export default function ToolConfig({ key={actionIndex} className="w-full border border-silver dark:border-silver/40 rounded-xl" > -
+

{action.name}

@@ -146,7 +160,7 @@ export default function ToolConfig({
-
+
('INACTIVE'); @@ -86,62 +90,77 @@ export default function Tools() {
- {userTools - .filter((tool) => - tool.displayName - .toLowerCase() - .includes(searchTerm.toLowerCase()), - ) - .map((tool, index) => ( -
-
-
- - + +
+
+

+ {tool.displayName} +

+

+ {tool.description} +

+
-
-

- {tool.displayName} -

-

- {tool.description} -

+
+
-
- -
-
- ))} + )) + )}