Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: #1518

Merged
merged 1 commit into from
Jan 2, 2025
Merged

feat: #1518

Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 4 additions & 2 deletions src/components/TreeSelectOption/treeSelectOption.settings.js
Original file line number Diff line number Diff line change
Expand Up @@ -88,14 +88,16 @@ export const treeEntitiesOption = (
isFieldsDirty[langKey] = false;
});
let options = data?.map((entity) => {
let mainImageData = entity?.image;

return {
label: (
<SelectionItem
itemWidth="100%"
icon={
entity?.type?.toUpperCase() == taxonomyClass.ORGANIZATION ? (
entity?.logo?.thumbnail?.uri ? (
<img src={entity?.logo?.thumbnail?.uri} />
entity?.logo?.thumbnail?.uri || mainImageData?.original?.uri ? (
<img src={entity?.logo?.thumbnail?.uri ?? mainImageData?.original?.uri} />
) : (
<Icon component={Organizations} style={{ color: '#607EFC' }} />
)
Expand Down
89 changes: 46 additions & 43 deletions src/pages/Dashboard/Organizations/Organizations.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -437,50 +437,53 @@ function Organizations() {
current: Number(pageNumber),
showSizeChanger: false,
}}
renderItem={(item, index) => (
<ListItem
data-cy={`antd-organization-list-item-${index}`}
key={index}
id={index}
logo={item?.logo?.thumbnail?.uri}
defaultLogo={
<Icon
component={OrganizationLogo}
style={{ color: '#607EFC', fontSize: '18px' }}
data-cy="organization-logo"
/>
}
title={contentLanguageBilingual({
data: item?.name,
interfaceLanguage: user?.interfaceLanguage?.toLowerCase(),
calendarContentLanguage: calendarContentLanguage,
})}
description={contentLanguageBilingual({
data: item?.disambiguatingDescription,
interfaceLanguage: user?.interfaceLanguage?.toLowerCase(),
calendarContentLanguage: calendarContentLanguage,
})}
createdDate={item?.creator?.date}
createdByUserName={item?.creator?.userName}
updatedDate={item?.modifier?.date}
updatedByUserName={item?.modifier?.userName}
artsDataLink={artsDataLinkChecker(item?.sameAs)}
listItemHandler={() => listItemHandler(item?.id)}
actions={[
adminCheckHandler({ calendar, user }) && !isReadOnly && (
<DeleteOutlined
key={'delete-icon'}
style={{ color: '#222732', fontSize: '24px' }}
onClick={(e) => {
e.stopPropagation();
deleteOrganizationHandler(item?.id);
}}
data-cy="delete-organization"
renderItem={(item, index) => {
const mainImageData = item?.image?.find((image) => image?.isMain) || null;
return (
<ListItem
data-cy={`antd-organization-list-item-${index}`}
key={index}
id={index}
logo={item?.logo?.thumbnail?.uri ?? mainImageData?.original?.uri}
defaultLogo={
<Icon
component={OrganizationLogo}
style={{ color: '#607EFC', fontSize: '18px' }}
data-cy="organization-logo"
/>
),
]}
/>
)}
}
title={contentLanguageBilingual({
data: item?.name,
interfaceLanguage: user?.interfaceLanguage?.toLowerCase(),
calendarContentLanguage: calendarContentLanguage,
})}
description={contentLanguageBilingual({
data: item?.disambiguatingDescription,
interfaceLanguage: user?.interfaceLanguage?.toLowerCase(),
calendarContentLanguage: calendarContentLanguage,
})}
createdDate={item?.creator?.date}
createdByUserName={item?.creator?.userName}
updatedDate={item?.modifier?.date}
updatedByUserName={item?.modifier?.userName}
artsDataLink={artsDataLinkChecker(item?.sameAs)}
listItemHandler={() => listItemHandler(item?.id)}
actions={[
adminCheckHandler({ calendar, user }) && !isReadOnly && (
<DeleteOutlined
key={'delete-icon'}
style={{ color: '#222732', fontSize: '24px' }}
onClick={(e) => {
e.stopPropagation();
deleteOrganizationHandler(item?.id);
}}
data-cy="delete-organization"
/>
),
]}
/>
);
}}
/>
) : (
<NoContent style={{ height: '200px' }} data-cy="empty-organization" />
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -87,6 +87,7 @@ function OrganizationsReadOnly() {
const calendarContentLanguage = currentCalendarData?.contentLanguage;
const imageConfig = currentCalendarData?.imageConfig?.length > 0 && currentCalendarData?.imageConfig[0];
const imageGalleryData = organizationData?.image?.filter((image) => image && !image?.isMain) || [];
const mainImageData = organizationData?.image?.find((image) => image?.isMain) || null;

const formConstants = currentCalendarData?.forms?.filter((form) => form?.formName === 'Organization')[0];
let mandatoryStandardFields = [];
Expand Down Expand Up @@ -603,10 +604,10 @@ function OrganizationsReadOnly() {
</Row>
</Col>
<Col className="top-level-column">
{organizationData?.logo?.original?.uri && (
{(organizationData?.logo?.original?.uri || mainImageData?.original?.uri) && (
<div>
<img
src={organizationData?.logo?.original?.uri}
src={organizationData?.logo?.original?.uri ?? mainImageData?.original?.uri}
alt="avatar"
style={{
objectFit: 'contain',
Expand Down
Loading