diff --git a/apps/web/src/api/buster_rest/users/useGetUserInfo.ts b/apps/web/src/api/buster_rest/users/useGetUserInfo.ts index 1e4c865ae..fc78d4512 100644 --- a/apps/web/src/api/buster_rest/users/useGetUserInfo.ts +++ b/apps/web/src/api/buster_rest/users/useGetUserInfo.ts @@ -67,13 +67,6 @@ export const useIsUserRegistered = () => { const userBasicInfo = useGetUserBasicInfo(); const isAnonymousUser = useIsAnonymousUser(); const isUserRegistered = !!userOrganization?.id && !!userBasicInfo?.name && !isAnonymousUser; - console.log( - 'isUserRegistered', - userOrganization?.id, - userBasicInfo?.name, - isAnonymousUser, - userBasicInfo - ); return isUserRegistered; }; diff --git a/apps/web/src/controllers/HomePage/NewChatWarning.tsx b/apps/web/src/controllers/HomePage/NewChatWarning.tsx index 69a444dac..319a3064e 100644 --- a/apps/web/src/controllers/HomePage/NewChatWarning.tsx +++ b/apps/web/src/controllers/HomePage/NewChatWarning.tsx @@ -1,6 +1,8 @@ import type { UserOrganizationRole } from '@buster/server-shared/organization'; import { Link } from '@tanstack/react-router'; import React from 'react'; +import { useListDatasources } from '@/api/buster_rest/data_source'; +import { useGetDatasets } from '@/api/buster_rest/datasets'; import { Button } from '@/components/ui/buttons'; import { AlertWarning, ArrowUpRight, CircleCheck } from '@/components/ui/icons'; import { Paragraph, Text } from '@/components/ui/typography'; @@ -25,12 +27,12 @@ export const NewChatWarning = React.memo( const progressPercentage = (progress / 2) * 100; return ( -
+
Setup Checklist
{progress}/2 completed
-
+
{status ? : number} @@ -159,18 +161,59 @@ const SetupItem = ({ number, status, title, description, link, linkText }: Setup ); }; +interface ResourceSectionProps { + title: string; + items?: Array<{ id: string; name: string }>; + emptyMessage: string; + pluralName: string; +} + +const ResourceSection = ({ title, items, emptyMessage, pluralName }: ResourceSectionProps) => { + const itemCount = items?.length || 0; + + return ( +
+
+ {title} + + {itemCount} available + +
+ {items && items.length > 0 ? ( +
+ {items.slice(0, 3).map((item) => ( +
+
+ {item.name} +
+ ))} + {items.length > 3 && ( + + +{items.length - 3} more {pluralName} + + )} +
+ ) : ( + {emptyMessage} + )} +
+ ); +}; + interface ContactAdminCardProps { userRole?: UserOrganizationRole; } const ContactAdminCard = ({ userRole }: ContactAdminCardProps) => { const roleLabel = userRole ? translateRole(userRole) : 'User'; + const { data: datasets = [] } = useGetDatasets(); + const { data: datasources = [] } = useListDatasources(); return ( -
+
Contact Admin Required -
+
{roleLabel}
@@ -180,7 +223,7 @@ const ContactAdminCard = ({ userRole }: ContactAdminCardProps) => {
-
+
@@ -201,6 +244,25 @@ const ContactAdminCard = ({ userRole }: ContactAdminCardProps) => {
+ + {/* Available Resources */} +
+ Your Current Access + + + + +
);