generated from RealDevSquad/website-template
-
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
Open
shobhan-sundar-goutam
wants to merge
7
commits into
develop
Choose a base branch
from
feat/show-created-by-in-edit-todo-modal
base: develop
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from all commits
Commits
Show all changes
7 commits
Select commit
Hold shift + click to select a range
a985e7d
feat: display created by in Edit Todo modal
84beaba
refactor: removed unnecessary htmlFor
df17302
chore: remove comment for created by field
897f52f
refactor: remove Created By column
b085964
refactor: remove createdBy from watchlist.mock.ts
88867d8
fix: keeping creadetBy field in TWatchListTask as it is being used in…
b8e8394
fix: modified condition and used useForm with input
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -16,7 +16,7 @@ import { cn, isPastDate } from '@/lib/utils' | |
| import { SelectLabels } from '@/modules/dashboard/components/select-labels' | ||
| import { zodResolver } from '@hookform/resolvers/zod' | ||
| import { useQuery } from '@tanstack/react-query' | ||
| import { CalendarIcon, CircleDotIcon, LucideIcon, PlayIcon, TagIcon } from 'lucide-react' | ||
| import { CalendarIcon, CircleDotIcon, LucideIcon, PlayIcon, TagIcon, UserIcon } from 'lucide-react' | ||
| import { useState } from 'react' | ||
| import { Controller, useForm, UseFormWatch } from 'react-hook-form' | ||
| import { z } from 'zod' | ||
|
|
@@ -40,6 +40,12 @@ const todoFormSchema = z.object({ | |
| }, | ||
| { error: 'Assignee is required' }, | ||
| ), | ||
| createdBy: z | ||
| .object({ | ||
| label: z.string(), | ||
| value: z.string(), | ||
| }) | ||
| .optional(), | ||
|
Comment on lines
+43
to
+48
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
|
||
| }) | ||
|
|
||
| export type TTodoFormData = z.infer<typeof todoFormSchema> | ||
|
|
@@ -134,6 +140,7 @@ export const CreateEditTodoForm = ({ | |
| status: initialData?.status || TASK_STATUS_ENUM.TODO, | ||
| labels: initialData?.labels || [], | ||
| assignee: initialData?.assignee || undefined, | ||
| createdBy: initialData?.createdBy || undefined, | ||
| }, | ||
| }) | ||
|
|
||
|
|
@@ -326,6 +333,28 @@ export const CreateEditTodoForm = ({ | |
| </FormInput> | ||
| )} | ||
| /> | ||
|
|
||
| {mode === 'edit' && ( | ||
| <Controller | ||
| control={control} | ||
| name="createdBy" | ||
| render={({ field }) => ( | ||
| <FormInput | ||
| label="Created By" | ||
| htmlFor="createdBy" | ||
| icon={UserIcon} | ||
| errorMessage={errors.createdBy?.message} | ||
| > | ||
| <Input | ||
| {...field} | ||
| value={field.value?.label ?? '--'} | ||
| readOnly | ||
| className="cursor-default border-0 text-gray-700 shadow-none focus:ring-0 focus:outline-none focus-visible:ring-0" | ||
| /> | ||
| </FormInput> | ||
| )} | ||
| /> | ||
| )} | ||
| </div> | ||
| </div> | ||
|
|
||
|
|
||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.