fix comments
This commit is contained in:
@@ -237,7 +237,7 @@ export const SettingsPage: React.FC = () => {
|
||||
defaultValues: DEFAULT_FORM_VALUES,
|
||||
})
|
||||
|
||||
const { handleSubmit, reset, watch, formState: { isDirty, errors, isValid, dirtyFields } } = methods
|
||||
const { handleSubmit, reset, setError, watch, formState: { isDirty, errors, isValid, dirtyFields } } = methods
|
||||
|
||||
useEffect(() => {
|
||||
let isMounted = true
|
||||
@@ -286,6 +286,16 @@ export const SettingsPage: React.FC = () => {
|
||||
|
||||
const onSave = async (data: UpdateSettingsInput) => {
|
||||
if (!settings) return
|
||||
if (data.enableBasicAuth && !settings.basicAuthActive) {
|
||||
const password = data.basicAuthPassword?.trim() ?? ""
|
||||
if (!password) {
|
||||
setError("basicAuthPassword", {
|
||||
type: "manual",
|
||||
message: "Password is required when basic auth is enabled",
|
||||
})
|
||||
return
|
||||
}
|
||||
}
|
||||
try {
|
||||
setIsSaving(true)
|
||||
|
||||
|
||||
@@ -6,6 +6,7 @@ import { Checkbox } from "@/components/ui/checkbox"
|
||||
import { Separator } from "@/components/ui/separator"
|
||||
import { UpdateSettingsInput } from "@shared/settings-schema"
|
||||
import type { EnvSettingsValues } from "@client/pages/settings/types"
|
||||
import { formatSecretHint } from "@client/pages/settings/utils"
|
||||
import { SettingsInput } from "@client/pages/settings/components/SettingsInput"
|
||||
|
||||
type EnvironmentSettingsSectionProps = {
|
||||
@@ -14,8 +15,6 @@ type EnvironmentSettingsSectionProps = {
|
||||
isSaving: boolean
|
||||
}
|
||||
|
||||
const formatSecretHint = (hint: string | null) => (hint ? `${hint}********` : "Not set")
|
||||
|
||||
export const EnvironmentSettingsSection: React.FC<EnvironmentSettingsSectionProps> = ({
|
||||
values,
|
||||
isLoading,
|
||||
|
||||
@@ -6,6 +6,7 @@ import { Separator } from "@/components/ui/separator"
|
||||
import { UpdateSettingsInput } from "@shared/settings-schema"
|
||||
import type { WebhookValues } from "@client/pages/settings/types"
|
||||
import { SettingsInput } from "@client/pages/settings/components/SettingsInput"
|
||||
import { formatSecretHint } from "@client/pages/settings/utils"
|
||||
|
||||
type WebhooksSectionProps = {
|
||||
pipelineWebhook: WebhookValues
|
||||
@@ -24,8 +25,6 @@ export const WebhooksSection: React.FC<WebhooksSectionProps> = ({
|
||||
}) => {
|
||||
const { register, formState: { errors } } = useFormContext<UpdateSettingsInput>()
|
||||
|
||||
const formatSecretHint = (hint: string | null) => (hint ? `${hint}********` : "Not set")
|
||||
|
||||
return (
|
||||
<AccordionItem value="webhooks" className="border rounded-lg px-4">
|
||||
<AccordionTrigger className="hover:no-underline py-4">
|
||||
|
||||
@@ -12,3 +12,5 @@ export function resumeProjectsEqual(a: ResumeProjectsSettings, b: ResumeProjects
|
||||
arraysEqual(a.aiSelectableProjectIds, b.aiSelectableProjectIds)
|
||||
)
|
||||
}
|
||||
|
||||
export const formatSecretHint = (hint: string | null) => (hint ? `${hint}********` : "Not set")
|
||||
|
||||
Reference in New Issue
Block a user