From bf7a289ef5a780ca5d47e230be091a2d7170fa33 Mon Sep 17 00:00:00 2001 From: Dave Falke Date: Fri, 15 Nov 2024 10:54:32 -0500 Subject: [PATCH] Updates user datasets multi blast (#1272) * Make multi-blast workspace heading consistent with user-datasets * fix link and increase font-size for formInfo * fix link * Check protocol of url * Adjust font size of form info --- .../multi-blast/src/lib/components/BlastWorkspace.tsx | 10 +++++----- .../user-datasets/src/lib/Components/UploadForm.scss | 1 + .../user-datasets/src/lib/Components/UploadForm.tsx | 11 +++++++---- 3 files changed, 13 insertions(+), 9 deletions(-) diff --git a/packages/libs/multi-blast/src/lib/components/BlastWorkspace.tsx b/packages/libs/multi-blast/src/lib/components/BlastWorkspace.tsx index c1225e30d6..36a668ad90 100644 --- a/packages/libs/multi-blast/src/lib/components/BlastWorkspace.tsx +++ b/packages/libs/multi-blast/src/lib/components/BlastWorkspace.tsx @@ -28,7 +28,7 @@ export function BlastWorkspace(props: Props) { const { helpPageUrl, workspaceUrl, - workspaceHeading = 'BLAST', + workspaceHeading = 'My BLAST Jobs', workspaceShortName = 'BLAST', submitButtonText = 'BLAST', } = props; @@ -41,12 +41,12 @@ export function BlastWorkspace(props: Props) { routeBase={workspaceUrl} items={[ { - display: 'New job', - route: '/new', + display: 'All', + route: '/all', }, { - display: 'My jobs', - route: '/all', + display: 'New job', + route: '/new', }, { display: 'Help', diff --git a/packages/libs/user-datasets/src/lib/Components/UploadForm.scss b/packages/libs/user-datasets/src/lib/Components/UploadForm.scss index 93c6d2a9a5..ef786c185b 100644 --- a/packages/libs/user-datasets/src/lib/Components/UploadForm.scss +++ b/packages/libs/user-datasets/src/lib/Components/UploadForm.scss @@ -33,6 +33,7 @@ .formInfo { width: 80%; text-align: justify; + font-size: 1.2em; } select { max-width: 450px; diff --git a/packages/libs/user-datasets/src/lib/Components/UploadForm.tsx b/packages/libs/user-datasets/src/lib/Components/UploadForm.tsx index 396702394f..10ec0abc41 100644 --- a/packages/libs/user-datasets/src/lib/Components/UploadForm.tsx +++ b/packages/libs/user-datasets/src/lib/Components/UploadForm.tsx @@ -398,7 +398,7 @@ function UploadForm({ <> Before uploading your dataset, please ensure your data is formatted according to the instructions listed in the{' '} - "Help" tab. + "Help" tab. ), }} @@ -628,7 +628,9 @@ function validateForm( ) { return { valid: false, - errors: ['The provided data URL does not seem valid'], + errors: [ + 'The provided data URL does not seem valid. A valid URL must start with "http://" or "https://".', + ], }; } @@ -655,12 +657,13 @@ function isCompleteDataUploadSelection( // https://stackoverflow.com/a/43467144 function isValidUrl(string: string) { + let url: URL; try { - new URL(string); + url = new URL(string); } catch (_) { return false; } - return true; + return url.protocol === 'http' || url.protocol === 'https'; } export default UploadForm;