Skip to content

Commit

Permalink
Merge pull request #1412 from culturecreates/feature/issue-tech-suppo…
Browse files Browse the repository at this point in the history
…rt-92

Feature/issue tech support 92
  • Loading branch information
AbhishekPAnil authored Oct 21, 2024
2 parents ae40014 + 6f84855 commit 917f4ce
Showing 1 changed file with 22 additions and 3 deletions.
25 changes: 22 additions & 3 deletions src/pages/Dashboard/AddEvent/AddEvent.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -2169,6 +2169,18 @@ function AddEvent() {
}
}, [isReadOnly]);

useEffect(() => {
if (!taxonomyLoading && allTaxonomyData && !eventId && !duplicateId) {
if (
allTaxonomyData?.data
?.find((taxonomy) => taxonomy?.mappedToField === 'inLanguage')
?.concept?.map((concept) => (concept?.isDefault === true ? concept?.id : null))
?.filter((id) => id)?.length > 0
)
setAddedFields(addedFields.concat(otherInformationFieldNames?.inLanguage));
}
}, [taxonomyLoading]);

return !isLoading &&
!taxonomyLoading &&
currentCalendarData &&
Expand Down Expand Up @@ -4285,9 +4297,16 @@ function AddEvent() {
'none',
}}
label={taxonomyDetails(allTaxonomyData?.data, user, 'inLanguage', 'name', false)}
initialValue={eventData?.inLanguage?.map((inLanguage) => {
return inLanguage?.entityId;
})}
initialValue={
eventId
? eventData?.inLanguage?.map((inLanguage) => {
return inLanguage?.entityId;
})
: allTaxonomyData?.data
?.find((taxonomy) => taxonomy?.mappedToField === 'inLanguage')
?.concept?.map((concept) => (concept?.isDefault === true ? concept?.id : null))
?.filter((id) => id)
}
data-cy="form-item-eventlanguage-label">
<TreeSelectOption
allowClear
Expand Down

0 comments on commit 917f4ce

Please sign in to comment.