diff --git a/apps/web/src/api/asset_interfaces/terms/interfaces.ts b/apps/web/src/api/asset_interfaces/terms/interfaces.ts index 5e260f898..1c4a8b0d2 100644 --- a/apps/web/src/api/asset_interfaces/terms/interfaces.ts +++ b/apps/web/src/api/asset_interfaces/terms/interfaces.ts @@ -2,6 +2,7 @@ export interface BusterTerm { created_by: { id: string; name: string; + avatar_url: string | null; }; created_at: string; datasets: { diff --git a/apps/web/src/api/buster_rest/collections/queryRequests.ts b/apps/web/src/api/buster_rest/collections/queryRequests.ts index 2a2978ab3..7a93484fb 100644 --- a/apps/web/src/api/buster_rest/collections/queryRequests.ts +++ b/apps/web/src/api/buster_rest/collections/queryRequests.ts @@ -179,7 +179,10 @@ export const useShareCollection = () => { queryClient.setQueryData(queryKey, (previousData) => { if (!previousData) return previousData; return create(previousData, (draft: BusterCollection) => { - draft.individual_permissions = [...params, ...(draft.individual_permissions || [])]; + draft.individual_permissions = [ + ...params.map((p) => ({ ...p, avatar_url: null })), + ...(draft.individual_permissions || []) + ]; }); }); }, @@ -227,7 +230,7 @@ export const useUpdateCollectionShare = () => { draft.individual_permissions = draft.individual_permissions?.map((t) => { const found = params.users?.find((v) => v.email === t.email); - if (found) return found; + if (found) return { ...t, ...found }; return t; }) || []; diff --git a/apps/web/src/api/buster_rest/dashboards/queryRequests.ts b/apps/web/src/api/buster_rest/dashboards/queryRequests.ts index fbd546c5a..20662f6f2 100644 --- a/apps/web/src/api/buster_rest/dashboards/queryRequests.ts +++ b/apps/web/src/api/buster_rest/dashboards/queryRequests.ts @@ -352,7 +352,7 @@ export const useShareDashboard = () => { if (!previousData) return previousData; return create(previousData, (draft) => { draft.individual_permissions = [ - ...variables.params, + ...variables.params.map((p) => ({ ...p, avatar_url: null })), ...(draft.individual_permissions || []) ]; }); @@ -405,7 +405,7 @@ export const useUpdateDashboardShare = () => { draft.individual_permissions = draft.individual_permissions?.map((t) => { const found = params.users?.find((v) => v.email === t.email); - if (found) return found; + if (found) return { ...t, ...found }; return t; }) || []; diff --git a/apps/web/src/api/buster_rest/metrics/updateMetricQueryRequests.ts b/apps/web/src/api/buster_rest/metrics/updateMetricQueryRequests.ts index 94d61ee8c..8f02d47e2 100644 --- a/apps/web/src/api/buster_rest/metrics/updateMetricQueryRequests.ts +++ b/apps/web/src/api/buster_rest/metrics/updateMetricQueryRequests.ts @@ -229,7 +229,7 @@ export const useShareMetric = () => { if (!previousData) return previousData; return create(previousData, (draft: BusterMetric) => { draft.individual_permissions = [ - ...variables.params, + ...variables.params.map((p) => ({ ...p, avatar_url: null })), ...(draft.individual_permissions || []) ]; }); @@ -299,7 +299,7 @@ export const useUpdateMetricShare = () => { draft.individual_permissions = draft.individual_permissions?.map((t) => { const found = variables.params.users?.find((v) => v.email === t.email); - if (found) return found; + if (found) return { ...t, ...found }; return t; }) || []; diff --git a/apps/web/src/components/features/ShareMenu/IndividualSharePerson.tsx b/apps/web/src/components/features/ShareMenu/IndividualSharePerson.tsx index 3462ecf2c..cc62bea1a 100644 --- a/apps/web/src/components/features/ShareMenu/IndividualSharePerson.tsx +++ b/apps/web/src/components/features/ShareMenu/IndividualSharePerson.tsx @@ -9,11 +9,11 @@ export const IndividualSharePerson: React.FC<{ name?: string; email: string; role: ShareRole; - avatarURL: string | null; + avatar_url: string | null; onUpdateShareRole: (email: string, role: ShareRole | null) => void; assetType: ShareAssetType; disabled: boolean; -}> = React.memo(({ name, onUpdateShareRole, email, avatarURL, role, assetType, disabled }) => { +}> = React.memo(({ name, onUpdateShareRole, email, avatar_url, role, assetType, disabled }) => { const isSameEmailName = name === email; const onChangeShareLevel = useMemoizedFn((v: ShareRole | null) => { @@ -26,7 +26,7 @@ export const IndividualSharePerson: React.FC<{ data-testid={`share-person-${email}`}>
- +
diff --git a/apps/web/src/components/features/ShareMenu/ShareMenuContent.stories.tsx b/apps/web/src/components/features/ShareMenu/ShareMenuContent.stories.tsx index 0f7210fbc..2348e81e3 100644 --- a/apps/web/src/components/features/ShareMenu/ShareMenuContent.stories.tsx +++ b/apps/web/src/components/features/ShareMenu/ShareMenuContent.stories.tsx @@ -19,12 +19,14 @@ const mockShareConfig: ShareConfig = { { email: 'test_with_a_long_name_like_super_long_name@test.com', role: 'canView', - name: 'Test User' + name: 'Test User', + avatar_url: null }, { email: 'test2@test.com', role: 'fullAccess', - name: 'Test User 2 with a long name like super long name' + name: 'Test User 2 with a long name like super long name', + avatar_url: null } ], public_expiry_date: null, diff --git a/apps/web/src/components/ui/avatar/Avatar.tsx b/apps/web/src/components/ui/avatar/Avatar.tsx index 7d6b3e67a..3a7c5215d 100644 --- a/apps/web/src/components/ui/avatar/Avatar.tsx +++ b/apps/web/src/components/ui/avatar/Avatar.tsx @@ -6,7 +6,7 @@ import { Tooltip } from '../tooltip/Tooltip'; import { Avatar as AvatarBase, AvatarFallback, AvatarImage } from './AvatarBase'; export interface AvatarProps { - image: string | null | undefined; + image?: string | null | undefined; name?: string | null; className?: string; fallbackClassName?: string; diff --git a/apps/web/src/controllers/TermIndividualController/TermIndividualContentSider.tsx b/apps/web/src/controllers/TermIndividualController/TermIndividualContentSider.tsx index 8ff86e5af..b427a9390 100644 --- a/apps/web/src/controllers/TermIndividualController/TermIndividualContentSider.tsx +++ b/apps/web/src/controllers/TermIndividualController/TermIndividualContentSider.tsx @@ -45,7 +45,7 @@ export const TermIndividualContentSider: React.FC<{ termId: string }> = ({ termI
- + {term?.created_by.name} ( diff --git a/packages/server-shared/src/share/index.ts b/packages/server-shared/src/share/index.ts index 7446d0ba5..51be04808 100644 --- a/packages/server-shared/src/share/index.ts +++ b/packages/server-shared/src/share/index.ts @@ -1,2 +1,2 @@ -export * from './shareInterfaces'; -export * from './verificationInterfaces'; +export * from './share-interfaces.types'; +export * from './verification.types'; diff --git a/packages/server-shared/src/share/shareInterfaces.test.ts b/packages/server-shared/src/share/share-interfaces.test.ts similarity index 99% rename from packages/server-shared/src/share/shareInterfaces.test.ts rename to packages/server-shared/src/share/share-interfaces.test.ts index 8ef9fa194..14c8b4df8 100644 --- a/packages/server-shared/src/share/shareInterfaces.test.ts +++ b/packages/server-shared/src/share/share-interfaces.test.ts @@ -4,7 +4,7 @@ import { ShareConfigSchema, ShareIndividualSchema, ShareRoleSchema, -} from './shareInterfaces'; +} from './share-interfaces.types'; describe('ShareRoleSchema', () => { it('should accept valid role values', () => { diff --git a/packages/server-shared/src/share/shareInterfaces.ts b/packages/server-shared/src/share/share-interfaces.types.ts similarity index 100% rename from packages/server-shared/src/share/shareInterfaces.ts rename to packages/server-shared/src/share/share-interfaces.types.ts diff --git a/packages/server-shared/src/share/verificationInterfaces.ts b/packages/server-shared/src/share/verification.types.ts similarity index 100% rename from packages/server-shared/src/share/verificationInterfaces.ts rename to packages/server-shared/src/share/verification.types.ts