Skip to content

Commit

Permalink
Merge pull request #1344 from culturecreates/bugfix/issue-1224
Browse files Browse the repository at this point in the history
fix: hide virtual location from mandatory fields section. closes #1224
  • Loading branch information
AbhishekPAnil authored Sep 24, 2024
2 parents b052275 + 4a7d716 commit 855ebab
Show file tree
Hide file tree
Showing 2 changed files with 19 additions and 17 deletions.
5 changes: 1 addition & 4 deletions src/pages/Dashboard/AddEvent/AddEvent.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -1924,10 +1924,7 @@ function AddEvent() {
case eventFormRequiredFieldNames.LOCATION:
publishValidateFields.push('location-form-wrapper');
break;
case eventFormRequiredFieldNames.VIRTUAL_LOCATION:
initialAddedFields = initialAddedFields?.concat(locationType?.fieldNames);
publishValidateFields.push('location-form-wrapper');
break;

case eventFormRequiredFieldNames.IMAGE:
publishValidateFields.push('draggerWrap');
break;
Expand Down
31 changes: 18 additions & 13 deletions src/pages/Dashboard/Settings/MandatoryFields/MandatoryFields.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,7 @@ function MandatoryFields({ setDirtyStatus, tabKey }) {
formLabel: t('dashboard.settings.mandatoryFields.event'),
taxonomyClass: entitiesClass.event,
// prefilledFields: ['name', 'startDateTime', 'startDate', 'endDateTime', 'endDate', 'locationId'],
hiddenFields: ['VIRTUAL_LOCATION'],
},
{
formName: 'Place',
Expand Down Expand Up @@ -78,19 +79,23 @@ function MandatoryFields({ setDirtyStatus, tabKey }) {
standardAdminOnlyFields =
field?.formFieldProperties?.adminOnlyFields?.standardFields?.map((f) => f?.fieldName) ?? [];

let modifiedField = field?.formFields?.map((f) => {
return {
...f,
preFilled: minimumRequiredFields.includes(f?.name),
isRequiredField: standardAdminOnlyFields?.includes(f?.name)
? false
: requiredFields.includes(f?.name) || minimumRequiredFields.includes(f?.name),
isAdminOnlyField: standardAdminOnlyFields?.includes(f?.name) || false,
rule: field?.formFieldProperties?.mandatoryFields?.standardFields?.find(
(standardField) => f?.name === standardField?.fieldName,
)?.rule,
};
});
let modifiedField = field?.formFields
?.map((f) => {
if (preFilled?.hiddenFields?.includes(f?.name)) return null;
else
return {
...f,
preFilled: minimumRequiredFields.includes(f?.name),
isRequiredField: standardAdminOnlyFields?.includes(f?.name)
? false
: requiredFields.includes(f?.name) || minimumRequiredFields.includes(f?.name),
isAdminOnlyField: standardAdminOnlyFields?.includes(f?.name) || false,
rule: field?.formFieldProperties?.mandatoryFields?.standardFields?.find(
(standardField) => f?.name === standardField?.fieldName,
)?.rule,
};
})
?.filter((f) => f);
modifiedField = modifiedField?.concat(
allTaxonomyData?.data
?.filter((f) => f?.taxonomyClass === preFilled?.taxonomyClass && f?.isDynamicField)
Expand Down

0 comments on commit 855ebab

Please sign in to comment.