clear query results and handle error with no query generated (#1640)

* clear query results and handle error with no query generated

* clear query results and handle error with no query generated

* Update the query guidelines link

* Update the query guidelines link
This commit is contained in:
sunghyunkang1111
2023-10-04 12:20:56 -05:00
committed by GitHub
parent 12e8490350
commit 68b45e77a8
5 changed files with 92 additions and 41 deletions

View File

@@ -30,6 +30,7 @@ export interface QueryCopilotState {
showFeedbackBar: boolean;
showCopyPopup: boolean;
showErrorMessageBar: boolean;
showInvalidQueryMessageBar: boolean;
generatedQueryComments: string;
wasCopilotUsed: boolean;
showWelcomeSidebar: boolean;
@@ -64,6 +65,7 @@ export interface QueryCopilotState {
setShowFeedbackBar: (showFeedbackBar: boolean) => void;
setshowCopyPopup: (showCopyPopup: boolean) => void;
setShowErrorMessageBar: (showErrorMessageBar: boolean) => void;
setShowInvalidQueryMessageBar: (showInvalidQueryMessageBar: boolean) => void;
setGeneratedQueryComments: (generatedQueryComments: string) => void;
setWasCopilotUsed: (wasCopilotUsed: boolean) => void;
setShowWelcomeSidebar: (showWelcomeSidebar: boolean) => void;
@@ -104,6 +106,7 @@ export const useQueryCopilot: QueryCopilotStore = create((set) => ({
showFeedbackBar: false,
showCopyPopup: false,
showErrorMessageBar: false,
showInvalidQueryMessageBar: false,
generatedQueryComments: "",
wasCopilotUsed: false,
showWelcomeSidebar: true,
@@ -148,6 +151,7 @@ export const useQueryCopilot: QueryCopilotStore = create((set) => ({
setShowFeedbackBar: (showFeedbackBar: boolean) => set({ showFeedbackBar }),
setshowCopyPopup: (showCopyPopup: boolean) => set({ showCopyPopup }),
setShowErrorMessageBar: (showErrorMessageBar: boolean) => set({ showErrorMessageBar }),
setShowInvalidQueryMessageBar: (showInvalidQueryMessageBar: boolean) => set({ showInvalidQueryMessageBar }),
setGeneratedQueryComments: (generatedQueryComments: string) => set({ generatedQueryComments }),
setWasCopilotUsed: (wasCopilotUsed: boolean) => set({ wasCopilotUsed }),
setShowWelcomeSidebar: (showWelcomeSidebar: boolean) => set({ showWelcomeSidebar }),
@@ -196,6 +200,7 @@ export const useQueryCopilot: QueryCopilotStore = create((set) => ({
showFeedbackBar: false,
showCopyPopup: false,
showErrorMessageBar: false,
showInvalidQueryMessageBar: false,
generatedQueryComments: "",
wasCopilotUsed: false,
showCopilotSidebar: false,