diff --git a/web/src/app/chat/folders/FolderList.tsx b/web/src/app/chat/folders/FolderList.tsx index 566dccb5687..23661247d9a 100644 --- a/web/src/app/chat/folders/FolderList.tsx +++ b/web/src/app/chat/folders/FolderList.tsx @@ -24,6 +24,7 @@ import { CHAT_SESSION_ID_KEY } from "@/lib/drag/constants"; import Cookies from "js-cookie"; import { Popover } from "@/components/popover/Popover"; import { ChatSession } from "../interfaces"; +import { useChatContext } from "@/components/context/ChatContext"; const FolderItem = ({ folder, currentChatId, @@ -40,6 +41,7 @@ const FolderItem = ({ showShareModal: ((chatSession: ChatSession) => void) | undefined; showDeleteModal: ((chatSession: ChatSession) => void) | undefined; }) => { + const { refreshChatSessions } = useChatContext(); const [isExpanded, setIsExpanded] = useState(isInitiallyExpanded); const [isEditing, setIsEditing] = useState(initiallySelected); const [editedFolderName, setEditedFolderName] = useState( @@ -93,7 +95,7 @@ const FolderItem = ({ if (!continueEditing) { setIsEditing(false); } - router.refresh(); // Refresh values to update the sidebar + router.refresh(); } catch (error) { setPopup({ message: "Failed to save folder name", type: "error" }); } @@ -154,7 +156,8 @@ const FolderItem = ({ const chatSessionId = event.dataTransfer.getData(CHAT_SESSION_ID_KEY); try { await addChatToFolder(folder.folder_id, chatSessionId); - router.refresh(); // Refresh to show the updated folder contents + await refreshChatSessions(); + router.refresh(); } catch (error) { setPopup({ message: "Failed to add chat session to folder", diff --git a/web/src/app/ee/admin/cloud-settings/BillingInformationPage.tsx b/web/src/app/ee/admin/billing/BillingInformationPage.tsx similarity index 100% rename from web/src/app/ee/admin/cloud-settings/BillingInformationPage.tsx rename to web/src/app/ee/admin/billing/BillingInformationPage.tsx diff --git a/web/src/app/ee/admin/cloud-settings/page.tsx b/web/src/app/ee/admin/billing/page.tsx similarity index 74% rename from web/src/app/ee/admin/cloud-settings/page.tsx rename to web/src/app/ee/admin/billing/page.tsx index 6566e069ba7..96cfe7585b3 100644 --- a/web/src/app/ee/admin/cloud-settings/page.tsx +++ b/web/src/app/ee/admin/billing/page.tsx @@ -1,6 +1,6 @@ import { AdminPageTitle } from "@/components/admin/Title"; import BillingInformationPage from "./BillingInformationPage"; -import { FaCloud } from "react-icons/fa"; +import { MdOutlineCreditCard } from "react-icons/md"; export interface BillingInformation { seats: number; @@ -14,8 +14,8 @@ export default function page() { return (
} + title="Billing Information" + icon={} />
diff --git a/web/src/app/ee/admin/cloud-settings/utils.ts b/web/src/app/ee/admin/billing/utils.ts similarity index 100% rename from web/src/app/ee/admin/cloud-settings/utils.ts rename to web/src/app/ee/admin/billing/utils.ts diff --git a/web/src/components/admin/ClientLayout.tsx b/web/src/components/admin/ClientLayout.tsx index ac22cd65066..e63298c2857 100644 --- a/web/src/components/admin/ClientLayout.tsx +++ b/web/src/components/admin/ClientLayout.tsx @@ -30,7 +30,7 @@ import { User } from "@/lib/types"; import { usePathname } from "next/navigation"; import { SettingsContext } from "../settings/SettingsProvider"; import { useContext } from "react"; -import { Cloud } from "@phosphor-icons/react"; +import { MdOutlineCreditCard } from "react-icons/md"; export function ClientLayout({ user, @@ -386,14 +386,14 @@ export function ClientLayout({ { name: (
- -
Cloud Settings
+
Billing
), - link: "/admin/cloud-settings", + link: "/admin/billing", }, ] : []), diff --git a/web/src/components/admin/Layout.tsx b/web/src/components/admin/Layout.tsx index 2b1cef8cc2c..6c8cfce41bc 100644 --- a/web/src/components/admin/Layout.tsx +++ b/web/src/components/admin/Layout.tsx @@ -7,7 +7,7 @@ import { import { redirect } from "next/navigation"; import { ClientLayout } from "./ClientLayout"; import { - SERVER_SIDE_ONLY__CLOUD_ENABLED, + NEXT_PUBLIC_CLOUD_ENABLED, SERVER_SIDE_ONLY__PAID_ENTERPRISE_FEATURES_ENABLED, } from "@/lib/constants"; import { AnnouncementBanner } from "../header/AnnouncementBanner"; @@ -45,7 +45,7 @@ export async function Layout({ children }: { children: React.ReactNode }) { return ( diff --git a/web/src/components/chat_search/Header.tsx b/web/src/components/chat_search/Header.tsx index 633b79dfe46..a16ccd2b696 100644 --- a/web/src/components/chat_search/Header.tsx +++ b/web/src/components/chat_search/Header.tsx @@ -139,10 +139,9 @@ export default function FunctionalHeader({ - - {page != "assistants" && (
Update here diff --git a/web/src/lib/constants.ts b/web/src/lib/constants.ts index 2408bd8fca2..c84bc2eeeff 100644 --- a/web/src/lib/constants.ts +++ b/web/src/lib/constants.ts @@ -74,7 +74,4 @@ export const NEXT_PUBLIC_CLOUD_ENABLED = export const REGISTRATION_URL = process.env.INTERNAL_URL || "http://127.0.0.1:3001"; -export const SERVER_SIDE_ONLY__CLOUD_ENABLED = - process.env.NEXT_PUBLIC_CLOUD_ENABLED?.toLowerCase() === "true"; - export const TEST_ENV = process.env.TEST_ENV?.toLowerCase() === "true"; diff --git a/web/src/lib/userSS.ts b/web/src/lib/userSS.ts index 7360d549415..9e7de4acb2e 100644 --- a/web/src/lib/userSS.ts +++ b/web/src/lib/userSS.ts @@ -2,7 +2,7 @@ import { cookies } from "next/headers"; import { User } from "./types"; import { buildUrl } from "./utilsSS"; import { ReadonlyRequestCookies } from "next/dist/server/web/spec-extension/adapters/request-cookies"; -import { AuthType, SERVER_SIDE_ONLY__CLOUD_ENABLED } from "./constants"; +import { AuthType, NEXT_PUBLIC_CLOUD_ENABLED } from "./constants"; export interface AuthTypeMetadata { authType: AuthType; @@ -22,7 +22,7 @@ export const getAuthTypeMetadataSS = async (): Promise => { let authType: AuthType; // Override fasapi users auth so we can use both - if (SERVER_SIDE_ONLY__CLOUD_ENABLED) { + if (NEXT_PUBLIC_CLOUD_ENABLED) { authType = "cloud"; } else { authType = data.auth_type as AuthType; diff --git a/web/src/middleware.ts b/web/src/middleware.ts index 835c1b86237..cd601458133 100644 --- a/web/src/middleware.ts +++ b/web/src/middleware.ts @@ -14,7 +14,7 @@ export const config = { "/admin/standard-answer/:path*", // Cloud only - "/admin/cloud-settings/:path*", + "/admin/billing/:path*", ], };