mirror of https://github.com/buster-so/buster.git
avatar passthrough
This commit is contained in:
parent
0331be1cda
commit
2a6bd2f5a8
|
@ -8,6 +8,7 @@ const __dirname = dirname(__filename);
|
|||
|
||||
const apiUrl = new URL(env.NEXT_PUBLIC_API_URL).origin;
|
||||
const api2Url = new URL(env.NEXT_PUBLIC_API2_URL).origin;
|
||||
const profilePictureURL = 'https://googleusercontent.com';
|
||||
|
||||
// Function to create CSP header with dynamic API URLs
|
||||
const createCspHeader = (isEmbed = false) => {
|
||||
|
@ -32,7 +33,7 @@ const createCspHeader = (isEmbed = false) => {
|
|||
// Frame sources
|
||||
"frame-src 'self' https://vercel.live",
|
||||
// Connect sources for API calls
|
||||
`connect-src 'self' ${localDomains} https://*.vercel.app https://*.supabase.co wss://*.supabase.co https://*.posthog.com ${apiUrl} ${api2Url}`
|
||||
`connect-src 'self' ${localDomains} https://*.vercel.app https://*.supabase.co wss://*.supabase.co https://*.posthog.com ${apiUrl} ${api2Url} ${profilePictureURL}`
|
||||
.replace(/\s+/g, ' ')
|
||||
.trim(),
|
||||
// Media
|
||||
|
|
|
@ -30,7 +30,6 @@ export const SidebarUserFooter: React.FC = () => {
|
|||
const handleSignOut = useSignOut();
|
||||
if (!user) return null;
|
||||
|
||||
console.log(user);
|
||||
const { name, email, avatar_url } = user;
|
||||
|
||||
if (!name || !email) return null;
|
||||
|
|
|
@ -10,6 +10,7 @@ const Avatar = React.forwardRef<
|
|||
>(({ className, ...props }, ref) => (
|
||||
<AvatarPrimitive.Root
|
||||
ref={ref}
|
||||
data-slot="avatar"
|
||||
className={cn('relative flex h-7 w-7 shrink-0 overflow-hidden rounded-full', className)}
|
||||
{...props}
|
||||
/>
|
||||
|
@ -19,13 +20,16 @@ Avatar.displayName = AvatarPrimitive.Root.displayName;
|
|||
const AvatarImage = React.forwardRef<
|
||||
React.ElementRef<typeof AvatarPrimitive.Image>,
|
||||
React.ComponentPropsWithoutRef<typeof AvatarPrimitive.Image>
|
||||
>(({ className, ...props }, ref) => (
|
||||
<AvatarPrimitive.Image
|
||||
ref={ref}
|
||||
className={cn('aspect-square h-full w-full', className)}
|
||||
{...props}
|
||||
/>
|
||||
));
|
||||
>(({ className, ...props }, ref) => {
|
||||
return (
|
||||
<AvatarPrimitive.Image
|
||||
ref={ref}
|
||||
data-testid="avatar-image"
|
||||
data-slot="avatar-image"
|
||||
className={cn('aspect-square h-full w-full', className)}
|
||||
/>
|
||||
);
|
||||
});
|
||||
AvatarImage.displayName = AvatarPrimitive.Image.displayName;
|
||||
|
||||
const AvatarFallback = React.forwardRef<
|
||||
|
@ -34,6 +38,7 @@ const AvatarFallback = React.forwardRef<
|
|||
>(({ className, ...props }, ref) => (
|
||||
<AvatarPrimitive.Fallback
|
||||
ref={ref}
|
||||
data-slot="avatar-fallback"
|
||||
className={cn(
|
||||
'bg-gray-light/60 text-background flex h-full w-full items-center justify-center rounded-full text-[10px] leading-0',
|
||||
className
|
||||
|
|
|
@ -27,7 +27,6 @@ const ChatsContainer: React.FC<Record<string, never>> = () => {
|
|||
const [filters, setFilters] = useState<Partial<Parameters<typeof getListChats>[0]>>({});
|
||||
|
||||
const { data: list, isFetched } = useGetListChats(filters);
|
||||
console.log('list', list);
|
||||
|
||||
return <ChatItemsContainer chats={list} loading={!isFetched} type={'chats'} />;
|
||||
};
|
||||
|
|
|
@ -1,19 +1,14 @@
|
|||
import { z } from "zod/v4";
|
||||
import { z } from 'zod/v4';
|
||||
|
||||
export const ShareRoleSchema = z.enum([
|
||||
"owner", //owner of the asset
|
||||
"fullAccess", //same as owner, can share with others
|
||||
"canEdit", //can edit, cannot share
|
||||
"canFilter", //can filter dashboard
|
||||
"canView", //can view asset
|
||||
'owner', //owner of the asset
|
||||
'fullAccess', //same as owner, can share with others
|
||||
'canEdit', //can edit, cannot share
|
||||
'canFilter', //can filter dashboard
|
||||
'canView', //can view asset
|
||||
]);
|
||||
|
||||
export const ShareAssetTypeSchema = z.enum([
|
||||
"metric",
|
||||
"dashboard",
|
||||
"collection",
|
||||
"chat",
|
||||
]);
|
||||
export const ShareAssetTypeSchema = z.enum(['metric', 'dashboard', 'collection', 'chat']);
|
||||
|
||||
export const ShareIndividualSchema = z.object({
|
||||
email: z.string(),
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
import { z } from "zod/v4";
|
||||
import type { UserFavorite } from "./favorites.types";
|
||||
import type { UserOrganizationRole } from "./roles.types";
|
||||
import { z } from 'zod/v4';
|
||||
import type { UserFavorite } from './favorites.types';
|
||||
import type { UserOrganizationRole } from './roles.types';
|
||||
|
||||
export const UserSchema = z.object({
|
||||
attributes: z.object({
|
||||
|
|
|
@ -6029,6 +6029,7 @@ packages:
|
|||
|
||||
bun@1.2.18:
|
||||
resolution: {integrity: sha512-OR+EpNckoJN4tHMVZPaTPxDj2RgpJgJwLruTIFYbO3bQMguLd0YrmkWKYqsiihcLgm2ehIjF/H1RLfZiRa7+qQ==}
|
||||
cpu: [arm64, x64, aarch64]
|
||||
os: [darwin, linux, win32]
|
||||
hasBin: true
|
||||
|
||||
|
@ -17507,14 +17508,14 @@ snapshots:
|
|||
msw: 2.10.3(@types/node@20.19.4)(typescript@5.8.3)
|
||||
vite: 6.3.5(@types/node@20.19.4)(jiti@2.4.2)(lightningcss@1.30.1)(sass@1.89.2)(terser@5.43.1)(tsx@4.20.3)(yaml@2.8.0)
|
||||
|
||||
'@vitest/mocker@3.2.4(msw@2.10.3(@types/node@24.0.10)(typescript@5.8.3))(vite@6.3.5(@types/node@20.19.4)(jiti@2.4.2)(lightningcss@1.30.1)(sass@1.89.2)(terser@5.43.1)(tsx@4.20.3)(yaml@2.8.0))':
|
||||
'@vitest/mocker@3.2.4(msw@2.10.3(@types/node@24.0.10)(typescript@5.8.3))(vite@6.3.5(@types/node@24.0.10)(jiti@2.4.2)(lightningcss@1.30.1)(sass@1.89.2)(terser@5.43.1)(tsx@4.20.3)(yaml@2.8.0))':
|
||||
dependencies:
|
||||
'@vitest/spy': 3.2.4
|
||||
estree-walker: 3.0.3
|
||||
magic-string: 0.30.17
|
||||
optionalDependencies:
|
||||
msw: 2.10.3(@types/node@24.0.10)(typescript@5.8.3)
|
||||
vite: 6.3.5(@types/node@20.19.4)(jiti@2.4.2)(lightningcss@1.30.1)(sass@1.89.2)(terser@5.43.1)(tsx@4.20.3)(yaml@2.8.0)
|
||||
vite: 6.3.5(@types/node@24.0.10)(jiti@2.4.2)(lightningcss@1.30.1)(sass@1.89.2)(terser@5.43.1)(tsx@4.20.3)(yaml@2.8.0)
|
||||
|
||||
'@vitest/pretty-format@2.0.5':
|
||||
dependencies:
|
||||
|
@ -17557,7 +17558,7 @@ snapshots:
|
|||
sirv: 3.0.1
|
||||
tinyglobby: 0.2.14
|
||||
tinyrainbow: 2.0.0
|
||||
vitest: 3.2.4(@edge-runtime/vm@3.2.0)(@types/debug@4.1.12)(@types/node@20.19.4)(@vitest/ui@3.2.4)(jiti@2.4.2)(jsdom@26.1.0)(lightningcss@1.30.1)(msw@2.10.3(@types/node@20.19.4)(typescript@5.8.3))(sass@1.89.2)(terser@5.43.1)(tsx@4.20.3)(yaml@2.8.0)
|
||||
vitest: 3.2.4(@edge-runtime/vm@3.2.0)(@types/debug@4.1.12)(@types/node@24.0.10)(@vitest/ui@3.2.4)(jiti@2.4.2)(jsdom@26.1.0)(lightningcss@1.30.1)(msw@2.10.3(@types/node@24.0.10)(typescript@5.8.3))(sass@1.89.2)(terser@5.43.1)(tsx@4.20.3)(yaml@2.8.0)
|
||||
|
||||
'@vitest/utils@2.0.5':
|
||||
dependencies:
|
||||
|
@ -24303,7 +24304,7 @@ snapshots:
|
|||
dependencies:
|
||||
'@types/chai': 5.2.2
|
||||
'@vitest/expect': 3.2.4
|
||||
'@vitest/mocker': 3.2.4(msw@2.10.3(@types/node@24.0.10)(typescript@5.8.3))(vite@6.3.5(@types/node@20.19.4)(jiti@2.4.2)(lightningcss@1.30.1)(sass@1.89.2)(terser@5.43.1)(tsx@4.20.3)(yaml@2.8.0))
|
||||
'@vitest/mocker': 3.2.4(msw@2.10.3(@types/node@24.0.10)(typescript@5.8.3))(vite@6.3.5(@types/node@24.0.10)(jiti@2.4.2)(lightningcss@1.30.1)(sass@1.89.2)(terser@5.43.1)(tsx@4.20.3)(yaml@2.8.0))
|
||||
'@vitest/pretty-format': 3.2.4
|
||||
'@vitest/runner': 3.2.4
|
||||
'@vitest/snapshot': 3.2.4
|
||||
|
|
Loading…
Reference in New Issue