Skip to content

Commit

Permalink
Merge pull request #49 from M3nin0/fix/interactive-map-config
Browse files Browse the repository at this point in the history
form: enabling extra configuration for InteractiveMap
  • Loading branch information
M3nin0 committed Aug 6, 2024
2 parents 75f5eae + 39093c5 commit 72482a6
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,7 @@ import { LocationsFieldItem } from './LocationsFieldItem';
* @param {String} label Field Label.
* @param {String} labelIcon Field icon.
* @param {Bool} required Flag to set if the field is required in the form.
* @param {Object} interactiveMapConfig Configurations for the InteractiveMap object.
* @returns {JSX.Element}
*
* @note This component is based on `CreatibutorsField` from React Invenio Deposit.
Expand All @@ -57,6 +58,7 @@ export const LocationsFieldForm = ({
label,
labelIcon,
required,
interactiveMapConfig
}) => {
// field values
const formikValues = getIn(values, fieldPath, []);
Expand Down Expand Up @@ -123,6 +125,7 @@ export const LocationsFieldForm = ({
{locationAddButtonLabel}
</Button>
}
{...interactiveMapConfig}
/>
{locationsError && typeof locationsError === 'string' && (
<Label pointing={'left'} prompt>
Expand Down Expand Up @@ -164,6 +167,7 @@ LocationsField.propTypes = {
addLabel: PropTypes.string.isRequired,
editLabel: PropTypes.string.isRequired,
}).isRequired,
interactiveMapConfig: PropTypes.object
};

LocationsField.defaultProps = {
Expand All @@ -175,4 +179,5 @@ LocationsField.defaultProps = {
addLabel: i18next.t('Add location'),
editLabel: i18next.t('Edit location'),
},
interactiveMapConfig: {}
};
Original file line number Diff line number Diff line change
Expand Up @@ -182,7 +182,7 @@ export const LocationsModal = ({
clearable={true}
required={false}
/>
<GeometryField fieldPath={geometryPath} />
<GeometryField fieldPath={geometryPath} interactiveMapConfig={interactiveMapConfig} />
</Form>
</Modal.Content>
<Modal.Actions>
Expand Down

0 comments on commit 72482a6

Please sign in to comment.