fix(frontend): documents before connections (#2711)

# 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):
This commit is contained in:
Antoine Dewez 2024-06-24 16:34:06 +02:00 committed by GitHub
parent 546c44c5f0
commit 131eef7498
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -22,7 +22,7 @@ export const KnowledgeToFeed = ({
}): JSX.Element => {
const { allBrains, setCurrentBrainId, currentBrainId, currentBrain } =
useBrainContext();
const [selectedTab, setSelectedTab] = useState("Connections");
const [selectedTab, setSelectedTab] = useState("Documents");
const { knowledgeToFeed } = useKnowledgeToFeedContext();
const { openedConnections, setOpenedConnections, setCurrentSyncId } =
useFromConnectionsContext();
@ -40,14 +40,6 @@ 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,6 +49,14 @@ export const KnowledgeToFeed = ({
(knowledge) => knowledge.source === "upload"
).length,
},
{
label: "Connections",
isSelected: selectedTab === "Connections",
onClick: () => setSelectedTab("Connections"),
iconName: "sync",
badge: openedConnections.filter((connection) => connection.submitted)
.length,
},
{
label: "Websites' page",
isSelected: selectedTab === "Websites",