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}`}>