mirror of
https://github.com/danswer-ai/danswer.git
synced 2025-07-22 19:06:01 +02:00
Make WelcomeModal only appear for admins + only if no connectors are setup
This commit is contained in:
@@ -25,12 +25,7 @@ import { cookies } from "next/headers";
|
|||||||
import { DOCUMENT_SIDEBAR_WIDTH_COOKIE_NAME } from "@/components/resizable/contants";
|
import { DOCUMENT_SIDEBAR_WIDTH_COOKIE_NAME } from "@/components/resizable/contants";
|
||||||
import { personaComparator } from "../admin/personas/lib";
|
import { personaComparator } from "../admin/personas/lib";
|
||||||
import { ChatLayout } from "./ChatPage";
|
import { ChatLayout } from "./ChatPage";
|
||||||
import {
|
import { FullEmbeddingModelResponse } from "../admin/models/embedding/embeddingModels";
|
||||||
FullEmbeddingModelResponse,
|
|
||||||
checkModelNameIsValid,
|
|
||||||
} from "../admin/models/embedding/embeddingModels";
|
|
||||||
import { SwitchModelModal } from "@/components/SwitchModelModal";
|
|
||||||
import { NoSourcesModal } from "@/components/initialSetup/search/NoSourcesModal";
|
|
||||||
import { NoCompleteSourcesModal } from "@/components/initialSetup/search/NoCompleteSourceModal";
|
import { NoCompleteSourcesModal } from "@/components/initialSetup/search/NoCompleteSourceModal";
|
||||||
|
|
||||||
export default async function Page({
|
export default async function Page({
|
||||||
@@ -156,8 +151,11 @@ export default async function Page({
|
|||||||
? parseInt(documentSidebarCookieInitialWidth.value)
|
? parseInt(documentSidebarCookieInitialWidth.value)
|
||||||
: undefined;
|
: undefined;
|
||||||
|
|
||||||
const shouldShowWelcomeModal = !hasCompletedWelcomeFlowSS();
|
|
||||||
const hasAnyConnectors = ccPairs.length > 0;
|
const hasAnyConnectors = ccPairs.length > 0;
|
||||||
|
const shouldShowWelcomeModal =
|
||||||
|
!hasCompletedWelcomeFlowSS() &&
|
||||||
|
!hasAnyConnectors &&
|
||||||
|
(!user || user.role === "admin");
|
||||||
const shouldDisplaySourcesIncompleteModal =
|
const shouldDisplaySourcesIncompleteModal =
|
||||||
hasAnyConnectors &&
|
hasAnyConnectors &&
|
||||||
!shouldShowWelcomeModal &&
|
!shouldShowWelcomeModal &&
|
||||||
|
@@ -127,7 +127,11 @@ export default async function Home() {
|
|||||||
? (storedSearchType as SearchType)
|
? (storedSearchType as SearchType)
|
||||||
: SearchType.SEMANTIC; // default to semantic
|
: SearchType.SEMANTIC; // default to semantic
|
||||||
|
|
||||||
const shouldShowWelcomeModal = !hasCompletedWelcomeFlowSS();
|
const hasAnyConnectors = ccPairs.length > 0;
|
||||||
|
const shouldShowWelcomeModal =
|
||||||
|
!hasCompletedWelcomeFlowSS() &&
|
||||||
|
!hasAnyConnectors &&
|
||||||
|
(!user || user.role === "admin");
|
||||||
const shouldDisplayNoSourcesModal =
|
const shouldDisplayNoSourcesModal =
|
||||||
ccPairs.length === 0 && !shouldShowWelcomeModal;
|
ccPairs.length === 0 && !shouldShowWelcomeModal;
|
||||||
const shouldDisplaySourcesIncompleteModal =
|
const shouldDisplaySourcesIncompleteModal =
|
||||||
|
Reference in New Issue
Block a user