-
Notifications
You must be signed in to change notification settings - Fork 14
feat: show created by in Edit Todo modal #204
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: develop
Are you sure you want to change the base?
feat: show created by in Edit Todo modal #204
Conversation
|
Important Review skippedAuto incremental reviews are disabled on this repository. Please check the settings in the CodeRabbit UI or the You can disable this status message by setting the Note Other AI code review bot(s) detectedCodeRabbit has detected other AI code review bot(s) in this pull request and will avoid duplicating their findings in the review comments. This may lead to a less comprehensive review. Summary by CodeRabbit
WalkthroughAdds an optional createdBy field to the todo form data and displays a read-only “Created By” line (with UserIcon) in the Edit Todo modal when available. Updates default form-data mapping to populate createdBy from the todo entity. Changes
Sequence Diagram(s)sequenceDiagram
autonumber
actor User
participant EditTodoModal as Edit Todo Modal
participant Form as CreateEditTodoForm
participant Util as TodoUtil.getDefaultTodoFormData
User->>EditTodoModal: Open Edit Todo
EditTodoModal->>Util: Build initial form data from todo
Util-->>EditTodoModal: { ..., createdBy?: {label, value} }
EditTodoModal->>Form: Render with initialData, mode='edit'
alt createdBy present
Form-->>User: Show "Created By" (read-only) with UserIcon
else no createdBy
Form-->>User: Do not render "Created By"
end
Estimated code review effort🎯 2 (Simple) | ⏱️ ~10 minutes Suggested reviewers
Poem
Pre-merge checks✅ Passed checks (5 passed)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I've completed my review and didn't find any issues... but I did find this dog.
/ \__
( @\___
/ O
/ (_____/
/_____/ UFiles scanned
| File Path | Reviewed |
|---|---|
| src/lib/todo-util.ts | ✅ |
| src/components/todos/create-edit-todo-form.tsx | ✅ |
Explore our documentation to understand the languages and file types we support and the files we ignore.
Check out our docs on how you can make Korbit work best for you and your team.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Actionable comments posted: 2
📜 Review details
Configuration used: CodeRabbit UI
Review profile: ASSERTIVE
Plan: Pro
📒 Files selected for processing (2)
src/components/todos/create-edit-todo-form.tsx(3 hunks)src/lib/todo-util.ts(1 hunks)
🧰 Additional context used
🪛 ESLint
src/components/todos/create-edit-todo-form.tsx
[error] 19-19: Unable to resolve path to module 'lucide-react'.
(import-x/no-unresolved)
🔇 Additional comments (2)
src/components/todos/create-edit-todo-form.tsx (2)
43-49: Schema addition looks good
Optional createdBy object with label/value (string) is fine. With the util change to String(todo.createdBy.id), types will stay consistent end-to-end.
19-19: Fix ESLint: cannot resolve 'lucide-react'package.json contains [email protected] but node_modules weren't present in the verification run; the import-x/no-unresolved error is caused by missing installs or resolver misconfiguration.
- Actions: install deps (npm ci / pnpm install), confirm ESLint import/resolver (node / typescript / webpack) can resolve node_modules.
- Confirm the named exports in src/components/todos/create-edit-todo-form.tsx (CalendarIcon, CircleDotIcon, LucideIcon, PlayIcon, TagIcon, UserIcon) exist in [email protected] and adjust imports if necessary.
src/components/todos/create-edit-todo-form.tsx:19
|
@shobhan-sundar-goutam do we also have to remove |
Thanks for pointing this out. I had asked about the product requirement and Ankush asked to include the removal of |
iamitprakash
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
this issue ticket doesn't talk about removing column from grid #200
Ankush had asked me to include the removal of column in this task only Shall I create a different issue ticket and attach it here or include it in the same issue ticket? Please let me know what should I do |
This is not captured in ticket, so I am got going to trust on verbal comments, please make changes only to issues mentioned. Till now your PR will be on hold. Thank you |
| )} | ||
| /> | ||
|
|
||
| {mode === 'edit' && initialData?.createdBy && ( |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
do we really need this check
&& initialData?.createdBy
| createdBy: z | ||
| .object({ | ||
| label: z.string(), | ||
| value: z.string(), | ||
| }) | ||
| .optional(), |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
- we have added createdBy in the zod schema, but we're not passing it in the default value object in
useForm. Can you please pass it there, similar to the assignee?
| <FormInput label="Created By" icon={UserIcon}> | ||
| <p className="pl-3 text-sm text-gray-700">{initialData.createdBy.label}</p> | ||
| </FormInput> | ||
| )} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
- i would suggest using a input / selct and style it accordingly to look like text and make it disabled so that it is consistent with other inputs in the form.
b8e8394
Deploying todo-frontend with
|
| Latest commit: |
b8e8394
|
| Status: | ✅ Deploy successful! |
| Preview URL: | https://c055eb26.todo-frontend-76p.pages.dev |
| Branch Preview URL: | https://feat-show-created-by-in-edit.todo-frontend-76p.pages.dev |
Date: 12-09-25
Developer Name: @shobhan-sundar-goutam
Issue Ticket Number
created byin the modal, not on table #200Description
This PR adds a
Created Byfield to the Edit Todo modal, displaying the name of the user who originally created the task.Documentation Updated?
Under Feature Flag
Database Changes
Breaking Changes
Development Tested?
Screenshots
Screenshot 1
Created Byfield in edit todo modalCreated Bycolumn from table -Test Coverage
Screenshot 1
Additional Notes
Description by Korbit AI
What change is being made?
Add the display of "Created By" information in the Edit Todo modal, showing the user's name and id if available.
Why are these changes being made?
This change enhances the Edit Todo modal by providing context about the creator of the todo item, which can be important for tracking accountability and understanding the history behind a todo. The implementation checks for edit mode and conditionally renders the creator's information if it exists, ensuring that the display is relevant and informative without cluttering the user interface.