Skip to content

Commit

Permalink
Merge pull request #832 from culturecreates/develop
Browse files Browse the repository at this point in the history
Develop
  • Loading branch information
sahalali authored Dec 1, 2023
2 parents e2171c6 + d60d549 commit 52e1dd4
Show file tree
Hide file tree
Showing 13 changed files with 860 additions and 489 deletions.
1 change: 1 addition & 0 deletions src/constants/eventFormRequiredFieldNames.js
Original file line number Diff line number Diff line change
Expand Up @@ -12,4 +12,5 @@ export const eventFormRequiredFieldNames = {
LOCATION: 'LOCATION',
IMAGE: 'IMAGE',
FEATURED: 'FEATURED',
ORGANIZERS: 'ORGANIZERS',
};
84 changes: 52 additions & 32 deletions src/constants/formFields.js
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@ import SelectionItem from '../components/List/SelectionItem';
import BilingualTextEditor from '../components/BilingualTextEditor';
import Outlined from '../components/Button/Outlined';
import { sourceOptions } from './sourceOptions';
import LoadingIndicator from '../components/LoadingIndicator';

const { TextArea } = Input;

Expand Down Expand Up @@ -359,6 +360,8 @@ export const formFieldValue = [
allPlacesArtsdataList,
placeNavigationHandler,
mappedField,
isEntitiesFetching,
isExternalSourceFetching,
}) => {
return (
<>
Expand All @@ -379,49 +382,62 @@ export const formFieldValue = [
{t('dashboard.organization.createNew.search.footlightSectionHeading')}
</div>
<div className="search-scrollable-content">
{allPlacesList?.length > 0 ? (
allPlacesList?.map((place, index) => (
{isEntitiesFetching && (
<div
style={{ height: '200px', display: 'flex', alignItems: 'center', justifyContent: 'center' }}>
<LoadingIndicator />
</div>
)}
{!isEntitiesFetching &&
(allPlacesList?.length > 0 ? (
allPlacesList?.map((place, index) => (
<div
key={index}
className={`event-popover-options ${
locationPlace?.value == place?.value ? 'event-popover-options-active' : null
}`}
onClick={() => {
setLocationPlace(place);
form.setFieldValue(name, place?.value);
setIsPopoverOpen(false);
}}
data-cy={`div-${mappedField}-footlight-place-${index}`}>
{place?.label}
</div>
))
) : (
<NoContent />
))}
</div>
</>

<div className="popover-section-header" data-cy={`div-${mappedField}-artsdata-place-title`}>
{t('dashboard.organization.createNew.search.artsDataSectionHeading')}
</div>
<div className="search-scrollable-content">
{isExternalSourceFetching && (
<div style={{ height: '200px', display: 'flex', alignItems: 'center', justifyContent: 'center' }}>
<LoadingIndicator />
</div>
)}
{!isExternalSourceFetching &&
(allPlacesArtsdataList?.length > 0 ? (
allPlacesArtsdataList?.map((place, index) => (
<div
key={index}
className={`event-popover-options ${
locationPlace?.value == place?.value ? 'event-popover-options-active' : null
}`}
className="event-popover-options"
onClick={() => {
setLocationPlace(place);
form.setFieldValue(name, place?.value);
form.setFieldValue(name, place?.uri);
setIsPopoverOpen(false);
}}
data-cy={`div-${mappedField}-footlight-place-${index}`}>
data-cy={`div-${mappedField}-artsdata-place-${index}`}>
{place?.label}
</div>
))
) : (
<NoContent />
)}
</div>
</>

<div className="popover-section-header" data-cy={`div-${mappedField}-artsdata-place-title`}>
{t('dashboard.organization.createNew.search.artsDataSectionHeading')}
</div>
<div className="search-scrollable-content">
{allPlacesArtsdataList?.length > 0 ? (
allPlacesArtsdataList?.map((place, index) => (
<div
key={index}
className="event-popover-options"
onClick={() => {
setLocationPlace(place);
form.setFieldValue(name, place?.uri);
setIsPopoverOpen(false);
}}
data-cy={`div-${mappedField}-artsdata-place-${index}`}>
{place?.label}
</div>
))
) : (
<NoContent />
)}
))}
</div>
</div>
</div>
Expand Down Expand Up @@ -570,6 +586,8 @@ export const returnFormDataWithFields = ({
form,
style,
placeNavigationHandler,
isExternalSourceFetching,
isEntitiesFetching,
}) => {
return renderFormFields({
name: [field?.mappedField],
Expand Down Expand Up @@ -638,6 +656,8 @@ export const returnFormDataWithFields = ({
form,
taxonomyAlias: field?.taxonomyAlias,
placeNavigationHandler,
isExternalSourceFetching,
isEntitiesFetching,
}),
key: index,
initialValue: formInitialValueHandler(field?.type, field?.mappedField, field?.datatype, entityData),
Expand Down
5 changes: 4 additions & 1 deletion src/locales/en/translationEn.json
Original file line number Diff line number Diff line change
Expand Up @@ -363,7 +363,10 @@
"errorPublishing": "This event needs more information before it can be published.",
"errorReview": "This event needs more information before it can be sent for review.",
"errorDraft": "This event needs more information before it can be saved.",
"errorImage": "This image cannot be saved. Adjust the image or try a different one."
"errorImage": "This image cannot be saved. Adjust the image or try a different one.",
"organizer": {
"required": "An organizer is required."
}
},
"quickCreate": {
"title": "Quick Create",
Expand Down
5 changes: 4 additions & 1 deletion src/locales/fr/transalationFr.json
Original file line number Diff line number Diff line change
Expand Up @@ -361,7 +361,10 @@
"errorPublishing": "Cet événement a besoin de plus d'informations avant d'être publié.",
"errorReview": "Cet événement a besoin de plus d'informations avant d'être envoyé pour validation.",
"errorDraft": "Cet événement a besoin de plus d'informations avant d'être enregistré.",
"errorImage": "Cette image ne peut pas être enregistrée. Ajustez l'image ou essayez-en une autre."
"errorImage": "Cette image ne peut pas être enregistrée. Ajustez l'image ou essayez-en une autre.",
"organizer": {
"required": "Un organisateur est requise."
}
},
"quickCreate": {
"title": "Création Rapide",
Expand Down
Loading

0 comments on commit 52e1dd4

Please sign in to comment.