Skip to content
Merged

Dev #159

Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion src/components/routes/create-plan/CreatePlan.test.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -320,7 +320,7 @@ describe("CreatePlan Component", () => {
const tagInput = screen.getByPlaceholderText("Add a tag");
fireEvent.change(tagInput, { target: { value: "tag1" } });
fireEvent.keyDown(tagInput, { key: "Enter", code: "Enter" });
expect(screen.getByText("tag1")).toBeInTheDocument();
expect(screen.getByText("Tag1")).toBeInTheDocument();
});

it("shows no image preview initially", () => {
Expand Down
4 changes: 2 additions & 2 deletions src/components/routes/task/api/taskApi.ts
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ export const createSubTasks = async (
duration?: string;
source_text_id?: string | null;
pecha_segment_id?: string | null;
segment_id?: string | null;
segment_ids?: string[] | null;
}[],
) => {
const { data } = await axiosInstance.post(
Expand All @@ -72,7 +72,7 @@ export const updateSubTasks = async (
duration?: string;
source_text_id?: string | null;
pecha_segment_id?: string | null;
segment_id?: string | null;
segment_ids?: string[] | null;
}[],
) => {
await axiosInstance.put(
Expand Down
10 changes: 5 additions & 5 deletions src/components/routes/task/components/view/TaskForm.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -84,7 +84,7 @@ const TaskForm = ({
...(subTask.content_type === "SOURCE_REFERENCE" && {
source_text_id: subTask.source_text_id || null,
pecha_segment_id: subTask.pecha_segment_id || null,
segment_id: subTask.segment_id || null,
segment_ids: subTask.segment_ids || null,
}),
}));
await createSubTasks(taskResponse.id, subTasksPayload);
Expand Down Expand Up @@ -117,7 +117,7 @@ const TaskForm = ({
...(subTask.content_type === "SOURCE_REFERENCE" && {
source_text_id: subTask.source_text_id || null,
pecha_segment_id: subTask.pecha_segment_id || null,
segment_id: subTask.segment_id || null,
segment_ids: subTask.segment_ids || null,
}),
}));
await updateSubTasks(editingTask.id, subTasksPayload);
Expand Down Expand Up @@ -194,7 +194,7 @@ const TaskForm = ({
content: data.content,
source_text_id: data.source_text_id || null,
pecha_segment_id: data.pecha_segment_id || null,
segment_id: data.segment_id || null,
segment_ids: data.segment_ids || null,
};
default:
return {
Expand All @@ -212,7 +212,7 @@ const TaskForm = ({
content: string;
pecha_segment_id: string;
text_id: string;
segment_id: string;
segment_ids: string[];
}

const handleAddSubTask = (content_type: any, sourceData?: SourceData) => {
Expand Down Expand Up @@ -256,7 +256,7 @@ const TaskForm = ({
content: sourceData?.content || "",
source_text_id: sourceData?.text_id || null,
pecha_segment_id: sourceData?.pecha_segment_id || null,
segment_id: sourceData?.segment_id || null,
segment_ids: sourceData?.segment_ids || null,
};
break;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ interface SourceData {
content: string;
pecha_segment_id: string;
text_id: string;
segment_id: string;
segment_ids: string[];
}

interface ContentTypeSelectorProps {
Expand Down
2 changes: 1 addition & 1 deletion src/components/ui/molecules/subtask-card/SubTaskCard.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ interface SourceSubTask {
display_order?: number;
source_text_id?: string | null;
pecha_segment_id?: string | null;
segment_id?: string | null;
segment_ids?: string[] | null;
}
export type SubTask =
| VideoSubTask
Expand Down
8 changes: 7 additions & 1 deletion src/components/ui/molecules/tag-input/TagInput.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,13 @@ const TagInput = ({ value = [], onChange }: TagInputProps) => {
const handleKeyDown = (e: React.KeyboardEvent) => {
if (e.key === "Enter" && inputValue.trim()) {
e.preventDefault();
onChange?.([inputValue.trim(), ...value]);
const trimmed = inputValue.trim();
const normalizedTag =
trimmed.charAt(0).toUpperCase() + trimmed.slice(1).toLowerCase();

if (!value.includes(normalizedTag)) {
onChange?.([normalizedTag, ...value]);
}
setInputValue("");
}
};
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ interface SourceData {
content: string;
pecha_segment_id: string;
text_id: string;
segment_id: string;
segment_ids: string[];
}

interface SourceSelectorSheetProps {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ const SourceItem = ({ source, onSegment }: any) => {
content: segment.content,
pecha_segment_id: segment.pecha_segment_id,
text_id: source.text.text_id,
segment_id: segment.segment_id,
segment_ids: [segment.segment_id],
})
}
>
Expand Down
Loading