diff --git a/ui/src/pages/backoffice/Document/DocumentDetails/components/DocumentDeleteModal/DocumentDeleteModal.js b/ui/src/pages/backoffice/Document/DocumentDetails/components/DocumentDeleteModal/DocumentDeleteModal.js index 746e74e3c..34c699efd 100644 --- a/ui/src/pages/backoffice/Document/DocumentDetails/components/DocumentDeleteModal/DocumentDeleteModal.js +++ b/ui/src/pages/backoffice/Document/DocumentDetails/components/DocumentDeleteModal/DocumentDeleteModal.js @@ -22,7 +22,7 @@ const deleteDocButton = props => { ); }; -export class DocumentDeleteModal extends Component { +export default class DocumentDeleteModal extends Component { async getRelationRefs() { const hits = []; for (const [relation, records] of Object.entries(this.props.relations)) { @@ -119,7 +119,7 @@ export class DocumentDeleteModal extends Component { deleteHeader={`Are you sure you want to delete the Document record with ID ${document.metadata.pid}?`} refProps={this.createRefProps(document.metadata.pid)} - onDelete={() => this.deleteDocument(document.metadata.pid)} + onDelete={() => this.props.deleteDocument(document.metadata.pid)} trigger={deleteDocButton} /> ); @@ -129,4 +129,5 @@ export class DocumentDeleteModal extends Component { DocumentDeleteModal.propTypes = { document: PropTypes.object.isRequired, relations: PropTypes.object.isRequired, + deleteDocument: PropTypes.func.isRequired, }; diff --git a/ui/src/pages/backoffice/Document/DocumentDetails/components/DocumentDeleteModal/index.js b/ui/src/pages/backoffice/Document/DocumentDetails/components/DocumentDeleteModal/index.js index e4fb33c60..6a3f52054 100644 --- a/ui/src/pages/backoffice/Document/DocumentDetails/components/DocumentDeleteModal/index.js +++ b/ui/src/pages/backoffice/Document/DocumentDetails/components/DocumentDeleteModal/index.js @@ -1 +1,13 @@ -export { DocumentDeleteModal } from './DocumentDeleteModal'; +import { connect } from 'react-redux'; + +import { deleteDocument } from '../../state/actions'; +import DocumentDeleteModalComponent from './DocumentDeleteModal'; + +const mapDispatchToProps = dispatch => ({ + deleteDocument: documentPid => dispatch(deleteDocument(documentPid)), +}); + +export const DocumentDeleteModal = connect( + null, + mapDispatchToProps +)(DocumentDeleteModalComponent); diff --git a/ui/src/pages/backoffice/EItem/EItemDetails/components/EItemActionMenu/EItemActionMenu.js b/ui/src/pages/backoffice/EItem/EItemDetails/components/EItemActionMenu/EItemActionMenu.js index 4f9ae86ea..0f7ee6bea 100644 --- a/ui/src/pages/backoffice/EItem/EItemDetails/components/EItemActionMenu/EItemActionMenu.js +++ b/ui/src/pages/backoffice/EItem/EItemDetails/components/EItemActionMenu/EItemActionMenu.js @@ -19,7 +19,7 @@ export default class EItemActionMenu extends Component { return ( diff --git a/ui/src/pages/backoffice/Item/ItemDetails/components/ItemActionMenu/ItemActionMenu.js b/ui/src/pages/backoffice/Item/ItemDetails/components/ItemActionMenu/ItemActionMenu.js index f6aae9781..6f1c94eec 100644 --- a/ui/src/pages/backoffice/Item/ItemDetails/components/ItemActionMenu/ItemActionMenu.js +++ b/ui/src/pages/backoffice/Item/ItemDetails/components/ItemActionMenu/ItemActionMenu.js @@ -102,7 +102,7 @@ export default class ItemActionMenu extends Component { trigger={this.deleteDocButton} deleteHeader={`Are you sure you want to delete the physical copy record with ID ${item.pid}?`} - onDelete={() => this.deleteItem(item.pid)} + onDelete={() => this.props.deleteItem(item.pid)} refProps={this.createRefProps(item.pid)} /> Circulation diff --git a/ui/src/pages/backoffice/Series/SeriesDetails/__tests__/__snapshots__/SeriesDetails.test.js.snap b/ui/src/pages/backoffice/Series/SeriesDetails/__tests__/__snapshots__/SeriesDetails.test.js.snap index 3de513d51..900858fa6 100644 --- a/ui/src/pages/backoffice/Series/SeriesDetails/__tests__/__snapshots__/SeriesDetails.test.js.snap +++ b/ui/src/pages/backoffice/Series/SeriesDetails/__tests__/__snapshots__/SeriesDetails.test.js.snap @@ -92,7 +92,7 @@ exports[`SeriesDetails tests should load the details component 1`] = `
- +
, "key": "series-relations", diff --git a/ui/src/pages/backoffice/Series/SeriesDetails/components/SeriesDeleteModal/SeriesDeleteModal.js b/ui/src/pages/backoffice/Series/SeriesDetails/components/SeriesDeleteModal/SeriesDeleteModal.js index bd6daa0cb..30f5934f0 100644 --- a/ui/src/pages/backoffice/Series/SeriesDetails/components/SeriesDeleteModal/SeriesDeleteModal.js +++ b/ui/src/pages/backoffice/Series/SeriesDetails/components/SeriesDeleteModal/SeriesDeleteModal.js @@ -15,7 +15,7 @@ const deleteButton = props => { ); }; -export class SeriesDeleteModal extends Component { +export default class SeriesDeleteModal extends Component { async getRelationRefs() { const hits = []; for (const [relation, records] of Object.entries(this.props.relations)) { @@ -63,4 +63,5 @@ export class SeriesDeleteModal extends Component { SeriesDeleteModal.propTypes = { series: PropTypes.object.isRequired, relations: PropTypes.object.isRequired, + deleteSeries: PropTypes.func.isRequired, }; diff --git a/ui/src/pages/backoffice/Series/SeriesDetails/components/SeriesDeleteModal/index.js b/ui/src/pages/backoffice/Series/SeriesDetails/components/SeriesDeleteModal/index.js index 1d58554f2..102adb938 100644 --- a/ui/src/pages/backoffice/Series/SeriesDetails/components/SeriesDeleteModal/index.js +++ b/ui/src/pages/backoffice/Series/SeriesDetails/components/SeriesDeleteModal/index.js @@ -1 +1,13 @@ -export { SeriesDeleteModal } from './SeriesDeleteModal'; +import { connect } from 'react-redux'; +import { deleteSeries } from '../../state/actions'; + +import SeriesDeleteModalComponent from './SeriesDeleteModal'; + +const mapDeleteDispatch = dispatch => ({ + deleteSeries: seriesPid => dispatch(deleteSeries(seriesPid)), +}); + +export const SeriesDeleteModal = connect( + null, + mapDeleteDispatch +)(SeriesDeleteModalComponent); diff --git a/ui/src/pages/backoffice/Stats/MostLoanedDocumentsList/__tests__/__snapshots__/MostLoanedDocumentsList.test.js.snap b/ui/src/pages/backoffice/Stats/MostLoanedDocumentsList/__tests__/__snapshots__/MostLoanedDocumentsList.test.js.snap index aba6e8fc8..9f126d329 100644 --- a/ui/src/pages/backoffice/Stats/MostLoanedDocumentsList/__tests__/__snapshots__/MostLoanedDocumentsList.test.js.snap +++ b/ui/src/pages/backoffice/Stats/MostLoanedDocumentsList/__tests__/__snapshots__/MostLoanedDocumentsList.test.js.snap @@ -239,7 +239,6 @@ exports[`MostLoanedDocumentsList tests should render show a message with no docu className="field" > - - - - -
- - -
- - + +
-
- -
- -
- - -
-
- - - + +
+ + +
+ + + +
+ - - - - -
- - -
- - + +
-
- -
- -
- - -
-
- - - + +
+ + +
+ + + +
+
- - - - -
- - -
- - + +
-
- -
- -
- - -
-
- - - + +
+ + +
+ + + +
+
- - - - -
- - -
- - + +
-
- -
- -
- - -
-
- - - + +
+ + +
+ + + +
+ - - - - -
- - -
- - + +
-
- -
- -
- - -
-
- - - + +
+ + +
+ + + +
+
@@ -1444,7 +1162,6 @@ exports[`DocumentRequestForm tests should render the document request form corre Object { "dirty": false, "errors": Object {}, - "getFieldHelpers": [Function], "getFieldMeta": [Function], "getFieldProps": [Function], "handleBlur": [Function], @@ -1501,17 +1218,23 @@ exports[`DocumentRequestForm tests should render the document request form corre optimized={true} placeholder="Edition number" > - - - - -
- - -
- - + +
-
- -
- -
- - -
-
- - - + +
+ + +
+ + + +
+ - - - - -
- - -
- - + +
-
- -
- -
- - -
-
- - - + +
+ + +
+ + + +
+
- - - - -
- - -
- - + +
-
- -
- -
- - -
-
- - - + +
+ + +
+ + + +
+
- - - - -
- - -
- - + +
-
- -
- -
- - -
-
- - - + +
+ + +
+ + + +
+
@@ -2293,7 +1786,6 @@ exports[`DocumentRequestForm tests should render the document request form corre Object { "dirty": false, "errors": Object {}, - "getFieldHelpers": [Function], "getFieldMeta": [Function], "getFieldProps": [Function], "handleBlur": [Function], @@ -2350,17 +1842,23 @@ exports[`DocumentRequestForm tests should render the document request form corre optimized={true} placeholder="Page number" > - - - - -
- - -
- - + +
-
- -
- -
- - -
-
- - - + +
+ + +
+ + + +
+