Skip to content

Commit b4fe427

Browse files
committed
Address tool request review cleanups
1 parent 21aad9f commit b4fe427

2 files changed

Lines changed: 8 additions & 17 deletions

File tree

client/src/components/Tool/ToolRequestForm.vue

Lines changed: 7 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@ import { ref } from "vue";
44
55
import { submitUserNotification } from "@/api/notifications";
66
import { errorMessageAsString } from "@/utils/simple-error";
7+
import { isValidNetworkUrl } from "@/utils/url";
78
89
import GModal from "@/components/BaseComponents/GModal.vue";
910
import FormElement from "@/components/Form/FormElement.vue";
@@ -30,22 +31,14 @@ const urlError = ref("");
3031
3132
const formValid = () => !!(toolName.value.trim() && description.value.trim());
3233
33-
function validateUrl(): boolean {
34+
function validateToolUrl(): boolean {
3435
const url = toolUrl.value.trim();
35-
if (!url) {
36-
urlError.value = "";
37-
return true;
38-
}
39-
try {
40-
const parsed = new URL(url);
41-
if (parsed.protocol !== "https:") {
42-
urlError.value = "Only https:// URLs are allowed.";
43-
return false;
44-
}
45-
} catch {
46-
urlError.value = "Please enter a valid URL (e.g. https://example.com).";
36+
37+
if (url && (!url.startsWith("https://") || !isValidNetworkUrl(url))) {
38+
urlError.value = "Only https:// URLs are allowed.";
4739
return false;
4840
}
41+
4942
urlError.value = "";
5043
return true;
5144
}
@@ -73,7 +66,7 @@ async function submit() {
7366
return;
7467
}
7568
76-
if (!validateUrl()) {
69+
if (!validateToolUrl()) {
7770
return;
7871
}
7972

client/src/components/User/Notifications/NotificationsCategorySettings.vue

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -6,15 +6,13 @@ import { snakeCaseToTitleCase } from "@/utils/strings";
66
77
import NotificationsChannelSettings from "./NotificationsChannelSettings.vue";
88
9-
const categoryDescriptionMap: Record<NotificationCategory, string> = {
9+
const categoryDescriptionMap: Partial<Record<NotificationCategory, string>> = {
1010
message: `
1111
You will receive these notifications only when your Galaxy administrators send you a message.
1212
Please note that for certain critical or urgent messages, you will receive notifications even if you have disabled this channel.
1313
`,
1414
new_shared_item:
1515
"You will receive these notifications when someone shares an item with you i.e. a history, workflow, visualization, etc.",
16-
tool_request:
17-
"You will receive these notifications when a user submits a request for a new tool to be installed on the Galaxy instance.",
1816
};
1917
2018
interface NotificationsCategorySettingsProps {

0 commit comments

Comments
 (0)