LLM-Driven Extraction of Unstructured Data — Built for API Deployments & ETL Pipeline Workflows
Python ai-agentsdata-engineeringdocument-aigenerative-aiidpjson-extractionllmmcp-serverocrpdf-extractionprompt-engineeringstructured-output
FEAT: Unstract Payment Integration (FE) (#1053)
Tahier Hussain104a82bbcd10
diff --git a/frontend/src/components/helpers/auth/RequireAuth.js b/frontend/src/components/helpers/auth/RequireAuth.jsindex 48a6e7f7b..d98ba3c56 100644--- a/frontend/src/components/helpers/auth/RequireAuth.js+++ b/frontend/src/components/helpers/auth/RequireAuth.js@@ -3,6 +3,7 @@ import { useEffect } from "react";import {getOrgNameFromPathname,+ homePagePath,onboardCompleted,} from "../../../helpers/GetStaticData";import { useSessionStore } from "../../../store/session-store";@@ -53,7 +54,7 @@ const RequireAuth = () => {if (isLlmWhisperer) {navigateTo = `/llm-whisperer/${orgName}/playground`;} else if (onboardCompleted(adapters)) {- navigateTo = `/${orgName}/tools`;+ navigateTo = `/${orgName}/${homePagePath}`;}if (sessionDetails.role === "unstract_reviewer" ||diff --git a/frontend/src/components/helpers/auth/RequireGuest.js b/frontend/src/components/helpers/auth/RequireGuest.jsindex 00b1fa62c..a49c02035 100644--- a/frontend/src/components/helpers/auth/RequireGuest.js+++ b/frontend/src/components/helpers/auth/RequireGuest.js@@ -1,6 +1,10 @@import { Navigate, Outlet, useLocation } from "react-router-dom";-import { publicRoutes, onboardCompleted } from "../../../helpers/GetStaticData";+import {+ publicRoutes,+ onboardCompleted,+ homePagePath,+} from "../../../helpers/GetStaticData";import { useSessionStore } from "../../../store/session-store";let selectedProductStore;let isLlmWhisperer;@@ -28,7 +32,7 @@ const RequireGuest = () => {if (isLlmWhisperer) {navigateTo = `/llm-whisperer/${orgName}/playground`;} else if (onboardCompleted(adapters)) {- navigateTo = `/${orgName}/tools`;+ navigateTo = `/${orgName}/${homePagePath}`;}if (sessionDetails.role === "unstract_reviewer" ||diff --git a/frontend/src/components/navigations/side-nav-bar/SideNavBar.jsx b/frontend/src/components/navigations/side-nav-bar/SideNavBar.jsxindex 0a1997d9d..2d58d5cd8 100644--- a/frontend/src/components/navigations/side-nav-bar/SideNavBar.jsx+++ b/frontend/src/components/navigations/side-nav-bar/SideNavBar.jsx@@ -31,6 +31,14 @@ try {// Plugin unavailable.}+let dashboardSideMenuItem;+try {+ dashboardSideMenuItem =+ require("../../../plugins/unstract-subscription/helper/constants").dashboardSideMenuItem;+} catch (err) {+ // Plugin unavailable.+}+const SideNavBar = ({ collapsed }) => {const navigate = useNavigate();const { sessionDetails } = useSessionStore();@@ -40,7 +48,7 @@ const SideNavBar = ({ collapsed }) => {menu = sideMenu.useSideMenu();}- const data = menu || [+ const unstractMenuItems = [{id: 1,mainTitle: "MANAGE",@@ -155,6 +163,12 @@ const SideNavBar = ({ collapsed }) => {},];+ if (dashboardSideMenuItem) {+ unstractMenuItems[2].subMenu.push(dashboardSideMenuItem(orgName));+ }++ const data = menu || unstractMenuItems;+if (getMenuItem && flags?.app_deployment) {data[0]?.subMenu?.splice(1, 0, getMenuItem?.default(orgName));}diff --git a/frontend/src/components/navigations/top-nav-bar/TopNavBar.jsx b/frontend/src/components/navigations/top-nav-bar/TopNavBar.jsxindex 7bbd63be8..2dd2d23ed 100644--- a/frontend/src/components/navigations/top-nav-bar/TopNavBar.jsx+++ b/frontend/src/components/navigations/top-nav-bar/TopNavBar.jsx@@ -16,7 +16,7 @@ import {FileProtectOutlined,LikeOutlined,} from "@ant-design/icons";-import { useEffect, useState } from "react";+import { useEffect, useState, useMemo, useCallback } from "react";import { useNavigate, useLocation } from "react-router-dom";import axios from "axios";import PropTypes from "prop-types";@@ -24,6 +24,7 @@ import PropTypes from "prop-types";import { UnstractLogo } from "../../../assets/index.js";import {getBaseUrl,+ homePagePath,onboardCompleted,} from "../../../helpers/GetStaticData.js";import useLogout from "../../../hooks/useLogout.js";@@ -37,12 +38,13 @@ import { useExceptionHandler } from "../../../hooks/useExceptionHandler.jsx";let TrialDaysInfo;try {TrialDaysInfo =- require("../../../plugins/subscription/trial-helper/TrialDaysInfo.jsx").default;+ require("../../../plugins/unstract-subscription/components/TrialDaysInfo.jsx").default;} catch (err) {// Plugin not found}-let selectedProduct;+let selectedProductStore;+let selectedProduct;try {selectedProductStore = require("../../../plugins/llm-whisperer/store/select-product-store.js");@@ -51,7 +53,6 @@ try {}let PlatformDropdown;-try {PlatformDropdown =require("../../../plugins/platform-dropdown/PlatformDropDown.jsx").PlatformDropdown;@@ -59,12 +60,6 @@ try {// Plugin not found}-try {- selectedProductStore = require("../../../plugins/llm-whisperer/store/select-product-store.js");-} catch {- // Ignore if hook not available-}-let WhispererLogo;try {WhispererLogo =@@ -76,10 +71,9 @@ try {function TopNavBar({ isSimpleLayout, topNavBarOptions }) {const navigate = useNavigate();const { sessionDetails } = useSessionStore();- const { orgName, remainingTrialDays, allOrganization, orgId } =- sessionDetails;+ const { orgName, allOrganization, orgId } = sessionDetails;const baseUrl = getBaseUrl();- const onBoardUrl = baseUrl + `/${orgName}/onboard`;+ const onBoardUrl = `${baseUrl}/${orgName}/onboard`;const logout = useLogout();const [showOnboardBanner, setShowOnboardBanner] = useState(false);const [approverStatus, setApproverStatus] = useState(false);@@ -97,27 +91,29 @@ function TopNavBar({ isSimpleLayout, topNavBarOptions }) {const isUnstract = !(selectedProduct && selectedProduct !== "unstract");+ // Check user role and whether the onboarding is incompleteuseEffect(() => {- const isUnstractReviewer = sessionDetails.role === "unstract_reviewer";- const isUnstractSupervisor = sessionDetails.role === "unstract_supervisor";- const isUnstractAdmin = sessionDetails.role === "unstract_admin";+ const { role } = sessionDetails;+ const isReviewer = role === "unstract_reviewer";+ const isSupervisor = role === "unstract_supervisor";+ const isAdmin = role === "unstract_admin";setShowOnboardBanner(!onboardCompleted(sessionDetails?.adapters) &&- !isUnstractReviewer &&- !isUnstractSupervisor+ !isReviewer &&+ !isSupervisor);-- setApproverStatus(isUnstractAdmin || isUnstractSupervisor);- setReviewerStatus(isUnstractReviewer);+ setApproverStatus(isAdmin || isSupervisor);+ setReviewerStatus(isReviewer);}, [sessionDetails]);+ // Determine review page headeruseEffect(() => {- const checkReviewPage = location.pathname.split("review");- if (checkReviewPage.length > 1) {- if (checkReviewPage[1].includes("/approve")) {+ const pathSegments = location.pathname.split("review");+ if (pathSegments.length > 1) {+ if (pathSegments[1].includes("/approve")) {setReviewPageHeader("Approve");- } else if (checkReviewPage[1].includes("/download_and_sync")) {+ } else if (pathSegments[1].includes("/download_and_sync")) {setReviewPageHeader("Download and syncmanager");} else {setReviewPageHeader("Review");@@ -130,33 +126,8 @@ function TopNavBar({ isSimpleLayout, topNavBarOptions }) {}}, [location]);- const cascadeOptions = allOrganization?.map((org) => {- return {- key: org?.id,- label:- org?.id === sessionDetails?.orgId ? (- <div- onClick={() =>- setAlertDetails({- type: "error",- content: `You are already in ${org?.display_name}`,- })- }- >- {org?.display_name}- </div>- ) : (- <ConfirmModal- handleConfirm={() => handleContinue(org?.id)}- content={`Want to switch to ${org?.display_name} `}- >- <div>{org?.display_name}</div>- </ConfirmModal>- ),- };- });-- const handleContinue = async (selectedOrg) => {+ // Switch organization+ const handleContinue = useCallback(async (selectedOrg) => {const requestOptions = {method: "POST",url: `/api/v1/organization/${selectedOrg}/set`,@@ -164,51 +135,89 @@ function TopNavBar({ isSimpleLayout, topNavBarOptions }) {"X-CSRFToken": sessionDetails?.csrfToken,},};- await axios(requestOptions)- .then(() => {- navigate("/");- window.location.reload();- })- .catch((err) => {- setAlertDetails(handleException(err));+ try {+ await axios(requestOptions);+ navigate("/");+ window.location.reload();+ } catch (err) {+ setAlertDetails(handleException(err));+ }+ }, []);++ // Prepare org list for switching+ const cascadeOptions = useMemo(() => {+ return allOrganization?.map((org) => {+ return {+ key: org?.id,+ label:+ org?.id === sessionDetails?.orgId ? (+ <div+ onClick={() =>+ setAlertDetails({+ type: "error",+ content: `You are already in ${org?.display_name}`,+ })+ }+ >+ {org?.display_name}+ </div>+ ) : (+ <ConfirmModal+ handleConfirm={() => handleContinue(org?.id)}+ content={`Want to switch to ${org?.display_name}?`}+ >+ <div>{org?.display_name}</div>+ </ConfirmModal>+ ),+ };+ });+ }, [allOrganization, handleContinue]);++ // Build dropdown menu items+ const items = useMemo(() => {+ const menuItems = [];++ // Profile+ if (isUnstract && !isSimpleLayout) {+ menuItems.push({+ key: "1",+ label: (+ <Button+ onClick={() => navigate(`/${orgName}/profile`)}+ className="logout-button"+ >+ <UserOutlined /> Profile+ </Button>+ ),+ });+ }++ // Switch Organization+ if (allOrganization?.length > 1) {+ menuItems.push({+ key: "3",+ label: (+ <Dropdown+ placeholder="Switch Organization"+ menu={{+ items: cascadeOptions,+ selectable: true,+ selectedKeys: [orgId],+ className: "switch-org-menu",+ }}+ placement="left"+ >+ <div>+ <UserSwitchOutlined /> Switch Org+ </div>+ </Dropdown>+ ),});- };+ }- // Profile Dropdown items- const items = [- isUnstract && {- key: "1",- label: (- <Button- onClick={() => navigate(`/${orgName}/profile`)}- className="logout-button"- >- <UserOutlined /> Profile- </Button>- ),- },- allOrganization?.length > 1 && {- key: "3",- label: (- <Dropdown- placeholder="Switch Organization"- menu={{- items: cascadeOptions,- selectable: true,- selectedKeys: [orgId],- className: "switch-org-menu",- }}- placement="left"- >- <div>- {" "}- <UserSwitchOutlined /> Switch Org- </div>- </Dropdown>- ),- },- isUnstract &&- (reviewerStatus || approverStatus) && {+ // Review+ if (isUnstract && !isSimpleLayout && (reviewerStatus || approverStatus)) {+ menuItems.push({key: "4",label: (<Button@@ -218,9 +227,12 @@ function TopNavBar({ isSimpleLayout, topNavBarOptions }) {<FileProtectOutlined /> Review</Button>),- },- isUnstract &&- approverStatus && {+ });+ }++ // Approve+ if (isUnstract && !isSimpleLayout && approverStatus) {+ menuItems.push({key: "5",label: (<Button@@ -230,9 +242,9 @@ function TopNavBar({ isSimpleLayout, topNavBarOptions }) {<LikeOutlined /> Approve</Button>),- },- isUnstract &&- approverStatus && {+ });++ menuItems.push({key: "6",label: (<Button@@ -242,32 +254,50 @@ function TopNavBar({ isSimpleLayout, topNavBarOptions }) {<DownloadOutlined /> Download and Sync Manager</Button>),- },- {+ });+ }++ // Logout+ menuItems.push({key: "2",label: (<Button onClick={logout} className="logout-button"><LogoutOutlined /> Logout</Button>),- },- ];+ });++ return menuItems.filter(Boolean); // remove any undefined items+ }, [+ isUnstract,+ isSimpleLayout,+ reviewerStatus,+ approverStatus,+ allOrganization,+ cascadeOptions,+ orgName,+ orgId,+ ]);// Function to get the initials from the user name- const getInitials = (name) => {+ const getInitials = useCallback((name) => {const names = name?.split(" ");- const initials = names+ return names?.map((n) => n.charAt(0))?.join("")?.toUpperCase();- return initials;- };+ }, []);return (<Row align="middle" className="topNav"><Col span={6} className="platform-switch-container">{isUnstract ? (- <UnstractLogo className="topbar-logo" />+ <UnstractLogo+ className="topbar-logo cursor-pointer"+ onClick={() =>+ navigate(`/${sessionDetails?.orgName}/${homePagePath}`)+ }+ />) : (WhispererLogo && <WhispererLogo className="topbar-logo" />)}@@ -279,61 +309,55 @@ function TopNavBar({ isSimpleLayout, topNavBarOptions }) {)}{PlatformDropdown && <PlatformDropdown />}</Col>- {!isSimpleLayout && (- <>- <Col span={14} className="top-nav-alert-col">- {isUnstract && showOnboardBanner && (- <Alert- type="error"- message={- <>- <span className="top-nav-alert-msg">- Your setup process is incomplete. Now, that's a- bummer!- </span>- <a- href={onBoardUrl}- size="small"- type="text"- className="top-nav-alert-link"- >- Complete it to start using Unstract- </a>- </>- }- showIcon- />- )}- </Col>- <Col span={4}>- <Row justify="end" align="middle">- <Space>- {topNavBarOptions}- {isUnstract && TrialDaysInfo && (- <TrialDaysInfo remainingTrialDays={remainingTrialDays} />- )}- <Dropdown menu={{ items }} placement="bottomLeft" arrow>- <div className="top-navbar-dp">- {sessionDetails?.picture ? (- <Image- className="navbar-img"- height="100%"- width="100%"- preview={false}- src={sessionDetails?.picture}- />- ) : (- <Typography.Text className="initials">- {getInitials(sessionDetails?.name)}- </Typography.Text>- )}- </div>- </Dropdown>- </Space>- </Row>- </Col>- </>++ {isSimpleLayout ? (+ <Col span={14} />+ ) : (+ <Col span={14} className="top-nav-alert-col">+ {isUnstract && showOnboardBanner && (+ <Alert+ type="error"+ message={+ <>+ <span className="top-nav-alert-msg">+ Your setup process is incomplete. Now, that's a bummer!+ </span>+ <a href={onBoardUrl} className="top-nav-alert-link">+ Complete it to start using Unstract+ </a>+ </>+ }+ showIcon+ />+ )}+ </Col>)}++ <Col span={4}>+ <Row justify="end" align="middle">+ <Space>+ {topNavBarOptions}+ {isUnstract && TrialDaysInfo && <TrialDaysInfo />}+ <Dropdown menu={{ items }} placement="bottomLeft" arrow>+ <div className="top-navbar-dp">+ {sessionDetails?.picture ? (+ <Image+ className="navbar-img"+ height="100%"+ width="100%"+ preview={false}+ src={sessionDetails?.picture}+ />+ ) : (+ <Typography.Text className="initials">+ {getInitials(sessionDetails?.name)}+ </Typography.Text>+ )}+ </div>+ </Dropdown>+ </Space>+ </Row>+ </Col></Row>);}diff --git a/frontend/src/components/onboard/OnBoard.jsx b/frontend/src/components/onboard/OnBoard.jsxindex 79f0afd1c..cf6a02534 100644--- a/frontend/src/components/onboard/OnBoard.jsx+++ b/frontend/src/components/onboard/OnBoard.jsx@@ -8,7 +8,7 @@ import ConnectLLM from "../../assets/connect_llm.svg";import ConnectVectorDb from "../../assets/connect_vector_db.svg";import ConnectEmbedding from "../../assets/connect_embedding.svg";import ConnectTextExtractor from "../../assets/connect_x2text.svg";-import { onboardCompleted } from "../../helpers/GetStaticData.js";+import { homePagePath, onboardCompleted } from "../../helpers/GetStaticData.js";import { useSessionStore } from "../../store/session-store.js";import { AddSourceModal } from "../input-output/add-source-modal/AddSourceModal.jsx";import { CustomButton } from "../widgets/custom-button/CustomButton.jsx";@@ -22,7 +22,7 @@ function OnBoard() {const [openAddSourcesModal, setOpenAddSourcesModal] = useState(false);const [editItemId, setEditItemId] = useState(null);const [type, setType] = useState(null);- const homePageUrl = `/${orgName}/tools`;+ const homePageUrl = `/${orgName}/${homePagePath}`;const [adaptersList, setAdaptersList] = useState(adapters || []);useEffect(() => {if (onboardCompleted(adaptersList)) {diff --git a/frontend/src/components/settings/invite/InviteEditUser.jsx b/frontend/src/components/settings/invite/InviteEditUser.jsxindex e533063eb..f8d5e3fee 100644--- a/frontend/src/components/settings/invite/InviteEditUser.jsx+++ b/frontend/src/components/settings/invite/InviteEditUser.jsx@@ -12,6 +12,7 @@ import { TopBar } from "../../widgets/top-bar/TopBar.jsx";import "./InviteEditUser.css";import { useExceptionHandler } from "../../../hooks/useExceptionHandler.jsx";import usePostHogEvents from "../../../hooks/usePostHogEvents.js";+import { homePagePath } from "../../../helpers/GetStaticData.js";function InviteEditUser() {const axiosPrivate = useAxiosPrivate();@@ -145,7 +146,7 @@ function InviteEditUser() {useEffect(() => {if (!isInvite && !location.state) {- navigate(`/${sessionDetails?.orgName}/tools`);+ navigate(`/${sessionDetails?.orgName}/${homePagePath}`);}getUserRoles();}, []);diff --git a/frontend/src/components/widgets/spinner-loader/SpinnerLoader.css b/frontend/src/components/widgets/spinner-loader/SpinnerLoader.cssindex 113372065..ba9d75887 100644--- a/frontend/src/components/widgets/spinner-loader/SpinnerLoader.css+++ b/frontend/src/components/widgets/spinner-loader/SpinnerLoader.css@@ -1,23 +1,17 @@/* Styles for SpinnerLoader */-.spinner-loader-layout {- display: flex;- width: 100%;- height: 100%;-}-.spinner-loader-layout .ant-spin-dot-item {- background-color: #FFB400 !important; /* Change the color of the first dot */+ background-color: #ffb400 !important; /* Change the color of the first dot */}.spinner-loader-layout .ant-spin-dot-item:nth-child(2) {- background-color: #00A6ED !important; /* Change the color of the second dot */+ background-color: #00a6ed !important; /* Change the color of the second dot */}.spinner-loader-layout .ant-spin-dot-item:nth-child(3) {- background-color: #7FB800 !important; /* Change the color of the third dot */+ background-color: #7fb800 !important; /* Change the color of the third dot */}.spinner-loader-layout .ant-spin-dot-item:nth-child(4) {- background-color: #FF4D6D !important; /* Change the color of the fourth dot */+ background-color: #ff4d6d !important; /* Change the color of the fourth dot */}diff --git a/frontend/src/components/widgets/spinner-loader/SpinnerLoader.jsx b/frontend/src/components/widgets/spinner-loader/SpinnerLoader.jsxindex a7b290627..27d57bdc5 100644--- a/frontend/src/components/widgets/spinner-loader/SpinnerLoader.jsx+++ b/frontend/src/components/widgets/spinner-loader/SpinnerLoader.jsx@@ -18,12 +18,14 @@ function SpinnerLoader({align = "center",}) {return (- <div- className={`spinner-loader-layout ${- align === SPINNER_ALIGNMENT.DEFAULT ? "" : "center"- }`}- >- <Spin delay={delay} tip={text} size={size} />+ <div className="width-100 height-100">+ <div+ className={`spinner-loader-layout ${+ align === SPINNER_ALIGNMENT.DEFAULT ? "" : "center"+ }`}+ >+ <Spin delay={delay} tip={text} size={size} />+ </div></div>);}diff --git a/frontend/src/helpers/GetSessionData.js b/frontend/src/helpers/GetSessionData.jsindex 5ee6b9291..baed64a49 100644--- a/frontend/src/helpers/GetSessionData.js+++ b/frontend/src/helpers/GetSessionData.js@@ -20,7 +20,6 @@ function getSessionData(sessionData) {isAdmin: sessionData.isAdmin,adapters: sessionData?.adapters,logEventsId: sessionData?.logEventsId,- remainingTrialDays: sessionData?.remainingTrialDays,allOrganization: sessionData?.allOrganization,isPlatformAdmin: sessionData?.isPlatformAdmin,loginOnboardingMessage: sessionData?.loginOnboardingMessage,diff --git a/frontend/src/helpers/GetStaticData.js b/frontend/src/helpers/GetStaticData.jsindex 1fcf4fece..e75e1e560 100644--- a/frontend/src/helpers/GetStaticData.js+++ b/frontend/src/helpers/GetStaticData.js@@ -2,6 +2,14 @@ import moment from "moment";import momentTz from "moment-timezone";import { v4 as uuidv4 } from "uuid";+let cloudHomePagePath;+try {+ cloudHomePagePath =+ require("../plugins/unstract-subscription/helper/constants").cloudHomePagePath;+} catch (err) {+ // Ignore if plugin not available+}+const THEME = {DARK: "dark",LIGHT: "light",@@ -565,6 +573,10 @@ const generateCoverageKey = (promptId, profileId) => {return `coverage_${promptId}_${profileId}`;};+const TRIAL_PLAN = "TRIAL";++const homePagePath = cloudHomePagePath || "tools";+export {CONNECTOR_TYPE_MAP,O_AUTH_PROVIDERS,@@ -616,4 +628,6 @@ export {generateApiRunStatusId,base64toBlobWithMime,generateCoverageKey,+ TRIAL_PLAN,+ homePagePath,};diff --git a/frontend/src/hooks/useExceptionHandler.jsx b/frontend/src/hooks/useExceptionHandler.jsxindex c9472015c..94ceb071e 100644--- a/frontend/src/hooks/useExceptionHandler.jsx+++ b/frontend/src/hooks/useExceptionHandler.jsx@@ -51,7 +51,7 @@ const useExceptionHandler = () => {}break;case "subscription_error":- navigate("/trial-expired");+ navigate("/subscription-expired");return {title: title,type: "error",diff --git a/frontend/src/hooks/useRequestUrl.js b/frontend/src/hooks/useRequestUrl.jsnew file mode 100644index 000000000..1bb202f2f--- /dev/null+++ b/frontend/src/hooks/useRequestUrl.js@@ -0,0 +1,16 @@+import { useSessionStore } from "../store/session-store";++const useRequestUrl = () => {+ const { sessionDetails } = useSessionStore();++ const getUrl = (url) => {+ if (!url) return null;++ const baseUrl = `/api/v1/${sessionDetails?.orgId}/`;+ return baseUrl + url.replace(/^\//, "");+ };++ return { getUrl };+};++export default useRequestUrl;diff --git a/frontend/src/hooks/useUserSession.js b/frontend/src/hooks/useUserSession.jsindex de8782da2..0ba0d1956 100644--- a/frontend/src/hooks/useUserSession.js+++ b/frontend/src/hooks/useUserSession.js@@ -24,7 +24,7 @@ const useUserSession = () => {}if (error?.response?.data?.type === "subscription_error") {- navigate("/trial-expired");+ navigate("/subscription-expired");return;}diff --git a/frontend/src/index.css b/frontend/src/index.cssindex 49221c103..65d62801d 100644--- a/frontend/src/index.css+++ b/frontend/src/index.css@@ -15,6 +15,10 @@ body {min-width: 1024px;}+.page-bg-2 {+ background-color: var(--page-bg-2);+}+.center {display: grid;width: inherit;diff --git a/frontend/src/routes/Router.jsx b/frontend/src/routes/Router.jsxindex e2936ec54..08c9dd2cb 100644--- a/frontend/src/routes/Router.jsx+++ b/frontend/src/routes/Router.jsx@@ -19,9 +19,9 @@ let SimplePromptStudioHelper;let SimplePromptStudio;let SpsLanding;let SpsUpload;-let TrialRoutes;let PaymentSuccessful;let SelectProduct;+let UnstractSubscriptionEndPage;try {SimplePromptStudioHelper =require("../plugins/simple-prompt-studio/SimplePromptStudioHelper.jsx").SimplePromptStudioHelper;@@ -57,8 +57,8 @@ try {}try {- TrialRoutes =- require("../plugins/subscription/trial-page/TrialEndPage.jsx").TrialEndPage;+ UnstractSubscriptionEndPage =+ require("../plugins/unstract-subscription/pages/UnstractSubscriptionEndPage.jsx").UnstractSubscriptionEndPage;} catch (err) {// Do nothing, Not-found Page will be triggered.}@@ -116,14 +116,17 @@ function Router() {{SelectProduct && (<Route path="selectProduct" element={<SelectProduct />} />)}- {TrialRoutes && (- <Route path="/trial-expired" element={<TrialRoutes />} />+ {UnstractSubscriptionEndPage && (+ <Route+ path="/subscription-expired"+ element={<UnstractSubscriptionEndPage />}+ />)}{PaymentSuccessful && (<Route path="/payment/success" element={<PaymentSuccessful />} />)}<Route path="" element={<RequireAuth />}>- <Route path="">{MainAppRoute}</Route>+ {MainAppRoute}{llmWhispererRouter && (<Route path="llm-whisperer">{llmWhispererRouter()}</Route>)}diff --git a/frontend/src/routes/useMainAppRoutes.js b/frontend/src/routes/useMainAppRoutes.jsindex 039591f29..f77e96ad5 100644--- a/frontend/src/routes/useMainAppRoutes.js+++ b/frontend/src/routes/useMainAppRoutes.js@@ -32,6 +32,9 @@ let PRODUCT_NAMES = {};let ManualReviewPage;let SimpleManualReviewPage;let ReviewLayout;+let UnstractUsagePage;+let UnstractSubscriptionPage;+let UnstractSubscriptionCheck;try {RequirePlatformAdmin =@@ -62,7 +65,7 @@ try {try {OnboardProduct =- require("../plugins/llm-whisperer/components/onboard-product/OnboardProduct.jsx").OnboardProduct;+ require("../plugins/onboard-product/OnboardProduct.jsx").OnboardProduct;PRODUCT_NAMES = require("../plugins/llm-whisperer/helper.js").PRODUCT_NAMES;} catch (err) {// Do nothing.@@ -79,6 +82,17 @@ try {// Do nothing, Not-found Page will be triggered.}+try {+ UnstractSubscriptionPage =+ require("../plugins/unstract-subscription/pages/UnstractSubscriptionPage.jsx").UnstractSubscriptionPage;+ UnstractUsagePage =+ require("../plugins/unstract-subscription/pages/UnstractUsagePage.jsx").UnstractUsagePage;+ UnstractSubscriptionCheck =+ require("../plugins/unstract-subscription/components/UnstractSubscriptionCheck.jsx").UnstractSubscriptionCheck;+} catch (err) {+ // Do nothing, Not-found Page will be triggered.+}+function useMainAppRoutes() {const routes = (<>@@ -91,6 +105,12 @@ function useMainAppRoutes() {</Route>)}<Route path=":orgName" element={<PageLayout />}>+ {UnstractUsagePage && (+ <Route path="dashboard" element={<UnstractUsagePage />} />+ )}+ {UnstractSubscriptionPage && (+ <Route path="subscribe" element={<UnstractSubscriptionPage />} />+ )}<Route path="profile" element={<ProfilePage />} /><Routepath="api"@@ -186,7 +206,9 @@ function useMainAppRoutes() {path=""element={<OnboardProduct type={PRODUCT_NAMES?.unstract} />}>- {routes}+ <Route path="" element={<UnstractSubscriptionCheck />}>+ {routes}+ </Route></Route>);} else {