From 8349e7be13e6f7dd041ef34052760f9dcb64250c Mon Sep 17 00:00:00 2001 From: Abhishek P Anil Date: Fri, 24 Nov 2023 14:32:04 +0530 Subject: [PATCH 1/4] chore: added required field condition for organizers in tout culture calendar. closes #797 --- src/constants/eventFormRequiredFieldNames.js | 1 + src/locales/en/translationEn.json | 5 ++++- src/locales/fr/transalationFr.json | 5 ++++- src/pages/Dashboard/AddEvent/AddEvent.jsx | 23 +++++++++++++++++++- 4 files changed, 31 insertions(+), 3 deletions(-) diff --git a/src/constants/eventFormRequiredFieldNames.js b/src/constants/eventFormRequiredFieldNames.js index faff62444..6827cc84e 100644 --- a/src/constants/eventFormRequiredFieldNames.js +++ b/src/constants/eventFormRequiredFieldNames.js @@ -12,4 +12,5 @@ export const eventFormRequiredFieldNames = { LOCATION: 'LOCATION', IMAGE: 'IMAGE', FEATURED: 'FEATURED', + ORGANIZERS: 'ORGANIZERS', }; diff --git a/src/locales/en/translationEn.json b/src/locales/en/translationEn.json index 8d952d159..e45b90ed4 100644 --- a/src/locales/en/translationEn.json +++ b/src/locales/en/translationEn.json @@ -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", diff --git a/src/locales/fr/transalationFr.json b/src/locales/fr/transalationFr.json index 83667eada..de2cc0e12 100644 --- a/src/locales/fr/transalationFr.json +++ b/src/locales/fr/transalationFr.json @@ -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", diff --git a/src/pages/Dashboard/AddEvent/AddEvent.jsx b/src/pages/Dashboard/AddEvent/AddEvent.jsx index 1b506efa1..7f2e7de6b 100644 --- a/src/pages/Dashboard/AddEvent/AddEvent.jsx +++ b/src/pages/Dashboard/AddEvent/AddEvent.jsx @@ -1258,6 +1258,9 @@ function AddEvent() { case eventFormRequiredFieldNames.IMAGE: publishValidateFields.push('draggerWrap'); break; + case eventFormRequiredFieldNames.ORGANIZERS: + publishValidateFields.push('organizers'); + break; default: break; } @@ -2204,6 +2207,7 @@ function AddEvent() { @@ -2212,7 +2216,24 @@ function AddEvent() {

