Local media server bugfixes.
This commit is contained in:
@@ -15,6 +15,7 @@ import { selectBodyshop } from "../../redux/user/user.selectors";
|
||||
import { CreateExplorerLinkForJob } from "../../utils/localmedia";
|
||||
import DocumentsLocalUploadComponent from "../documents-local-upload/documents-local-upload.component";
|
||||
import JobsDocumentsLocalGalleryReassign from "./jobs-documents-local-gallery.reassign.component";
|
||||
import JobsDocumentsLocalGallerySelectAllComponent from "./jobs-documents-local-gallery.selectall.component";
|
||||
|
||||
const mapStateToProps = createStructuredSelector({
|
||||
bodyshop: selectBodyshop,
|
||||
@@ -76,6 +77,7 @@ export function JobsDocumentsLocalGallery({
|
||||
<Button>{t("documents.labels.openinexplorer")}</Button>
|
||||
</a>
|
||||
<JobsDocumentsLocalGalleryReassign jobid={job.id} />
|
||||
<JobsDocumentsLocalGallerySelectAllComponent jobid={job.id} />
|
||||
</Space>
|
||||
<Card>
|
||||
<DocumentsLocalUploadComponent
|
||||
|
||||
@@ -0,0 +1,53 @@
|
||||
import { Button, Space } from "antd";
|
||||
import React from "react";
|
||||
import { useTranslation } from "react-i18next";
|
||||
|
||||
import { connect } from "react-redux";
|
||||
import { createStructuredSelector } from "reselect";
|
||||
import {
|
||||
selectAllmediaForJob,
|
||||
deselectAllMediaForJob,
|
||||
} from "../../redux/media/media.actions";
|
||||
const mapStateToProps = createStructuredSelector({
|
||||
//currentUser: selectCurrentUser
|
||||
});
|
||||
const mapDispatchToProps = (dispatch) => ({
|
||||
selectAllmediaForJob: (jobid) => dispatch(selectAllmediaForJob(jobid)),
|
||||
deselectAllmediaForJob: (jobid) => dispatch(deselectAllMediaForJob(jobid)),
|
||||
});
|
||||
export default connect(
|
||||
mapStateToProps,
|
||||
mapDispatchToProps
|
||||
)(JobsDocumentsLocalGallerySelectAllComponent);
|
||||
|
||||
export function JobsDocumentsLocalGallerySelectAllComponent({
|
||||
jobid,
|
||||
selectAllmediaForJob,
|
||||
deselectAllmediaForJob,
|
||||
}) {
|
||||
const { t } = useTranslation();
|
||||
|
||||
// onSelectImage={(index, image) => {
|
||||
// toggleMediaSelected({ jobid: job.id, filename: image.filename });
|
||||
// }}
|
||||
|
||||
const handleSelectAll = () => {
|
||||
selectAllmediaForJob({ jobid });
|
||||
};
|
||||
|
||||
const handleDeselectAll = () => {
|
||||
deselectAllmediaForJob({ jobid });
|
||||
};
|
||||
|
||||
return (
|
||||
<Space wrap>
|
||||
<Button onClick={handleSelectAll}>
|
||||
{t("general.actions.selectall")}
|
||||
</Button>
|
||||
|
||||
<Button onClick={handleDeselectAll}>
|
||||
{t("general.actions.deselectall")}
|
||||
</Button>
|
||||
</Space>
|
||||
);
|
||||
}
|
||||
Reference in New Issue
Block a user