Skip to content

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

FEAT: UX Improvements in Unified Portal (#831)

Tahier Hussain65b436fe5e07
diff --git a/backend/account_v2/authentication_controller.py b/backend/account_v2/authentication_controller.py
index e7b7b7ddc..31dd284d7 100644
--- a/backend/account_v2/authentication_controller.py
+++ b/backend/account_v2/authentication_controller.py
@@ -191,11 +191,6 @@ class AuthenticationController:
)
if new_organization:
- try:
- self.auth_service.hubspot_signup_api(request=request)
- except MethodNotImplemented:
- logger.info("hubspot_signup_api not implemented")
-
try:
self.auth_service.frictionless_onboarding(
organization=organization, user=user
diff --git a/frontend/src/components/log-in/Login.jsx b/frontend/src/components/log-in/Login.jsx
index b47365536..39fbeaa19 100644
--- a/frontend/src/components/log-in/Login.jsx
+++ b/frontend/src/components/log-in/Login.jsx
@@ -5,20 +5,53 @@ import logo from "../../assets/UnstractLogoBlack.svg";
import loginRightBanner from "../../assets/login-right-panel.svg";
import { getBaseUrl } from "../../helpers/GetStaticData";
import "./Login.css";
+import { useEffect } from "react";
+import { useLocation } from "react-router-dom";
let LoginForm = null;
+let PRODUCT_NAMES = {};
+let SELECTED_PRODUCT;
+let selectedProductStore;
+let setSelectedProduct;
try {
LoginForm = require("../../plugins/login-form/LoginForm").LoginForm;
+ PRODUCT_NAMES = require("../../plugins/llm-whisperer/helper").PRODUCT_NAMES;
+ SELECTED_PRODUCT =
+ require("../../plugins/llm-whisperer/helper").SELECTED_PRODUCT;
+ selectedProductStore = require("../../plugins/llm-whisperer/store/select-product-store.js");
} catch {
// The components will remain null of it is not available
}
+
function Login() {
+ const location = useLocation();
+ const queryParams = new URLSearchParams(location.search);
+ const selectedProduct = queryParams.get(SELECTED_PRODUCT);
const baseUrl = getBaseUrl();
const newURL = baseUrl + "/api/v1/login";
const handleLogin = () => {
window.location.href = newURL;
};
+ try {
+ if (selectedProductStore?.useSelectedProductStore) {
+ setSelectedProduct = selectedProductStore.useSelectedProductStore(
+ (state) => state?.setSelectedProduct
+ );
+ }
+ } catch (error) {
+ // Do nothing
+ }
+
+ useEffect(() => {
+ if (
+ selectedProduct &&
+ Object.values(PRODUCT_NAMES).includes(selectedProduct)
+ ) {
+ setSelectedProduct(selectedProduct);
+ }
+ }, [selectedProduct]);
+
return (
<div className="login-main">
<Row>
diff --git a/frontend/src/hooks/useLogout.js b/frontend/src/hooks/useLogout.js
index cdcedbdb2..1395dc905 100644
--- a/frontend/src/hooks/useLogout.js
+++ b/frontend/src/hooks/useLogout.js
@@ -15,7 +15,6 @@ function useLogout() {
return () => {
setSessionDetails(getSessionData(null));
- localStorage.removeItem("selectedProduct");
posthog.reset();
clearSessionCookies();
const baseUrl = getBaseUrl();
diff --git a/frontend/src/hooks/useSessionValid.js b/frontend/src/hooks/useSessionValid.js
index cf7b202f4..c77310a9e 100644
--- a/frontend/src/hooks/useSessionValid.js
+++ b/frontend/src/hooks/useSessionValid.js
@@ -30,9 +30,11 @@ try {
let selectedProduct;
let selectedProductStore;
+let PRODUCT_NAMES = {};
try {
selectedProductStore = require("../plugins/llm-whisperer/store/select-product-store.js");
+ PRODUCT_NAMES = require("../plugins/llm-whisperer/helper").PRODUCT_NAMES;
} catch {
// Ignore if hook not available
}
@@ -57,7 +59,11 @@ function useSessionValid() {
selectedProductStore,
selectedProduct
) => {
- if (userSessionData && selectedProductStore && !selectedProduct) {
+ if (
+ userSessionData &&
+ selectedProductStore &&
+ !Object.values(PRODUCT_NAMES).includes(selectedProduct)
+ ) {
navigate("/selectProduct");
return true; // Indicate that navigation has occurred
}
diff --git a/frontend/src/routes/useMainAppRoutes.js b/frontend/src/routes/useMainAppRoutes.js
index a0c88a1c3..e9272ae77 100644
--- a/frontend/src/routes/useMainAppRoutes.js
+++ b/frontend/src/routes/useMainAppRoutes.js
@@ -28,6 +28,8 @@ let AppDeployments;
let ChatAppPage;
let ChatAppLayout;
let ManualReviewSettings;
+let OnboardProduct;
+let PRODUCT_NAMES = {};
try {
RequirePlatformAdmin =
@@ -56,8 +58,16 @@ try {
// Do nothing, Not-found Page will be triggered.
}
+try {
+ OnboardProduct =
+ require("../plugins/llm-whisperer/components/onboard-product/OnboardProduct.jsx").OnboardProduct;
+ PRODUCT_NAMES = require("../plugins/llm-whisperer/helper.js").PRODUCT_NAMES;
+} catch (err) {
+ // Do nothing.
+}
+
function useMainAppRoutes() {
- return (
+ const routes = (
<Route path="" element={<RequireAuth />}>
<Route path=":orgName" element={<FullPageLayout />}>
<Route path="onboard" element={<OnBoardPage />} />
@@ -132,6 +142,19 @@ function useMainAppRoutes() {
</Route>
</Route>
);
+
+ if (OnboardProduct && Object.keys(PRODUCT_NAMES)?.length) {
+ return (
+ <Route
+ path=""
+ element={<OnboardProduct type={PRODUCT_NAMES?.unstract} />}
+ >
+ {routes}
+ </Route>
+ );
+ } else {
+ return routes;
+ }
}
export { useMainAppRoutes };