- + ({ + validator() { + if (requiredFieldNames?.includes(eventFormRequiredFieldNames?.ORGANIZERS)) { + if (selectedOrganizers?.length > 0) { + return Promise.resolve(); + } else + return Promise.reject( + new Error(t('dashboard.events.addEditEvent.validations.organizer.required')), + ); + } + }, + }), + ]}> setIsPopoverOpen({ ...isPopoverOpen, organizer: open })} From 79db45fd9602647715f82b97e8fa9fe3a28a244a Mon Sep 17 00:00:00 2001 From: Abhishek P Anil Date: Tue, 28 Nov 2023 12:05:26 +0530 Subject: [PATCH 2/4] feat: added search api changes to search person page. --- .../Dashboard/SearchPerson/SearchPerson.jsx | 198 ++++++++++-------- src/redux/store.js | 3 + src/services/entities.js | 4 +- src/services/externalSource.js | 23 ++ 4 files changed, 142 insertions(+), 86 deletions(-) create mode 100644 src/services/externalSource.js diff --git a/src/pages/Dashboard/SearchPerson/SearchPerson.jsx b/src/pages/Dashboard/SearchPerson/SearchPerson.jsx index 185528ffd..bca55284e 100644 --- a/src/pages/Dashboard/SearchPerson/SearchPerson.jsx +++ b/src/pages/Dashboard/SearchPerson/SearchPerson.jsx @@ -19,6 +19,8 @@ import './searchPerson.css'; import { routinghandler } from '../../../utils/roleRoutingHandler'; import { useDebounce } from '../../../hooks/debounce'; import { SEARCH_DELAY } from '../../../constants/search'; +import { useGetExternalSourceQuery, useLazyGetExternalSourceQuery } from '../../../services/externalSource'; +import LoadingIndicator from '../../../components/LoadingIndicator'; function SearchPerson() { const { t } = useTranslation(); @@ -36,24 +38,30 @@ function SearchPerson() { const [quickCreateKeyword, setQuickCreateKeyword] = useState(''); const [selectedPeople, setSelectedPeople] = useState([]); - const [getEntities] = useLazyGetEntitiesQuery({ sessionId: timestampRef }); + const [getEntities, { isFetching: isEntitiesFetching }] = useLazyGetEntitiesQuery({ sessionId: timestampRef }); + const [getExternalSource, { isFetching: isExternalSourceFetching }] = useLazyGetExternalSourceQuery(); let query = new URLSearchParams(); query.append('classes', entitiesClass.person); - const { currentData: initialEntities, isLoading: initialPersonLoading } = useGetEntitiesQuery({ + const { currentData: initialEntities, isFetching: initialPersonLoading } = useGetEntitiesQuery({ + calendarId, + searchKey: '', + classes: decodeURIComponent(query.toString()), + sessionId: timestampRef, + }); + const { currentData: initialExternalSource, isFetching: initialExternalSourceLoading } = useGetExternalSourceQuery({ calendarId, searchKey: '', classes: decodeURIComponent(query.toString()), sessionId: timestampRef, - includeArtsdata: true, }); // effects useEffect(() => { - if (initialEntities && currentCalendarData) { - setPeopleList(initialEntities?.cms); - setPeopleListArtsData(initialEntities?.artsdata); + if (initialEntities && currentCalendarData && initialExternalSourceLoading) { + setPeopleList(initialEntities); + setPeopleListArtsData(initialExternalSource?.artsdata); } }, [initialPersonLoading]); @@ -66,10 +74,20 @@ function SearchPerson() { const searchHandler = (value) => { let query = new URLSearchParams(); query.append('classes', entitiesClass.person); - getEntities({ searchKey: value, classes: decodeURIComponent(query.toString()), calendarId, includeArtsdata: true }) + getEntities({ searchKey: value, classes: decodeURIComponent(query.toString()), calendarId }) + .unwrap() + .then((response) => { + setPeopleList(response); + }) + .catch((error) => console.log(error)); + getExternalSource({ + searchKey: value, + classes: decodeURIComponent(query.toString()), + calendarId, + excludeExistingCMS: true, + }) .unwrap() .then((response) => { - setPeopleList(response?.cms); setPeopleListArtsData(response?.artsdata); }) .catch((error) => console.log(error)); @@ -102,51 +120,57 @@ function SearchPerson() { {t('dashboard.people.createNew.search.footlightSectionHeading')}
- {peopleList?.length > 0 ? ( - peopleList?.map((person, index) => ( -
{ - setSelectedPeople([...selectedPeople, person]); - setIsPopoverOpen(false); - }} - data-cy={`div-person-footlight-${index}`}> - - ) - } - linkText={t('dashboard.people.createNew.search.linkText')} + {isEntitiesFetching && ( +
+ +
+ )} + {!isEntitiesFetching && + (peopleList?.length > 0 ? ( + peopleList?.map((person, index) => ( +
{ - if (routinghandler(user, calendarId, person?.creator?.userId, null, true)) { - navigate( - `${PathName.Dashboard}/${calendarId}${PathName.People}${PathName.AddPerson}?id=${person?.id}`, - ); - } else navigate(`${PathName.Dashboard}/${calendarId}${PathName.People}/${person?.id}`); + setSelectedPeople([...selectedPeople, person]); + setIsPopoverOpen(false); }} - /> -
- )) - ) : ( - - )} + data-cy={`div-person-footlight-${index}`}> + + ) + } + linkText={t('dashboard.people.createNew.search.linkText')} + onClick={() => { + if (routinghandler(user, calendarId, person?.creator?.userId, null, true)) { + navigate( + `${PathName.Dashboard}/${calendarId}${PathName.People}${PathName.AddPerson}?id=${person?.id}`, + ); + } else navigate(`${PathName.Dashboard}/${calendarId}${PathName.People}/${person?.id}`); + }} + /> +
+ )) + ) : ( + + ))}
{quickCreateKeyword.length > 0 && ( @@ -155,40 +179,46 @@ function SearchPerson() { {t('dashboard.people.createNew.search.artsDataSectionHeading')}
- {peopleListArtsData?.length > 0 ? ( - peopleListArtsData?.map((person, index) => ( -
{ - setSelectedPeople([...selectedPeople, person]); - setIsPopoverOpen(false); - }} - data-cy={`div-person-artsdata-${index}`}> - - ) - } - linkText={t('dashboard.people.createNew.search.linkText')} - onClick={() => artsDataClickHandler(person)} - /> -
- )) - ) : ( - + {isExternalSourceFetching && ( +
+ +
)} + {!isExternalSourceFetching && + (peopleListArtsData?.length > 0 ? ( + peopleListArtsData?.map((person, index) => ( +
{ + setSelectedPeople([...selectedPeople, person]); + setIsPopoverOpen(false); + }} + data-cy={`div-person-artsdata-${index}`}> + + ) + } + linkText={t('dashboard.people.createNew.search.linkText')} + onClick={() => artsDataClickHandler(person)} + /> +
+ )) + ) : ( + + ))}
)} diff --git a/src/redux/store.js b/src/redux/store.js index 95ee0234b..f0c22be37 100644 --- a/src/redux/store.js +++ b/src/redux/store.js @@ -18,6 +18,7 @@ import { organizationApi } from '../services/organization'; import { peopleApi } from '../services/people'; import { postalAddressApi } from '../services/postalAddress'; import ErrorSliceReducer from './reducer/ErrorSlice'; +import { externalSourceApi } from '../services/externalSource'; // import localforage from 'localforage'; const persistConfig = { @@ -37,6 +38,7 @@ const middlewares = [ organizationApi.middleware, peopleApi.middleware, postalAddressApi.middleware, + externalSourceApi.middleware, ]; const appReducer = combineReducers({ @@ -56,6 +58,7 @@ const appReducer = combineReducers({ [organizationApi.reducerPath]: organizationApi.reducer, [peopleApi.reducerPath]: peopleApi.reducer, [postalAddressApi.reducerPath]: postalAddressApi.reducer, + [externalSourceApi.reducerPath]: externalSourceApi.reducer, }); const rootReducer = (state, action) => appReducer(state, action); diff --git a/src/services/entities.js b/src/services/entities.js index 8390fa4b5..fb9af4692 100644 --- a/src/services/entities.js +++ b/src/services/entities.js @@ -7,8 +7,8 @@ export const entitiesApi = createApi({ keepUnusedDataFor: 10, endpoints: (builder) => ({ getEntities: builder.query({ - query: ({ searchKey, classes, calendarId, includeArtsdata }) => ({ - url: `entities?query=${searchKey}&${classes}&includeArtsdata=${includeArtsdata}`, + query: ({ searchKey, classes, calendarId }) => ({ + url: `entities?query=${searchKey}&${classes}`, method: 'GET', headers: { diff --git a/src/services/externalSource.js b/src/services/externalSource.js new file mode 100644 index 000000000..fd504ac4e --- /dev/null +++ b/src/services/externalSource.js @@ -0,0 +1,23 @@ +import { createApi } from '@reduxjs/toolkit/query/react'; +import { baseQueryWithReauth } from '../utils/services'; +export const externalSourceApi = createApi({ + reducerPath: 'externalSourceApi', + baseQuery: baseQueryWithReauth, + tagTypes: ['ExternalSource'], + keepUnusedDataFor: 10, + endpoints: (builder) => ({ + getExternalSource: builder.query({ + query: ({ searchKey, classes, calendarId, excludeExistingCMS = true }) => ({ + url: `search-external-sources?query=${searchKey}&${classes}&sources=Artsdata&exclude-existing-cms-entites=${excludeExistingCMS}`, //Note: Change the source and excludeCms as per the api need + method: 'GET', + + headers: { + 'calendar-id': calendarId, + }, + }), + transformResponse: (response) => response, + }), + }), +}); + +export const { useLazyGetExternalSourceQuery, useGetExternalSourceQuery } = externalSourceApi; From dd8d177f6d7dfdd33cff34b19965200a321b110f Mon Sep 17 00:00:00 2001 From: Abhishek P Anil Date: Tue, 28 Nov 2023 17:55:12 +0530 Subject: [PATCH 3/4] feat: added search api changes to search place,orgs create place,event --- src/pages/Dashboard/AddEvent/AddEvent.jsx | 407 ++++++++++++------ .../CreateNewPlace/CreateNewPlace.jsx | 195 ++++++--- .../SearchOrganizations.jsx | 184 ++++---- .../Dashboard/SearchPerson/SearchPerson.jsx | 4 +- .../Dashboard/SearchPlaces/SearchPlaces.jsx | 196 +++++---- 5 files changed, 620 insertions(+), 366 deletions(-) diff --git a/src/pages/Dashboard/AddEvent/AddEvent.jsx b/src/pages/Dashboard/AddEvent/AddEvent.jsx index 7f2e7de6b..e224845bc 100644 --- a/src/pages/Dashboard/AddEvent/AddEvent.jsx +++ b/src/pages/Dashboard/AddEvent/AddEvent.jsx @@ -84,6 +84,7 @@ import QuickCreatePlace from '../../../components/Modal/QuickCreatePlace'; import { useDebounce } from '../../../hooks/debounce'; import { SEARCH_DELAY } from '../../../constants/search'; import { sourceOptions } from '../../../constants/sourceOptions'; +import { useGetExternalSourceQuery, useLazyGetExternalSourceQuery } from '../../../services/externalSource'; const { TextArea } = Input; function AddEvent() { @@ -123,10 +124,16 @@ function AddEvent() { searchKey: '', classes: decodeURIComponent(query.toString()), sessionId: timestampRef, - includeArtsdata: true, + }); + const { currentData: initialExternalSource, isFetching: initialExternalSourceLoading } = useGetExternalSourceQuery({ + calendarId, + searchKey: '', + classes: decodeURIComponent(query.toString()), + sessionId: timestampRef, }); const [addEvent, { isLoading: addEventLoading }] = useAddEventMutation(); - const [getEntities] = useLazyGetEntitiesQuery({ sessionId: timestampRef }); + const [getEntities, { isFetching: isEntitiesFetching }] = useLazyGetEntitiesQuery({ sessionId: timestampRef }); + const [getExternalSource, { isFetching: isExternalSourceFetching }] = useLazyGetExternalSourceQuery(); const [updateEventState, { isLoading: updateEventStateLoading }] = useUpdateEventStateMutation(); const [updateEvent, { isLoading: updateEventLoading }] = useUpdateEventMutation(); const [addImage, { error: isAddImageError, isLoading: addImageLoading }] = useAddImageMutation(); @@ -820,11 +827,20 @@ function AddEvent() { searchKey: inputValue, classes: decodeURIComponent(query.toString()), calendarId, - includeArtsdata: true, }) .unwrap() .then((response) => { - setAllPlacesList(placesOptions(response?.cms, user, calendarContentLanguage, sourceOptions.CMS)); + setAllPlacesList(placesOptions(response, user, calendarContentLanguage, sourceOptions.CMS)); + }) + .catch((error) => console.log(error)); + getExternalSource({ + searchKey: inputValue, + classes: decodeURIComponent(query.toString()), + calendarId, + excludeExistingCMS: true, + }) + .unwrap() + .then((response) => { setAllPlacesArtsdataList( placesOptions(response?.artsdata, user, calendarContentLanguage, sourceOptions.ARTSDATA), ); @@ -836,21 +852,35 @@ function AddEvent() { let query = new URLSearchParams(); query.append('classes', entitiesClass.organization); query.append('classes', entitiesClass.person); - getEntities({ searchKey: value, classes: decodeURIComponent(query.toString()), calendarId, includeArtsdata: true }) + getEntities({ searchKey: value, classes: decodeURIComponent(query.toString()), calendarId }) + .unwrap() + .then((response) => { + if (type == 'organizers') { + setOrganizersList(treeEntitiesOption(response, user, calendarContentLanguage, sourceOptions.CMS)); + } else if (type == 'performers') { + setPerformerList(treeEntitiesOption(response, user, calendarContentLanguage, sourceOptions.CMS)); + } else if (type == 'supporters') { + setSupporterList(treeEntitiesOption(response, user, calendarContentLanguage, sourceOptions.CMS)); + } + }) + .catch((error) => console.log(error)); + getExternalSource({ + searchKey: value, + classes: decodeURIComponent(query.toString()), + calendarId, + excludeExistingCMS: true, + }) .unwrap() .then((response) => { if (type == 'organizers') { - setOrganizersList(treeEntitiesOption(response?.cms, user, calendarContentLanguage, sourceOptions.CMS)); setOrganizersArtsdataList( treeEntitiesOption(response?.artsdata, user, calendarContentLanguage, sourceOptions.ARTSDATA), ); } else if (type == 'performers') { - setPerformerList(treeEntitiesOption(response?.cms, user, calendarContentLanguage, sourceOptions.CMS)); setPerformerArtsdataList( treeEntitiesOption(response?.artsdata, user, calendarContentLanguage, sourceOptions.ARTSDATA), ); } else if (type == 'supporters') { - setSupporterList(treeEntitiesOption(response?.cms, user, calendarContentLanguage, sourceOptions.CMS)); setSupporterArtsdataList( treeEntitiesOption(response?.artsdata, user, calendarContentLanguage, sourceOptions.ARTSDATA), ); @@ -1271,22 +1301,22 @@ function AddEvent() { }, [currentCalendarData]); useEffect(() => { - if (initialEntities && currentCalendarData) { - setOrganizersList(treeEntitiesOption(initialEntities?.cms, user, calendarContentLanguage, sourceOptions.CMS)); - setPerformerList(treeEntitiesOption(initialEntities?.cms, user, calendarContentLanguage, sourceOptions.CMS)); - setSupporterList(treeEntitiesOption(initialEntities?.cms, user, calendarContentLanguage, sourceOptions.CMS)); + if (initialEntities && currentCalendarData && initialExternalSourceLoading) { + setOrganizersList(treeEntitiesOption(initialEntities, user, calendarContentLanguage, sourceOptions.CMS)); + setPerformerList(treeEntitiesOption(initialEntities, user, calendarContentLanguage, sourceOptions.CMS)); + setSupporterList(treeEntitiesOption(initialEntities, user, calendarContentLanguage, sourceOptions.CMS)); setPerformerArtsdataList( - treeEntitiesOption(initialEntities?.artsdata, user, calendarContentLanguage, sourceOptions.ARTSDATA), + treeEntitiesOption(initialExternalSource?.artsdata, user, calendarContentLanguage, sourceOptions.ARTSDATA), ); setSupporterArtsdataList( - treeEntitiesOption(initialEntities?.artsdata, user, calendarContentLanguage, sourceOptions.ARTSDATA), + treeEntitiesOption(initialExternalSource?.artsdata, user, calendarContentLanguage, sourceOptions.ARTSDATA), ); setOrganizersArtsdataList( - treeEntitiesOption(initialEntities?.artsdata, user, calendarContentLanguage, sourceOptions.ARTSDATA), + treeEntitiesOption(initialExternalSource?.artsdata, user, calendarContentLanguage, sourceOptions.ARTSDATA), ), placesSearch(); } - }, [initialEntityLoading, currentCalendarData]); + }, [initialEntityLoading, currentCalendarData, initialExternalSourceLoading]); return !isLoading && !taxonomyLoading && @@ -1294,7 +1324,8 @@ function AddEvent() { currentCalendarData && !updateEventLoading && !addEventLoading && - !updateEventStateLoading ? ( + !updateEventStateLoading && + !initialExternalSourceLoading ? (
- {allPlacesList?.length > 0 ? ( - allPlacesList?.map((place, index) => ( -
{ - setLocationPlace(place); - form.setFieldValue('locationPlace', place?.value); - setIsPopoverOpen({ - ...isPopoverOpen, - locationPlace: false, - }); - }} - data-cy={`div-select-place-${index}`}> - {place?.label} -
- )) - ) : ( - + {isEntitiesFetching && ( +
+ +
)} -
- - {quickCreateKeyword !== '' && ( - <> -
- {t('dashboard.organization.createNew.search.artsDataSectionHeading')} -
-
- {allPlacesArtsdataList?.length > 0 ? ( - allPlacesArtsdataList?.map((place, index) => ( + {!isEntitiesFetching && + (allPlacesList?.length > 0 ? ( + allPlacesList?.map((place, index) => (
{ setLocationPlace(place); - form.setFieldValue('locationPlace', place?.uri); + form.setFieldValue('locationPlace', place?.value); setIsPopoverOpen({ ...isPopoverOpen, locationPlace: false, }); }} - data-cy={`div-select-arts-data-place-${index}`}> + data-cy={`div-select-place-${index}`}> {place?.label}
)) ) : ( + ))} +
+ + {quickCreateKeyword !== '' && ( + <> +
+ {t('dashboard.organization.createNew.search.artsDataSectionHeading')} +
+
+ {isExternalSourceFetching && ( +
+ +
)} + {!isExternalSourceFetching && + (allPlacesArtsdataList?.length > 0 ? ( + allPlacesArtsdataList?.map((place, index) => ( +
{ + setLocationPlace(place); + form.setFieldValue('locationPlace', place?.uri); + setIsPopoverOpen({ + ...isPopoverOpen, + locationPlace: false, + }); + }} + data-cy={`div-select-arts-data-place-${index}`}> + {place?.label} +
+ )) + ) : ( + + ))}
)} @@ -2251,35 +2306,20 @@ function AddEvent() { {t('dashboard.organization.createNew.search.footlightSectionHeading')}
- {organizersList?.length > 0 ? ( - organizersList?.map((organizer, index) => ( -
{ - setSelectedOrganizers([...selectedOrganizers, organizer]); - setIsPopoverOpen({ - ...isPopoverOpen, - organizer: false, - }); - }} - data-cy={`div-select-organizer-${index}`}> - {organizer?.label} -
- )) - ) : ( - + {isEntitiesFetching && ( +
+ +
)} -
- - {quickCreateKeyword !== '' && ( - <> -
- {t('dashboard.organization.createNew.search.artsDataSectionHeading')} -
-
- {organizersArtsdataList?.length > 0 ? ( - organizersArtsdataList?.map((organizer, index) => ( + {!isEntitiesFetching && + (organizersList?.length > 0 ? ( + organizersList?.map((organizer, index) => (
+ data-cy={`div-select-organizer-${index}`}> {organizer?.label}
)) ) : ( + ))} +
+ + {quickCreateKeyword !== '' && ( + <> +
+ {t('dashboard.organization.createNew.search.artsDataSectionHeading')} +
+
+ {isExternalSourceFetching && ( +
+ +
)} + {!isExternalSourceFetching && + (organizersArtsdataList?.length > 0 ? ( + organizersArtsdataList?.map((organizer, index) => ( +
{ + setSelectedOrganizers([...selectedOrganizers, organizer]); + setIsPopoverOpen({ + ...isPopoverOpen, + organizer: false, + }); + }} + data-cy={`div-select-artsdata-organizer-${index}`}> + {organizer?.label} +
+ )) + ) : ( + + ))}
)} @@ -2608,36 +2687,20 @@ function AddEvent() { {t('dashboard.organization.createNew.search.footlightSectionHeading')}
- {performerList?.length > 0 ? ( - performerList?.map((performer, index) => ( -
{ - setSelectedPerformers([...selectedPerformers, performer]); - setIsPopoverOpen({ - ...isPopoverOpen, - performer: false, - }); - }} - data-cy={`div-select-performer-${index}`}> - {performer?.label} -
- )) - ) : ( - + {isEntitiesFetching && ( +
+ +
)} -
- - - {quickCreateKeyword !== '' && ( - <> -
- {t('dashboard.organization.createNew.search.artsDataSectionHeading')} -
-
- {performerArtsdataList?.length > 0 ? ( - performerArtsdataList?.map((performer, index) => ( + {!isEntitiesFetching && + (performerList?.length > 0 ? ( + performerList?.map((performer, index) => (
+ data-cy={`div-select-performer-${index}`}> {performer?.label}
)) ) : ( + ))} +
+ + + {quickCreateKeyword !== '' && ( + <> +
+ {t('dashboard.organization.createNew.search.artsDataSectionHeading')} +
+
+ {isExternalSourceFetching && ( +
+ +
)} + {!isExternalSourceFetching && + (performerArtsdataList?.length > 0 ? ( + performerArtsdataList?.map((performer, index) => ( +
{ + setSelectedPerformers([...selectedPerformers, performer]); + setIsPopoverOpen({ + ...isPopoverOpen, + performer: false, + }); + }} + data-cy={`div-select-artsdata-performer-${index}`}> + {performer?.label} +
+ )) + ) : ( + + ))}
)} @@ -2750,36 +2853,20 @@ function AddEvent() { {t('dashboard.organization.createNew.search.footlightSectionHeading')}
- {supporterList?.length > 0 ? ( - supporterList?.map((supporter, index) => ( -
{ - setSelectedSupporters([...selectedSupporters, supporter]); - setIsPopoverOpen({ - ...isPopoverOpen, - supporter: false, - }); - }} - data-cy={`div-select-supporter-${index}`}> - {supporter?.label} -
- )) - ) : ( - + {isEntitiesFetching && ( +
+ +
)} -
- - - {quickCreateKeyword !== '' && ( - <> -
- {t('dashboard.organization.createNew.search.artsDataSectionHeading')} -
-
- {supporterArtsdataList?.length > 0 ? ( - supporterArtsdataList?.map((supporter, index) => ( + {!isEntitiesFetching && + (supporterList?.length > 0 ? ( + supporterList?.map((supporter, index) => (
+ data-cy={`div-select-supporter-${index}`}> {supporter?.label}
)) ) : ( + ))} +
+ + + {quickCreateKeyword !== '' && ( + <> +
+ {t('dashboard.organization.createNew.search.artsDataSectionHeading')} +
+
+ {isExternalSourceFetching && ( +
+ +
)} + {!isExternalSourceFetching && + (supporterArtsdataList?.length > 0 ? ( + supporterArtsdataList?.map((supporter, index) => ( +
{ + setSelectedSupporters([...selectedSupporters, supporter]); + setIsPopoverOpen({ + ...isPopoverOpen, + supporter: false, + }); + }} + data-cy={`div-select-artsdata-supporter-${index}`}> + {supporter?.label} +
+ )) + ) : ( + + ))}
)} diff --git a/src/pages/Dashboard/CreateNewPlace/CreateNewPlace.jsx b/src/pages/Dashboard/CreateNewPlace/CreateNewPlace.jsx index 86fcfb8cc..13993072d 100644 --- a/src/pages/Dashboard/CreateNewPlace/CreateNewPlace.jsx +++ b/src/pages/Dashboard/CreateNewPlace/CreateNewPlace.jsx @@ -70,6 +70,7 @@ import { SEARCH_DELAY } from '../../../constants/search'; import { userRoles } from '../../../constants/userRoles'; import { getExternalSourceId } from '../../../utils/getExternalSourceId'; import { sourceOptions } from '../../../constants/sourceOptions'; +import { useLazyGetExternalSourceQuery } from '../../../services/externalSource'; const { TextArea } = Input; @@ -134,7 +135,8 @@ function CreateNewPlace() { includeConcepts: true, sessionId: timestampRef, }); - const [getEntities] = useLazyGetEntitiesQuery({ sessionId: timestampRef }); + const [getEntities, { isFetching: isEntitiesFetching }] = useLazyGetEntitiesQuery({ sessionId: timestampRef }); + const [getExternalSource, { isFetching: isExternalSourceFetching }] = useLazyGetExternalSourceQuery(); const [addImage, { error: isAddImageError, isLoading: addImageLoading }] = useAddImageMutation(); const [addPlace, { isLoading: addPlaceLoading }] = useAddPlaceMutation(); const [updatePlace, { isLoading: updatePlaceLoading }] = useUpdatePlaceMutation(); @@ -626,15 +628,24 @@ function CreateNewPlace() { searchKey: inputValue, classes: decodeURIComponent(query.toString()), calendarId, - includeArtsdata: true, }) .unwrap() .then((response) => { let containedInPlaceFilter = []; - if (placeId) containedInPlaceFilter = response?.cms?.filter((place) => place?.id != placeId); - else containedInPlaceFilter = response?.cms; + if (placeId) containedInPlaceFilter = response?.filter((place) => place?.id != placeId); + else containedInPlaceFilter = response; setAllPlacesList(placesOptions(containedInPlaceFilter, user, calendarContentLanguage, sourceOptions.CMS)); + }) + .catch((error) => console.log(error)); + getExternalSource({ + searchKey: inputValue, + classes: decodeURIComponent(query.toString()), + calendarId, + excludeExistingCMS: true, + }) + .unwrap() + .then((response) => { setAllPlacesArtsdataList( placesOptions(response?.artsdata, user, calendarContentLanguage, sourceOptions.ARTSDATA), ); @@ -1700,38 +1711,23 @@ function CreateNewPlace() { {t('dashboard.organization.createNew.search.footlightSectionHeading')}
- {allPlacesList?.length > 0 ? ( - allPlacesList?.map((place, index) => ( -
{ - setSelectedContainsPlaces([...selectedContainsPlaces, place]); - setIsPopoverOpen({ - ...isPopoverOpen, - containsPlace: false, - }); - }} - data-cy="div-place-footlight"> - {place?.label} -
- )) - ) : ( - + {isEntitiesFetching && ( +
+ +
)} -
- - {quickCreateKeyword !== '' && ( - <> -
- {t('dashboard.organization.createNew.search.artsDataSectionHeading')} -
-
- {allPlacesArtsdataList?.length > 0 ? ( - allPlacesArtsdataList?.map((place, index) => ( + {!isEntitiesFetching && + (allPlacesList?.length > 0 ? ( + allPlacesList?.map((place, index) => (
{ setSelectedContainsPlaces([...selectedContainsPlaces, place]); setIsPopoverOpen({ @@ -1739,13 +1735,52 @@ function CreateNewPlace() { containsPlace: false, }); }} - data-cy="div-place-artsdata"> + data-cy="div-place-footlight"> {place?.label}
)) ) : ( + ))} +
+ + {quickCreateKeyword !== '' && ( + <> +
+ {t('dashboard.organization.createNew.search.artsDataSectionHeading')} +
+
+ {isExternalSourceFetching && ( +
+ +
)} + {!isExternalSourceFetching && + (allPlacesArtsdataList?.length > 0 ? ( + allPlacesArtsdataList?.map((place, index) => ( +
{ + setSelectedContainsPlaces([...selectedContainsPlaces, place]); + setIsPopoverOpen({ + ...isPopoverOpen, + containsPlace: false, + }); + }} + data-cy="div-place-artsdata"> + {place?.label} +
+ )) + ) : ( + + ))}
)} @@ -1825,45 +1860,29 @@ function CreateNewPlace() { {t('dashboard.organization.createNew.search.footlightSectionHeading')}
- {allPlacesList?.length > 0 ? ( - allPlacesList?.map((place, index) => ( -
{ - setContainedInPlace(place); - form.setFieldValue(formFieldNames.CONTAINED_IN_PLACE, place?.value); - setIsPopoverOpen({ - ...isPopoverOpen, - containedInPlace: false, - }); - }}> - {place?.label} -
- )) - ) : ( - + {isEntitiesFetching && ( +
+ +
)} -
- - {quickCreateKeyword !== '' && ( - <> -
- {t('dashboard.organization.createNew.search.artsDataSectionHeading')} -
-
- {allPlacesArtsdataList?.length > 0 ? ( - allPlacesArtsdataList?.map((place, index) => ( + {!isEntitiesFetching && + (allPlacesList?.length > 0 ? ( + allPlacesList?.map((place, index) => (
{ setContainedInPlace(place); - form.setFieldValue(formFieldNames.CONTAINED_IN_PLACE, place?.uri); + form.setFieldValue(formFieldNames.CONTAINED_IN_PLACE, place?.value); setIsPopoverOpen({ ...isPopoverOpen, containedInPlace: false, @@ -1874,7 +1893,47 @@ function CreateNewPlace() { )) ) : ( + ))} +
+ + {quickCreateKeyword !== '' && ( + <> +
+ {t('dashboard.organization.createNew.search.artsDataSectionHeading')} +
+
+ {isExternalSourceFetching && ( +
+ +
)} + {!isExternalSourceFetching && + (allPlacesArtsdataList?.length > 0 ? ( + allPlacesArtsdataList?.map((place, index) => ( +
{ + setContainedInPlace(place); + form.setFieldValue(formFieldNames.CONTAINED_IN_PLACE, place?.uri); + setIsPopoverOpen({ + ...isPopoverOpen, + containedInPlace: false, + }); + }}> + {place?.label} +
+ )) + ) : ( + + ))}
)} diff --git a/src/pages/Dashboard/SearchOrganizations/SearchOrganizations.jsx b/src/pages/Dashboard/SearchOrganizations/SearchOrganizations.jsx index 450d50b7d..98e79c0b3 100644 --- a/src/pages/Dashboard/SearchOrganizations/SearchOrganizations.jsx +++ b/src/pages/Dashboard/SearchOrganizations/SearchOrganizations.jsx @@ -19,6 +19,8 @@ import { Popover } from 'antd'; import { routinghandler } from '../../../utils/roleRoutingHandler'; import { useDebounce } from '../../../hooks/debounce'; import { SEARCH_DELAY } from '../../../constants/search'; +import { useGetExternalSourceQuery, useLazyGetExternalSourceQuery } from '../../../services/externalSource'; +import LoadingIndicator from '../../../components/LoadingIndicator'; function SearchOrganizations() { const { t } = useTranslation(); @@ -35,7 +37,8 @@ function SearchOrganizations() { const [organizationListArtsData, setOrganizationListArtsData] = useState([]); const [quickCreateKeyword, setQuickCreateKeyword] = useState(''); - const [getEntities] = useLazyGetEntitiesQuery({ sessionId: timestampRef }); + const [getEntities, { isFetching: isEntitiesFetching }] = useLazyGetEntitiesQuery({ sessionId: timestampRef }); + const [getExternalSource, { isFetching: isExternalSourceFetching }] = useLazyGetExternalSourceQuery(); let query = new URLSearchParams(); query.append('classes', entitiesClass.organization); @@ -46,13 +49,19 @@ function SearchOrganizations() { includeArtsdata: true, sessionId: timestampRef, }); + const { currentData: initialExternalSource, isFetching: initialExternalSourceLoading } = useGetExternalSourceQuery({ + calendarId, + searchKey: '', + classes: decodeURIComponent(query.toString()), + sessionId: timestampRef, + }); // effects useEffect(() => { - if (initialEntities && currentCalendarData) { - setOrganizationList(initialEntities?.cms); - setOrganizationListArtsData(initialEntities?.artsdata); + if (initialEntities && currentCalendarData && initialExternalSourceLoading) { + setOrganizationList(initialEntities); + setOrganizationListArtsData(initialExternalSource?.artsdata); } }, [initialOrganizersLoading]); @@ -67,10 +76,20 @@ function SearchOrganizations() { const searchHandler = (value) => { let query = new URLSearchParams(); query.append('classes', entitiesClass.organization); - getEntities({ searchKey: value, classes: decodeURIComponent(query.toString()), calendarId, includeArtsdata: true }) + getEntities({ searchKey: value, classes: decodeURIComponent(query.toString()), calendarId }) + .unwrap() + .then((response) => { + setOrganizationList(response); + }) + .catch((error) => console.log(error)); + getExternalSource({ + searchKey: value, + classes: decodeURIComponent(query.toString()), + calendarId, + excludeExistingCMS: true, + }) .unwrap() .then((response) => { - setOrganizationList(response?.cms); setOrganizationListArtsData(response?.artsdata); }) .catch((error) => console.log(error)); @@ -104,51 +123,59 @@ function SearchOrganizations() { {t('dashboard.organization.createNew.search.footlightSectionHeading')}
- {organizationList?.length > 0 ? ( - organizationList?.map((organizer, index) => ( -
{ - setIsPopoverOpen(false); - }} - data-cy={`div-organization-footlight-${index}`}> - - ) : ( - - ) - } - linkText={t('dashboard.organization.createNew.search.linkText')} + {isEntitiesFetching && ( +
+ +
+ )} + {!isEntitiesFetching && + (organizationList?.length > 0 ? ( + organizationList?.map((organizer, index) => ( +
{ - if (routinghandler(user, calendarId, organizer?.creator?.userId, null, true)) { - navigate( - `${PathName.Dashboard}/${calendarId}${PathName.Organizations}${PathName.AddOrganization}?id=${organizer?.id}`, - ); - } else - navigate(`${PathName.Dashboard}/${calendarId}${PathName.Organizations}/${organizer?.id}`); + setIsPopoverOpen(false); }} - /> -
- )) - ) : ( - - )} + data-cy={`div-organization-footlight-${index}`}> + + ) : ( + + ) + } + linkText={t('dashboard.organization.createNew.search.linkText')} + onClick={() => { + if (routinghandler(user, calendarId, organizer?.creator?.userId, null, true)) { + navigate( + `${PathName.Dashboard}/${calendarId}${PathName.Organizations}${PathName.AddOrganization}?id=${organizer?.id}`, + ); + } else + navigate( + `${PathName.Dashboard}/${calendarId}${PathName.Organizations}/${organizer?.id}`, + ); + }} + /> +
+ )) + ) : ( + + ))}
{quickCreateKeyword !== '' && ( <> @@ -156,33 +183,40 @@ function SearchOrganizations() { {t('dashboard.organization.createNew.search.artsDataSectionHeading')}
- {organizationListArtsData?.length > 0 ? ( - organizationListArtsData?.map((organizer, index) => ( -
{ - setIsPopoverOpen(false); - }}> - : } - linkText={t('dashboard.organization.createNew.search.linkText')} - onClick={() => artsDataClickHandler(organizer)} - /> -
- )) - ) : ( - + {isExternalSourceFetching && ( +
+ +
)} + {!isExternalSourceFetching && + (organizationListArtsData?.length > 0 ? ( + organizationListArtsData?.map((organizer, index) => ( +
{ + setIsPopoverOpen(false); + }}> + : } + linkText={t('dashboard.organization.createNew.search.linkText')} + onClick={() => artsDataClickHandler(organizer)} + /> +
+ )) + ) : ( + + ))}
)} diff --git a/src/pages/Dashboard/SearchPerson/SearchPerson.jsx b/src/pages/Dashboard/SearchPerson/SearchPerson.jsx index bca55284e..6fde8e9a3 100644 --- a/src/pages/Dashboard/SearchPerson/SearchPerson.jsx +++ b/src/pages/Dashboard/SearchPerson/SearchPerson.jsx @@ -39,7 +39,8 @@ function SearchPerson() { const [selectedPeople, setSelectedPeople] = useState([]); const [getEntities, { isFetching: isEntitiesFetching }] = useLazyGetEntitiesQuery({ sessionId: timestampRef }); - const [getExternalSource, { isFetching: isExternalSourceFetching }] = useLazyGetExternalSourceQuery(); + const [getExternalSource, { isFetching: isExternalSourceFetching, isSuccess: isExternalSourceSuccess }] = + useLazyGetExternalSourceQuery(); let query = new URLSearchParams(); query.append('classes', entitiesClass.person); @@ -185,6 +186,7 @@ function SearchPerson() { )} {!isExternalSourceFetching && + isExternalSourceSuccess && (peopleListArtsData?.length > 0 ? ( peopleListArtsData?.map((person, index) => (
{ - if (initialEntities && currentCalendarData) { - setPlacesList(initialEntities?.cms); - setPlacesListArtsData(initialEntities?.artsdata); + if (initialEntities && currentCalendarData && initialExternalSourceLoading) { + setPlacesList(initialEntities); + setPlacesListArtsData(initialExternalSource?.artsdata); } }, [initialPlacesLoading]); @@ -64,10 +73,20 @@ function SearchPlaces() { const searchHandler = (value) => { let query = new URLSearchParams(); query.append('classes', entitiesClass.place); - getEntities({ searchKey: value, classes: decodeURIComponent(query.toString()), calendarId, includeArtsdata: true }) + getEntities({ searchKey: value, classes: decodeURIComponent(query.toString()), calendarId }) + .unwrap() + .then((response) => { + setPlacesList(response); + }) + .catch((error) => console.log(error)); + getExternalSource({ + searchKey: value, + classes: decodeURIComponent(query.toString()), + calendarId, + excludeExistingCMS: true, + }) .unwrap() .then((response) => { - setPlacesList(response?.cms); setPlacesListArtsData(response?.artsdata); }) .catch((error) => console.log(error)); @@ -101,51 +120,57 @@ function SearchPlaces() { {t('dashboard.places.createNew.search.footlightSectionHeading')}
- {placesList?.length > 0 ? ( - placesList?.map((place, index) => ( -
{ - setSelectedPlaces([...selectedPlaces, place]); - setIsPopoverOpen(false); - }} - data-cy={`div-place-footlight-${index}`}> - - ) - } - linkText={t('dashboard.places.createNew.search.linkText')} + {isEntitiesFetching && ( +
+ +
+ )} + {!isEntitiesFetching && + (placesList?.length > 0 ? ( + placesList?.map((place, index) => ( +
{ - if (routinghandler(user, calendarId, place?.creator?.userId, null, true)) { - navigate( - `${PathName.Dashboard}/${calendarId}${PathName.Places}${PathName.AddPlace}?id=${place?.id}`, - ); - } else navigate(`${PathName.Dashboard}/${calendarId}${PathName.Places}/${place?.id}`); + setSelectedPlaces([...selectedPlaces, place]); + setIsPopoverOpen(false); }} - /> -
- )) - ) : ( - - )} + data-cy={`div-place-footlight-${index}`}> + + ) + } + linkText={t('dashboard.places.createNew.search.linkText')} + onClick={() => { + if (routinghandler(user, calendarId, place?.creator?.userId, null, true)) { + navigate( + `${PathName.Dashboard}/${calendarId}${PathName.Places}${PathName.AddPlace}?id=${place?.id}`, + ); + } else navigate(`${PathName.Dashboard}/${calendarId}${PathName.Places}/${place?.id}`); + }} + /> +
+ )) + ) : ( + + ))}
{quickCreateKeyword.length > 0 && ( @@ -154,39 +179,46 @@ function SearchPlaces() { {t('dashboard.places.createNew.search.artsDataSectionHeading')}
- {placesListArtsData?.length > 0 ? ( - placesListArtsData?.map((place, index) => ( -
{ - setIsPopoverOpen(false); - }} - data-cy={`div-place-artsdata-${index}`}> - - ) - } - linkText={t('dashboard.places.createNew.search.linkText')} - onClick={() => artsDataClickHandler(place)} - /> -
- )) - ) : ( - + {isExternalSourceFetching && ( +
+ +
)} + {!isExternalSourceFetching && + (placesListArtsData?.length > 0 ? ( + placesListArtsData?.map((place, index) => ( +
{ + setIsPopoverOpen(false); + }} + data-cy={`div-place-artsdata-${index}`}> + + ) + } + linkText={t('dashboard.places.createNew.search.linkText')} + onClick={() => artsDataClickHandler(place)} + /> +
+ )) + ) : ( + + ))}
)} From ca88b0e22447bc152d547a8b47a6d0262ae53145 Mon Sep 17 00:00:00 2001 From: Abhishek P Anil Date: Wed, 29 Nov 2023 10:13:40 +0530 Subject: [PATCH 4/4] feat: added support for changes in search api for search fields in data centric approach --- src/constants/formFields.js | 84 ++++++++++++------- .../CreateNewOrganization.jsx | 19 ++++- 2 files changed, 68 insertions(+), 35 deletions(-) diff --git a/src/constants/formFields.js b/src/constants/formFields.js index 2bfc80852..4b8427e70 100644 --- a/src/constants/formFields.js +++ b/src/constants/formFields.js @@ -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; @@ -359,6 +360,8 @@ export const formFieldValue = [ allPlacesArtsdataList, placeNavigationHandler, mappedField, + isEntitiesFetching, + isExternalSourceFetching, }) => { return ( <> @@ -379,49 +382,62 @@ export const formFieldValue = [ {t('dashboard.organization.createNew.search.footlightSectionHeading')}
- {allPlacesList?.length > 0 ? ( - allPlacesList?.map((place, index) => ( + {isEntitiesFetching && ( +
+ +
+ )} + {!isEntitiesFetching && + (allPlacesList?.length > 0 ? ( + allPlacesList?.map((place, index) => ( +
{ + setLocationPlace(place); + form.setFieldValue(name, place?.value); + setIsPopoverOpen(false); + }} + data-cy={`div-${mappedField}-footlight-place-${index}`}> + {place?.label} +
+ )) + ) : ( + + ))} +
+ + +
+ {t('dashboard.organization.createNew.search.artsDataSectionHeading')} +
+
+ {isExternalSourceFetching && ( +
+ +
+ )} + {!isExternalSourceFetching && + (allPlacesArtsdataList?.length > 0 ? ( + allPlacesArtsdataList?.map((place, index) => (
{ 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}
)) ) : ( - )} -
- - -
- {t('dashboard.organization.createNew.search.artsDataSectionHeading')} -
-
- {allPlacesArtsdataList?.length > 0 ? ( - allPlacesArtsdataList?.map((place, index) => ( -
{ - setLocationPlace(place); - form.setFieldValue(name, place?.uri); - setIsPopoverOpen(false); - }} - data-cy={`div-${mappedField}-artsdata-place-${index}`}> - {place?.label} -
- )) - ) : ( - - )} + ))}
@@ -570,6 +586,8 @@ export const returnFormDataWithFields = ({ form, style, placeNavigationHandler, + isExternalSourceFetching, + isEntitiesFetching, }) => { return renderFormFields({ name: [field?.mappedField], @@ -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), diff --git a/src/pages/Dashboard/CreateNewOrganization/CreateNewOrganization.jsx b/src/pages/Dashboard/CreateNewOrganization/CreateNewOrganization.jsx index 8f4b300df..380c0ab3d 100644 --- a/src/pages/Dashboard/CreateNewOrganization/CreateNewOrganization.jsx +++ b/src/pages/Dashboard/CreateNewOrganization/CreateNewOrganization.jsx @@ -45,6 +45,7 @@ import { useDebounce } from '../../../hooks/debounce'; import { SEARCH_DELAY } from '../../../constants/search'; import { sourceOptions } from '../../../constants/sourceOptions'; import { getExternalSourceId } from '../../../utils/getExternalSourceId'; +import { useLazyGetExternalSourceQuery } from '../../../services/externalSource'; function CreateNewOrganization() { const timestampRef = useRef(Date.now()).current; @@ -75,7 +76,8 @@ function CreateNewOrganization() { }); const [getPlace] = useLazyGetPlaceQuery(); const [getAllTaxonomy] = useLazyGetAllTaxonomyQuery({ sessionId: timestampRef }); - const [getEntities] = useLazyGetEntitiesQuery({ sessionId: timestampRef }); + const [getEntities, { isFetching: isEntitiesFetching }] = useLazyGetEntitiesQuery(); + const [getExternalSource, { isFetching: isExternalSourceFetching }] = useLazyGetExternalSourceQuery(); const [addOrganization, { isLoading: addOrganizationLoading }] = useAddOrganizationMutation(); const [updateOrganization, { isLoading: updateOrganizationLoading }] = useUpdateOrganizationMutation(); const [addImage, { isLoading: imageUploadLoading }] = useAddImageMutation(); @@ -518,11 +520,20 @@ function CreateNewOrganization() { searchKey: inputValue, classes: decodeURIComponent(query.toString()), calendarId, - includeArtsdata: true, }) .unwrap() .then((response) => { - setAllPlacesList(placesOptions(response?.cms, user, calendarContentLanguage, sourceOptions.CMS)); + setAllPlacesList(placesOptions(response, user, calendarContentLanguage, sourceOptions.CMS)); + }) + .catch((error) => console.log(error)); + getExternalSource({ + searchKey: inputValue, + classes: decodeURIComponent(query.toString()), + calendarId, + excludeExistingCMS: true, + }) + .unwrap() + .then((response) => { setAllPlacesArtsdataList( placesOptions(response?.artsdata, user, calendarContentLanguage, sourceOptions.ARTSDATA), ); @@ -835,6 +846,8 @@ function CreateNewOrganization() { : '', }, placeNavigationHandler, + isEntitiesFetching, + isExternalSourceFetching, }); } });