mirror of
https://github.com/StanGirard/quivr.git
synced 2024-12-04 05:07:48 +03:00
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):
This commit is contained in:
parent
a22fa9bb55
commit
bfec25be0e
@ -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 = ({
|
||||
)}
|
||||
<Tabs tabList={knowledgesTabs} />
|
||||
<div className={styles.tabs_content_wrapper}>
|
||||
{selectedTab === "Connections" && <FromConnections />}
|
||||
{selectedTab === "Documents" && <FromDocuments />}
|
||||
{selectedTab === "Websites" && <FromWebsites />}
|
||||
{selectedTab === "Connections" && <FromConnections />}
|
||||
</div>
|
||||
</div>
|
||||
);
|
||||
|
Loading…
Reference in New Issue
Block a user