Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

form: enabling extra configuration for InteractiveMap #49

Merged
merged 1 commit into from
Aug 6, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Loading