From f9aaecf5a7882bc0e52f108975648ce7008102a2 Mon Sep 17 00:00:00 2001 From: Bryon Lewis Date: Thu, 18 Nov 2021 10:15:22 -0500 Subject: [PATCH 01/16] initial MVP of zip upload working --- client/dive-common/apispec.ts | 2 +- .../dive-common/components/ImportButton.vue | 9 ++- client/dive-common/constants.ts | 5 ++ client/platform/web-girder/utils.ts | 8 ++- client/platform/web-girder/views/Upload.vue | 58 +++++++++++++++---- server/dive_server/crud_rpc.py | 25 ++++++++ server/dive_tasks/tasks.py | 43 ++++++++++++++ server/dive_utils/constants.py | 2 + 8 files changed, 135 insertions(+), 17 deletions(-) diff --git a/client/dive-common/apispec.ts b/client/dive-common/apispec.ts index 1c7dee2f4..9d751ff10 100644 --- a/client/dive-common/apispec.ts +++ b/client/dive-common/apispec.ts @@ -125,7 +125,7 @@ interface Api { saveMetadata(datasetId: string, metadata: DatasetMetaMutable): Promise; saveAttributes(datasetId: string, args: SaveAttributeArgs): Promise; // Non-Endpoint shared functions - openFromDisk(datasetType: DatasetType | 'calibration' | 'annotation' | 'text', directory?: boolean): + openFromDisk(datasetType: DatasetType | 'calibration' | 'annotation' | 'text' | 'zip', directory?: boolean): Promise<{canceled?: boolean; filePaths: string[]; fileList?: File[]; root?: string}>; importAnnotationFile(id: string, path: string, file?: File): Promise; } diff --git a/client/dive-common/components/ImportButton.vue b/client/dive-common/components/ImportButton.vue index e203d1382..577b870b9 100644 --- a/client/dive-common/components/ImportButton.vue +++ b/client/dive-common/components/ImportButton.vue @@ -20,7 +20,7 @@ export default defineComponent({ required: true, }, openType: { - type: String as PropType, + type: String as PropType, required: true, }, multiCamImport: { //TODO: Temporarily used to hide the stereo settings from users @@ -31,6 +31,10 @@ export default defineComponent({ type: Object, default: () => DefaultButtonAttrs, }, + small: { // Smaller setting for "Add Another ..." + type: Boolean, + default: false, + }, }, setup() { return { @@ -50,7 +54,8 @@ export default defineComponent({