From ddb900bf0170e589c73d5e0334461e3235850983 Mon Sep 17 00:00:00 2001 From: Patrick Fic Date: Fri, 8 Jan 2021 10:04:24 -0800 Subject: [PATCH] Added select all images/docs buttons IO-410 --- bodyshop_translations.babel | 42 +++++++++++++++++++ .../jobs-change-status.component.jsx | 2 - ...-documents-gallery.selectall.component.jsx | 30 +++++++++++++ client/src/translations/en_us/common.json | 4 +- client/src/translations/es/common.json | 4 +- client/src/translations/fr/common.json | 4 +- 6 files changed, 81 insertions(+), 5 deletions(-) diff --git a/bodyshop_translations.babel b/bodyshop_translations.babel index dc9e49dcd..c8241b88e 100644 --- a/bodyshop_translations.babel +++ b/bodyshop_translations.babel @@ -8711,6 +8711,48 @@ + + selectallimages + false + + + + + + en-US + false + + + es-MX + false + + + fr-CA + false + + + + + selectallotherdocuments + false + + + + + + en-US + false + + + es-MX + false + + + fr-CA + false + + + diff --git a/client/src/components/jobs-change-status/jobs-change-status.component.jsx b/client/src/components/jobs-change-status/jobs-change-status.component.jsx index 01d7aa936..406b84d80 100644 --- a/client/src/components/jobs-change-status/jobs-change-status.component.jsx +++ b/client/src/components/jobs-change-status/jobs-change-status.component.jsx @@ -68,8 +68,6 @@ export function JobsChangeStatus({ job, bodyshop, jobRO }) { } }, [job, setAvailableStatuses, bodyshop]); - console.log("availableStatuses", availableStatuses); - console.log("otherStages", otherStages); const statusmenu = ( { diff --git a/client/src/components/jobs-documents-gallery/jobs-documents-gallery.selectall.component.jsx b/client/src/components/jobs-documents-gallery/jobs-documents-gallery.selectall.component.jsx index 1e6a0cf4f..fb6e16ee2 100644 --- a/client/src/components/jobs-documents-gallery/jobs-documents-gallery.selectall.component.jsx +++ b/client/src/components/jobs-documents-gallery/jobs-documents-gallery.selectall.component.jsx @@ -11,24 +11,54 @@ export default function JobsDocumentsGallerySelectAllComponent({ const handleSelectAll = () => { setGalleryImages({ ...galleryImages, + other: galleryImages.other.map((i) => { + return { ...i, isSelected: true }; + }), images: galleryImages.images.map((i) => { return { ...i, isSelected: true }; }), }); }; + const handleSelectAllImages = () => { + setGalleryImages({ + ...galleryImages, + + images: galleryImages.images.map((i) => { + return { ...i, isSelected: true }; + }), + }); + }; + const handleSelectAllDocuments = () => { + setGalleryImages({ + ...galleryImages, + other: galleryImages.other.map((i) => { + return { ...i, isSelected: true }; + }), + }); + }; const handleDeselectAll = () => { setGalleryImages({ ...galleryImages, + other: galleryImages.other.map((i) => { + return { ...i, isSelected: false }; + }), images: galleryImages.images.map((i) => { return { ...i, isSelected: false }; }), }); }; + return ( <> + + diff --git a/client/src/translations/en_us/common.json b/client/src/translations/en_us/common.json index 08fe5e98a..5aafa3c5b 100644 --- a/client/src/translations/en_us/common.json +++ b/client/src/translations/en_us/common.json @@ -575,7 +575,9 @@ "documents": { "actions": { "delete": "Delete Selected Documents", - "download": "Download Selected Documents" + "download": "Download Selected Documents", + "selectallimages": "Select All Images", + "selectallotherdocuments": "Select All Other Documents" }, "errors": { "deletes3": "Error deleting document from storage. ", diff --git a/client/src/translations/es/common.json b/client/src/translations/es/common.json index 93e923a34..4b701b711 100644 --- a/client/src/translations/es/common.json +++ b/client/src/translations/es/common.json @@ -575,7 +575,9 @@ "documents": { "actions": { "delete": "", - "download": "" + "download": "", + "selectallimages": "", + "selectallotherdocuments": "" }, "errors": { "deletes3": "Error al eliminar el documento del almacenamiento.", diff --git a/client/src/translations/fr/common.json b/client/src/translations/fr/common.json index 41872bfb9..f4f6ea4a5 100644 --- a/client/src/translations/fr/common.json +++ b/client/src/translations/fr/common.json @@ -575,7 +575,9 @@ "documents": { "actions": { "delete": "", - "download": "" + "download": "", + "selectallimages": "", + "selectallotherdocuments": "" }, "errors": { "deletes3": "Erreur lors de la suppression du document du stockage.",