From 67d043c850d45ded27315d12b8a23437fcfc8338 Mon Sep 17 00:00:00 2001 From: Tahier Hussain Date: Mon, 13 Apr 2026 21:25:15 +0530 Subject: [PATCH 1/4] fix: default notification emails to current user and add validation MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - Pre-populate notification_emails field with current user's email - Add email validation to reject invalid email formats - Update tooltip text 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude --- frontend/src/ide/scheduler/JobDeploy.jsx | 27 ++++++++++++++++++++++-- 1 file changed, 25 insertions(+), 2 deletions(-) diff --git a/frontend/src/ide/scheduler/JobDeploy.jsx b/frontend/src/ide/scheduler/JobDeploy.jsx index f16f1b2..f17bc70 100644 --- a/frontend/src/ide/scheduler/JobDeploy.jsx +++ b/frontend/src/ide/scheduler/JobDeploy.jsx @@ -37,6 +37,7 @@ import { import { checkPermission } from "../../common/helpers"; import { useNotificationService } from "../../service/notification-service"; import { useProjectStore } from "../../store/project-store"; +import { useSessionStore } from "../../store/session-store"; import { useJobService } from "./service"; import { CronFields } from "./CronFields"; import { IntervalFields } from "./IntervalFields"; @@ -98,6 +99,8 @@ const JobDeploy = memo(function JobDeploy({ const canWrite = checkPermission("JOB_DEPLOYMENT", "can_write"); const { notify } = useNotificationService(); const { projectId } = useProjectStore(); + const { sessionDetails } = useSessionStore(); + const userEmail = sessionDetails?.email || ""; const { createTask, updateTask, @@ -410,7 +413,7 @@ const JobDeploy = memo(function JobDeploy({ max_retries: 0, notify_on_failure: false, notify_on_success: false, - notification_emails: [], + notification_emails: userEmail ? [userEmail] : [], trigger_on_complete: null, }} > @@ -669,7 +672,27 @@ const JobDeploy = memo(function JobDeploy({ { + if (!value || value.length === 0) + return Promise.resolve(); + const emailRegex = /^[^\s@]+@[^\s@]+\.[^\s@]+$/; + const invalid = value.filter( + (e) => !emailRegex.test(e) + ); + if (invalid.length > 0) { + return Promise.reject( + new Error( + `Invalid email(s): ${invalid.join(", ")}` + ) + ); + } + return Promise.resolve(); + }, + }, + ]} >