diff --git a/src/components/Button/SmallButton/SmallButton.jsx b/src/components/Button/SmallButton/SmallButton.jsx new file mode 100644 index 000000000..35be2837d --- /dev/null +++ b/src/components/Button/SmallButton/SmallButton.jsx @@ -0,0 +1,14 @@ +import React from 'react'; +import { Button } from 'antd'; +import './smallButton.css'; + +const SmallButton = (props) => { + const { label } = props; + return ( +
+ +
+ ); +}; + +export default SmallButton; diff --git a/src/components/Button/SmallButton/index.js b/src/components/Button/SmallButton/index.js new file mode 100644 index 000000000..fd97116e8 --- /dev/null +++ b/src/components/Button/SmallButton/index.js @@ -0,0 +1 @@ +export { default } from './SmallButton'; diff --git a/src/components/Button/SmallButton/smallButton.css b/src/components/Button/SmallButton/smallButton.css new file mode 100644 index 000000000..8aacfd140 --- /dev/null +++ b/src/components/Button/SmallButton/smallButton.css @@ -0,0 +1,22 @@ +.small-button-wrapper .ant-btn { + background: #2196f3; + border-radius: 4px; + height: 24px; + font-size: 12px; + font-weight: 600; + line-height: 16px; + letter-spacing: 0em; + text-align: left; + color: #ffffff; +} + +.small-button-wrapper .ant-btn-default { + padding-top: 4px; + padding-left: 8px; + padding-bottom: 4px; + padding-right: 8px; +} + +.small-button-wrapper { + cursor: initial; +} diff --git a/src/components/List/SelectionItem/SelectionItem.jsx b/src/components/List/SelectionItem/SelectionItem.jsx index f3c53b12d..faa71ef3b 100644 --- a/src/components/List/SelectionItem/SelectionItem.jsx +++ b/src/components/List/SelectionItem/SelectionItem.jsx @@ -7,6 +7,7 @@ import { contentLanguageBilingual } from '../../../utils/bilingual'; import { useSelector } from 'react-redux'; import { getUserDetails } from '../../../redux/reducer/userSlice'; import ArtsDataLink from '../../Tags/ArtsDataLink/ArtsDataLink'; +import SmallButton from '../../Button/SmallButton'; function SelectionItem(props) { const { @@ -18,6 +19,7 @@ function SelectionItem(props) { onClose, itemWidth, postalAddress, + region, accessibility, openingHours, calendarContentLanguage, @@ -119,6 +121,17 @@ function SelectionItem(props) { {postalAddress?.postalCode && {postalAddress?.postalCode}}
+ {Array.isArray(region) && ( + + )} {openingHours && (

} + region={place?.regions} name={ place?.name?.en || place?.name?.fr ? contentLanguageBilingual({ @@ -74,6 +75,7 @@ export const placesOptions = (data, user, calendarContentLanguage, source = sour }) : typeof place?.description === 'string' && place?.description, postalAddress: place?.postalAddress ?? place?.address, + region: place?.regions, accessibility: place?.accessibility ?? [], openingHours: place?.openingHours, key: place?.id, diff --git a/src/pages/Dashboard/AddEvent/AddEvent.jsx b/src/pages/Dashboard/AddEvent/AddEvent.jsx index 660aa5e1b..291814c3d 100644 --- a/src/pages/Dashboard/AddEvent/AddEvent.jsx +++ b/src/pages/Dashboard/AddEvent/AddEvent.jsx @@ -205,6 +205,7 @@ function AddEvent() { .then((response) => { resolve(response?.id); setNewEventId(response?.id); + if (!toggle) { notification.success({ description: t('dashboard.events.addEditEvent.notification.saveAsDraft'), @@ -915,42 +916,55 @@ function AddEvent() { ...initialPlace[0], ['openingHours']: initialPlace[0]?.openingHours?.uri, }; - let initialPlaceAccessibiltiy = []; - if (initialPlace[0]?.accessibility?.length > 0) { - getAllTaxonomy({ - calendarId, - search: '', - taxonomyClass: taxonomyClass.PLACE, - includeConcepts: true, - sessionId: timestampRef, - }) - .unwrap() - .then((res) => { + getAllTaxonomy({ + calendarId, + search: '', + taxonomyClass: taxonomyClass.PLACE, + includeConcepts: true, + sessionId: timestampRef, + }) + .unwrap() + .then((res) => { + if (initialPlace[0]?.accessibility?.length > 0) { res?.data?.forEach((taxonomy) => { if (taxonomy?.mappedToField === 'PlaceAccessibility') { + let initialPlaceAccessibiltiy = []; initialPlace[0]?.accessibility?.forEach((accessibility) => { taxonomy?.concept?.forEach((concept) => { if (concept?.id == accessibility?.entityId) { - initialPlaceAccessibiltiy = initialPlaceAccessibiltiy?.concat([concept]); + initialPlaceAccessibiltiy.push(concept); } }); }); + initialPlace[0] = { + ...initialPlace[0], + ['accessibility']: initialPlaceAccessibiltiy, + }; + setLocationPlace(placesOptions(initialPlace, user, calendarContentLanguage)[0], sourceOptions.CMS); } }); + } else { initialPlace[0] = { ...initialPlace[0], - ['accessibility']: initialPlaceAccessibiltiy, + ['accessibility']: [], }; setLocationPlace(placesOptions(initialPlace, user, calendarContentLanguage)[0], sourceOptions.CMS); - }) - .catch((error) => console.log(error)); - } else { - initialPlace[0] = { - ...initialPlace[0], - ['accessibility']: [], - }; - setLocationPlace(placesOptions(initialPlace, user, calendarContentLanguage)[0], sourceOptions.CMS); - } + } + res?.data?.map((taxonomy) => { + if (taxonomy?.mappedToField == 'Region') { + taxonomy?.concept?.forEach((t) => { + if (initialPlace[0]?.regions[0]?.entityId == t?.id) { + initialPlace[0] = { ...initialPlace[0], regions: [t] }; + setLocationPlace( + placesOptions(initialPlace, user, calendarContentLanguage)[0], + sourceOptions.CMS, + ); + } + }); + } + }); + }) + .catch((error) => console.log(error)); } if (eventData?.locations?.filter((location) => location?.isVirtualLocation == true)?.length > 0) initialAddedFields = initialAddedFields?.concat(locationType?.fieldNames); @@ -971,6 +985,7 @@ function AddEvent() { type: organizer?.type, logo: organizer?.entity?.logo, image: organizer?.entity?.image, + contactPoint: organizer?.entity?.contactPoint, }; }); setSelectedOrganizers( @@ -1108,6 +1123,7 @@ function AddEvent() { window.location.replace(`${location?.origin}${PathName.Dashboard}/${calendarId}${PathName.Events}/${eventId}`); } }, [isLoading, currentCalendarData]); + useEffect(() => { if (currentCalendarData) { let publishValidateFields = []; @@ -1788,6 +1804,7 @@ function AddEvent() { accessibility={locationPlace?.accessibility} openingHours={locationPlace?.openingHours} calendarContentLanguage={calendarContentLanguage} + region={locationPlace?.region} bordered closable onClose={() => {