From 8f076bfc04a12a54fcc228d1c9bda2393cd265ea Mon Sep 17 00:00:00 2001 From: Nate Date: Wed, 16 Oct 2024 11:37:32 -0700 Subject: [PATCH] fix type errs --- docs/static/schemas/config.json | 66 +++++++++++++++++++ .../src/quickEdit/QuickEditQuickPick.ts | 2 +- gui/src/pages/config-error/index.tsx | 10 +-- 3 files changed, 72 insertions(+), 6 deletions(-) diff --git a/docs/static/schemas/config.json b/docs/static/schemas/config.json index c000f2d7f..58128d128 100644 --- a/docs/static/schemas/config.json +++ b/docs/static/schemas/config.json @@ -1629,6 +1629,72 @@ } }, "allOf": [ + { + "if": { + "properties": { + "name": { + "enum": ["discord"] + } + } + }, + "then": { + "allOf": [ + { + "properties": { + "params": { + "properties": { + "discordKey": { + "type": "string", + "description": "Your Discord bot token to access the Discord API. Required to fetch messages from servers." + }, + "guildId": { + "type": "string", + "description": "The ID of the guild (server) from which to fetch channels and messages." + }, + "channels": { + "type": "array", + "description": "A list of channel objects to search for messages", + "items": { + "type": "object", + "properties": { + "id": { + "type": "string", + "description": "The unique ID of the channel" + }, + "name": { + "type": "string", + "description": "The name of the channel" + } + }, + "required": ["id"] + } + } + }, + "required": ["discordKey"] + } + } + }, + { + "oneOf": [ + { + "properties": { + "params": { + "required": ["guildId"] + } + } + }, + { + "properties": { + "params": { + "required": ["channels"] + } + } + } + ] + } + ] + } + }, { "if": { "properties": { diff --git a/extensions/vscode/src/quickEdit/QuickEditQuickPick.ts b/extensions/vscode/src/quickEdit/QuickEditQuickPick.ts index 0c0b276a8..64d262957 100644 --- a/extensions/vscode/src/quickEdit/QuickEditQuickPick.ts +++ b/extensions/vscode/src/quickEdit/QuickEditQuickPick.ts @@ -384,7 +384,7 @@ export class QuickEdit { const searchResults = this.miniSearch.search( searchQuery, - ) as FileMiniSearchResult[]; + ) as unknown as FileMiniSearchResult[]; if (searchResults.length > 0) { quickPick.items = searchResults diff --git a/gui/src/pages/config-error/index.tsx b/gui/src/pages/config-error/index.tsx index 50fad2097..349c2cfe4 100644 --- a/gui/src/pages/config-error/index.tsx +++ b/gui/src/pages/config-error/index.tsx @@ -2,11 +2,11 @@ import { ArrowLeftIcon, ExclamationCircleIcon, } from "@heroicons/react/24/outline"; +import { useSelector } from "react-redux"; import { useNavigate } from "react-router-dom"; import { vscBackground } from "../../components"; -import { ROUTES } from "../../util/navigation"; -import { useSelector } from "react-redux"; import { RootState } from "../../redux/store"; +import { ROUTES } from "../../util/navigation"; export default function ConfigErrorPage() { const navigate = useNavigate(); @@ -27,16 +27,16 @@ export default function ConfigErrorPage() { Chat -
+

Config Errors

Please resolve the following errors in your config.json file.

- {configError && configError.errors.length > 0 ? ( + {configError && configError.length > 0 ? (
    - {configError.errors.map((error, index) => ( + {configError.map((error, index) => (