Added select and deselect all to gallery images IO-410

This commit is contained in:
Patrick Fic
2020-12-08 10:36:22 -08:00
parent 4ae344f33e
commit 79910f6725
6 changed files with 91 additions and 1 deletions

View File

@@ -5,6 +5,7 @@ import { useTranslation } from "react-i18next";
import DocumentsUploadComponent from "../documents-upload/documents-upload.component";
import JobsDocumentsDownloadButton from "./jobs-document-gallery.download.component";
import JobsDocumentsDeleteButton from "./jobs-documents-gallery.delete.component";
import JobsDocumentsGallerySelectAllComponent from "./jobs-documents-gallery.selectall.component";
function JobsDocumentsComponent({
data,
@@ -72,6 +73,10 @@ function JobsDocumentsComponent({
callbackAfterUpload={billsCallback || refetch}
tagsArray={["test"]}
/>
<JobsDocumentsGallerySelectAllComponent
galleryImages={galleryImages}
setGalleryImages={setgalleryImages}
/>
<JobsDocumentsDownloadButton galleryImages={galleryImages} />
<JobsDocumentsDeleteButton
galleryImages={galleryImages}

View File

@@ -0,0 +1,37 @@
import { Button } from "antd";
import React from "react";
import { useTranslation } from "react-i18next";
export default function JobsDocumentsGallerySelectAllComponent({
galleryImages,
setGalleryImages,
}) {
const { t } = useTranslation();
const handleSelectAll = () => {
setGalleryImages({
...galleryImages,
images: galleryImages.images.map((i) => {
return { ...i, isSelected: true };
}),
});
};
const handleDeselectAll = () => {
setGalleryImages({
...galleryImages,
images: galleryImages.images.map((i) => {
return { ...i, isSelected: false };
}),
});
};
return (
<>
<Button onClick={handleSelectAll}>
{t("general.actions.selectall")}
</Button>
<Button onClick={handleDeselectAll}>
{t("general.actions.deselectall")}
</Button>
</>
);
}

View File

@@ -618,6 +618,7 @@
"create": "Create",
"delete": "Delete",
"deleteall": "Delete All",
"deselectall": "Deselect All",
"edit": "Edit",
"login": "Login",
"refresh": "Refresh",
@@ -626,6 +627,7 @@
"resetpassword": "Reset Password",
"save": "Save",
"saveandnew": "Save and New",
"selectall": "Select All",
"submit": "Submit",
"submitticket": "Submit a Support Ticket",
"view": "View"

View File

@@ -618,6 +618,7 @@
"create": "",
"delete": "Borrar",
"deleteall": "",
"deselectall": "",
"edit": "Editar",
"login": "",
"refresh": "",
@@ -626,6 +627,7 @@
"resetpassword": "",
"save": "Salvar",
"saveandnew": "",
"selectall": "",
"submit": "",
"submitticket": "",
"view": ""

View File

@@ -618,6 +618,7 @@
"create": "",
"delete": "Effacer",
"deleteall": "",
"deselectall": "",
"edit": "modifier",
"login": "",
"refresh": "",
@@ -626,6 +627,7 @@
"resetpassword": "",
"save": "sauvegarder",
"saveandnew": "",
"selectall": "",
"submit": "",
"submitticket": "",
"view": ""