From bfec25be0e80a8cd0de3dfd07e6e547598dc2e91 Mon Sep 17 00:00:00 2001
From: Antoine Dewez <44063631+Zewed@users.noreply.github.com>
Date: Mon, 17 Jun 2024 11:43:27 +0200
Subject: [PATCH] feat(frontend): set from connections by default in knowledge
to feed (#2680)
# Description
Please include a summary of the changes and the related issue. Please
also include relevant motivation and context.
## Checklist before requesting a review
Please delete options that are not relevant.
- [ ] My code follows the style guidelines of this project
- [ ] I have performed a self-review of my code
- [ ] I have commented hard-to-understand areas
- [ ] I have ideally added tests that prove my fix is effective or that
my feature works
- [ ] New and existing unit tests pass locally with my changes
- [ ] Any dependent changes have been merged
## Screenshots (if appropriate):
---
.../KnowledgeToFeed/KnowledgeToFeed.tsx | 20 +++++++++----------
1 file changed, 10 insertions(+), 10 deletions(-)
diff --git a/frontend/app/chat/[chatId]/components/ActionsBar/components/KnowledgeToFeed/KnowledgeToFeed.tsx b/frontend/app/chat/[chatId]/components/ActionsBar/components/KnowledgeToFeed/KnowledgeToFeed.tsx
index 63da54ecf..b62c1d441 100644
--- a/frontend/app/chat/[chatId]/components/ActionsBar/components/KnowledgeToFeed/KnowledgeToFeed.tsx
+++ b/frontend/app/chat/[chatId]/components/ActionsBar/components/KnowledgeToFeed/KnowledgeToFeed.tsx
@@ -22,7 +22,7 @@ export const KnowledgeToFeed = ({
}): JSX.Element => {
const { allBrains, setCurrentBrainId, currentBrainId, currentBrain } =
useBrainContext();
- const [selectedTab, setSelectedTab] = useState("Documents");
+ const [selectedTab, setSelectedTab] = useState("Connections");
const { knowledgeToFeed } = useKnowledgeToFeedContext();
const { openedConnections, setOpenedConnections, setCurrentSyncId } =
useFromConnectionsContext();
@@ -40,6 +40,14 @@ export const KnowledgeToFeed = ({
);
const knowledgesTabs: Tab[] = [
+ {
+ label: "Connections",
+ isSelected: selectedTab === "Connections",
+ onClick: () => setSelectedTab("Connections"),
+ iconName: "sync",
+ badge: openedConnections.filter((connection) => connection.submitted)
+ .length,
+ },
{
label: "Documents",
isSelected: selectedTab === "Documents",
@@ -57,14 +65,6 @@ export const KnowledgeToFeed = ({
badge: knowledgeToFeed.filter((knowledge) => knowledge.source === "crawl")
.length,
},
- {
- label: "Connections",
- isSelected: selectedTab === "Connections",
- onClick: () => setSelectedTab("Connections"),
- iconName: "sync",
- badge: openedConnections.filter((connection) => connection.submitted)
- .length,
- },
];
useEffect(() => {
@@ -123,9 +123,9 @@ export const KnowledgeToFeed = ({
)}