From d5f72cbd24b6d9fe118813cce57630f2c891ac91 Mon Sep 17 00:00:00 2001 From: jasquat Date: Fri, 16 Dec 2022 15:12:14 -0500 Subject: [PATCH] fixed file upload of new files and get 1000 process models to list tiles page w/ burnettk --- .../src/components/ProcessModelListTiles.tsx | 2 +- spiffworkflow-frontend/src/routes/ProcessModelShow.tsx | 10 ++++++++-- 2 files changed, 9 insertions(+), 3 deletions(-) diff --git a/spiffworkflow-frontend/src/components/ProcessModelListTiles.tsx b/spiffworkflow-frontend/src/components/ProcessModelListTiles.tsx index 1412635c..bf197823 100644 --- a/spiffworkflow-frontend/src/components/ProcessModelListTiles.tsx +++ b/spiffworkflow-frontend/src/components/ProcessModelListTiles.tsx @@ -35,7 +35,7 @@ export default function ProcessModelListTiles({ setProcessModels(result.results); }; // only allow 10 for now until we get the backend only returning certain models for user execution - let queryParams = '?per_page=20'; + let queryParams = '?per_page=1000'; if (processGroup) { queryParams = `${queryParams}&process_group_identifier=${processGroup.id}`; } else { diff --git a/spiffworkflow-frontend/src/routes/ProcessModelShow.tsx b/spiffworkflow-frontend/src/routes/ProcessModelShow.tsx index 15935b7d..fd9f7b85 100644 --- a/spiffworkflow-frontend/src/routes/ProcessModelShow.tsx +++ b/spiffworkflow-frontend/src/routes/ProcessModelShow.tsx @@ -418,12 +418,18 @@ export default function ProcessModelShow() { const checkDuplicateFile = (event: any) => { if (processModel && processModel.files.length > 0) { + let foundExistingFile = false; processModel.files.forEach((file) => { if (file.name === filesToUpload[0].name) { - displayOverwriteConfirmation(file.name); - setFileUploadEvent(event); + foundExistingFile = true; } }); + if (foundExistingFile) { + displayOverwriteConfirmation(filesToUpload[0].name); + setFileUploadEvent(event); + } else { + doFileUpload(event); + } } };