diff --git a/rdmo/management/assets/js/components/import/ImportElement.js b/rdmo/management/assets/js/components/import/ImportElement.js index c670272f44..3558f9b5b8 100644 --- a/rdmo/management/assets/js/components/import/ImportElement.js +++ b/rdmo/management/assets/js/components/import/ImportElement.js @@ -11,35 +11,35 @@ import Warnings from './common/Warnings' import { codeClass, verboseNames } from '../../constants/elements' import { isEmpty } from 'lodash' -const ImportElement = ({ config, instance, importActions }) => { - const showFields = () => importActions.updateElement(instance, {show: !instance.show}) - const toggleImport = () => importActions.updateElement(instance, {import: !instance.import}) - const updateInstance = (key, value) => importActions.updateElement(instance, {[key]: value}) +const ImportElement = ({ config, element, importActions }) => { + const showFields = () => importActions.updateElement(element, {show: !element.show}) + const toggleImport = () => importActions.updateElement(element, {import: !element.import}) + const updateElement = (key, value) => importActions.updateElement(element, {[key]: value}) return (
- {verboseNames[instance.model]}{' '}
- {instance.uri}
- {instance.created && {' '}{gettext('created')} && }
- {instance.updated && {' '}{gettext('updated')} && }
+ {verboseNames[element.model]}{' '}
+ {element.uri}
+ {element.created && {' '}{gettext('created')} && }
+ {element.updated && {' '}{gettext('updated')} && }
{
- !isEmpty(instance.errors) && !(instance.created || instance.updated) &&
+ !isEmpty(element.errors) && !(element.created || element.updated) &&
{' '}{gettext('could not be imported')}
}
{
- !isEmpty(instance.errors) && (instance.created || instance.updated) &&
+ !isEmpty(element.errors) && (element.created || element.updated) &&
<>{', '}{gettext('but could not be added to parent element')}>
}
{'.'}
{message}
)} - {instance.errors.map(message =>{message}
)} + {element.warnings.map(message =>{message}
)} + {element.errors.map(message =>{message}
)}