Bug fix: avatar of account owner not displayed (#690)

* Begin - fix account owner not displayed

* Finish - profile pic of account owner not displayed
This commit is contained in:
Félix Malfait
2023-07-16 19:03:19 +02:00
committed by GitHub
parent 51d25c3e93
commit 11405f561f
12 changed files with 36 additions and 8 deletions

View File

@ -7,7 +7,7 @@ import { Company, User } from '~/generated/graphql';
import { CompanyAccountOwnerPicker } from './CompanyAccountOwnerPicker';
export type CompanyAccountOnwer = Pick<Company, 'id'> & {
accountOwner?: Pick<User, 'id' | 'displayName'> | null;
accountOwner?: Pick<User, 'id' | 'displayName' | 'avatarUrl'> | null;
};
export type OwnProps = {
@ -40,6 +40,7 @@ export function CompanyAccountOwnerCell({ company }: OwnProps) {
<PersonChip
id={company.accountOwner.id}
name={company.accountOwner?.displayName ?? ''}
picture={company.accountOwner?.avatarUrl ?? ''}
/>
) : (
<></>

View File

@ -42,6 +42,7 @@ export function CompanyAccountOwnerPicker({
id: user.id,
name: user.displayName,
avatarType: 'rounded',
avatarUrl: user.avatarUrl ?? '',
}),
orderByField: 'firstName',
searchOnFields: ['firstName', 'lastName'],

View File

@ -12,7 +12,7 @@ import { CompanyAccountOwnerPickerFieldEditMode } from './CompanyAccountOwnerPic
type OwnProps = {
company: Pick<Company, 'id' | 'accountOwnerId'> & {
accountOwner?: Pick<User, 'id' | 'displayName'> | null;
accountOwner?: Pick<User, 'id' | 'displayName' | 'avatarUrl'> | null;
};
};
@ -41,6 +41,7 @@ export function CompanyAccountOwnerEditableField({ company }: OwnProps) {
<PersonChip
id={company.accountOwner.id}
name={company.accountOwner?.displayName ?? ''}
picture={company.accountOwner?.avatarUrl ?? ''}
/>
) : (
<></>

View File

@ -34,6 +34,7 @@ export const GET_COMPANIES = gql`
displayName
firstName
lastName
avatarUrl
}
}
}

View File

@ -16,6 +16,7 @@ export const GET_COMPANY = gql`
id
email
displayName
avatarUrl
}
}
}

View File

@ -16,6 +16,7 @@ export function EditableCompanyAccountOwnerCell() {
company={{
id: currentRowEntityId ?? '',
accountOwner: {
avatarUrl: accountOwner?.avatarUrl ?? '',
displayName: accountOwner?.displayName ?? '',
id: accountOwner?.id ?? '',
},