Skip to content

LLM-Driven Extraction of Unstructured Data — Built for API Deployments & ETL Pipeline Workflows

Hide onboard banner when all adapters configured after skipping from onboard screen (#196)

Siddhiq6ec792dc0055
diff --git a/frontend/src/components/input-output/configure-ds/ConfigureDs.jsx b/frontend/src/components/input-output/configure-ds/ConfigureDs.jsx
index 6be1bc4e8..1feb27f56 100644
--- a/frontend/src/components/input-output/configure-ds/ConfigureDs.jsx
+++ b/frontend/src/components/input-output/configure-ds/ConfigureDs.jsx
@@ -39,6 +39,7 @@ function ConfigureDs({
const { sessionDetails } = useSessionStore();
const { setAlertDetails } = useAlertStore();
const handleException = useExceptionHandler();
+ const { updateSessionDetails } = useSessionStore();
const { id } = useParams();
@@ -222,6 +223,9 @@ function ConfigureDs({
method === "POST" ? "added" : "updated"
} connector`,
});
+ if (sourceType === Object.keys(sourceTypes)[1] && method === "POST") {
+ updateSession(type);
+ }
setOpen(false);
})
.catch((err) => {
@@ -232,6 +236,16 @@ function ConfigureDs({
});
};
+ const updateSession = (type) => {
+ const adapterType = type.toLowerCase();
+ const adaptersList = sessionDetails?.adapters;
+ if (adaptersList && !adaptersList.includes(adapterType)) {
+ adaptersList.push(adapterType);
+ const adaptersListInSession = { adapters: adaptersList };
+ updateSessionDetails(adaptersListInSession);
+ }
+ };
+
return (
<div className="config-layout">
{!isLoading && oAuthProvider?.length > 0 && (
diff --git a/frontend/src/components/navigations/top-nav-bar/TopNavBar.jsx b/frontend/src/components/navigations/top-nav-bar/TopNavBar.jsx
index 841bae585..c4fd833f7 100644
--- a/frontend/src/components/navigations/top-nav-bar/TopNavBar.jsx
+++ b/frontend/src/components/navigations/top-nav-bar/TopNavBar.jsx
@@ -1,20 +1,19 @@
import { Alert, Button, Col, Dropdown, Image, Row, Typography } from "antd";
import { useEffect, useState } from "react";
import { useNavigate } from "react-router-dom";
+import axios from "axios";
import { UnstractLogo } from "../../../assets/index.js";
import {
getBaseUrl,
onboardCompleted,
} from "../../../helpers/GetStaticData.js";
-import { useAxiosPrivate } from "../../../hooks/useAxiosPrivate.js";
import useLogout from "../../../hooks/useLogout.js";
import "../../../layouts/page-layout/PageLayout.css";
import { useSessionStore } from "../../../store/session-store.js";
import "./TopNavBar.css";
import { useAlertStore } from "../../../store/alert-store.js";
import { ConfirmModal } from "../../widgets/confirm-modal/ConfirmModal.jsx";
-import axios from "axios";
import { useExceptionHandler } from "../../../hooks/useExceptionHandler.jsx";
let TrialDaysInfo;
@@ -33,35 +32,13 @@ function TopNavBar() {
const baseUrl = getBaseUrl();
const onBoardUrl = baseUrl + `/${orgName}/onboard`;
const logout = useLogout();
- const axiosPrivate = useAxiosPrivate();
+ const [showOnboardBanner, setShowOnboardBanner] = useState(false);
const { setAlertDetails } = useAlertStore();
const handleException = useExceptionHandler();
- const [showOnboardBanner, setShowOnboardBanner] = useState(false);
useEffect(() => {
- getAdapters();
- }, []);
-
- const getAdapters = () => {
- const requestOptions = {
- method: "GET",
- url: `/api/v1/unstract/${sessionDetails?.orgId}/adapter/`,
- };
-
- axiosPrivate(requestOptions)
- .then((res) => {
- const data = res?.data;
- const adapterTypes = [
- ...new Set(data?.map((obj) => obj?.adapter_type.toLowerCase())),
- ];
- if (!onboardCompleted(adapterTypes)) {
- setShowOnboardBanner(true);
- }
- })
- .catch((err) => {
- setAlertDetails(handleException(err));
- });
- };
+ setShowOnboardBanner(!onboardCompleted(sessionDetails?.adapters));
+ }, [sessionDetails]);
const cascadeOptions = allOrganization.map((org) => {
return {