fix(i18n): localize watcher fallback labels (#2596)
Co-authored-by: Kandev Agent <agent@kandev.dev>
This commit is contained in:
@@ -31,7 +31,7 @@ import {
|
||||
DEFAULT_ISSUE_WATCH_PROMPT,
|
||||
} from "@/components/github/issue-watch-placeholders";
|
||||
import { RepoFilterSelector } from "@/components/github/repo-filter-selector";
|
||||
import { STEP_DEFAULT, STEP_DEFAULT_LABEL, resolveProfileId } from "@/lib/watcher-profile-default";
|
||||
import { STEP_DEFAULT, resolveProfileId } from "@/lib/watcher-profile-default";
|
||||
import type {
|
||||
RepoFilter,
|
||||
IssueWatch,
|
||||
@@ -271,6 +271,7 @@ function IssueAutomationFields({
|
||||
}) {
|
||||
const { t } = useTranslation();
|
||||
const { workflows, agentProfiles, allExecutorProfiles } = useWatchFormData(form.workspaceId);
|
||||
const stepDefaultLabel = t("common:useStepDefaultOption");
|
||||
const { steps: workflowSteps, loading: stepsLoading } = useWorkflowSteps(form.workflowId);
|
||||
const placeholders = useMemo(() => issueWatchPlaceholders(t), [t]);
|
||||
|
||||
@@ -302,9 +303,9 @@ function IssueAutomationFields({
|
||||
description={t("github:optionalFallsBackToStepDefault")}
|
||||
value={form.agentProfileId || STEP_DEFAULT}
|
||||
onChange={(v) => setForm((prev) => ({ ...prev, agentProfileId: resolveProfileId(v) }))}
|
||||
placeholder={STEP_DEFAULT_LABEL}
|
||||
placeholder={stepDefaultLabel}
|
||||
items={[
|
||||
{ id: STEP_DEFAULT, label: STEP_DEFAULT_LABEL },
|
||||
{ id: STEP_DEFAULT, label: stepDefaultLabel },
|
||||
...agentProfiles.map((p) => ({
|
||||
id: p.id,
|
||||
label: p.label,
|
||||
@@ -317,9 +318,9 @@ function IssueAutomationFields({
|
||||
description={t("github:optionalFallsBackToStepDefault")}
|
||||
value={form.executorProfileId || STEP_DEFAULT}
|
||||
onChange={(v) => setForm((prev) => ({ ...prev, executorProfileId: resolveProfileId(v) }))}
|
||||
placeholder={STEP_DEFAULT_LABEL}
|
||||
placeholder={stepDefaultLabel}
|
||||
items={[
|
||||
{ id: STEP_DEFAULT, label: STEP_DEFAULT_LABEL },
|
||||
{ id: STEP_DEFAULT, label: stepDefaultLabel },
|
||||
...allExecutorProfiles.map((p) => ({ id: p.id, label: p.name })),
|
||||
]}
|
||||
/>
|
||||
|
||||
@@ -29,7 +29,7 @@ import {
|
||||
import { DEFAULT_REVIEW_WATCH_PROMPT } from "@/components/github/review-watch-placeholders";
|
||||
import { ReviewWatchPromptField } from "@/components/github/review-watch-prompt-field";
|
||||
import { RepoFilterSelector } from "@/components/github/repo-filter-selector";
|
||||
import { STEP_DEFAULT, STEP_DEFAULT_LABEL, resolveProfileId } from "@/lib/watcher-profile-default";
|
||||
import { STEP_DEFAULT, resolveProfileId } from "@/lib/watcher-profile-default";
|
||||
import type {
|
||||
RepoFilter,
|
||||
ReviewWatch,
|
||||
@@ -433,6 +433,7 @@ function ProfileFields({
|
||||
executorProfiles: Array<{ id: string; name: string }>;
|
||||
}) {
|
||||
const { t } = useTranslation();
|
||||
const stepDefaultLabel = t("common:useStepDefaultOption");
|
||||
return (
|
||||
<div className="grid grid-cols-2 gap-4">
|
||||
<SelectField
|
||||
@@ -440,9 +441,9 @@ function ProfileFields({
|
||||
description={t("github:optionalFallsBackToStepDefault")}
|
||||
value={form.agentProfileId || STEP_DEFAULT}
|
||||
onChange={(v) => setForm((prev) => ({ ...prev, agentProfileId: resolveProfileId(v) }))}
|
||||
placeholder={STEP_DEFAULT_LABEL}
|
||||
placeholder={stepDefaultLabel}
|
||||
items={[
|
||||
{ id: STEP_DEFAULT, label: STEP_DEFAULT_LABEL },
|
||||
{ id: STEP_DEFAULT, label: stepDefaultLabel },
|
||||
...agentProfiles.map((p) => ({
|
||||
id: p.id,
|
||||
label: p.label,
|
||||
@@ -469,10 +470,10 @@ function ProfileFields({
|
||||
}
|
||||
>
|
||||
<SelectTrigger className="cursor-pointer">
|
||||
<SelectValue placeholder={STEP_DEFAULT_LABEL} />
|
||||
<SelectValue placeholder={stepDefaultLabel} />
|
||||
</SelectTrigger>
|
||||
<SelectContent>
|
||||
<SelectItem value={STEP_DEFAULT}>{STEP_DEFAULT_LABEL}</SelectItem>
|
||||
<SelectItem value={STEP_DEFAULT}>{stepDefaultLabel}</SelectItem>
|
||||
{executorProfiles.map((p) => (
|
||||
<SelectItem key={p.id} value={p.id}>
|
||||
{p.name}
|
||||
|
||||
Reference in New Issue
Block a user