From d5af00a80f04e55998ea1cba7b395120e2db05f5 Mon Sep 17 00:00:00 2001 From: Spencer Rose Date: Fri, 3 Nov 2023 13:10:38 -0700 Subject: [PATCH 1/3] Download tools update, selective downloads and fixes to API download endpoints. --- client/src/_components/common/download.js | 5 +- client/src/_components/common/icon.js | 9 +- client/src/_components/common/table.js | 5 +- .../src/_components/content/explorer.help.js | 18 +- .../_components/{common => content}/footer.js | 2 +- .../src/_components/content/toolkit.help.js | 36 +- client/src/_components/menus/editor.menu.js | 36 +- client/src/_components/menus/header.menu.js | 2 +- client/src/_components/menus/main.menu.js | 8 +- .../src/_components/menus/navigator.menu.js | 122 +++++++ client/src/_components/menus/viewer.menu.js | 117 ++---- .../_components/navigator/search.navigator.js | 24 +- .../_components/selectors/dialog.selector.js | 8 + .../_components/selectors/file.selector.js | 40 +- .../_components/styles/download.module.css | 18 + client/src/_components/styles/menu.module.css | 5 + .../toolkit/canvas/default.canvas.toolkit.js | 2 +- .../src/_components/toolkit/menu.toolkit.js | 4 +- .../toolkit/panel/controller.panel.toolkit.js | 16 +- .../toolkit/panel/info.panel.toolkit.js | 4 +- client/src/_components/toolkit/toolkit.js | 2 +- .../toolkit/tools/comparator.toolkit.js | 4 +- .../toolkit/tools/loader.toolkit.js | 4 +- .../toolkit/utils/align.utils.toolkit.js | 4 +- .../toolkit/utils/loader.utils.toolkit.js | 2 +- .../toolkit/utils/tiff.utils.toolkit.js | 2 +- .../src/_components/tools/download.tools.js | 341 +++++++++++------- client/src/_components/views/admin.view.js | 1 - client/src/_components/views/capture.view.js | 2 +- client/src/_components/views/editor.view.js | 2 +- client/src/_components/views/files.view.js | 14 +- client/src/_components/views/help.view.js | 2 +- client/src/_components/views/visitor.view.js | 2 +- client/src/_providers/nav.provider.client.js | 50 ++- .../src/_services/session.services.client.js | 78 +++- client/src/_utils/data.utils.client.js | 1 + client/src/index.css | 4 +- client/src/schema.js | 2 +- queue/app.js | 2 +- queue/images.services.js | 2 +- src/controllers/files.controller.js | 158 ++------ src/lib/file.utils.js | 3 +- src/queries/files.queries.js | 11 +- src/routes/files.routes.js | 4 +- src/services/files.services.js | 177 +++++++-- 45 files changed, 867 insertions(+), 488 deletions(-) rename client/src/_components/{common => content}/footer.js (96%) create mode 100644 client/src/_components/menus/navigator.menu.js create mode 100644 client/src/_components/styles/download.module.css create mode 100644 client/src/_components/styles/menu.module.css diff --git a/client/src/_components/common/download.js b/client/src/_components/common/download.js index bcb97f2..548492d 100644 --- a/client/src/_components/common/download.js +++ b/client/src/_components/common/download.js @@ -107,6 +107,7 @@ const Download = ({ router.online, save ).catch(_handleError); + callback(); } catch (err) { _handleError(err) @@ -130,9 +131,7 @@ const Download = ({ title={ message && message.hasOwnProperty('msg') ? message.msg - : `Download ${route.indexOf('raw') > 0 - ? 'Original (Raw) Version:' - : 'Scaled Version:'} ${filename || `file_${id}.${format}`}.` + : `Download ${filename || `file_${id}.${format}`}.` } onClick={_handleDownload}> diff --git a/client/src/_components/common/icon.js b/client/src/_components/common/icon.js index 74b6351..1c04372 100644 --- a/client/src/_components/common/icon.js +++ b/client/src/_components/common/icon.js @@ -10,6 +10,7 @@ import React from 'react'; import { FontAwesomeIcon } from '@fortawesome/react-fontawesome'; import { library } from '@fortawesome/fontawesome-svg-core'; import { + faPaperclip, faLocationArrow, faChartBar, faGripVertical, @@ -234,6 +235,7 @@ library.add( faExclamationTriangle, faArrowAltCircleRight, faLock, + faPaperclip ); @@ -275,9 +277,10 @@ const getIconClass = (iconType) => { delete: 'trash-alt', import: 'file-import', export: 'file-export', + attach: 'paperclip', scroll: 'location-arrow', externalLink: 'external-link-square-alt', - align: 'images', + align: 'crosshairs', overlay: 'columns', filter: 'filter', filterNavigation: 'filter', @@ -324,7 +327,7 @@ const getIconClass = (iconType) => { vopen: 'chevron-circle-down', vclose: 'chevron-circle-right', upload: 'upload', - download: 'download', + download: 'file-download', bulk_download: 'download', image: 'image', images: 'images', @@ -353,7 +356,7 @@ const getIconClass = (iconType) => { photographers: 'users', field_notes_authors: 'users', comparisons: 'images', - iat: 'images', + iat: 'crosshairs', jpg: 'file-image', jpeg: 'file-image', png: 'file-image', diff --git a/client/src/_components/common/table.js b/client/src/_components/common/table.js index de93896..e704de0 100644 --- a/client/src/_components/common/table.js +++ b/client/src/_components/common/table.js @@ -46,17 +46,18 @@ const TableHeader = ({ tableID, cols }) => { */ const TableBody = ({tableID, rows, cols}) => { + const noop = ()=>{}; return { rows.map((row, index) => { return ( - + { cols .filter(col => row.hasOwnProperty(col.name)) .map(col => + className={row.className}> {row[col.name]} ) diff --git a/client/src/_components/content/explorer.help.js b/client/src/_components/content/explorer.help.js index 42a6d66..024c1c0 100644 --- a/client/src/_components/content/explorer.help.js +++ b/client/src/_components/content/explorer.help.js @@ -63,8 +63,7 @@ const explorerHelp = (gotoPage) => {

About this Guide

- This guide covers usage of features available in both the Explorer, and the Image Alignment Tool - image alignment tool, as well as documentation for the MLE Editor management tool. Click on the + This guide covers usage of features available in both the Explorer, and the Alignment Tool as well as documentation for the MLE Editor management tool. Click on the tabs at the top to switch between tools, and the tabs to the left for tool topics.

; @@ -83,7 +82,7 @@ const explorerHelp = (gotoPage) => {

The viewer is where